{"_id":"@atomist/slack-messages","_rev":"98-250a64fe9ae9fbdfb7647b9a2e0f0e91","name":"@atomist/slack-messages","description":"Atomist utilities for creating formatted Slack messages","dist-tags":{"latest":"1.2.2","branch-master":"1.2.2-master.20210315181220","next":"1.2.2-master.20210315181220"},"versions":{"0.1.0":{"name":"@atomist/slack-messages","version":"0.1.0","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.3.0","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"2.2.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"648a617229ef76683022c6398f2b4e93b311f22e","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.1.0","_shasum":"cd42c680eb8be1a16e2b125ec74fc58b83002512","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"cd42c680eb8be1a16e2b125ec74fc58b83002512","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.1.0.tgz","integrity":"sha512-q9riSFho9LmGsSCDSrpVQM3JWSGxtvS5D+/WjkUXNZjwurZQ2OhPWLppXiKGPto+/u5vxxzjLlPKtJha34N3RA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxI6Gw4GvJLtBHwwL0QanOkxePYpFw1bx/jSLLVBbk2AIgL2u5TVxUf8RpfXdoZ1AyIFyjW8qkfzN72rGRsdl9vjg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/slack-messages-0.1.0.tgz_1494344924427_0.4921297919936478"}},"0.2.0":{"name":"@atomist/slack-messages","version":"0.2.0","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.3.0","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"2.2.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"1b0c2bae57833f511131135b2f948dd7fe8b91d1","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.2.0","_shasum":"c14466f9c0b5607ac7813751f1ef6f9ddf97fc21","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"c14466f9c0b5607ac7813751f1ef6f9ddf97fc21","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.2.0.tgz","integrity":"sha512-H+aZ1bwhq0YuHN5cJZ+LdhUK90WAcOzJY1/lNzNGt93UTMIIwa4efQEoUFWcBUWEKwz8khi1y8lr8SoaW3lrAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID+dYu4CYeguEAFvjCd8Z7iRbKTlKt8gD+Ohm6inUwoHAiBsQuvYsDVXiut5k1p5fpXmaXFHxKSFRI2W6k+QbFSWeQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/slack-messages-0.2.0.tgz_1494370474067_0.6933350535109639"}},"0.3.0":{"name":"@atomist/slack-messages","version":"0.3.0","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.3.0","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"2.2.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"b3a06608ab1e775f04612dc4c8a6fd751441cddd","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.3.0","_shasum":"ee840da6fca42a85752d11aadf725ea17725d749","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"ee840da6fca42a85752d11aadf725ea17725d749","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.3.0.tgz","integrity":"sha512-6JRUmEzdaloabsdYztr3x0+T5r0/Np73wjJMFxcqR0KM1TfoRriDP9khiZB6rtYuHwt3ZeUbpGfNRrdCKCXV9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgWxK+G69ot4yPLbnbFdHkP45N7wId04hqmO+swMkrQAiA4kfarGao09sx6Kd2iKOBROffEXT44xkbgBJev3ufNyQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/slack-messages-0.3.0.tgz_1494428809115_0.5732029813807458"}},"0.3.1":{"name":"@atomist/slack-messages","version":"0.3.1","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.3.0","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"2.2.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"6ef16b1c9ddcf8087755f16a32e4ee7979808a44","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.3.1","_shasum":"bd3676f468d04e0bd81330c8c9f6482c9e4e7dfa","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"bd3676f468d04e0bd81330c8c9f6482c9e4e7dfa","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.3.1.tgz","integrity":"sha512-xP/DdOoCLbtu77mtJqXDx5R7pmmVxBR+WsOwY9CHi1KA6jcJpUMzjVGdowZCjMovywEZPOG+l2MctguoEiQ/SA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSsnXNn478rSUGbXjO6luNreg7BczgRy8t0Kty7s25+wIhAIi3uih9MKFbZzJ/Bgq3HQfC9b1PNHTvDcVg6LAOBLPJ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/slack-messages-0.3.1.tgz_1494431911464_0.28993316320702434"}},"0.4.0":{"name":"@atomist/slack-messages","version":"0.4.0","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.3.0","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"2.2.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"b89e353b4d98b583854f1bf97899d51424140ec0","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.4.0","_shasum":"9552ca2718ed9a7876b7336e4ea17b1cd112c9df","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"9552ca2718ed9a7876b7336e4ea17b1cd112c9df","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.4.0.tgz","integrity":"sha512-i3WQ/O88F25i3zCYRsXDhJ2rw0Jhc9jRm7g5Bw6622M3dpFXSPKccDnSyCAIjhPHeWbuSJsM1qEDfGlSi/4yew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBxYoCZZQjAkMHyQpEsmW4pMQPGlYBFQMTqLpx8QY8kMAiEA8ueTQtzisHJEb8bTs6/05QR/kGoHrJqSJXYJGNI1Jro="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/slack-messages-0.4.0.tgz_1494456313280_0.6239023620728403"}},"0.5.0":{"name":"@atomist/slack-messages","version":"0.5.0","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.3.0","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"2.2.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"f15261ab96c55496cd2b2b905a3a5f0a700e0843","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.5.0","_shasum":"180f34c1adb3812c589a7d7cc573fd2103d732a9","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"180f34c1adb3812c589a7d7cc573fd2103d732a9","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.5.0.tgz","integrity":"sha512-Zvss4fEyUz9Zp9wl4yYtYxyar6hy/l2GdiTz0XsWxcPFHFlECuYwA2rw4qRj343qjonYod8ZUlzrSixPqGzIuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTDtAtKJlrMqsEnhy+40GxJ7cxyX3xSp7FUFEfpGhyewIgBpX5FHCa44o1ccTK/VccxQRqKrudPUDQUV68s6k0QZU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/slack-messages-0.5.0.tgz_1494858023132_0.020432285964488983"}},"0.5.1":{"name":"@atomist/slack-messages","version":"0.5.1","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.3.0","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"2.2.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"8148bc507d09aee3130fb234d481ae926eaf15ce","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.5.1","_shasum":"b9fd4c7e2c976bede245ab92ff8a0f390ab10848","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"b9fd4c7e2c976bede245ab92ff8a0f390ab10848","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.5.1.tgz","integrity":"sha512-0+PrPYm6MkczipAgSkgXX7gveA5r2QSMMmnHhAFAgQHn00+ozRhF0eFHzdFm2hqcZbHGVo+gRYGx6cGI5kwemA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE+ICvTLVOX/zKgdrwDe2jfObM22H10+c3aB7O0LKe4VAiEA9NPKiGtguxkuCP69KTnUSFYMF1i0UxyH2WCp9BIiQmE="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/slack-messages-0.5.1.tgz_1494860542270_0.8637966664973646"}},"0.6.0":{"name":"@atomist/slack-messages","version":"0.6.0","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.4.1","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"^2.3.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"247b36a4856a348323699aff92b6f66052a748e9","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.6.0","_shasum":"45b9d13e8957285b15f347655f08571a9e94d066","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"45b9d13e8957285b15f347655f08571a9e94d066","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.6.0.tgz","integrity":"sha512-ImwvBot0Z5LMJvzb5i3AFdame3cCAxDfYIpp1A0vgXjSZHFZWDyNRfGmiX6yyyWIV35Qubf3HKD/ipCwefu1/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoLjuXbR7k+QuhjN2DR2+hLA5wWmZqjwcKBRr5+VG8VgIgL4WlxnlaUbuMKa5jEA4boxrc0qj6g30BkOWYFgMhCqg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/slack-messages-0.6.0.tgz_1494959168123_0.6221335276495665"}},"0.7.0":{"name":"@atomist/slack-messages","version":"0.7.0","author":{"name":"Atomist, Inc"},"directories":{"test":"build/test"},"scripts":{"test":"tsc -p . && mocha --require intelli-espower-loader --recursive build/test","cleantest":"rm -rf build && tsc -p . && mocha --require intelli-espower-loader --recursive build/test","autotest":"supervisor -q -n exit -x ./node_modules/.bin/mocha -- --require intelli-espower-loader --recursive build/test"},"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["Atomist"],"license":"Apache-2.0","bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"homepage":"https://github.com/atomist/slack-messages#readme","devDependencies":{"@types/mocha":"^2.2.41","@types/node":"^7.0.18","@types/power-assert":"^1.4.29","intelli-espower-loader":"^1.0.1","mocha":"^3.4.1","power-assert":"^1.4.2","supervisor":"^0.12.0","tslint":"^5.1.0","typescript":"^2.3.2"},"dependencies":{"@atomist/rug":"^1.0.0-m.3"},"gitHead":"9fd182380b344dd9128c2b329334e8c4a2eb396c","description":"[![Build Status](https://travis-ci.org/atomist/slack-messages.svg?branch=master)](https://travis-ci.org/atomist/slack-messages) [![Slack Status](https://join.atomist.com/badge.svg)](https://join.atomist.com/)","_id":"@atomist/slack-messages@0.7.0","_shasum":"8e87b8c57ac639193d9d988c35a5123a42398d9d","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"shasum":"8e87b8c57ac639193d9d988c35a5123a42398d9d","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.7.0.tgz","integrity":"sha512-tAhhMnhhupjcsVukSgliK0PaIbfd5ftYOYMrY3xQqmgzUhOUsBdX5OZkVfs5KKK0UeyXpRHUO1zpChaueDNn+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBEUHPvihBqPyhaxsOqY3EZEVCXChGX8pCjvUC13uoRCAiBpAVOJzCsETUVxX3rKg7egAhZ0yQQO8vxN564n8u0TvA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages-0.7.0.tgz_1499163729887_0.5767990886233747"}},"0.8.0":{"name":"@atomist/slack-messages","description":"utilities for creating Slack messages","version":"0.8.0","author":{"name":"Atomist"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["atomist","rug","slack"],"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"dependencies":{"@atomist/rug":"^1.0.0-m.5","deprecated-decorator":"^0.1.6","lodash":"^4.17.4"},"devDependencies":{"@types/mocha":"^2.2.41","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.0","mocha":"^3.4.2","power-assert":"^1.4.4","supervisor":"^0.12.0","tslint":"^5.4.3","typescript":"^2.3.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -x npm -- test","clean":"npm run clean-js ; rm -rf build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p .","distclean":"npm run clean ; rm -rf node_modules","lint":"tslint '**/*.ts' --exclude 'node_modules/**' --exclude 'build/**' -t verbose","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/*.ts'"},"gitHead":"65fe2999985a768f339fa7fd21c42f387700a311","_id":"@atomist/slack-messages@0.8.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-ykaWcvTcTFgD4fpL5sVwijStZjfY/Vhm5u/+CQTJWGKHEOv7ZV4OmHciQzpAj1Jchv8US0aZ9vs2F3UylhTchg==","shasum":"5f08842ab9f1f3761c7024546d5eb13d0d8dc082","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.8.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/SBKi1IkhsayOafCgeyCH7CV4DTRaY6QF+B7KspK3EgIgR84AbxPJE6Ckknfb9/oZM7Y+d12VVzPdRLqsfmcLJQg="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages-0.8.0.tgz_1502739102401_0.6828797168564051"}},"0.9.0":{"name":"@atomist/slack-messages","description":"utilities for creating Slack messages","version":"0.9.0","author":{"name":"Atomist"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["atomist","rug","slack"],"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"dependencies":{"@atomist/rug":"^1.0.0-m.6","deprecated-decorator":"^0.1.6","lodash":"^4.17.4"},"devDependencies":{"@types/mocha":"^2.2.41","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.0","mocha":"^3.4.2","power-assert":"^1.4.4","supervisor":"^0.12.0","tslint":"^5.4.3","typescript":"^2.3.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -x npm -- test","clean":"npm run clean-js ; rm -rf build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p .","distclean":"npm run clean ; rm -rf node_modules","lint":"tslint '**/*.ts' --exclude 'node_modules/**' --exclude 'build/**' -t verbose","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/*.ts'"},"gitHead":"a57d49f3c645a31f805ff4e4bd32fdaa66ac5fd5","_id":"@atomist/slack-messages@0.9.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-s5b6608Ah8pGlQf3L98yC98+s6tqEThnz6EZVqCJxanNZ28/sWd4D4tRBx6hWy7hbESiNXsjhArq2FNPY4x08Q==","shasum":"b728afe23ba22cc7107254c2fb6eb5f94cb3097d","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.9.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCLtbukVzA/EHHVz/7PHVE1gxQ5yGImC32t0lB1D/4ugIhAL/IqYT+PIuOutiGKFBvm+AuHArkNSyQldDlcTO0BfaJ"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages-0.9.0.tgz_1502959228477_0.9349786737002432"}},"0.10.0":{"name":"@atomist/slack-messages","description":"utilities for creating Slack messages","version":"0.10.0","author":{"name":"Atomist"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["atomist","rug","slack"],"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"dependencies":{"@atomist/rug":"^1.0.0-m.5","deprecated-decorator":"^0.1.6","lodash":"^4.17.4"},"devDependencies":{"@types/mocha":"^2.2.41","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.0","mocha":"^3.4.2","power-assert":"^1.4.4","supervisor":"^0.12.0","tslint":"^5.4.3","typescript":"^2.3.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -x npm -- test","clean":"npm run clean-js ; rm -rf build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p .","distclean":"npm run clean ; rm -rf node_modules","lint":"tslint '**/*.ts' --exclude 'node_modules/**' --exclude 'build/**' -t verbose","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/*.ts'"},"gitHead":"796e35f8c4c7b9276c53efc295e99cb61e9afd73","_id":"@atomist/slack-messages@0.10.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-3cLIk6KBCMJYlvuz+3bdMCJtsDomd44BkJGQw+O8zrSpkovOFm6ZdT0j930sMPX2dKr/APUjN95BCpfDAe44Zw==","shasum":"6b6d0d65bb36ebe6ba65e0a71b659f00abf9da87","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.10.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA/ry/C0XDWMCKdEZmyc2uj2sxOSyhhKMt2a8EHpe3+WAiA/ej09kWpsQhVgqgZxllRZBBBXbFbwYN6cX0xYF4GgnA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages-0.10.0.tgz_1503079121536_0.9846540582366288"}},"0.11.0":{"name":"@atomist/slack-messages","description":"utilities for creating Slack messages","version":"0.11.0","author":{"name":"Atomist"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["atomist","rug","slack"],"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"dependencies":{"@atomist/rug":"^1.0.0-m.6","deprecated-decorator":"^0.1.6","lodash":"^4.17.4"},"devDependencies":{"@types/lodash":"^4.14.73","@types/mocha":"^2.2.41","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.0","mocha":"^3.4.2","power-assert":"^1.4.4","supervisor":"^0.12.0","tslint":"^5.4.3","typescript":"^2.3.2"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -x npm -- test","clean":"npm run clean-js ; rm -rf build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p .","distclean":"npm run clean ; rm -rf node_modules","lint":"tslint '**/*.ts' --exclude 'node_modules/**' --exclude 'build/**' -t verbose","lint-fix":"npm run lint -- --fix","test":"mocha --compilers ts:espower-typescript/guess 'test/**/*.ts'"},"gitHead":"c257f40be4c11d294d07ef70870ebd7550ff3051","_id":"@atomist/slack-messages@0.11.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-KaQWLazBQIqvw9gYiOdO+LEY/HfE42tqKDWMW2Uq5obnGI2itdAJsKhR3uW3MIbSi9LCyl4+Pu0dj23dMIwmfw==","shasum":"879e5182ddf6caf641b2b40b230a6f544327a684","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.11.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC0cRM89q0tY57Up3v4tzdjXhnB/6Q09XcEFQSNbo+RTAiEAovsBaa+az0jmOuyx+i7/R6ByLheIW+skoZlwGmASE0w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages-0.11.0.tgz_1503084520859_0.06075197225436568"}},"0.12.0":{"name":"@atomist/slack-messages","description":"utilities for creating Slack messages","version":"0.12.0","author":{"name":"Atomist"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["atomist","rug","slack"],"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"dependencies":{"deprecated-decorator":"^0.1.6","lodash":"^4.17.4"},"devDependencies":{"@types/lodash":"^4.14.73","@types/mocha":"^2.2.41","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.0","mocha":"^3.4.2","power-assert":"^1.4.4","supervisor":"^0.12.0","tslint":"^5.6.0","typedoc":"^0.8.0","typescript":"^2.5.1","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -x npm -- test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p .","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/**/*.ts'","typedoc":"typedoc --mode modules --excludeExternals"},"gitHead":"ac5de03114a51fba54f39143be49ea37e075faec","_id":"@atomist/slack-messages@0.12.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-shs9/Owmg2AhM4ZGCNR4OShHnqB7ji8D+6giC6V+oqDYacpk9rrpU1EfPjKLug0ASXMfEVSw53LC2K/fIS56sg==","shasum":"ff9a5d6f05a787956f8ebf4bbee324beb79e2583","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.12.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVfduUF68pkLVnSUgweWuAM23tjNZj52tOtlIRvt9LfQIgXI/KfgUkT1VCGs7P4CCZVR02qW61xlZbhkMfXF89mMQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages-0.12.0.tgz_1505903189295_0.3966514184139669"}},"0.12.1":{"name":"@atomist/slack-messages","description":"Utilities for creating Slack messages","version":"0.12.1","author":{"name":"Atomist"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"keywords":["atomist","rug","slack"],"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"dependencies":{"deprecated-decorator":"^0.1.6","lodash":"^4.17.4"},"devDependencies":{"@types/lodash":"^4.14.73","@types/mocha":"^2.2.41","@types/power-assert":"^1.4.29","espower-typescript":"^8.0.0","mocha":"^3.4.2","power-assert":"^1.4.4","supervisor":"^0.12.0","tslint":"^5.6.0","typedoc":"^0.8.0","typescript":"^2.5.1","typescript-formatter":"^6.0.0"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor -q -n exit -x npm -- test","build":"npm run lint && npm run compile && npm test","clean":"npm run clean-js ; rm -rf build","clean-js":"find src test -type f -name '*.js' -print0 | xargs -0 rm -f","compile":"tsc -p .","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/**/*.ts'","typedoc":"typedoc --mode modules --excludeExternals"},"gitHead":"553cdf02ce8f192e86529fcac36148017c04d7de","_id":"@atomist/slack-messages@0.12.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-xKCG/tOOfmFYYVlY1HzAJypbLOhrLD2laXOdEpLB8tNTpYfiAdVhZbA94yKOLzHYwL/jBkkxElKblbPQ6Do4nA==","shasum":"6ea4cf72954add4b1f1fba346b48e69ab04032a8","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-0.12.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhtEiZjR5o9Yc+r5t8yeXOlALKgdYoF5/h8u47Sly2QwIgYkuBGcV+7YR830iF9r63tkiTqp4T/y+y0+KS9FwPm7Y="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages-0.12.1.tgz_1510255917558_0.5149214330594987"}},"1.0.0-master.20180829132449":{"name":"@atomist/slack-messages","version":"1.0.0-master.20180829132449","description":"Utilities for creating Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","supervisor":"^0.12.0","tslint":"^5.11.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","compile":"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/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"f1b33fe0388601d6b1c603b1f366147adce31ebe","readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/slack-messages@1.0.0-master.20180829132449","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-+a4Z+uKcdUDtNVIilaVOi5Fwef61s6uKb57guqaMBaW7zgn9TOVyEH1Ls5bcR0Y9LvphGvGV+IgxcnGL7Cm7NA==","shasum":"34eba38484c69c43b06d8b9f583e4b76c971d109","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.0-master.20180829132449.tgz","fileCount":17,"unpackedSize":48057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhp7oCRA9TVsSAnZWagAAeEkP/1qlUIcO9DnBKCqP7zgU\nWVIxcrLRPKEMKbjYCk1TpSjKoqHqld09rVwGPUz/rkqnObv7JUvuFYQCLSz9\nherjSRKA1CoiPY9yHszq7yPTLLM7cA0vb4FNQWbofjudYefEm4h7UDJD0Rz0\nKOfghkunr2Y/IRwDHCJXWDocVtuIsDr1YhFEXuh3YH4McNH7B0MaBbH3ZE94\n8iEbihJvUNlV4x5zl4hoTOq4Ms4v7nJwkF7AP8mvGIjliXVmGWItUVMGpH6n\nrNYdUPaHOdmyFnEY0Trll5CKqa8h+AIAueNDCcScbfOmUKDzmwS5q4uD0Fgb\n3c3bSNqW5o2qV8bXhtW1zQx/kwoiHsdoOdDkNQnPeMzQCzMqK3Z3w6CIUKoT\nskScr7BJONxHvHBhcgP83Ddjzav58o4TLVtUYYUCGRxrNhp9l22Jo/gDXbY7\nlhSfUNGBMHqvWLA96kvfBjX7m5IxL7o4nTEhzW8Qwol4bIBwqDukQvzDgmIm\n1WOimSBBw+evtFWXu4QLPQDcxcnCI0sDS0yHChwnHKigCqYFG4+Q8g1Ptowp\nfGXQjO6wbnIVllpCdpzJ23u8ZsQEiWgNWuRklomKm8KNj7SIRm1t7erVb/7U\n8KrFIHAvW01ERdtDkzsES6fwffFpArCy8ztflmo+in3oEoK25pLrwB/o/49Q\nmRM/\r\n=PpUE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8nkQ5r6iyFki2HXpK3lj2pcvOvWzcvheT18i8GOfTxAiEA+tu9pPvH79jKwtxYPu7hcUsEa8RPpKwf+1swH6dnie8="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.0-master.20180829132449_1535549160314_0.5165671814540778"},"_hasShrinkwrap":false},"1.0.0-master.20180830183648":{"name":"@atomist/slack-messages","version":"1.0.0-master.20180830183648","description":"Utilities for creating Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","supervisor":"^0.12.0","tslint":"^5.11.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --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/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"43548476853626433c95f442d3ec6e6788e2ed41","readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/slack-messages@1.0.0-master.20180830183648","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-JPKIG3/cTXmf4EIwqmDmvjj7zse29B+wTEI26lpgppbCtfNbT5/KFBimdDUxmzlxIbH/7NiggbtNS1/ptLvsbQ==","shasum":"0ed881d161cc115aece0252c7708c759e8658d5c","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.0-master.20180830183648.tgz","fileCount":20,"unpackedSize":49760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiDmFCRA9TVsSAnZWagAAZq4P/RIaxIZljtDZPrChro8X\nZMR7ReEnqZyraKoTUr6bmv1YkGc0mn2PuMOMbt8z2pmsXO8KqYBUmLAD9F75\n4dMa0QMWoZHAcSyeE9ciA33u9OG11w9jrkArvMtOpiReSTXE/MHkZwhWB0aw\nLiLktJPtB9vYAwC1BAXUD3U1B2M+7ys0t+RB/zuLLMnD0wi1YeqrwveOR5ry\nueu6K7QHLGWJQZ0t0AelY65Y/oRINl3SYAhZ5OcYiMt3fZro9F/9ra9998W5\nOhJXDBWs9ZAuQj862Nw+FlbHbvjOV0Xu8gssBEnNtzhbf41kW4f6J+mlXQKd\nZ0CVKUKfvxPpGOMQF1At0jTif+C3so8dAAQomZ22NCa2/LEXFcVj1QG7DfPj\nXpXdIgmFVLXPT6AqwpxqewHn3zgq5vWyw8sg8lACUiERCkwTnBL+5vCqbxSJ\nZsEAt4Leh4Wh38y6m5VVfu7wOGVo2cSAIw7tVoNjGuwRohSyGxC9W76QNZQ7\nCCQ/U//AB/zCoLnzviWvnV2JHP4CF/tXdLb3sx0SJg4LS3FEZ/HvtdjDd8b9\nw1GkyYJ/NRxs5a1wqW9O21W4h91P2ElR9zRSh8bCuJe3mJb2jO0TAzGLbn6T\n+uiTFeg+hw1spXRg2YBpPeglTlrqiumlVJilJZp+nmsEYB7xYQAu2khd6AOP\ncyVq\r\n=Q0u3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkp8UjD44YH4D/8MzMa2kb43ItM4rWwyAZadcsZb2nXgIgHAyAe4EMtt90AVeGEbShA1BydO/MlMkj4rQr16NwofY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.0-master.20180830183648_1535654276771_0.8005108900006934"},"_hasShrinkwrap":false},"1.0.0-master.20180830185933":{"name":"@atomist/slack-messages","version":"1.0.0-master.20180830185933","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","supervisor":"^0.12.0","tslint":"^5.11.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --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/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"5afef0ad6dda37b07a53fc061e575409379ff972","readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/slack-messages@1.0.0-master.20180830185933","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-Tio9zPvEIDV9wY/ShM0BePvXEvuH4lloDov3phdSHEfKqxv7KZgRY4CQKQQd4jV2UhArSkQQ7QmCL1PZl8YICQ==","shasum":"0b4a9abb6a7c3d5ee5b83031cdcb564e77b6ec34","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.0-master.20180830185933.tgz","fileCount":20,"unpackedSize":50025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiD7hCRA9TVsSAnZWagAAqvgP/1cqHIxhfGT+Uld5QQmk\nnhHtX4yJxw+VVbstvU2XLxseMhv9rE4LTHCs+9UtA3Z3lQ2lMBda5n5lKeBW\ncUL8lOAPf5AjMll+pS83cXDWLeB9nJ15IMdm+DL3X1Kcs9A+n3cheCbLmM6Q\nSkYQIXqO4UdrVxd0C2FgabCxiumg3pe1FJjn7MKd7te9v4OJ2hHOvC6RZgPF\nlqB38O38CDVMqWkXAqYzFK9OEh6bsRItld5isoItXwlUaL9pM9d2ad0IgnB8\n/BTXbTbvPkIAAI6+G+QfgLdotGORRAQ5txWoRVxdV1phRRTRfNnuzhHUbeoz\nD/lo0FKBhhDLYYIdMbhPefufj4P08idQAs3Jcoul1U3cPnqvw/EXuRrOXda+\nkXkbRPwuZ9+2vlBncQ/HTjK+hZVW+7YReb+4A7Lxnk/lH7UXkQ67eSOGfDVc\ndju1UaqD2TfFUKIVZpRmS0T1Jy4g2CPopgVDJyIdBhen0+MqUnDAv2S6beSc\nn72lPBZld37GMr/q7QdpOWGYECEv28heF0zFgu4hme3K+Km6f0p5QJcuKWYZ\nAcibBWtRUnN6o1T7nkRvz/nQDLpoFdJS/GC8X7nvSAPSPh+MIOoui/6UjtUv\nl9HuAHoPasraR0u8zw+joXAmxlPSYsQX/rBIY+zOUghA4+jKT6L1uGJs+yIL\nrwVo\r\n=jKx/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJ8UnV+XvRw0J8Sk+voqbgCzOWono2Kbd2oLSTpP8iyQIgcHhlXDkCQJ1++6yMvIkHVhiQreO4NzgKCWydgW3ipdI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.0-master.20180830185933_1535655648946_0.8756888608861957"},"_hasShrinkwrap":false},"1.0.0":{"name":"@atomist/slack-messages","version":"1.0.0","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","supervisor":"^0.12.0","tslint":"^5.11.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --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/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"5afef0ad6dda37b07a53fc061e575409379ff972","_id":"@atomist/slack-messages@1.0.0","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-X9otKaaCbxSCmx2+1RMl6tsLilXdQ4Z0UPL3/qYFrit0YbWjI6Ws1pVOKA6h+NOIJb5QmMoFlsFYsAgOwcM+ew==","shasum":"4d0e976a2bc1635c5704b7d5bf37cb55ecb069b3","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.0.tgz","fileCount":20,"unpackedSize":50003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiEBLCRA9TVsSAnZWagAAr4oP/3u3iYxSPYskxdvMKBNr\niZbME7iI+gWPt0zZvWHYceksgqc5L9D4WzI+vQg7k4sV6oEJRk/YiaRjugzM\nMwT5wrDO4cyhP69H1m4KFjc8r7uPjhXus/ILM9EOm18SB2JJvgTBvlvj0uUy\nR+xfc6CfNpagUJ/NJ/ZW7D2PEXhDX0it6g3JxYSOMMYT3fieVCsoB0U1OsvT\nwVUf8zr0jaekPs+b33kGaei2GpUMhW2hYs0ALqDOVTYLHcl93v87ALeVorj+\nIVgNbflyvygElbnftjik4IAvZATXJcSeAs7V+tAaVrQA14jU1zSP8KfG61zv\ny2CgmbbUZ0dMhuB0d68uZMmMXsjsJttn5dLZJ07tWye6dD9Rs17jgkRp0Nt/\nsxTh0nlcD2N+dm8IZ95FF9qG9QGyLvFDwqoPUrrNCoExzjokYNXHx6Ay8Y/C\n8Fyi5fH+j1ABfQQI8XxPOTAZceVwFDmEKn+hJ/jbCXHSpwJUQlCK+2NVqF4k\nKNZ2snd2qb7mT2ujU67uy3Wz85LoTjRW3ul0DsEHwILr4xbGjelBj16pkFnI\neuL5nvVUd5jGLb4SihpoaflLiSQguTNBzu1RWh6HAA0EaqYrfrzbKlykfllk\ny+NltZBDKVElctkMlyUCrx59iIdjEfPZiMHa7PEVvQuWMsWB9rMFq/zD8g2C\n7tMT\r\n=/KQ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGdJcosQ0u36RpTb4Q/aErUEVhTaKQItPJ/Fp//DLjkYAiAN+GmoUh4y67fFpsXiG3eTZjGWnJJ6/hWUmmO7fZvCGQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.0_1535656010827_0.917147495484852"},"_hasShrinkwrap":false},"1.0.1-master.20180830190736":{"name":"@atomist/slack-messages","version":"1.0.1-master.20180830190736","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","supervisor":"^0.12.0","tslint":"^5.11.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --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/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"96e1c048faf99f0364cfb293b23f08c31303ed20","readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","_id":"@atomist/slack-messages@1.0.1-master.20180830190736","_npmVersion":"6.4.0","_nodeVersion":"9.11.2","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-1rpHUyCHyRLbPSenrCLZm2oV/s20u26vWH9fYrs+rUJec+Ft+xNSGl9l/QvpPXJO30xyF6W7QWg/k+k9x2JRPw==","shasum":"22bceddd14f1db26d65aaaa950295f3d8b348ca6","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.1-master.20180830190736.tgz","fileCount":20,"unpackedSize":50115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiEDACRA9TVsSAnZWagAAm7cP/iMIJ2gB/0wPNITITi/9\n+TU8Tun0N2nGmux40kSLUKS2QToHY0GMWioM0nYBLEorxaElWSch/wdShfJs\n6veOwkvgfHPlY5Z+q0cQIsctsiPOI61ExrbU+knZzosjZ5OsY//6JufxCKXk\nyKOxdMAdhYUG18tcnSGEjnxeJM8dZIjmUhUMBlhLwBdzSQ3ekvmccjSlgsyF\nBULMmxMVEFX/H/KEKA9lwG5y1rOfZqTAECDbQXKvjX/ntxtFRg8EV+M5i5qJ\nJKIBChtiOpu2/bQbuWTMBEc+IjcfaWW3x7a1fIE3pQgD5VtokcAk4rLWZ7vX\nkNqJkRJy85fNaInL9tkzSl81crlSumSffRfV/94tGgus6uexCfsVMj6A1rsC\njZHva64tx2Ooo6w1gobpq/4pX4We0hRnqqM+kUPaIrREBosgNn2fJNfaMsvq\n0AEoFIUQvFXr9EpbmW0AOFSzyqFHrQdYxzL0GfRABe3m+T1zJT8vQbL1Dksf\nPMlAlTz62mUn50pjfEI4tUtW/M/2l1qiYzLAhxa0Iuu/3kCgbn42Aa+8bIvh\nN1rRjBu5C+K+BzQqoR5EzppCQ6buWlEfRCSmyAMv9U9XbJeq5eJZuwVJ/yEf\n6C6M+fP+tpOFFxGqtecmgHkvkdpI5l9VK7Bvtt44V+yDIj3nuOYh0XOj/B5V\nwzpK\r\n=aW78\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAi8JWC7j9eO1hJCk0yKHQ5whPuV5+QBK88Ax6sbEdp0AiEAu6g7fXh0mxveljxn9nA6MlrbJwhFbvxOoulVv40IlMw="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.1-master.20180830190736_1535656127394_0.13293515456201344"},"_hasShrinkwrap":false},"1.0.1-master.20181109094511":{"name":"@atomist/slack-messages","version":"1.0.1-master.20181109094511","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","supervisor":"^0.12.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --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/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a1ba921f95d9765b62b3d6cc8cc4a326e996f9b6","_id":"@atomist/slack-messages@1.0.1-master.20181109094511","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-VEJVvtvGSB+yGw49vnDnf1SgzmxTrNVJny6ZvcK9HNmHMSQsdrui3ZFhxSf9QT5/zM9f/4VUbrdaeMY/o47yag==","shasum":"703e5f0b660789d2492986898f9588ee40893d27","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.1-master.20181109094511.tgz","fileCount":20,"unpackedSize":50784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5VdiCRA9TVsSAnZWagAAr5UP/1xjkgTWjdz5IL5V6bNV\n+5nnytLVpifFdeCg+O1ZidqRBGHoanw4b3soArC5kdKUUKTf01SRnMGgRTAM\nny8idSknKUnb3rYxS4z6joG2zubeky+yssjlem1MeRGHFoOaCfutPwJi7t8t\nMFq1hsIW7+9gBggpFHdqgXYH3/yhOOBpaZBCMueim1kK/Bq7/ka+c8kXCoiU\ntcKHpnr2Uf1pgHejbQfmOUKUzVItBfwUMUM+KB7QCXaYmiRnzIVV2IjhdiQQ\nXYfoOiog040CLoguiXZb0FUDrkES3qwSHBFL0RiVswOR7wLcmaA2PZeZrcVG\n2cevEdBZj0f/5SfFZL0MR4JxW168/M/YVxhFmQBrfPzoxj87A7lujBqX/CSw\nrPIzzNGJScl6PXyEgTPZ1BsdlSNW2kE7fP5gYzfwew60AOiTOAJwXVetIwJG\nEq6arZrj+xXSeGgUb99VsMDp3qaBqZFkDOgDR7LISAmDwosYXvfz0oWxw6HE\nxOuyN5Rvzdmhe/qmkWyrs0Gv9GyQSIThm/ErULSIfO+rNtrRjLJtpMBx8QMg\n3cuX/ybbwZsI5eX9nD7Zfnh3iTiZVySTXL0Jifx77h7benYH4S0VJUzCzMyI\nlDCwqfvmdTqCaEFP5KswIQASTGXLP/c51jlzBe1rYpyGS0xpb4T77XIoLewS\nq4k6\r\n=p6PU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoo/6RlyRvYW/lck943BGHZaYeLTcPRxPiAdhEJLmunQIgZB64jmRqFn83cxFydqEifddWVIdHrTjdde82QuIh9Ec="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.1-master.20181109094511_1541756769540_0.2813808905223629"},"_hasShrinkwrap":false},"1.0.1":{"name":"@atomist/slack-messages","version":"1.0.1","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","supervisor":"^0.12.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --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/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.0.0","npm":">=5.0.0"},"gitHead":"994757424612ddbc0db4b8d2a199119c07f93448","_id":"@atomist/slack-messages@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-qUfsfgvvofcPOiEzw4RxH8OwzZxeSQOFQJKOQTiR48cQ9FGXVFuAYOnW5r0qnCL/yJdnn/fK+k4KXwlvcF7+7Q==","shasum":"c4dea0472295f2288cb010992faf25dc5b56a4e1","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.1.tgz","fileCount":20,"unpackedSize":50762,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5VemCRA9TVsSAnZWagAAV1wP/j488GqmmSxGF2/cpIxn\nsqSB5cIKhGdxrThUDil9wIuUIH4ChfbHWD/A2E5PZKOvhNPPlT2C/Voxo7IS\n3mf/MGdWJa6Qn8L/w/PgO9lJoDX+SsY1ghMiqGLv34puk2TNiF4SY4UN0/Vw\n3sKiEzyXqY0ZI4BTmnOGqHITXgPfRPmgLe51t2N94zMAT5snnVdfETeTPXE6\nM8+PNBeVke9dcg0G3uZsFKJagvuRRnHw7n7qCqI8/a8XN/wDAyrFFTcrSqIc\nl6ZbdhtB0Mg9b1vkDXcwWxtP0z86/HGn62CX380Q5E7Kba449rD4UG8Ro4VN\n5b7ZrOsynpiC5MyS82OkQy8iIzgEPcueFgXlZlAee/MmQP8WNC1ycW4Nzoso\n9hpvC2GiuSn8Ins3min1DUJNgszHmjqL8J8tM8O202MVp4Z7amtgZhb4vo9h\ntBPi+PiUTc8L2irVfnINba43xCZ5DXvjemzUY8xXlu3YPruRNWSuAD/08W52\nSMUlfLb0AjBQYJENpN+M04Xy6kxjMEr4TN4ye4vSF5zd18phqai6pkoN/aj2\nvnzRoELHRsKsowHFjhtt1UWRJ7GDdgB/LGYFZTjAwiwpZf4M8JfHCQ+9FP8x\nqNGUUcomekJsywg4N2YaUPoX5Yxj4ISPO1kzuIalH2+67vmcKcLA2CFHJTAr\nx1Or\r\n=+Gfn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClTNkdfr8MxbS7eKfY29RNNhYN7PXHvufsviS35Cp6bwIhANEOsJO6rDEHJ6aJ+GOHehHn2vRYtDZw92tUFOK+DF+s"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.1_1541756837351_0.4993953710340082"},"_hasShrinkwrap":false},"1.0.2-master.20181115140150":{"name":"@atomist/slack-messages","version":"1.0.2-master.20181115140150","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0e6c974b6ed5b5aab083af1c690d9ae31934dd6d","_id":"@atomist/slack-messages@1.0.2-master.20181115140150","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-HOpJA4si/kjhVRLtBH9MKDwgOYmL2ePYeU+EGvADt1IC2yDQz25eld286xij4+1gDftv8k7FBd/09Rd4Wxvfzg==","shasum":"f0d156a5c732fe60a19c3480efc0b02033465d1e","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.2-master.20181115140150.tgz","fileCount":20,"unpackedSize":50938,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7XyKCRA9TVsSAnZWagAABh0P/RkGqjEE9yqV0FM/33UW\nCm6uSOdCrRaDKC+ihObV9OKOglm2xRWsAokJDjb+xlWAVh6nB87P5kb8ywoz\nxDO2N0d3A2EgUPimm3efncC7TP6g/33q3eApdv129kV7xYxVeQ37u56odBhg\nWs6i2sic/EX/RGJZvfTo9rN0UxXqJCM3YSAei1reiY4npIhN7zITnZQNmOna\nsrDpox8mKZt87w9zME+gjNj5AFgAxttpEDhlXBk8jcovFIACE/E2UU/4JS3e\nr9aUREXNBs76ETaYsFWEyNxJTr3KLXLPlINX75Gv4QQ9uvpP/yukdBaIXgPJ\nJVx4oB0y8/aWI439xg18cPYqXJUiaqBFvEbX9jYwOFvi+EJBfeAaOxwfdmKZ\n/9Lrj2tW7f/Rt7fjNsLNrivdcqvaKyrjKMxdZI4UtMcKiWku07K+FV304pBO\nq/mcJPkPPqdt76lIDYgwO8OsbQiKUGOrw5Nl9nVyMPkr9poaO6KaIiSqEPiw\n6uJZydcCo4putgcK+QtwrEUC60DoQCeX2JWuFmxL3cBAAGmkPOgnHdBG0SlV\nuJx8xXUsbA9jHzkpkpbDKdsCfxfX8JFz1OrQ/TKsqna4udKiqJvQkXRj/7ak\nZrJzzpsQ+4BoLJihGHlsRhTZzw5NBAxeoMwmsmWiDqVS1aei+j4M0hvrFImk\nMgqR\r\n=KvGy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3UmyrBSTpnZEbWahN+/KRorvE5LtwSG3WRgiHwOuK/AiAnquAlLXkguCcoGnPQXNEsPvldB76Il5LMtjC1ki4GPw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.2-master.20181115140150_1542290570205_0.11660547152925926"},"_hasShrinkwrap":false},"1.0.2-master.20181115151310":{"name":"@atomist/slack-messages","version":"1.0.2-master.20181115151310","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7d6cc9aed3a9e610ebb6ed1f5aae3647f14eaaf8","_id":"@atomist/slack-messages@1.0.2-master.20181115151310","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-QB6jDbK6yPR1/K45IjOkJcdS1nUOzJco2dUTVxHtHCccqRCFtcksFNM+6db70LPyIhuyFkFtYfn/VcbDYjtLiQ==","shasum":"b7b9af975cac1750658b786fc13bd18b06cf1704","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.0.2-master.20181115151310.tgz","fileCount":20,"unpackedSize":55643,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7Y05CRA9TVsSAnZWagAAtRYQAJbfcpUEhlq1nB39I/7r\nMhsIqaZfb4nJoKevdF0TQfc0m24DhIJPocT4HctWsxIoYPk8EZzU+6VRnKfg\nmGc7zB9HCvxyUs0OzcMS2k21jXuohf/SyafUqtzv9PDH6liZjLFvTIW05o4/\nwSHI0MMrxBBtYFlmM/VN6X05AiVeNM58V7s8vpW/l9p0FbpmvhIWQ68DK1Hr\n82fJYfjEjegoQVyjEH9bRiksMAfrt9gCCkHHzw9HAmh+Tec6521AzuEwVPNQ\nPgKmW/OO3xH9hkUZMJSyvjF5M9Oxtb7A7Oli3PyRLvUuHjNpMrfzdsoUAHon\nhIZNJ0m5S78Vc7V5QKrjp1v8ATyGRsTnnVVhIi23hBXFnLCWmPu8SD7Hmj3Z\nufv6P01kiSA5zv7EgHIN7FcxQaOgN+EGu1EBHPOo+iuwoSY6x/aAB5aBjdNg\nlzaZfUm77H6Tt/YESwVGFzCQXqWciksAWOzilFMbtdY/Pjk6cvNXootP0q7R\nvfF4KDt6b+MZUKBCMT9Xfj/OMQz2m0yaBU6Dey64AQMIfkAtBFRGzjnDw8I0\nhJtqtN6X4Gy8SQfc36/+nqLMEnFMOZuCZX+Zk7cVqDSzxX58IdCfoD5p1ccJ\ny+0df/0HH55BPAANQkvAXAFNSAsBug7zSiS6wgEfHOatvyIK3sM0QEdH8zln\nQAAc\r\n=JnP8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAtOfQJIsUjrsQd0q4gqohEtpBRuqYoas2+G6+p1NXvqAiB7rUHIIl50szZzrNpPLkObxTbfRbrZ42MaKlL01842hQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.0.2-master.20181115151310_1542294840833_0.7462916334435388"},"_hasShrinkwrap":false},"1.1.0-master.20181115202354":{"name":"@atomist/slack-messages","version":"1.1.0-master.20181115202354","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"eca8911587ac31facf6eddb5948295eb7ff5d147","_id":"@atomist/slack-messages@1.1.0-master.20181115202354","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-++lC8NauExgRYOkOMBGP4Ww+hSNE50iZktomvg+n8CidCUZgjTwO7ch/cZxuakP06O7rc3cLHqqQlIUTDlqrQQ==","shasum":"0e5c3eb306ac3f6ecdd684f8d42e4dd05949492a","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.0-master.20181115202354.tgz","fileCount":20,"unpackedSize":57645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7dYOCRA9TVsSAnZWagAA8AUP+weMAIZ9xbMh6tyUvGB5\nV/R9GMo04s51v3gokEFdHHEUvL+wMYS3Mbn3JSC9QqQ4LpkJTKnoef6cxMpI\nhdxvBQto8c6nVJUyY6p4vzdAtk8zpDiMezkJBA3Gq5Zpove23mdOP+FOkiGf\nucRA93wKKSIZqnGIkRqW8zI5G6YtocyblJvHPVHznqkohtZ50L52xHUPHvh6\nW1iBIHzNpR48W1VoNCuLGmBbE5JEkTRFaXrxf+8hLTMgBsmL5lt8IpsQljXm\naMwejdlGvdo0vtd2VLZPHmips7Y/aP5zY+ccTvZOtVVL/vFaVPT8g+cIZkn3\nDXl2mam61Db6jmTcbJIMTTWy7iUTvPshL5RpXc7i23sFr66AvHQxNPILtAcA\n8X+o6IwnOTJYMPUATDP422jRpKM+2Kv3c80jBowi6C9DrStIW5aiUt3cn1lF\n+N7QEjgSLaMDqjedhePAU0LS86vossL80WgNbSLbgeOlAhA8JtfO24UAHjXQ\nfmfi5JExuCV3B7XCumwW14xlMGV4Hc2sQ5hyTA8ZknyOPUIEWH0+0Rjn6PVb\nsqOGt6dWJ7bjump7+yPpZI/B/GE8cepUo2m3MobH2MWKxjo/2knAiY0aiQ/Q\nU2ei2YhUNdJpc+bYJO9/rA5Bk7CXijnioyEhmvR2VxvVe1Ks4Dc7AADefJ25\nZ0p+\r\n=a+XY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgGE6oY0694ParH86fAoKWhaBwqCUo9gNZc2CM3F+8cQIhAIr4dGzBjZM/ZlISDjex69a8zrD9VPOpf7edHmFnKPgS"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.0-master.20181115202354_1542313486088_0.9039576505995899"},"_hasShrinkwrap":false},"1.1.0":{"name":"@atomist/slack-messages","version":"1.1.0","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.3","power-assert":"^1.6.0","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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"7e5bb02610a248dec88e1dd919184c66f5ef19eb","_id":"@atomist/slack-messages@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-sai3gxAyFXVBa7A7AADdVcO8Nw0gV+bXHY9T4Ki447gqbMpAyyVj3V2qxY6wmdI9j5EcwPl0fOaBpFN3xEJTkw==","shasum":"82f6b0dc91498726d0df2541ba01dab4a6c5775f","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.0.tgz","fileCount":20,"unpackedSize":57623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7dZPCRA9TVsSAnZWagAA/eAP/iEESHo+LlfRGNugtZpu\n7qv0vKZxCiMi9ECSJkaOnjkfpeW0ai9VJmbIe89+xtbIOuaOZQDTdWy7aJUs\nj35GlHGC4DnAh1HCDV9BdcUHeY9fAXdpq2bGEDxs3q/1pV4Z78uS0J1Yt8+m\nEbPIcqDmycVtEL9WUAqnowl2OjGlW6f1CNBg0VgJwM5cI5wlZy28MD3K7I7C\noaRebfS4g7giywDaybLtWM+Yw1iTOTVwm0FuESZchS6F4Ukwyijkc/7wWO1r\ntYRXhC1PrvrTTOvnA6CCeJvSGI7tJJlHMmVVsc4IVIEPWjMfOSmE7JqoHDrE\nyv2URB6S6/iGeK4IHH2g5GXKlmve3yQEVGO/gIOLKc+5LPQrMh52k4ObuPh7\nPnjzlFMpp/ZmInsWiNMuPAdacbbOKNVArgUVVgPTKVPm1UlRgR7S8OOVhXZA\nNel7+uqdvGI0GRexHLAByFW9pJ9SbhI4DH+gScjV57NxGzgwp9CyMdU36hEk\ntKi1YvgjHtTWk+p0lHaVuC+sCo1fu2SArnV8NJIDVswlTpEgkvxxZbim9TZT\npk8WesFs8qI0jL6j86cQ1JSKOCXRt5HXLmcsMkiCq1jssaJRTv4hiXoSL3T2\nTXUXCGTpDV/QG0AAazt/Yces4ONyWHfjNv0eMbms0TqntqqIUohROOb1Y9+T\nyToi\r\n=eBTu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVZy3Onmp5xtAPbhUNg5/8jKX+oBKEYJoJJW9PQSGJuQIgcAH7SIGzt1haA7v4Mt/EauOPC8AbayK2Co2+IqNnV3c="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.0_1542313551208_0.804849737509572"},"_hasShrinkwrap":false},"1.1.1-master.20190205203349":{"name":"@atomist/slack-messages","version":"1.1.1-master.20190205203349","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.5","power-assert":"^1.6.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.1","typedoc":"^0.14.2","typescript":"^3.3.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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-message\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-message\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"880e6df211a43312f419b88e314bc3eabad25acc","_id":"@atomist/slack-messages@1.1.1-master.20190205203349","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-a2IB+l5uMK8rqukZw2NX62CbhKxFD2YS41PkGr5XDPQfhghjwDWZwsXTW8cUXix3mHVMdFtwgP+bQJMy5/NUKw==","shasum":"fe737c60b85f1707b0349c411cc6b90f0203035b","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.1-master.20190205203349.tgz","fileCount":20,"unpackedSize":57827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWfNwCRA9TVsSAnZWagAAlUIP/RltxqjBeJRADsUUThSA\nUrN8DE3QU3zfCA2JacrD7ZOzW38s940NQfC0xMDVLnZqgFC94y29FZmv/LON\nOKiyYZiaWk6izXlKgqZB9SDlBRR/sUzOhrNHzT/hfmcsoDk/yFVCc+Nmwtwa\nW+UJjNP/pgDkf3wqsUB9Ky3tGqogT0kZggTBzsAXh58JxLVbvST5xkDz7EYY\nIwCTS8SKMfkBns7dKqzHAXVea7JvWZ6eg/2nPaMzuDqhMDPyW0iNIgHaljEM\n3fdaqc/1WLDc8uJU8O3Ta4soZWHYdom01LAU5u+FhLm/nXTyDl4xz6FcUQZn\nM23i/ZRPC2aZI7FHADhS1MndATT+nQNfZ1hJtbC6RrYImLZ+5CXewLVU6H+3\nLWVaqewhTotAi+OLnDItPR9MkYr4OQ79dmW4OBXnJW0Q0hhc1dDBgcma3Pyj\n+BsZOB0Ltko4eTiMrRiJyBmuTV7OTIg5w2M5RgJDwtrHVtjZRES5junPnw1t\nPWWg4ni/kMcziu3i6acEMoiw0Sbk6QeEo/uFTwVdizx44mP3Xj9ncCFA2Fgm\nLc5YejAc1X4iVkflq5p95W58pcBjKUXSYXVpR2ZcBEJ+NyJkHxpSVJ1CvuXM\nsIO7RmJrs1OmhKZR7LO7EXezHLvIVQ9c4QI03jJreoYKzS3Af3Wh6qSrQkRC\nR73K\r\n=8/l9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEjhGsRtz/H2kPMjv5OtW7GyQHzJ5EqsJxPKVtIfXEJlAiBRM7QD4unWuz6h+e91xmJPq2kc1+aXIMixaefq1R5eVw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.1-master.20190205203349_1549398895830_0.9093192273306538"},"_hasShrinkwrap":false},"1.1.1-master.20190217194316":{"name":"@atomist/slack-messages","version":"1.1.1-master.20190217194316","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.0","mocha":"^5.2.0","npm-run-all":"^4.1.5","power-assert":"^1.6.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^7.0.1","tslint":"^5.12.1","typedoc":"^0.14.2","typescript":"^3.3.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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4f3d7e7a8b386434029d3065db4b15f7e0d26b25","_id":"@atomist/slack-messages@1.1.1-master.20190217194316","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"atomist","email":"npm@atomist.com"},"dist":{"integrity":"sha512-jPBz3WIFILGUXTwrYznmSzTr3wZmg4LZD/TgYOvVRh2/oD/r6MaQEMN2IOfu15fbgJh/BstI5h8ViHBG5cvLog==","shasum":"b765446a14565198627038999fc78f5b9ce70502","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.1-master.20190217194316.tgz","fileCount":20,"unpackedSize":57936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcabm0CRA9TVsSAnZWagAAgpYP+wZOL9qFubUkWF4fJwhY\nmqTWp1G7hVG9FbTqrrJBB/hxfAIT8JP+d7h5x5a1EyEXVuCKVg2CBiDtkjDY\nr7RSTCLax6qO+af44Rhxzt7HAMq8dRi7sSNMUUdiD4J0xHu9RUxWgxwbd7Kj\nm1AFRy++juEeT6/dD7pkdt5XYUUiPmmkOnKURrdkj09mtvN1mNR7rCj2Ozof\nxO0GnPibKc1wHO/iUH06fdWX4bwAPRFBZvdDMmyt3beQkzx7zm9oUeFTin8U\nYHxaRz27LRhS23+tJS4EpX0uk0/BR5lpxddIsHmnKW8CriwAITDXv5a0rTRf\nMBgb20lmViKYhk6wigYufesUgmImDJPqe0yzAUvWTPbY/IRng8utiIJ7E3l8\nXnValFZuWwuJfplShxmeujo69yqDsZGBcc0mbrEsrSU2lHZhJ6pF6XcW/VDU\n00pF4G2E9sil+q+HuB3Dj2clbEzwV1fcL1WUzOPbi03vmkQt65t4svM2BGbR\nV1ppoiRAvg6Q5+dIxLS5tvkOBfeHygzNOQNz+MlgaRhHIFe9EnmkU3dN3Ik7\nkzYrOvPXSeBhummnAJrB69cmzMiKEdqibZnaasfM2mzM9UcfZTJdQ51AqQBh\ngmCvjh27ppBnuYsNscy7RlagIt0fOLoWGvcjuFpSyrz74z2xPWnRWJk+LCQL\nvX9z\r\n=fEnG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZMz/IAkOHRnsIt0Md2h0nbNuBvr+7ww6j9SAqgNpt1AiB6+VwSFBvcI7g9sRyziVKXKBP7o2TQt+HOPgfM3bWjbQ=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.1-master.20190217194316_1550432692215_0.7654333083337272"},"_hasShrinkwrap":false},"1.1.1-master.20190618205814":{"name":"@atomist/slack-messages","version":"1.1.1-master.20190618205814","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.2","mocha":"^5.2.0","npm-run-all":"^4.1.5","power-assert":"^1.6.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.17.0","typedoc":"^0.14.2","typescript":"^3.5.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7d3824f86d2af80c70b39bf8dab883d9aa57497f","_id":"@atomist/slack-messages@1.1.1-master.20190618205814","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-gxy9mzCHyFucr52+VqUmHoNqAgJyS+LRcinUHHz/ogUlxkFv/X7fkTU3+zeGpL/fvnFiKvEKqK/mx9FE1t49TA==","shasum":"19c105b487134adef3f7cb03cd7568bb95f4216d","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.1-master.20190618205814.tgz","fileCount":21,"unpackedSize":59599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCVC/CRA9TVsSAnZWagAAlD0P/38+sZ9f2+wUdSDeFkyW\n0fusWkD2aeq05Ao+ffqGkMiShUYyHylyF/o9k8bHjkNxWNiwh7RERZ2LLFTB\np4ugWZQQsy+CFEt8UEpbs/Ua8UxT2i3wNUYMlUFmfwr7qiwLxWoq8jcv3nmo\nP1ipwJyBz2HnBNSvItzozKzoCtukYQCSqWabLYwLiRTTDiDX4sOS+r/mn0Nt\n6SVkIFeZv2bYVD5o6P6HBTRmvuk0xqQ9ImnDk8YO3T4vR3U2XNJT651MFWFr\nLw+r+Uc8wxyACYN+0bUEPqWyph797iNlp74tLeyUT0/reryvaMUkQ/foVH8L\n6q4wZ2RLJ+A1CvkGIGi3jEy1JqZexN2TWXCJtf39mXm6NSc5FPjfZy78FMHH\n5gTkSFT/7I9i7gkKGRBkLC2Gd5hj428sn/Wn/oD7Xr1kQ/bVy9bsiPyQEiiK\n8+1rYEL9r9vR0K1VybcXvazX17xEWUX6XjOuasmy8mZvTbd2cE2cqB26Y1YT\nLyyAZYKhwmKXBOUSn6/SMxlUbFTcJm4Shqqhu7kg4eluWUVW+7wYtfR8TX73\ne/ngwrvf56ySKzfQXk1rZm54lmP1+gDXQgvySMZ3ye91TRdLw6l9l5iSyOgG\nwy4Zp+lYqfp2e0KY6STZwJB0ETPwzjetLHVVzb0fC3OazG3VS9yBfOzi1uGG\nkcAK\r\n=vrzb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHAx1KVxtAFet/yAB7kdP8MiY116rmwPW71dsqzwfxwyAiAsCycNKrSzox3aViTgVVN41sqsgAgZfWFzpEjg83V1Pg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.1-master.20190618205814_1560891582971_0.885824536048502"},"_hasShrinkwrap":false},"1.1.1":{"name":"@atomist/slack-messages","version":"1.1.1","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.5","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.2","mocha":"^5.2.0","npm-run-all":"^4.1.5","power-assert":"^1.6.0","rimraf":"^2.6.2","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.17.0","typedoc":"^0.14.2","typescript":"^3.5.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.1.0","npm":">=5.0.0"},"gitHead":"9094a00dd5bf3e31832a04cc8bae305a2febc72b","_id":"@atomist/slack-messages@1.1.1","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-m2OzlTDbhvzK4hgswH9Lx0cdpq1AntXu53Klz5RGkFfuoDvKsnlU7tmtVfNWtUiP0zZbGtrb/BZYH7aB6TRnMA==","shasum":"9de42932e89065fb4fe4842978ca2d1ed3424cea","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.1.tgz","fileCount":21,"unpackedSize":59577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCVJ0CRA9TVsSAnZWagAA/voP/13bgiUCWHMZ2spM79af\n2iuvTcxmw105zp4D5ClY10aNL20XBeJhVPg+/2tTGwWxJdugDBBq3AcxY/lF\nPop7OtRNGbCG/0dpiAfVQOtGxqWrycO/JKR8CjU6i6TG5oB+rOboHHKKUpSd\nlluBulomyGzM+v56kltrA9+6JwQ9W9FwikbDCcNwNGBuYzob6r8CjstZyKPZ\nE61wSW9NcDbx2KWDRSOTULNOGOKoNgkN4SyW8dEtEvc2ZJF3a4eFl6RViX31\nJJX3zDSlz9bmkp28gE7nJYsVnCKvwwHoDWfJvw1Noc5rM1aqHDwQOrFfbThR\nHD5ZDj6y+PuEO7skoyIPVLfXdV0YS1lvwLpQazJEYJl9jgBje3vcy9oKFOoL\nSee7ds0MWU3wRUhaubSRbJvY7/eqoOJNIzuY6fLQ5gsrXatv+DfQhFi6Rsz8\nSrfoLPMCkGBHyzdNGv2uCGslQSUzIXZlQ/GGOpmlQHM1IfT2Owds1l4MWHdu\n4mPXmW9kDgUusckTVe6pVIX90NAUJCNNNT/uFfsQ27PqUkJkewdJgYMJL1wl\nZqwUagwq5Yv02oOwg4QGCdz777SblgkQ58euDlKDT8+bddnJtViJIKt7Xwsp\n6XPWEz/iObCD+reenAVP6Kf9YVvtCwbBqB3gMzk1aDnq/wG29m7bBGfDdeck\nf3g3\r\n=iwfN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJHbmgpm/yEkxdtyMkZszJDCs+FQHSGQr7IbZ6qZqCRwIhAIGeLfZEW8KbWUXf+QxbVpAlm7NNFmAijizebGR4GMKc"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.1_1560892019801_0.1543630579481987"},"_hasShrinkwrap":false},"1.1.2-master.20190716171319":{"name":"@atomist/slack-messages","version":"1.1.2-master.20190716171319","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.7","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.2","mocha":"^6.1.4","npm-run-all":"^4.1.5","power-assert":"^1.6.1","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2","typescript":"^3.5.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"e62a4e6d534d84afc552d63f5e3553cf122aa73a","_id":"@atomist/slack-messages@1.1.2-master.20190716171319","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-2FvgWmbm7/UTfNCM+r4mfwd3ZccjeOjXQkYgAuiL8qrtTdfWH77yDhBKKHYIHm0Vu76N3ivEv2ptsKw704T9Fw==","shasum":"7001fa8ee2ba1e68121ccc03d2b787bbc88266cb","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.2-master.20190716171319.tgz","fileCount":25,"unpackedSize":63865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLgYMCRA9TVsSAnZWagAA0SoQAJo/BLm8h8A7lqf7j3qr\nvQErZ3JzK9YTeR3E/+YFN2uTRxDkTUVeGXDqU7/trOF/Hw+BeHyfq8AcNO85\n1P18pzEnquqJ/mnuonWZrM4E+DBpXhJoLWHtzPe+0N9u4QrsSfWkjaOHhSK5\nA60C8mfNXrlviP/Z6lOBgIVssqMlQYA17Oysgj84lEg5JC/CTQxz8eFssCAR\ng6DbcREpGIGIPuLufUqVNtFVhkbmhhe9RnpP+mWV3qrVUnCi3Gjk2u59wE8A\n3AH6xHZh2lOIumEn3VwNXWRjiuwOhxXl4Lb/AwHrYApWMKZMw+bW4kKse3Xi\nndGCoG/ecgjD7W6+H7CEuRWLrfvhmNPy26wfl7endRt6x8gYxBNSGXa70WXq\n7ysI0Q6PfV1w0v/+FyppPnCf19R5ECKx8xr2hHWBS/j/FLdPmdoF/cnKmfim\nqIXKnF+IwAIIWpaL9TDmS1a7dlGQ+zGMKrL3Fl8kMTMc+43MrzYc+YrY7+pi\n8XGUOV8YKa+3ugu9E5As53E3C0lH692W70QBAmAd8HscUoft/GBaSmYUueJS\nsca5fyj5E8PkK/nFMHC57gVWXILJfozNjkb/TZd8sgcKjMmTwyZKz/9FrGX9\nyoSl0YLVZzs2IApCa6Zo+z7J06BEu9ZVylv1sBjXdfJ2CU5RWLYOad1kRcYq\nRYbA\r\n=5+2z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7B3ZdFKsvrtGLn5qmnbYbP+osqvxipsO+0Lc+m3GIpAiEA0D5cmvFNh8fWub02p5oC6v2sdiwzfYwSEYdXXENu6WY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.2-master.20190716171319_1563297291913_0.5970748919698259"},"_hasShrinkwrap":false},"1.1.2-atomist.anq2qhoid.typescript-version.master.20190904142734":{"name":"@atomist/slack-messages","version":"1.1.2-atomist.anq2qhoid.typescript-version.master.20190904142734","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.7","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.2","mocha":"^6.1.4","npm-run-all":"^4.1.5","power-assert":"^1.6.1","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2","typescript":"^3.6.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ab0c47c8d5883ffe407766970e3cb54a397cae37","_id":"@atomist/slack-messages@1.1.2-atomist.anq2qhoid.typescript-version.master.20190904142734","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-koCoMkzxzHl69ZsZ7Hn/BNxkMnOMcWsAcX6RAKdQ3DLW76Hapu+k18+XobHVu4KPznYVk3ncWw4RkU6AcBoSKg==","shasum":"ce03bcca866dcb366b8b9705fcb9aeebe0cccfa5","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.2-atomist.anq2qhoid.typescript-version.master.20190904142734.tgz","fileCount":25,"unpackedSize":63902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdb8pFCRA9TVsSAnZWagAA41kP/RPa7dxeIHHMO9aYRLWh\nCOuztur19rjIab/qzZ2y47rFgnRN69drPnkbxgOxVpOWPtPQ9XeNHzvXBXMF\nKvxL8OEtP4prVdfFmBeI8BZ7XVe9l7wuOi/WcxnorEPJcobvMTAJvAPcDnPO\nG5N28uXUVuqtMOilGM6JAn3GMsvYfTukLvYhe6GVInxz5TNWtV1h+PlAog6E\nKRa49fM7B3VgtrHN46nlTKfkvaTdvTV9ygvkM6X9XHQpAs+1UVLGNU0Ndavr\niQXvskkvHKgr2fqR5M567BApxYOI9wAYgcxMDoYf+PvIEUIHuRmKIhgXce+U\nLb6AiEqBUy3AS+WPYtRno0x93hJ7V7BiYu8juFmo169BY2SKQcn6U9ce7guH\n/GZhGtLJ5V9aTYsWQEvdNUDDS0ZBVcuY7j8dbxtlWQ4ubmP/WXaaphHAceS3\nc4H+4ff1lq0JcZiHqaYtN5K8mRuxxjrKiwNIgAT+1WcRODE5XLLV+W5e8c2Z\ne7HnfwtdqTt2hfmhU5Ki92nTWIRAaq16HR0dnwdHE2jv76BDHxtgEuR0Sl0X\n55qr56J2VOmV3lV38mIxG/eAp9JkXWLtondRcjMzq1GLACFrQcuM6W6/IQri\nWi3dbiO/S1MSEFJbU8yD04tf55rv/MAP48KzHLZJRqa+sYo4cm9keZo9rzzw\n5qB/\r\n=qvjf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC67FHU7x5zavQL+ctQBptN5GLZg4GhJXReEpnC+CDEKAIhAPeAckAn/bgssbBHBUdVq/MNT8Z73Qd+T3gatcwskYYj"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.2-atomist.anq2qhoid.typescript-version.master.20190904142734_1567607364951_0.6565486307077311"},"_hasShrinkwrap":false},"1.1.2-atomist.a260p86nh.typescript-version.master.20190915195615":{"name":"@atomist/slack-messages","version":"1.1.2-atomist.a260p86nh.typescript-version.master.20190915195615","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.7","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.2","mocha":"^6.1.4","npm-run-all":"^4.1.5","power-assert":"^1.6.1","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2","typescript":"^3.6.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"bffb743de0bd0f212c1dcc9c6e2dab92132d0369","_id":"@atomist/slack-messages@1.1.2-atomist.a260p86nh.typescript-version.master.20190915195615","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-rJ2FsAdizjxrCHXjBNW1Q2CXZnFOCgYir8WWWSBDSfBXRh6/0rexn86q6Z2/Xfl3BwF/PeYRX89KKFUcjrHU0g==","shasum":"dba2f20b4c69fcae6b3ed5650b8f10c8685feb24","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.2-atomist.a260p86nh.typescript-version.master.20190915195615.tgz","fileCount":25,"unpackedSize":63902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdfpe6CRA9TVsSAnZWagAA7dcP/3tXSM0+w5sMCbOlo8E7\nk159tI8/6ZgcltHb2zSr8Fz3vuDXqacwHOBpC5XLlrNRXs0PKuhzWcvF0vbk\nGsbuXeiTJU99Rz5rI8Nr5gf+lokaDc9pHTaTO/SMBkbSzZk9mon1bZ/UUj7W\nZej7mAp3YYp1cL8RsePMJzRY+p+hAMB9jKhltlyirQxNgKQ6/rExbnMduElX\nhrARAsCt/JWbUCzy2Ob1T2Fjf8wlLGTHISCS69t1YipVqpdjpvcmRIJlZDzU\n0vPTnO4TukCF0KOJMi49U+VOZB/QILwrq1Zl/6LfzWb5yzNmwXsPrliuyocA\nH7hn6KktB9bj3dt25i4hS6aFsu+9kawyaEJxvRgshqcIHmbUq8BHz+O4uKf9\nOPiMcUqczObDALp9bWhtVLaS1KTPSkYBfZPaM8X/FgQtUbeeukAOwxPN7rCc\nTvitLqYma2+DfAMY/EBHkDdeqw0BNe3XnqEfap872BLpJzdeDv34yg2qsGLG\nAFLdRxJl4hKP6FXB2u9K8u4+ToNlcC7cEEuBO3rbUgm3wMQ+g4z689dKbVqq\nPn7FvmhMXLNsp3MOnofRD2R+/g6n+N7pPZr0ZCZFPwOZxKne8GTa3DqifDL/\nLHe9cLesHqNdhDHWsdyrRKgHw201DmQGcS4/slHTe7Gvy8EAf3SrfzP/cK+p\nfMGW\r\n=EW1u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGH2fQjW/sYamwi9nz22W1SEcch5i2+jSS6iD/7jBzyrAiEAq2bWWprAFZ1jF+FjYakn4F9Xd8+DeCnptQ71Uvsx2DY="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.2-atomist.a260p86nh.typescript-version.master.20190915195615_1568577466292_0.06370320533591367"},"_hasShrinkwrap":false},"1.1.2-master.20190916021445":{"name":"@atomist/slack-messages","version":"1.1.2-master.20190916021445","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.7","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.2","mocha":"^6.1.4","npm-run-all":"^4.1.5","power-assert":"^1.6.1","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.3.0","tslint":"^5.18.0","typedoc":"^0.14.2","typescript":"^3.6.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8de9320df3b71ce8f07b5f43645789ebd8edd390","_id":"@atomist/slack-messages@1.1.2-master.20190916021445","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-UbRjIdmqTwPCnm5OhFa2u26/NcBOAGecKvcIpuAb+ldRJYZWtTa7ynvUN75tjBgXPHFQAS0VzDuezV2B5fAMzw==","shasum":"65674fca93d6746d0c96effe9924471f05781534","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.2-master.20190916021445.tgz","fileCount":25,"unpackedSize":63865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdfvBxCRA9TVsSAnZWagAAZG8QAJy0ImfmgEY5iOJwNFGp\naqRauyJgWg2P1CMcdcGueNsBBRmN3DCNXvBj9eUzgMTcYgTEbxaOm9uIh/gg\nw9JfLUs7xwvIRUQ6Znn8HUuNoncdxBlzisz4+J3RGJYp+YfVevhS3soJH/qm\nMFKiwfHwAo1KgOUM5me5Z+l3aapNb9g59lOmkaqvs91VqhpDSYHwDkM+rfV7\n9SZ8wI1P/kKkIU0p1seI3YyUwz1dsPxbgTWOXV6I6TOxQNRSTl1WMtEohyZC\nbthqwUCRkjlL+sthmgPCIwqu61bhehlttu5IVUDccd7QRM7hPi7/YDiObGNu\n1GtiPqxG418H+arpqTwgcjakUTVnmkfAK+x34daiEthHJyTx9RosRCoqIeCv\nkmRgDSbWI5sZctLEkceRKTSBvqVJCSsYXXN3oSSyNII2NUY2e9ZNPezxu3QT\nGVWMmPbsBX1r3pxPhEI0iZN5vSM+2DyFUxxJ/kSf6jXLgOGAN+NRCxpD5ZYU\nh6MtO0gTLDJfvMOd3cu/5Zd4ub3JtDhlHc2mHmYvlLNy40tCRzYSkGCa/gY4\nzCAE+KsO6OyBmKebfbjr40hWbrSSVKkg/7N5SiIzqWhyDsl2u8wP8sYkrp7z\nPxZomalq2xEIqS2KSALTXEVZQC/oPf1x+0G5tTuDi23XUH8uKL896tZ103+2\n+rsQ\r\n=vKMG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICX8yZb04Lpoomx8Gffn9Eo/MwikhoWfpm5R/kVnH3+kAiEAtbjwLgt6bmVfLRILWkm0UX8z0t7YOFbFu7FsxX13nrU="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.2-master.20190916021445_1568600177177_0.514972428701348"},"_hasShrinkwrap":false},"1.1.2-master.20200108150633":{"name":"@atomist/slack-messages","version":"1.1.2-master.20200108150633","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^5.2.7","@types/power-assert":"^1.5.0","espower-typescript":"^9.0.2","mocha":"^6.1.4","npm-run-all":"^4.1.5","power-assert":"^1.6.1","rimraf":"^2.6.3","supervisor":"^0.12.0","ts-node":"^8.5.4","tslint":"^5.20.1","typedoc":"^0.15.6","typescript":"^3.7.4"},"directories":{"test":"test"},"scripts":{"autotest":"supervisor --watch index.ts,lib,test --extensions ts --no-restart-on exit --quiet --exec npm -- test","build":"run-s compile test lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"tslint --config tslint.json --format verbose --project .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\"","typedoc":"npm run doc"},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"0dee95423ab335b2750987dec41b6d95e541ecaa","_id":"@atomist/slack-messages@1.1.2-master.20200108150633","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-PxP8dz7NccwTvAvnVNGs/TubirsrGrvg2HwuGihvKWxyye6ccDPNl+KYvLnisi0SbHqnl/wozLj3LXrvqBkoaw==","shasum":"87e290010005ffeedc6edfdfb79d6c9f883695ab","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.2-master.20200108150633.tgz","fileCount":25,"unpackedSize":63939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFfAmCRA9TVsSAnZWagAA0nYP/1OfzOi65sVj2F0hxw7A\nFKpWGdE3o6MabcLhwh10uUOQEeklEAgXF9g5gAoxRUUWbV/Z00PM+iXBfaeZ\nYl2KXqqmre8heqXQWE7yBWNGYvbBP2P1dsiXnrqZMk0yBdqQmqCwBiNXaR5w\nI1RWgyrRBdGkRK5vXQF41sSuRF1x41JF+m7W0tiwbPzINCull3VRfOcncQ+t\nBI/P2Xid8oWcwmjyCx4GjfAPnYoJOq2QpiuVYjwijJzlKuBKemonnXw3wr9U\ng8w6nrXA0ZOmW5QPnR2EYGf70gPvjBelryYbGfn7UzclOJ6s6OjEBueDzT/y\nSQRB7u+AikPgSQ8o2lcoOWAgaeG4gWCr8/wSkuKKIeNc+QMoxAT3iKJGiXk/\nxspaO2OVMQWtYna5eyyb59X4ZjwUwiGrBM2bppQqrWcQPahemqUA3CcPESPE\nED1bKApmlhORFgfZVg5cV4MQppcnH9NpwLEXR0tenPB7RLQFlgOcBRx1g/W0\nQ3VmL20kivXPVqQQlGSGDaE8Eao04qv0ZYJImyvJOZYNqWMk0IZiRtGoQzBB\nlJYSaQgQBdBFFXs4Nd2+Zu2eUxGDwVLts+bNU5imfUYxnQEmEYE2eZ9QleKz\nW9tlZsDZ7iGogJTFlv1+WHtyJ3tHU8El7iuuLk3T3F4ea95gkeWTq8vMp6Hq\nqeQ6\r\n=8vPl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8X9JmN+xK6apRIXVLJG4M0NXwl9DQj63tKz2zVmFWjgIhALheLqo6Hc4kMAVow9zZbA2y05w/RUIkLTQH7JN/5nJN"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.2-master.20200108150633_1578496038359_0.2148970624738571"},"_hasShrinkwrap":false},"1.1.2-master.20200430150635":{"name":"@atomist/slack-messages","version":"1.1.2-master.20200430150635","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^7.0.2","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^2.30.0","@typescript-eslint/parser":"^2.30.0","eslint":"^6.8.0","espower-typescript":"^9.0.2","mocha":"^7.1.2","npm-run-all":"^4.1.5","power-assert":"^1.6.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.9.1","typedoc":"^0.17.6","typescript":"^3.8.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6d3e48f2f73f07d642d35aac2fd2a35b6771ea63","_id":"@atomist/slack-messages@1.1.2-master.20200430150635","_nodeVersion":"12.8.0","_npmVersion":"6.10.2","dist":{"integrity":"sha512-HLYkCSPUC/fLEDLldGStTp3dPjvhJliTRK1A4USOEt802cXaiatDObl0czXeLykA1BOOqklWbx0VECuapKU00Q==","shasum":"7ade8cb8c82a011cbd0f2bf3b4be0caa47f2b528","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.1.2-master.20200430150635.tgz","fileCount":26,"unpackedSize":58760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJequmvCRA9TVsSAnZWagAA+QEP/RZG3t49QxkVU8pmqrWP\n1JhF+3XImBCDzra/fu/wY6FylVtn2gkL7zapZf3LpnkOEk195Izz61PkMbpj\nY9gC9rl6XG9DdbWzIZ3yplCYsufYyXLQ9SA7UntwueTkmgbJTrXSTlTPWMNa\nJB8h11PNd1LkjMkRgbUKRdXiIqab2N/SF/JpO/8OqIn6VkrYAE9RXisqdP2c\nu6au+P5moJB0EeCT38SIRMSjiospMYXczG0G18aBIaUHGdY/7ryBXi9ZjxQI\nkWmAbhZAT1QTg9hPB1z0uZAv6rR4XIxnqnENgDNFZS0EDIvyFwLi/BEKoQFg\ndC0MjQkGITmmv/lJ1hSUHYiTf/z+gNV308kmlm2FXWyDhlOVHJvwAyXf9vTd\nb75m1eyBl+jDHB4a6g/pFPTtaa2hv/8kOm1oIQjIgT/SlN/15IxbnwYjZE/w\ndgxeh0sPUI6rPxYKORTlmOzRT0dySr3mNEzsA3ijreIrn6MzVGYriuyoUqJg\nWPN7p1dJcyLnCrSXgwUDlbRbUkAbjr2jFjLZHVNk0b+HfiUAW3buqmMRprAE\n7vqbwwY83GqhcYZN9Yths1/gPIjHkHo/dw4ITYxw6qX7Xa4o/KKKRsNf4ixZ\nnujTILM8M4U9BiCZ8ggZ048UcITOcTxDpP3pPYbR80vmgETQv5110z1dbhxv\nvN2m\r\n=n/YR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4Zuvvs3zqsAeP2q6Ofds9TSmx9JIGCfyYtr/N1rJxUAIhALrsbWc7AexH/yaFTo8PcxyMFu5NJOGPHT1MUU5ghcmc"}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.1.2-master.20200430150635_1588259246709_0.4621572260099003"},"_hasShrinkwrap":false},"1.2.0-master.20200806083357":{"name":"@atomist/slack-messages","version":"1.2.0-master.20200806083357","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.0.5","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.7"},"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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6f61a5589279c79e0952a0d5960d48d5473793d0","_id":"@atomist/slack-messages@1.2.0-master.20200806083357","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-fLWWM0DAwWGNMV6MtkTg33wzOv1Dqmxap4zOjxuxjuqvypjzSd3W7JmTrrDJMt0Lq9Y+ovwSMVrnb6gG/oTtGQ==","shasum":"606a0231cf67ca7b1a09a58adccae24e42e23019","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20200806083357.tgz","fileCount":28,"unpackedSize":68154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK8C4CRA9TVsSAnZWagAA1nUP+QBq2jhKbnboOTpq+znP\nLIYxsFUvfEOoHN1QsR7WMpA1PAoG/GxX3aBMTEPLv44VhlY/ZrfFyjzoi5ED\nWwqyX8nhRyuRuhM8yi0da11OBJxf3dl8LihYjnZa8OpNZNC2AdUcQ2pj7VPn\nr/O6SYdkmBMA3daEa6GdhoQUPo7BkvuewawAVW2InBh1G8OeyqrOg+FlRUfJ\nHSki/LH1KTzq95snnyNcY2AW2SAU1WvY8gjIlKDkzGbiVxEZbBLwFuhX5Gck\nyJRVg2aTRygzxai6TvM6ck4lQKm2tqHYmVL0EaxJK8xHqKI988vgJTXNukyi\nj2wjTpHP/E5kbJKgqbICj/rqcQBEmrYGLPO9AfvYKEY6z0c0tw8hSnAMvEg3\nf53MwBUpZOgG6oFggJSHwNUBUbY/ndB5ptZsLCy1BroDBkV27o41Tpn8wlPk\nxKqEIVrlEzINul2/T0YDJYQA6D04HiVQEIT7twVXBFjgfXWUTDww0l6beRwX\ny/e7Hno6NZdPL5C6awpAdDamy20so+T54o0giHZER++ydcIQz0kiWoUfyZw0\nC4JGhrRW/v2CG8Y9VCZBpTvrIn9ZdPAmw/eVykdJ907BR2QL27yLp/uKA1rW\nu4mDR3AoFxsm9uGolumWrgjohjvUw/qO5I811jw1nMwSHkrZtgBLJp/JbAMC\nbUjt\r\n=STFb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAjpsowZnq//capV/GD36d/Yz0fubRmV32JvEQgnc4TCAiBsCtBPHPWke2ynidGzVBP8JWj3qaYPlU/Tk9c+P1UUsw=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20200806083357_1596702903925_0.03528006473329737"},"_hasShrinkwrap":false},"1.2.0-master.20200806083522":{"name":"@atomist/slack-messages","version":"1.2.0-master.20200806083522","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.0.5","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.7"},"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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"6f61a5589279c79e0952a0d5960d48d5473793d0","_id":"@atomist/slack-messages@1.2.0-master.20200806083522","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-f2JItd6pHw+DGlMv9MwxfepcniqkrfsyCUBUF+3MoKkPP27LUs2eJrcOPRCYyOzxZfCZIfiX8a2w7OdsV/BCpA==","shasum":"9a5eb3c6d2aa4e2f9685f388747ad5e82cec902d","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20200806083522.tgz","fileCount":28,"unpackedSize":68154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK8EKCRA9TVsSAnZWagAA0XgP/Rtbk7F4+xaaZMLapqy4\nM7MHVuFO8pQu3LHo8vlTFnRTDJlS+jGWmJS6bBe//w2LhnlMAtSp3dmyTqU7\nzNkjcGQY6rieUbjQdwmntxdp1JPsOkj9922Aa+bL/tpIrdkQ+uf+BFs8wzVe\n88Fnur4Em562d373sOW6DBV5d0CVJ23k0tuL93zR5t9veMB/RnQLRoXWVRlb\nQ5AotAjCWfhYCYgoTaLbhZ0AknDaF2N4+5jFok9OJO9fsfNdWumjV95GzvqD\nH+adbbZCfAUmz/+J2oue404sj5OwpVTdOxaIuzCEHylI5+hWQxG0A49fayX4\n+IH+WblWX5O5qc/SDxPi0pAVMfMrmaTPqAhp4lKyXlOmKryceuQVkFYikx4W\nr36FmeE1hMFJP8+01xubLwgeynkcZ5qKLSCHthLydZMH1p7bcYQItwmSjO+3\nwwUiBOcj0asW2P1rDiTn6dsyXKmvWbkRY7fS1kCt3hYueOMfaxBPOEpIPf2B\nm0sjcX0et7DUAU7i8Z9Tm7i1mDp8e7ixLIZ1UD3sY5q3Bf0DWdxPnZLzuynp\nqaBa67BjzWGhZIh5B3TMkK7ubYIxNu3T1XYNWH89bJ7x7Hz4Rx+zq18ANe7d\nX3Jp5JapZ5GXOBI2wZz+iAW4qEAhx1K+gG1xDBrbV+S5VjjutsAfe1/B/09b\nNfLb\r\n=875d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDe0XQy2e0UUXJ5Or87VNez4Sm/f/Bo5H9PrucJoIXyQgIgI1hwUhwMO4Brp2BJciJSrtCprwXLAAwKqQToIWTKt5o="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20200806083522_1596702986350_0.9909138403869744"},"_hasShrinkwrap":false},"1.2.0-master.20200806083959":{"name":"@atomist/slack-messages","version":"1.2.0-master.20200806083959","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.0.5","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.7"},"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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"db4cbd98e9ec4554cee5b802a05b47a8b47e7950","_id":"@atomist/slack-messages@1.2.0-master.20200806083959","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-JRojh07EgbzkRYnD0+eWiJB6Kv18kSeNW2PDpE2/P9CQcp5eBBrJqew/aoW6MDd9HBkpK1dbXk5rz089vLKJCw==","shasum":"096f15d7f24b56245cf015811e63ce943b9e6ed2","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20200806083959.tgz","fileCount":28,"unpackedSize":68577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK8IhCRA9TVsSAnZWagAAvZUP/iMfHDWMA2+Y7hQGADg1\nmmeu11AxTTUI0jz0F7+MnmwXYfaEk+q5otsPo4LN+6d/GMTtWDWxTLoYCu+F\ndcR7OByANqyLAlVnV5HuzUXD3SSTo/v94wfCa6BdnEP0ap/gs9vxkm29ksum\nY/U6UxJzG83jwRzkrGi6i87UzwK4AOPgeeJ4hpoygrstDrhholesyKHhWHgY\n0ZkXWwvc3OtzZb4Qvx89G1fVhvpNU3aGKsnTC2nXl1/3K4obDUHyL32pYkfj\nlVTkOlCcG6GEb2rAHhMH7F9Z0rQBUHuGGhUIxsJ/skibcJgP6JGDo0lgbFJ4\ndSNGdk1AFviPJVT3GrUffGhPU0/ufqIc236c3ktmfa6EdugLGrlQi4O5/67I\ncvjRTz+LA/uejZEvANKx/ZBudggrAhO9p1LfMYV0rRV5gqm59Bsrr6uAfek5\n6cv7aDyWSPOUZ6IUvFl0/uVl8SrKMjcQn1sE7Tj9+rrxpuPHwtT/wySM7iUB\n8FkLhYUMuxsg/xGRB6umOu2Gv0+Ue6+jRkJafiTQhFwHG4dOmQTb0sSHVhh9\nvJ51gYqQ7MXPdphe6npcNiUPOb9Vv1EYoZjd7DWypZF8wyjsoVLbWTfT3Jmr\nhsmvrQ0W5pumQ2HQUWrhZ892q/d+N5638c21J6Ni9+un9OObdjaKzLMIiMUW\npYNX\r\n=g7Gt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFDT9qi1q6qcXV9XLNxF1biQbEfDL3OQKXgAB2NDbBBAIgLzuUYf2Z+Q2QNvbIqYFdj8yWak6yWmqjUB+WKHVSi18="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20200806083959_1596703265497_0.28437712383370206"},"_hasShrinkwrap":false},"1.2.0-master.20200806084935":{"name":"@atomist/slack-messages","version":"1.2.0-master.20200806084935","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.0.5","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.7"},"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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"8a29b79ae746bfcdb1961db25a066c1b260530f0","_id":"@atomist/slack-messages@1.2.0-master.20200806084935","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-AzWHW404To/hSj6hIxyE7XCTlatDC1I8AxIqjNGXbB9MP9ReQnQbKTx7Hc3XFWBJGrTUSsPAdd4gQucTFUVH7A==","shasum":"6a17840d7c4da227e55c0494b18715b48f152104","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20200806084935.tgz","fileCount":28,"unpackedSize":69774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK8RhCRA9TVsSAnZWagAAaUMP/RzzgdmOtvRsTIH/RDiu\ngBDuPzNergxZyp8+EmfbEgBYN1tE7QIcq80BsRI2dRja8XzD7ERcOUG9cLja\nVZLbW31BgSfRCVWY2h+zg/+MHsC+skUMRlYd3g0mPPTorYxdxaOMbugZAdEf\n4I8ZHKwpaH4KN25bCFoAUynHmYlulfbjhh1RbKfQkBxJhT7QI1VY6ZTO89+K\nrsRPjahKBTlyj4O1aqrMOL5mpGLq5206DLtmCpOr3Y8l1Ej8Igjq0hDiojhM\nz+d4zs+SCdGkoLzEd46CtJV6eqyNCSY1JN5k2Ow2Su8yzthLQDQoQFLUgyRD\nDHuT7HAS2qjqo/9+rxXweN4nnm1akHPe1N72lPXfvaV08OG3K/MwWkJX7urB\n6ld7jRzEmjMm/XbWtPbpprsHSVkBsLTtx3Seb8XlByUfh4BxPwt8Y6npUodQ\nXJNYTQO8+YOP2uKewc6FsKftNsropEVkJEhsgRQzAGzG9V8FN6LXqClrHZSC\nmNZ5jzkoBzw4OT+U7OmlKvsr07+MAGFviZem/TTcpAFgzvQNqaiFfGxApxCj\nJoN/fmcC+2z3e7uw9hV99Jwo1Gl848s4VPlkEbOBCX66zGoD6J7VeP3XLb1a\nON51PqwjaTHdq1SJZXeECjga0Z5OrrOPa6DuPaEEHw7SRzStrkiMBWamKitx\nCtUI\r\n=R11d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+9P4JEFeQHdyYkO4SiaRVmSIxq4EahCMJD8av/TqXFwIgCrLZ5aPDbrHjQ+J7UkMYQgBCXPE89eGy1d64ueHyCrI="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20200806084935_1596703840563_0.8661608220992552"},"_hasShrinkwrap":false},"1.2.0-master.20200806090151":{"name":"@atomist/slack-messages","version":"1.2.0-master.20200806090151","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.0.5","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.7"},"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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"ad8dc98275d08822dd8320b04641f530ec4fceab","_id":"@atomist/slack-messages@1.2.0-master.20200806090151","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-3i+Pqlue6BZkq2mB/moc4hfN+TlrajmTGKGpUSshr0SH1yjmL6VWLNSwvWof4iNBaAlrJ+gQuyIzkINSsZ1/9A==","shasum":"7d675d34a99bbbe635582a3b74a2206b4a40e052","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20200806090151.tgz","fileCount":28,"unpackedSize":69780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK8c+CRA9TVsSAnZWagAAJcMP+wcmR/EySLedrfs3EBus\ncD2beYHwdS2dSijXWte/9C/nWWgrbT/zt/DxboIl1YkZeN40+gAeCN4Giip6\nFzhoh0qVchnRaUJfXbXJNv9+xqBodrMqg+u6mUbPEfowJRzgk5OJTwjhVv8I\nIegJDNKhFiy6CxmClSM9XdnixA/BsB9sV4hLhENJbTfAzJv4sovLnFfOZurJ\ntw6ZkKb0bt+cG0vjtlr1vXMQ9oDIMWxEQOJ1Pbp3K2E/C0JgNuhGEV18U2hy\nHdcd4qkVj5UpY6QnpcA4X+U3K1nemiPegoHiWqnfoAUu/DRF9XPdcTtEkVcs\nI78Hy81c1vwR2FYpkZBNcvAIo7//OTiHmBKwdHI0A7qFYPQpVwuWwpS5mFF3\n8HWlm/VOOeNy78c6OytsxVyVl/a2t3UhUFgZvvs8lzamjLnwtM6aFceXf3F3\nN5oFxX85QeyMYEwhft9CI13hTlkfpDbtyrED+AYat+GLVW3c/fzAwWcdqVkk\nEbI4D2YymNfFPucv7tcxNiDsF+cgcNBeKE/LLyPEO99qsp6kk7Zgi2WyJX8A\nID8iMWJOMYKt7Ki36EmJpc5ks3K6coohFha1CDtQt0cZbpXdDVDfljqsQJlJ\nSFkeuzWocdDEITetpeXIr13uHoNedavb30SDT5B2PVkdgP7u0RvalFIJSX5y\ngQe7\r\n=77/d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWps+gnTAQIlFWJ9Uovt8WivKtmEYq8KlZyiI1o0Ut+gIgaxbnSmC6RlwcFF0iHlhCdoayMSZQOyjV/Dxeq4A47SQ="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20200806090151_1596704574298_0.14054741631417222"},"_hasShrinkwrap":false},"1.2.0-master.20200806120304":{"name":"@atomist/slack-messages","version":"1.2.0-master.20200806120304","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.0.5","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.7"},"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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f3d28009bf83060a37c51d9479c7a90e821c26c6","_id":"@atomist/slack-messages@1.2.0-master.20200806120304","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-I9W15PqpnpbnsA/veCbj+LDAbtisGcpHzmqSW3rZkbzCs0WdFEtimjaOogbFIbqcOexD9WMH+7RKzKsa4vxycw==","shasum":"58adebe202c42af5821a585b167f3c0f6c5b94eb","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20200806120304.tgz","fileCount":28,"unpackedSize":69765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfK/G2CRA9TVsSAnZWagAAG3IQAIb8KzYIdgVV6rOPSdvF\nXVzKam3mtfSwJ7rAbhiQYXPBI8/VTqS8DkQ6lRAHgObuuY5x5ELndyw9ZLG+\nIVU06970juFsFJPWGgb5LD2FownVEZL9wN4b/UxoZNCq47EHLeoEy/cqZVwx\nDBeUAHYwjaiNKmDafRNJDXC0pHMyKJuCblwldV//xxZ0QU984W1XBKg3O7pY\n+x+LcA9ZDtfjFiL4NEGTaz4XAPPnSFsOArw6C9fJKHhn+u3rQ67Bgzlzg0RW\nhJOg70mbxun1pCs/oyNhnLriDIaVPOT1geX2NS/XqXUwCpuSexnpwQxL4nHW\n1sHiO4SgArNZdLyJUJHb1OGrNVwFCPygwgf0nU23J8RSO6M4vIypqX2GpU/S\nGtzKIShEFGt9ykYTMlVw9JHOUYre5SpW9PDAaVBl0pQ45SuWZeDCojMBQUYg\nM+xVahpPEtsF7KXzeR3MrOed1r3PWinqE+ArXQaI2835wmzUhw06xjgh9bVM\n2ZH9dIQTs7y/HuzKyOBJIw6V4pecN5Pr1YNL/F5GYhQGjWwPkHPqzi2P8NSl\ndDidtAFHFRFNrm5MXoMSsUMipFDrtvGHj7nXZRzNqAYTEuYtq/jrZtaYOvC1\n0jBVyVjUGr10Bi2N9zWtsNrqFqzV85/28xBLFrb1TtaZda1Zcm2uey0i3Lx3\noV77\r\n=jhG6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBdye23/iJ21b4j4yVqIRKwoPgFrwtnORhcNi5t+y3olAiEApcUO7YQ2hJjazFM6lJdPpgvEuoQXARRglD4rZxTQD3w="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20200806120304_1596715446453_0.01800456502347947"},"_hasShrinkwrap":false},"1.2.0-master.20200806132057":{"name":"@atomist/slack-messages","version":"1.2.0-master.20200806132057","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^3.8.0","@typescript-eslint/parser":"^3.8.0","eslint":"^7.6.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.0.5","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^8.10.2","typedoc":"^0.17.8","typescript":"^3.9.7"},"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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"a8d6b0637e9a4a872c6913a7d28814b9365367bd","_id":"@atomist/slack-messages@1.2.0-master.20200806132057","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-/trQ5CKx9yjileZ+m+aZ5WNgnOYNwCVd509UFEKP3ctvbLWrScuwxtprXeDPCDzTBpwHfSSQGELrHEuO/9dA8g==","shasum":"a45708bccf97e2760ab5bd3bbfce38b8d99865e3","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20200806132057.tgz","fileCount":28,"unpackedSize":69820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfLAP6CRA9TVsSAnZWagAAeo4P/36sJ2yT65Oxb2Jc/vv3\n0dndyY6uv3a/KDBLfeS5iqi5AgDtlkGQPAV+wC/8YPUQPdtXGaU150TNnKd9\nSiPdR2203XMTlYbl/9/T74Z77N3vxR2h5qLD61lvMMjY4fK9Ifo+1kjV/HEC\n9FdUOK6YkgZCBB7F/9BlSMPrc8n9+aLnU/LBnLIQwxjkkCXn87mwWlH2Jcaw\nH5PejgLuPsX3qdKMLlBQKie0LnUAcIAhxLDCPOAdvTIXyxyc/i+l0PMpmxJA\nJdATGVrzPDBQR1zqmF9r9YOP4cxg4jYGT+x+SkbCz7UbZa8ris/lBCRO1Lx4\n9seBXUdrz1S3nkWmHrBoUXX9lxCIpq51DaXA2fkouB5/DEyc41XT/eTbzjlW\nW5/Y3Edwr81iHgUzdC12A9fo96QzlqYFLTkbhfcXZWVFp6nA82//cslx2Ka2\nZbgBkgBbXudkE259AQCOCrijE9iKTQk4Hc4F9baAS7U810YDsp7mymzmM4wB\np5Am05pBwnUJEcxTwQn7Oy8oEaEkQ7Rbaar7UyK/jbZFPugNLI1RUqOvkJJT\nER81Yc3PoT2fpq/TBr5WPl+rwBq9fz5eGFQboJwq6XdoIXw/D1CRsKrWqBTH\nbzix0Y3wTRS+mP/j8l4OTvERGYTj6FWGdgpqh0qYP4M/jQIXCPpVwGDTWpBr\n7760\r\n=9ZQT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+9zptmynSYwXswWMb2IOup4jh10SJKsAY2aA5USo0vAiBS1LDP4hmU20mWdtdEJ3lz2r9vWjuQo/3XTWJ2mxLptg=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20200806132057_1596720122130_0.2895235328729062"},"_hasShrinkwrap":false},"1.2.0-master.20201007124259":{"name":"@atomist/slack-messages","version":"1.2.0-master.20201007124259","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.3","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.4.0","@typescript-eslint/parser":"^4.4.0","eslint":"^7.10.0","eslint-config-prettier":"^6.12.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.3","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.1.2","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.2","typescript":"^4.0.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7176700d4aa6bdbedd8de9b19e8d4f523f2b5481","_id":"@atomist/slack-messages@1.2.0-master.20201007124259","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-xAza3HY2hmFEDbFREw2/QAhHiSd6CfBR6DcsxmW5soIgU+Q3vB3u/WYoduW+LgP4+OMu5DBGJP/BjaIGaErh7Q==","shasum":"e4411ae09a63f14c34623eb1a4de104e90ba4620","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0-master.20201007124259.tgz","fileCount":28,"unpackedSize":69876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffbgSCRA9TVsSAnZWagAAskkQAKL9duhgqoFhpgQPFFTD\n9vQSR1RouaqS8J1orO6VXRIvV4/d/EaMo8wcBkzF5LR52a38FRh27gNZbDAi\nPrx2wRtN7P9/uNOM8FNRv6wK0Cd/u7kUTWYDI051rMCf5+ya7dEDZlCXbn4y\nsCVeLAVvUPrUf9+zjpT59q0iNBowMdpVV1ix3y6wHrCC9PYABx7WuvV3SdAg\nr24CKiNhwHz7SUSYpXQxvEqgmVptM0jc6OPeFCO0SpvW+vnt0DXmrucEU+no\nsYikffbrg9GHHSYfU3pCjGA64e4ECIoLC/2X4XtZI8esr4RYQuIbaOvRo1lF\nINndjUwEFRbYzZ9OsGAcRiTgkfKFgQ66EJ9G6vUVsSbUOJIb8k9ww/C9GLci\nw4ClFn/JwIvCiBrgINGWMzCuqLvSyINLujFENLhMkWVmysXZJTTnp6mB3B+7\n1IS/4J1FLgjW4zDLID2Y0hu31H5vz8EUPIVUTxk8HrE+FAWO4VEC/nABbEqA\nKAFbkrIzmt2DKHTj9V29dsSPHb0qyPn2howQ04+D0K8r0/fYT4RVivb9VcbW\nDBZ/q6DtMN+4VWhl2FnDyFWNda+AQfLCDkFWHkEAKbzTUAa5DYeXJ+dzlhoo\nqhAEQ6Fzipru4FQpC5DKyLu8eEuNW8AWWsimRYNXPJjmY8HSaqtADkocdrSo\nu4CK\r\n=lxV7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEUGSzPd0m/y0d36m9NYiyl4ppi6myjGeAgmdpSesT1+AiB0O5/Vx33ATvao96Q52PBdnVi0uBqHzyKE6utU8DfDaA=="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0-master.20201007124259_1602074641959_0.6920795360701071"},"_hasShrinkwrap":false},"1.2.0":{"name":"@atomist/slack-messages","version":"1.2.0","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.3","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.4.0","@typescript-eslint/parser":"^4.4.0","eslint":"^7.10.0","eslint-config-prettier":"^6.12.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.3","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.1.2","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.2","typescript":"^4.0.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"4cd2a46dc060d84e3169dc11f1175a98d489b3a9","_id":"@atomist/slack-messages@1.2.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-ZDDooL8brlN+oH4MKaG/es0Y4ccYzcVJaPwwblWww/VB6t8BqqGvnIzqQ2U45XCv9o0LMMOQ3/JFl2p4Ajzjzg==","shasum":"488594ecb6676c7571dc66fcb18fb7452fecccb2","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.0.tgz","fileCount":28,"unpackedSize":69854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffbhsCRA9TVsSAnZWagAAWsIQAJtBT+uh3RuEXRoNjfbz\nJpZ7nUMp11aOGI5polIx1QDgGmpV/3B5GmPGcG410N2SoNVczC8JrTT46lmy\n5Tgs1xbPftX9dm0YK7GIpGJGKQDRswgHwEyJHGefr7hiCsBxn0dcPa2pAmVn\nV04GvtSfcNV31ZgC9FA9vticlK7y1NSQoJMAgoovPVIaV1zaIoXzUahJvWLN\nnWHl6UVzOWDQ4c2qxp8JaeVbXpS3YucenH53vL7CrqfVAFwSiIWipmlKIoZB\nf0zdg0kz+AKWrWtn/EPGgjA9I/gAjHD/KFVO+ORXnYl4QgkoDTMJQSprgmIN\nNHFkIozChhkVYLEZamtRAMSPOl0tBDEA3DXKT4DcxTcMySeBFzE2PfToR2yn\nus870Bxz0EmW6aF7ctwZxUtR7DQIRahnu0P81aUJZusqApfYeZ2o9WtYjq6i\nH2FawnwutA1Eh735BUtMxjklxNNEczHxX8pTbnXI67zhB1v+WzKS3kv9ptBn\npjePcwTzttG8GArB6HKLhQjzNeYp99VuVXUIqWfdUcaCfEmuiiXo3uX2AgMu\ny+ZrBALbHtL2iVNjPEKiQkq4TPULXmzHDxccM5yda1wzGmAcJBgHnZbxRPae\nhS7x6y77CI3Rm2WycVinRKcRVKAEUuoRYdDCbjEcgkd12UhEyK+iRWV3UEq+\nSZ09\r\n=lIJ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID5sVmiDJHNheAYmeLtCP2kKy/EVhLAHwO5ar045WeYHAiEAlgCjrzlbVHJtk8ePIP+UKqtlVowN+rrlb+QjiGwZQ5o="}]},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.0_1602074731896_0.36367226483609105"},"_hasShrinkwrap":false},"1.2.1-master.20201124151723":{"name":"@atomist/slack-messages","version":"1.2.1-master.20201124151723","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.3","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.4.0","@typescript-eslint/parser":"^4.4.0","eslint":"^7.10.0","eslint-config-prettier":"^6.12.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.3","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.1.2","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.2","typescript":"^4.0.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#support`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"4a35d4d21201b10e30a189d7c5824a7789fcae3d","_id":"@atomist/slack-messages@1.2.1-master.20201124151723","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-4avx6h+a+p+9JtprSUdZ8U3ZjInt2kuLpotoaBRZyNBhITqTFIq2sn1XwIyc1TmP88JyMw+kYRwjuwLGQipO/w==","shasum":"31e244e407ad33915ddeda6e7eeea580ac7690c5","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.1-master.20201124151723.tgz","fileCount":28,"unpackedSize":70210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvSRICRA9TVsSAnZWagAArxAP/2V8xQmOrwMFmrHUpYl1\n93OS1a1HDsTx+qRklPjix9CQwnwtdIqNnr1Q9zpDJYRRs10HQcM/3z+nsdlK\nNxR7RpD9BVo5Wl6qhp2ze0RuS4J3jC5P36tAY8jsH7qR2npU7fwdFpxQdyew\n8o0HPrVnn3qg6SZG0BbTZNEJO6DisShIfwnzBv2pJF7/TnBF6o9h6BjXH1X0\nHnp3v1Kl+2ELe1leqs387DSyhNE+9eMgc/50MuBxAVBeMoOCqvT2PCuLBLWs\nRdrGSboHK3T9HFRXjed091deP+ygfHTkpshjgiA8FOvjb3JntNk9p3JcwJVY\nDCihA66Zj3lVQlG4tKWSuq8QXsnr4SmKQu5msVzPUSsJO944L9lPGt1Pi/B+\nZ3Z1D2ffkMZVMgRIuAX9fCr1UbhseVvfo07gjfYJ4+g6iiYtdkQ973bp3cZB\nQmGqgnk5rpr9NH1XlN7828Cm0BtdyfKYhsGjV+gmc8FiQFLReX6sbKQX/OKs\n/V8dZiy2V0B39YUPvMq57G/VpYmJe0VxoV81HtPi3g+qeknQzy2uE1dbH4xG\nlkotnPxHXDr0fyhP7LR2jwx8n4DiCpi+OIpEqzBECuSJm6D1WlM1ho4T+EuH\nCuDizPgfJCjfhyanO196EX8q+wpgyqcz+FC3Xcyt1go22EL6yppwkm2qXZPT\nJFRk\r\n=JV/h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCb0FayHdUFUGGB3gOqzeGUTe4oQ8dN8ZZGTwpekQozkQIhAO3gZcbwwWW5Qpc+N1CUXmhmVHHThtkDLJTdza6oLoHg"}]},"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.1-master.20201124151723_1606231111562_0.6348062212780514"},"_hasShrinkwrap":false},"1.2.1":{"name":"@atomist/slack-messages","version":"1.2.1","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.3","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.4.0","@typescript-eslint/parser":"^4.4.0","eslint":"^7.10.0","eslint-config-prettier":"^6.12.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.3","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.1.2","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.2","typescript":"^4.0.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"638fb1a4d7d44e4e75432e78045ba2efc53daf1f","_id":"@atomist/slack-messages@1.2.1","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-TYiuOxy5Pf9ORn94X/ujl7PY9opIh+l6NzRAV8EBLpIv3IC9gmEoev4wmmyP7Q33J0/nGjqxAaZcq/n2SZrYaQ==","shasum":"74e9499ae2b017cbb0e4f047033b9434cb42c1d7","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.1.tgz","fileCount":28,"unpackedSize":70188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvSR5CRA9TVsSAnZWagAATusP/jq3DPuF1IAFZkRtkyw6\n2h0DuzwXG9tP22BNLngBlZRxa3/RLe5Ka6IWJaQm9bvWp55OedNppwyik54U\ne/rrXm4hrhBvqjSKAZUjtdqOr60k6XcBWEz1h/D0d9fO9LuJ4do25iC8SSWT\nMlX34Q7+yCXfAbIXxXDdzFChTof66/lzaJPhZenFUeWyUsa0ecZ65x5jaDMf\nac+1PlHnj4GrFHRY3m5CxxP8pEiDAumrX/qN36Sp/l1unaq+V/WvLXDr94Vd\n9xaiyPVf3FJAljhW3rGHMoEf1hg5tv6x4lBtLY7V3omV9+sBpJHu41wnzHqO\nRi6oQfrI04SFY8OcSE+B8GwRktc6Ul6DXabY/fN0snejc/c9Jpd1NKiuSkuY\nSj6NnlJ3+xCVgVitXmgsqc2WMVHpVXOhEHxH84qyhKi+OQxuMrs8rBKazaNl\nK0Z+Y7IBqplnGdEN7DqzHolLwptTPL+r0sJmk8hhcnWCJmQcUPlSpTWscTFd\n7sQ8qcrYL6aYfNa7wnBE+D6rQhY6crgZ3sWKYl0RKT2SZxsUukwywPfMf3C2\ny9DZjMJoO4zCBgMfQVNHpgI+KjcPXCuof6j52XyNc8uhlKcKzN5VYajlIXOH\n7hLeuGNluV53SOYS1rKvMCop6CCf9N41XK7njoxOkeUxMU5oVampnS9hn+RR\nreeF\r\n=Z6+c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJJt3PidfzQRhD1yskfNxZSQsKktvt/cJHybNnMjqmlQIhANHUMb+xJfL/UOgpMl+tQa9gA8iJDvf7aZ9rKDTmlgkj"}]},"_npmUser":{"name":"atomist","email":"npm@atomist.com"},"maintainers":[{"name":"atomist","email":"npm@atomist.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slack-messages_1.2.1_1606231161464_0.6876488088180781"},"_hasShrinkwrap":false},"1.2.2-master.20210108045512":{"name":"@atomist/slack-messages","version":"1.2.2-master.20210108045512","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.0.3","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.4.0","@typescript-eslint/parser":"^4.4.0","eslint":"^7.10.0","eslint-config-prettier":"^6.12.0","eslint-plugin-prettier":"^3.1.4","espower-typescript":"^9.0.2","mocha":"^8.1.3","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.1.2","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.0.0","typedoc":"^0.19.2","typescript":"^4.0.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"597ea6679b4f903b604949f73f8906df3e53dda6","_id":"@atomist/slack-messages@1.2.2-master.20210108045512","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-P9B3UMr3YgBqoPKZ1x0C1fQi1cZl9AWw95/8HzrThVEyCY9v4E0a0q6XGNHV2xr0gun6prdVFhpGZASh1YCCzA==","shasum":"3350ae9920bff21c5e308856ca1f4e8671bb39c3","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-master.20210108045512.tgz","fileCount":28,"unpackedSize":70207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9+YtCRA9TVsSAnZWagAAeAsP/ij9ehKaf33qiX8aPnGx\n2WJp3XWDU9NcG8YGoYwB/9w98CHNUKlBx4nepNMda2VR0RQBJeVd9N0MC26j\nUff+AIrLOU4v/LFf9P7NKuv4NFR0SUCVxjT2ESmJl0TvmZjszh89zFf2zEzT\n0iYnLeqytXVYeIsBtPil81uNEiVUEQt/kTdGdwzmluV8HGT03BaZaca7dKWn\ntidTguHC91NqJc7yD+lo6hLM73iaO/N26Sy8PNGNatyPS0IEm15MIW/WRZXK\n4LLOb/2FrtJZBvPtvApv32bnMlOZtvc3QO+vj/g1slDmZW5/2kwQsJTjM6Go\nr2hpGMOZ0YPt2oikq+yKugqFcYXlpxk6jb0HP21uq5EWVWvyXLGH4+CWNKzD\nStKbG4DXRcU8+DhaxbV1kJPSVrJz4YsPY5rkSq+SNKTU8kle7sq0TIZYiQZ0\nGT2YPDLsjEG5hgcwhulQ3KajU4Cimmfqsi9IkvGv/q/xGbx/ei3JLd4qeBqS\n7xI/WoNEVCeIY/YlPJmbxgN+JT6TRF0nMkwfKG0GXuqO40v9/MJyRlBljFJh\naeP9ldtSyiHd31LmwbZ6zDlq6siGSW4t0LYKKBkpUu3DopqFATSzHGRDTvvQ\nMGIGU6Y+Mi7FtP97Vau3herpXFZwNobU5TJ5POZdgcGpk7DPW4C8jX6rpzTV\nbrHz\r\n=dR6K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICq4XCnvQqRo0Gtrsghr7v+UMVgp0VnV3sSoAqiE8n9HAiAxsg5lg3AhRxZNZpje6AHrv/pjmc1i3FbgvnBUSRy37w=="}]},"_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/slack-messages_1.2.2-master.20210108045512_1610081837288_0.32943234159739876"},"_hasShrinkwrap":false},"1.2.2-atomist.npm-update-master.20210201152343":{"name":"@atomist/slack-messages","version":"1.2.2-atomist.npm-update-master.20210201152343","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.0","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.14.1","@typescript-eslint/parser":"^4.14.1","eslint":"^7.19.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.2.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.19.2","typescript":"^4.1.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"45571a9dfa55af36aefb7bed2bf79a3088cfdff6","_id":"@atomist/slack-messages@1.2.2-atomist.npm-update-master.20210201152343","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-90l2gzGBSFmFffvOK5Ejev9aoEL5+Q+cUJ/8zg5CRURUnTI1hEOLppmwvVXPiGJMMxHMDyCQGY3zCpwWBYaUkw==","shasum":"c68784ec2beb30546495d8bcaf6d8210d022d356","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-atomist.npm-update-master.20210201152343.tgz","fileCount":28,"unpackedSize":70228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGB1UCRA9TVsSAnZWagAAaMIQAJR5AHA2gpuRHsSGtNkt\nY5IVlDOkkOfMWQ5+bVvKxSepzjRDf4cuelInsCdAFkXI3BWOwy/X1EpQLpjh\nTi7DbS1uiBzSBIH+/I3jG1g3VYE+/RndpPk9bH9Vs0uUTRWXVqVqlsupOUE6\njDHJmxsgVznHLyV/5rohYtQke4JukZwro4dNhhsbtUo5IMu4rMXgsbDvxn0X\nuG29a6u7ID0GpOJEbnxtO2dl61SpReVeHGSlPItE0i7270/2L3aiMn0MksJD\nT6vHU707yTrOSZfvMqSHGdk9eC+vYJ4hNYgCz0eHbp334cMjwdeW5LQH2EXb\nMS9J0/NSivM610qchc0FVHHJ6risGd9o7gagzKwfnfi2hzM5FdK3FamNJbHw\nz1pry7LPjFmNmh4it/kHIxhvsITMMxeLOeWxEd/kWHBKm3PAaH3u/pNlX8FW\n3Li2MskmzyCMey4MIQsXtlsWCww4wWTgvK0yaY1o+EVqVvF5xMthEeTnKIjF\nZqMQEtpaYopNltsC9A+C7DHmriAkJf6I4RC5KOpxzHjTMMOq16DMXShCFHe8\nfWcfno9X24NAjT5y6+M2JU4D7gK9Jj7i2ET/IZRS3PdAxSNnjwOZe6+ZsI/n\nGyzey7Q5ejhWIkyrmfZegXUrBbRgriw5gDcS7ueEI+BERDlNy8HuCLaYLi5P\nAQEi\r\n=bAzI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfoS6ZK/ezXBRoYMxHWiZi6DXVtYSQEwiD1HA+tIKwEQIhAMLBdue8p4VcLgmEMVw4x3+W5KQ6KZRucJGUdglH8HyR"}]},"_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/slack-messages_1.2.2-atomist.npm-update-master.20210201152343_1612193108560_0.4972631678870427"},"_hasShrinkwrap":false},"1.2.2-atomist.npm-audit-master.20210224150904":{"name":"@atomist/slack-messages","version":"1.2.2-atomist.npm-audit-master.20210224150904","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.0","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.14.1","@typescript-eslint/parser":"^4.14.1","eslint":"^7.19.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.2.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.28","typescript":"^4.1.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"cf3f3a8950c354a17aaa58214226d458903e89df","_id":"@atomist/slack-messages@1.2.2-atomist.npm-audit-master.20210224150904","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-ZKjJh32CYsqicVM0oKrC4WKcDFqX9ALoMTLhfUh5TN2ff2/mSGONWQlVpF2HTeo2C2z/BUcMbM//K5rfFbzelg==","shasum":"3c5feea54e95dd16bb21a7e50921c0bc3c363253","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-atomist.npm-audit-master.20210224150904.tgz","fileCount":28,"unpackedSize":70228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNmxZCRA9TVsSAnZWagAAKmIP+wSOsKFhqCqm7UQmonGe\nkXhxerqennt9RZouqr9aoXQn04AyrGmyh45oo0uR1WCk+2Dp2pNTN3m4+Asq\nwWBN4POJPNMIbMsy9jqrE/KZyzxZ9AiB29pj+cd4wP99BLH6dcMbSSSLfTjP\nksOGLYpSmRrgjZLpdhRnfLeXjVQMf+GSxNU0JEZ4RPQuKfGxVGsQHDDOHRLw\nlnnEaTZb+MEqgCu3wEVwK9uMNgG7jNRrdUhvd64NWEwWFaT/j8dw45Q9/zan\nKL+4a8T41dR/ah+W/woT0mNbkJzdHWv5itaocvs4B/3dRr0/f81JEsiL51cB\nQqDUmiBVMsiOW7PXgh8En1TIVUjhfKYGzxPsTu5Up3YXXyZYKIJoqgPufRWN\nBIJZECQo19s3gk4T7Cfohn6eSv6+sWJlKwpDb/feSm2SP8PZMXluBCC1JfIE\n1nYwUhbPTGBCKcm3Wf2d5nA8zI+WnxapdQiY3rUqUuDjBp+ThrQGJN3R6fz2\nWxcUWaXH6WAptmSHqbzwxiiTArFE4ju866NZS7VqWrmep+cDpQeQRGATJiNp\nds8pvQ1DZHazbxTKNyVnUNm1bn3la8povBn6+emLUidILGOFKxSHPw4ax31Z\nsYKSyF9qtnpJri4ZzsDSeLPJ19ksz7bxfwJxzkLxx89GBHGbOpEfDFTsOBWZ\nIoZQ\r\n=lxE1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDd6eHLZysRKxxfbXqNNQbDFXauasFVOJhLGX4aJvXugIgWrR1e6eyIRiX1F+iWg2rTOiHQ7ZrY+aNgKU05D4Ql44="}]},"_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/slack-messages_1.2.2-atomist.npm-audit-master.20210224150904_1614179416918_0.016443724089430845"},"_hasShrinkwrap":false},"1.2.2-master.20210224151204":{"name":"@atomist/slack-messages","version":"1.2.2-master.20210224151204","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.0","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.14.1","@typescript-eslint/parser":"^4.14.1","eslint":"^7.19.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.2.1","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.28","typescript":"^4.1.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"d5efaa36336e5b6229fbd7827cc5a6e0da26667a","_id":"@atomist/slack-messages@1.2.2-master.20210224151204","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Qo6khENR9TZ0ZffiP76FUNJ3Em7z0FD3QGSx960NHPgN9XO1H6imjhSuRGAixBE/ezleF9NNXPp7nO0UOKwsBw==","shasum":"07466f3acf0c45690f3e651e343916cffb1c6376","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-master.20210224151204.tgz","fileCount":28,"unpackedSize":70210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNm0VCRA9TVsSAnZWagAAeZsP/jhLgg+TBe+2xO5Bv6hT\niLcEsSI40CTKYVBcYZUs3lFHWIG6KZyF8KW85hhuFtbxXUCTLH/Wpu02wHZ5\neF9Nn9Gi7VZhIrPvCYDJ4DCHKapobBkL65DPp6GmEdAec0fV9vufA+HdTx3K\nRVBvAJZMYoKS6r/DnPzou3GfAwztdcisFpMeOvx+c5+iZL/6483tYezuBOU7\nieZWSiwsk128wWeZNPh/kbF5J2B3Zl6H/PhJqHPZGESf+UszuvarlUjBhZ6K\n5EaE4JUuQq4MLieBlArDALuny/bvuRnc+qeukKTzsGYZ+CfY3qb2QMJs/VC5\na2xlrNBPvaxLM/wfyxxNG4zDAuZupkaq6iEocMGHPphL9et/mlQN2uJSp8Zk\nTbzdgjMmnF+4zpWLx+jcyXe45+jUnl6zvViK/CldI9SkYomhnDLonY1LrCZJ\neniMRBRY4QldDd/WtJcjR9V2tUZsYrC6Iix1820q71/tQqilkIm+/auBoRVD\nS7aK/nlYaKJzfbXMKJBEuzZHIhCxVEKbuU258z8Ph4I3hUBoBk+7H+OCEkVH\nPmGTB+E9iRq+5J2GBciUyvPJT1sVrunmqFwHidaVVcyUqY9Uxb57gaLK/bEw\nbjCdyFe/0ET+VKxiAEfQ6eJwsQcXKjGhHXxEX5f7eqx16rgINc058TgNBZD1\nvxBq\r\n=cjES\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCL2MrBmRMxm6oyOKa3H/Gws1Ch0S/dBk++CT2wrvvrtgIgHBxEPlGsXXprxs6w48MuxMTFVc5tiBPGyyW/sueNqhk="}]},"_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/slack-messages_1.2.2-master.20210224151204_1614179605406_0.6065595444768694"},"_hasShrinkwrap":false},"1.2.2-atomist.npm-update-master.20210224151330":{"name":"@atomist/slack-messages","version":"1.2.2-atomist.npm-update-master.20210224151330","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","eslint":"^7.20.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.0","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.28","typescript":"^4.2.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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"72d2620375fe37e09447b5ddfa4698f8bf134431","_id":"@atomist/slack-messages@1.2.2-atomist.npm-update-master.20210224151330","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-Vh13Frw2J1/aHPi/iy4gCxvXlVgf1jbbEEaYG6yEQ5H6LwlrsdPBhush/C7wKJieXMaOwHkDVL0JIl5l4kGAUQ==","shasum":"d3fdd1ab4d33b7583133c9ebe772bbd6a45df0b4","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-atomist.npm-update-master.20210224151330.tgz","fileCount":28,"unpackedSize":70229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNm1iCRA9TVsSAnZWagAAVkoP/jcESFJNoDhYA0a6/lWg\nCjqV3pra8sccf0hN3nv20nOCW6vO7OCyvoXDC3wc/5giZJssmCUZ1bnE0qFg\nNsJDi9PfYw51vpJURGG+wjgWt3UJI1eUDjqaR5S9XhzyFi2usYRM75pqFFNj\nmGCO66vTdxBEFqH/Ov/Egslju2S1om3/LdJa/bQWUEaSM79r7mM+lilkk5I8\nRv/WWD38d5SkhNbiJBK2tqpgCi++CfvphZI3AWr0AFd08sA0u1+T0DK9RwOC\njngq9RzWzCugG1nG8i+y1LfxiqGqEowBupNd7CY0yf3A+0wflZ3BCUWy5HWE\njnDyLiV+HoQsgfZqP+DC920HIzRoTTeQXEL/cyycbFZiypTxaO2t9472w2Sm\njnpKeJiKeEYdtUdIjn1PPrNiSlrmd18C+MyI3E1c7q5RzOpHAlUzO+XoZk8u\ngRLBrDjhfyPQGhrQTdJl+951kGsyiOgIhP5U7XVQHgdJgE/cLU52welGRXML\nlYRmN+xQ0+NlyggNstMJB7OS7G+ejhfVKY/p5kqWZQy4b1zeogefFRgKrjyh\nk0LXLU6QuSUoR9Pcw+BynCA3q7KgrmWcpwja/fsKpq3R/XWWtEBo5ii03or5\njR0B+YBLYXfMqt0AOGEuad6kdcWlOSgbOW19WmMqliot/AYi8U+jntt4KAMS\nUiZi\r\n=/if+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBHndnWplotjY3C1ldwGkXmB3ianOUodlgcanWX4OzDAIgdwgV8QJqbWfGCEGnZPlLbppRQ1pNuXF5v9r7anWTs8U="}]},"_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/slack-messages_1.2.2-atomist.npm-update-master.20210224151330_1614179681681_0.8294831577030604"},"_hasShrinkwrap":false},"1.2.2-master.20210224151634":{"name":"@atomist/slack-messages","version":"1.2.2-master.20210224151634","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","eslint":"^7.20.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.0","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.28","typescript":"^4.2.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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"5da8339553bc061732c1fef85f3ff01cca8f4b2a","_id":"@atomist/slack-messages@1.2.2-master.20210224151634","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-AU3cY2Kf+nhGuRed1NYaiBBzXVoRTVJL0AevTbBQePU9vkMwGP8Tz99yb5XQS/daddj3xSILBmsgKJU/8rkB1g==","shasum":"13255926abb8e956392199bb805560773de8dc72","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-master.20210224151634.tgz","fileCount":28,"unpackedSize":70210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNm4vCRA9TVsSAnZWagAAx08P/1Qdc0T0hXwEjBZUqZc6\niuq83f7M8b0cu18Q1eEM8cc2Xnd8UgGUOmyEGALJjdgaZpZNLlkEegRQXOLx\ne7l888OYG5CA99DsejeEPvM43l+aXlDzQCwNXHAGmQ3Luq1zaCv1g49sm5jW\nkvGKEDEh3IRIDe5HhxuRyd4JgYKhICFxKazuEkVIm1LJRBq1S5bcXpeeBaHr\nOewACseARmYzZEBat8fCQWgTD/fFGNhP2OhwsU82leMCO5meVuHcXtnFu/+G\n5IKTl9V7YMYgH1WucIXuhZgxwF5ell6OJdlCNl5XehcKJCJJk4bETguxgOXv\noGMRqRSYHTuIv2Qv0u55Ya5QEYCqWZ3sPp4pghnmxQDBybe6bDXmnI9y69/h\nXGN70QuuXs1Nc8AcOKXmFn5rmB6tKTVtXvkGvA1gRmwdhmPm7xKJppTDRbp0\n7Y3URj4Bl55FjqDmtpEhJ8yJAY+HJgoe55ddkEjVZPIQT6weH6Zt/+u/dANL\nKh6GO63itUC0l6/W31Xi0zUGmYYV6iTW1LRtq1FcJ9dGsc7fm7bPxXG4ROZR\nhUzdqDERjENhXF3nr+TAyIn9v8fj1nUUQDteqd38Acek/Rz8mJgxgaSPWNT5\naV64ExE6G2Rl5BIK+IgfBpwOTWYgkyTA2LUtykMMjUT3dCfa/PpobOB2DhF7\npMl6\r\n=MaNv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgBSrd3JJUn0wEhqqwIwnTEeDxj1RPgdrFIbCB3Nu3pAiEAjz2tj43q2c9/GFFWnRH4KgziKAJl7S/LFqQ19XA+304="}]},"_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/slack-messages_1.2.2-master.20210224151634_1614179886787_0.9432020951524618"},"_hasShrinkwrap":false},"1.2.2-master.20210315175954":{"name":"@atomist/slack-messages","version":"1.2.2-master.20210315175954","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","eslint":"^7.20.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.0","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.28","typescript":"^4.2.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 lint doc","clean":"run-p clean:compile clean:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"7f2986c4ccc5ff40e67a29c1f485bfa6a647b94e","_id":"@atomist/slack-messages@1.2.2-master.20210315175954","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-JOl1nSNvD1zKm1QSHbsS3IJn9P+Jk5stbT+X4cP+aK8QiGYWsa2YSL7Q6+cieNaU/r5t2c5WP+XcgzeduBi1Cg==","shasum":"aabe25af92c4f5ac5671b7839c7b6d3369990260","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-master.20210315175954.tgz","fileCount":28,"unpackedSize":70344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6DcCRA9TVsSAnZWagAALaoQAI6bkYEktuv2mIqsO3Mt\nYgy5BK6hjwIIvJOLI2bgu2lznmCIK+I40L9rJC7htZmozo/ZSAGrjqpx90Yx\nc9jA3fmZMQHKLFcJ1WBQVFSE6lKV+wXrmb/sjCOz+yEp4JDQWgL/+hM817IH\nZBuChOYanZVZLoolrnc41x6Tpt/txS4YTW+N7ubI5WK9WoxvcSO5lZk9CXF7\nFVtLbv/8u16a+wxXN11Lz0qAptOkcX6BCYbdPnlhtdHjzR3ZRiuyML8RSj+g\nvgjMb+6XWeD147j292MrSnR4Ez4sGQafh+UiutE4qdsq/cTgg3tL21XkFf7m\n2ngFbWNTHHiJzuX06wdDtG9RpLmHSv/n5Tts3ZGI8zAq5Q+7VHf3Ec1zipLQ\nCf9Thk+4Kbd4AnidXLLZypwYbF2jqeDTmU8wv6Pf4IiYZd14RoNQovpYnF9A\njw/P+YhTZGczi9ryPl7BQRFHIrZcjSEFz/Y6bgBA4MI69oFlSKW9PViPQfQd\ngnE9kucku+D/8AkKmInTeOn2cuSrsG5ma8YpagDmIgevE6GoUOL8CiOQnSO7\n/o1Y8PZhCe+X98p74beXWI2Em5qPig0lccDMP7XKuFViSpAhZQExKGc486K/\nAF3FMpXtAq1/6JB1NjvJfM4vMjCgdV6mgaqEak0Af4tutTun/2n4wiRLZ4wR\nbuol\r\n=9nlM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHIYfy/ROwrrR124idiSeO78BSU2LbYgCcYPSJWzvJMgIhAMchhz8t3f3QiaAf5sTkacpubLFVCRcWjAfvHXznWjb5"}]},"_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/slack-messages_1.2.2-master.20210315175954_1615831260165_0.24407684670833452"},"_hasShrinkwrap":false},"1.2.2-atomist.npm-update-master.20210315180049":{"name":"@atomist/slack-messages","version":"1.2.2-atomist.npm-update-master.20210315180049","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.18.0","@typescript-eslint/parser":"^4.18.0","eslint":"^7.22.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32","typescript":"^4.2.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"3f9b4111409c7cfddff27c6086d0e6a61872cd9f","_id":"@atomist/slack-messages@1.2.2-atomist.npm-update-master.20210315180049","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-ctLnYhtWxtOq5ABHMHjTqsJc+RrmFqCjgzhjb188dMBxtlxAYP2RVsIACCaeQF1rETfJQXvbphmXiJY96SyubA==","shasum":"0a93c72f3de38e7d24425e31b699d76cf38512b7","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-atomist.npm-update-master.20210315180049.tgz","fileCount":28,"unpackedSize":70233,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6ENCRA9TVsSAnZWagAAhVoQAI7cji3SWbilikO4cpPZ\nG9EXUHNbe1KuNujeD4va0K33NKWpQ2R/06JUmqc+TmM+QUHgnklOBjtI0kmN\nlDPRYvoc6PbSJflXYW43qrWlnwXIdQzVNVkYKVKefztNkZ+PAIFoqRZ4a6qj\nODi77wnPFlMpmoXu66+ZvM7FtrCBI31KfFcRn8+j4A6fCHTE0+BEWWopdDFP\nqtlr+YJO45fJf6WoVUtzeogatTqPfTumXulDlrzwCKS8eWXu2D2p2BpPlDb9\nDLL1KNcHyUPFx18E3Amk3lOLeZJN6kOouq3xnCsv0ZSoyj3FBkzhhQHxVQVp\ntxS+EjqDN5yKVSpXswm6qRfng0BOqNtVbY6N4nXVx7brtGLZrotrz7wUrUdb\n+WnjN8r+hJT3plvIygY2mQUl/4Gf/WCy2nPFN+9xDAE/Ye92WRhNGL5iK1N0\nMh1Rk5JduEkhzmIJsWspv+IiMjRKhX8SGymHSrd6teu+hPeG3sDzC7GKwMrR\nomhFA2HOUB5FS7dcv37BvpQQP8DVO75lswWkM6aagqtDQ/xKCl+xxrHXOvpK\nhmRCje6v+O+vA8G7TtF2SsJEszLcLSmtfhmwzgpT0U7ZRrLsfXOopiuJDYdh\nfu+UT1Z9xbYe4VfFzFoUjg5+LnPKEHRLNsGJF6qQMmrChIR3uMwVUb/m7GGR\nHtV5\r\n=jxzG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCHyqXeOjmj+coCAaqK7eMUa7HRmpnRMiYOOreoGnkJ7UCIDB6/lDvQfkPU9nPYFEeAUL95+txxHQUkJ9zQOjvGiPA"}]},"_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/slack-messages_1.2.2-atomist.npm-update-master.20210315180049_1615831309530_0.3003534664468015"},"_hasShrinkwrap":false},"1.2.2-master.20210315180324":{"name":"@atomist/slack-messages","version":"1.2.2-master.20210315180324","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.18.0","@typescript-eslint/parser":"^4.18.0","eslint":"^7.22.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32","typescript":"^4.2.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"97e6c9ce2151a471ea4074c1c3f9350938039408","_id":"@atomist/slack-messages@1.2.2-master.20210315180324","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-TL231poFAEY3nd2s9QfjT1BPt/T+VjCSRi3ILYpMQfjGEDu8tmyZCua2XdwZzUTqPkO3uAsrBc7hYw46730jBA==","shasum":"4f76641bd88daf4d452e11864d75e197ab3a7275","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-master.20210315180324.tgz","fileCount":28,"unpackedSize":70344,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6GsCRA9TVsSAnZWagAAASYP/1qd6sEQcZSLFYKQ9iz9\np5ljmB/iFweQ6Y3No9GUTm4HNf4xPUaBgcozr+BfAUzlu2FSBl8zZ9FeTLAy\nqpdoVrkLD7vsdMC7hEkBMfgyUY4oXk5hiJv+X7KEI8aMHEXiXKitoAkAhQlT\nUcLANoxSWA+lQUaxBlKl6BXEJV8U6sFRk8ThayQXZVHKbHZPu4z3T+Q2dpLG\nsmKaqvToBK8uOjnN5U+gT5Dt0jX1mtmgiCkQjIKvPAamegeNmSOUuDni9XBX\nWVqC63cCzSV0dPsMWGAVbTVo4/9ZVmf3cvo3mTiiGFGa3HyiFbVCj5K06mAb\n+kmbhUWEusQR4QV6EArdaj/dnsJiBCeyRnvkweAwEQ8amIVaiJQCxVACX67O\nqS1q/r7Hgu4WjG7NNIUnJv46XDQ3x2PB6v5eBQ1ub8Azv25QNjmVCyAIX/Nb\nb2eYQeMkdp3ScNoavVM0ZtsUI6pxG1yOZ5IyX2t+MjyvuIzlM6AWWTJhEZTd\n30lqz7Wb+Ce2ZTj7YJxPQNY5ZCYMnvuXpAVv9uvaSX8Xbrx5yd5piDkt/eWC\nahKr+OCIjxv3+VwbNd6bCTeS0d3BAQHPenQ5xNWoHJFf7kmZJIx5v6r2dvy5\nNQoJ0+6XsJHBqmbt77TZN1m76TiaG8Ssyz98oVwuDJ+iGgCjnNPS+35NL+Ur\nIM8L\r\n=C+4e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBjhiE6SSXs33lmW66S5MRdhZvUflXWekaxxaTybuQ28AiEAwTGFEruZErXGEY2ehaVNpOpjUCNlSLUtjhBCf78d534="}]},"_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/slack-messages_1.2.2-master.20210315180324_1615831468465_0.5685312244072578"},"_hasShrinkwrap":false},"1.2.2-atomist.npm-update-master.20210315180424":{"name":"@atomist/slack-messages","version":"1.2.2-atomist.npm-update-master.20210315180424","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.18.0","@typescript-eslint/parser":"^4.18.0","eslint":"^7.22.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32","typescript":"^4.2.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"9fb51de6ecaf9d5c0b6e7b299d9b03ddf715a6e2","_id":"@atomist/slack-messages@1.2.2-atomist.npm-update-master.20210315180424","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-k1YT3T46LUoUEaASJ71/vyAEQz9HL8KiOM7B7GUqm8iTpSdf3zr1MCaSltUhzzPwrgEreIccXL9+4rAylOzG9g==","shasum":"bb8df8e3f5f520749975ce6b78cf27f29c25e2d8","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-atomist.npm-update-master.20210315180424.tgz","fileCount":28,"unpackedSize":70363,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6HnCRA9TVsSAnZWagAAFFAP/18LH+Fexs/B5s+FWT5X\n5nucd9KeiuYFyUE6ytbUTU42xsbUmUEWtg+ipd+4hcpfv4LVECrm/br+6425\nuPoNraTO3kw6KxcUEtfGYrM1LPusPbuTuLbrIiKpRm7nAMTH5YK67ZKho4zD\nTopmkTaFJ3tTg9nC0o3HXamwiQXcdnOPqVd7mKLVfgfUSbBhaBG2728zbtQv\n6Sgb4x6x5MmNEkIrG2Wp8WUtHR7T5EfMjGPKllASvWitRB92ZYHfIiNEeKhG\noLFE4Cu4/zhS+yKauzSjazzsO+LlHN7+Tng/qdmVu75lGgPkMgBClk5B7dE+\nrvVtej0A6Kt7xr4IxuVAjjw0PLIURLsjmMLfPbyhxXFeuCwUbprPVexVBYiH\nU9oQaZhi3cfrZrQF1uFJvkCApZ21nXONte/sP6tRm86/ZDtXhiWXH3xNbJlu\ngWVmsWwnpomjD/lXKwIAbt4pIBCyMJslJml5VoiAguhPwQ3wtnrayI0yr8TY\nr4VTL/PLgGS3JzB0N6wOOj2FkUU7Zqzn2ZmOOf1Bs37aKyLfLXO3SJSxV9Rd\n5qRZr9AGTFzdfSkBDdcfS9eAA8l61zQDHpvc0jc7n8SIikmjEF2Az8G+qy52\nTMk7LWCFwsYgsQKkD+zCni4yWVvLStsReemcy0+jyfHD1egVl0+L3kE1ih13\n2GqV\r\n=7CMm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXbg8i8bmdLHC64p1ZjiqWHV5iBy/02asBYTkARQvGkAIhAMVlLeeE4h3jv7Uehy3PZ33HxSMJ7nCMhYDn8lS9EwhH"}]},"_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/slack-messages_1.2.2-atomist.npm-update-master.20210315180424_1615831526635_0.09079824190084551"},"_hasShrinkwrap":false},"1.2.2-master.20210315181159":{"name":"@atomist/slack-messages","version":"1.2.2-master.20210315181159","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.18.0","@typescript-eslint/parser":"^4.18.0","eslint":"^7.22.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32","typescript":"^4.2.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSupport for sending Slack Block messages is also supported.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f53e3655e2309d3f1f28226887d2bbdb0ef02883","_id":"@atomist/slack-messages@1.2.2-master.20210315181159","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-WmrSq5aZgtyXw3/RZyaeIt7q6qQKTCHZaxc2kyNl04UgQ0hrgW7QfIcHuF+v7OpU18YIZd0Kw4jzYS68QcngOw==","shasum":"46b259b7f073315b6796874cbc43bf4bde7e71b4","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-master.20210315181159.tgz","fileCount":28,"unpackedSize":70405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6OtCRA9TVsSAnZWagAAajYP/ROg6Zg6bZDch9QPGd6b\nRTolRwMCLXfSLsgIBPc++s05RTfKCl9+ptwqf4Xv27fPBbVM8ifMWn68EaM2\nbgb+kZRyBprSZe4zmx9ydHhdCM2nF6DuUnpBEuYJbV2xFVfID/D1xday/vOr\nLTr3tRVmifLqs7W5lbWJSg42xXt1Ihc0X2/WKjGDXRYobB9Lhn5lOAOQjMCo\nSA9m+wa5mAyUviLtwUZnI5PmfGn/sN4lzzkpRQnjofBwXGJaMtbz8mVfIBPy\npyzPJKNAKpLRxG22HNoP7ZdLdhWQNmEQ2faFdFDX9YNKgH4bwzrc2GmiabQg\nDnf6JAhaYU8lDQGmoTiQTGfr8txqDuDRhq8tO6KfiixkRwGevIP/EKf+XEkf\nx+gl40JmyAFPgeOHbZZHpXnDp0w4JwDpF5eUB41qFiEniOK75vETKusanxc2\nzWK97/lz1lWmGms/URGL4nA5Rz4eShOk0UI0x7o6TeTXhk2GHYAI37x6tKhw\nFGNS8G1SQSTVmAjshToNdJEhzjnMymAkWTD7qhKKTVDG2Kj7zBZp7wmMFteC\nXNtYO6pJWVOQK5aAphJ28OYwE4DK057RS8JzH1wRf9wnwBvyt1vrcjGL0ecl\n/VVazW4EkemVQoTb9LMFYnsOWgWcDvRsgTW0PsN+sUgYC6rfV+BDOTh2O+Vs\ncBrJ\r\n=6Sp0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjmAKPVNqqROAbdO7380nJc06NRBPtPvw0llyQ0lqoRwIhAJB3CfeP9l+4gMabQgd4ZmGqmT84I9hBNF4UL3zFCzWV"}]},"_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/slack-messages_1.2.2-master.20210315181159_1615831981514_0.9549359172915863"},"_hasShrinkwrap":false},"1.2.2-master.20210315181220":{"name":"@atomist/slack-messages","version":"1.2.2-master.20210315181220","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.18.0","@typescript-eslint/parser":"^4.18.0","eslint":"^7.22.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32","typescript":"^4.2.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSupport for sending Slack Block messages is also supported.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","readmeFilename":"README.md","gitHead":"f53e3655e2309d3f1f28226887d2bbdb0ef02883","_id":"@atomist/slack-messages@1.2.2-master.20210315181220","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-+43Cb0eGdIkvpFoZ4eimx+kxlKsxUvsq6LgIbfZKGhtLraPGTTmVoFHnlRdyARphCZHZiQz6fHHn4aT6Gn5Fkw==","shasum":"181387adec8f52179f82d8a3e56df4e955b1a5cf","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2-master.20210315181220.tgz","fileCount":28,"unpackedSize":70405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6PFCRA9TVsSAnZWagAAfwoQAJwu6g/IQtcj63fdzhCf\nmtnQS2/X2FADozhDAKuPAnjWflhALVxJQ0u8usBQ/aMCldPlIjpG30u6z2GW\nWOECB4RjoVHR2GfuWDEHroTrzELibvDtcePQif31wU0eAOlXnCZvYPG3tjaL\nWIMjX+WWQiRn4bXGbFaAoKG5C5WfMebZF4NoYbAy8sCfm39cvKINTlTWDTs/\nKImjPgMxzSCCCI4EgYg7OTlbJYfnKVSb9awCqoaF8sppaC3w/YMRLGY6p6VJ\n131vEtuE2DnFn//cEinvfUCuYn4J1ZmNqfITG19y5eLLgXlHcO0DDVrCC8Aj\nHdLkOZb9n/AtndtBOh67TqlUgutPZeG+SdFELQO1ZntvDAAYLP/Bim1o0v9M\nWZTOT8t6xMngODbZfgVEZJGa3pThYVeUl2hm0f8hV2BhmzlGEVXVdqhygUyq\n95Y7aKgA/gMpFr5y71gOaT0MrI+I2BicjT8XoULmtWG5aWm8vKvN3nQJUwxZ\nbwUDbbAo3x2QtKPgWFcQ0XEiUNmFc+uiNZvr3TJKCSMWpfLv1PDRU8sF89pc\n7moCqEew4NEOksDJsokR1uwQLltBRGSgyVOGa4yJdXYz9O4UaJmHINTWZgm9\nf74xc9PeFs6e2whoJgOzDeyo7PwHiXLP7lXmGtQy/UUk/Ivs2/9ltsNtTnQ5\nVWIx\r\n=u602\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcXaIBeZrMKYqDziSXLexGvnoERg8s1E96ShAIkoUXnAIhAKDNTqS/wb7dvdesHe1z6UVRaSeXvcZN0O7SRFWyA9GK"}]},"_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/slack-messages_1.2.2-master.20210315181220_1615832005082_0.7583330151733279"},"_hasShrinkwrap":false},"1.2.2":{"name":"@atomist/slack-messages","version":"1.2.2","description":"Atomist utilities for creating formatted Slack messages","author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"license":"Apache-2.0","homepage":"https://github.com/atomist/slack-messages#readme","repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"keywords":["atomist","automation","sdm","slack"],"main":"./index.js","types":"./index.d.ts","dependencies":{},"devDependencies":{"@types/mocha":"^8.2.1","@types/power-assert":"^1.5.3","@typescript-eslint/eslint-plugin":"^4.18.0","@typescript-eslint/parser":"^4.18.0","eslint":"^7.22.0","eslint-config-prettier":"^6.15.0","eslint-plugin-prettier":"^3.3.1","espower-typescript":"^9.0.2","mocha":"^8.3.2","npm-run-all":"^4.1.5","power-assert":"^1.6.1","prettier":"^2.2.1","rimraf":"^3.0.2","supervisor":"^0.12.0","ts-node":"^9.1.1","typedoc":"^0.20.32","typescript":"^4.2.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:doc clean:run clean:test","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:doc":"rimraf doc","clean:npm":"rimraf node_modules","clean:run":"rimraf *-v8.log profile.txt log","clean:test":"rimraf .nyc_output coverage","compile":"tsc --project .","doc":"typedoc --mode modules --excludeExternals --ignoreCompilerErrors --exclude \"**/*.d.ts\" --out doc index.ts lib","lint":"eslint --ext .ts .","lint:fix":"npm run lint -- --fix","test":"mocha --require espower-typescript/guess \"test/**/*.test.ts\"","test:one":"mocha --require espower-typescript/guess \"test/**/${TEST:-*.test.ts}\""},"engines":{"node":">=8.2.0","npm":">=5.0.0"},"gitHead":"c938c67e957345ba6a0015ca3ace1fd779d0979c","_id":"@atomist/slack-messages@1.2.2","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-K1kQv1BZVtMXQqdpNZt9Pgh85KwamsWX9gYyq1xG4cpyb+EacfMiNfumrju16piFXanCUrCR0P1DowPjV2qV/A==","shasum":"782d31936a0363e4458272bcc8fbe4f7651292ee","tarball":"https://registry.npmjs.org/@atomist/slack-messages/-/slack-messages-1.2.2.tgz","fileCount":28,"unpackedSize":70383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT6PkCRA9TVsSAnZWagAAObMP/0e/x9pZ37S+Ri+wp83J\nABG4BrLGOoNWVHcv5yc+uyd+NQNgkj/rpy5jNGUl5f9mcxFBHu+WIZd0elGt\ntEhySfRgxML70Nil1O7tT4wC+xeohynfRpZBnfa+RaalaUI0jXViJ5hHb0s2\nVQ1swbPiKa8o/JXfYQcALMZc+u2/pze8IWRBPYxh7mTr1gdWupCQYiI840po\nG/h3uJJM8QG2dAE509ek43wnvpq75DM7viQzXcZU9qsLHjLrmgWD9n9FoXaH\ngl6oc8cgD4/RijqV5jH/nDGIw60hdeEIFaszpYgdajJjLaySsZH/gcKaj8rg\nYAVCQyJ2NshtU6cNjn6OAPCQsMVY82fCyu32hzUuN3TaZvxpUv7IRXPPWR8C\n78NcCrOeYbbiVj3uGFJiusJroWLBcak6S60kgRmJv+pdlhuCmqfpSfoBL2Z3\nvBuW5sj/csXt/3mwuYzZ2qLvQJ0uJH3yf2z7jfteXKPOte6hNG6o0fKO4PSU\npsmIjLCIOZoqoruXiB6PYr7POh84FjXcgp2RaQ3IVbPUZ4io9QS3EyDAq9Lu\nKF4JTU4H7UVciTf5cq9z7mHbtmmCfYkM2Py1GDOxtZiqf+7ygPv2EGF2wb2j\nXP49IWrpcecHxsHUrNaq79LVkTANVDQCJVB1ht8O58/yFTi9wf7mfBwrAsd6\nig+e\r\n=bZSh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOgPJ/geFHvDnaA7VHxg8E0nbU0Nzdy9/XoH+NsCxjNQIgO30S9rnxpo8KCIaA3I348qgoSSy9Agm/++B6DG4CPFg="}]},"_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/slack-messages_1.2.2_1615832036065_0.6488042417472151"},"_hasShrinkwrap":false}},"readme":"# @atomist/slack-messages\n\n[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/slack-messages/9e7d7699-14a8-4273-945b-9e5ca08aa38f)](https://app.atomist.com/workspace/T29E48P34)\n[![npm version](https://img.shields.io/npm/v/@atomist/slack-messages.svg)](https://www.npmjs.com/package/@atomist/slack-messages)\n\n[Node.js][node] module that helps to create well-formatted\n[Slack][slackhq] messages sent through the `@atomist` bot from your\nsoftware delivery machine (SDM).  This module also facilitates adding\nactions to your Slack messages that execute SDM commands.\n\nSupport for sending Slack Block messages is also supported.\n\nSee the [Atomist documentation][atomist-doc] for more information on\nwhat SDMs are and what they can do for you using the Atomist API for\nsoftware.\n\n[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)\n[slackhq]: https://slack.com/ (Slack)\n\n## Using\n\nConstruct a message as a plain map following the [Slack message\nformatting API][slack-api].\n\n[slack-api]: https://api.slack.com/docs/message-formatting (Slack message formatting API)\n\n```typescript\nimport { SlackMessage } from \"@atomist/slack-messages\";\n// A very simple message\nconst msg: SlackMessage = { text: \"Simple message\" };\n```\n\n```typescript\nimport {\n    escape,\n    SlackMessage,\n    url,\n} from \"@atomist/slack-messages\";\n// Here is an example of a message with a Slack action (button).\nconst msg: SlackMessage = {\n    text: `${url(user.url, \"@\" + user.name)} opened issue: ${url(issue.url, issue.title)}`,\n    attachments: [\n        {\n            text: escape(issue.body),\n            fallback: escape(issue.title),\n            mrkdwn_in: [\"text\"],\n            actions: [\n                {\n                    text: \"Close issue\",\n                    type: \"button\",\n                    name: \"closeissue\",\n                    value: \"somebuttonid\",\n                },\n            ],\n            callback_id: \"cllbck1\",\n        },\n    ],\n};\n```\n\nAnd then render the message with `render(msg)`.  This will construct a\nJSON string representation of the message:\n\n```typescript\nimport { render } from \"@atomist/slack-messages\"\n\nconst renderedMsg = render(msg);\n```\n\nor to produce a pretty JSON string:\n\n```typescript\nconst renderedMsg = render(msg, true);\n```\n\nThis will produce the following JSON string (pretty version):\n\n```json\n{\n  \"text\": \"<https://github.com/anna|@anna> opened issue: <https://github.com/someorg/somerepo/issues/484|This issue title contains &lt;unsafe&gt; characters and &amp;>\",\n  \"attachments\": [\n    {\n      \"text\": \"This is a very important issue with body containing &lt;unsafe&gt; characters and even &amp;\",\n      \"fallback\": \"This issue title contains &lt;unsafe&gt; characters and &amp;\",\n      \"mrkdwn_in\": [\n        \"text\"\n      ],\n      \"callback_id\": \"cllbck1\",\n      \"actions\": [\n        {\n          \"text\": \"Close issue\",\n          \"type\": \"button\",\n          \"name\": \"rug\",\n          \"value\": \"somebuttonid\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nNote that the `render` function will automatically assign a unique\n`callback_id` to each attachments that has actions.  But, if you\nprovide your custom `callback_id` it will be preserved as is.\n\n### Additional helper functions\n\n#### Special characters\n\n```typescript\nescape(\"Slack requires you to escape <, > and &\");\n// => \"Slack requires you to escape &lt;, &gt; and &amp;\"\n```\n\n#### Links\n\n```typescript\n// Simple link\nurl(\"https://www.atomist.com\");\n// => \"<https://www.atomist.com>\"\n\n// Link with label\nurl(\"https://www.atomist.com\", \"atomist\");\n// => \"<https://www.atomist.com|atomist>\"\n```\n\n#### User & channel links\n\n```typescript\n// @some-user (Slack will display user name for provided user ID)\nuser(\"U123\");\n// => \"<@U123>\"\n\n// #some-channel (Slack will display channel name for provided channel ID)\nchannel(\"C123\");\n// => \"<#C123>\"\n```\n\n#### Special variables\n\n```typescript\n// @channel\natChannel();\n// => \"<!channel>\"\n\n// @here\natHere();\n// => \"<!here>\"\n\n// @everyone\natEveryone();\n// => \"<!everyone>\"\n```\n\n#### Emoji\n\n```typescript\nemoji(\"smile\");\n// => \":smile:\";\n```\n\n#### Markdown\n\nSlack will render markdown if field where markdown is present is\nincluded in `mrkdwn_in` array.\n\n```typescript\nbold(\"This text will appear bold\");\n// => \"*This text will appear bold*\"\n\nitalic(\"This text will appear italic\");\n// => \"_This text will appear italic_\"\n\nstrikethrough(\"This text will appear strike-through\");\n// => \"~This text will appear strike-through~\"\n\n// Single line code block\ncodeLine(\"var a = new A();\");\n// =>  \"`var a = new A();`\"\n\n// Multi line code block\ncodeBlock(\"var a = new A();\\nvar b = new B();\");\n// => \"```var a = new A();\\nvar b = new B();```\"\n\n// List\nlistItem(\"Item 1\");\n// => \"• Item 1\"\n```\n\n### GitHub to Slack markdown conversion\n\nGitHub and Slack markdown are different enough to make your GitHub\nissues or GitHub PRs look quite bad in Slack by default.  You can use\nthe `githubToSlack` function from `Markdown` to convert text that uses\nGitHub markdown to text that will look good in Slack:\n\n```typescript\nimport { githubToSlack } from \"@atomist/slack-messages\"\n\ngithubToSlack(\"* list item 1\\n* list item 2\\n\\**some bold text** and *some italic text* with a link [click here](http://someplace.com)\");\n// => \"• list item 1\\n• list item 2\\n*some bold text* and _some italic text_ with a link <http://someplace.com|click here>\"\n```\n\n## Support\n\nGeneral support questions should be discussed in the `#help`\nchannel in the [Atomist community Slack workspace][slack].\n\nIf you find a problem, please create an [issue][].\n\n[issue]: https://github.com/atomist/slack-messages/issues\n\n## Development\n\nYou will need to install [Node.js][node] to build and test this\nproject.\n\n[node]: https://nodejs.org/ (Node.js)\n\n### Build and test\n\nInstall dependencies.\n\n```\n$ npm install\n```\n\nUse the `build` package script to compile, test, lint, and build the\ndocumentation.\n\n```\n$ npm run build\n```\n\n### Release\n\nReleases are handled via the [Atomist SDM][atomist-sdm].  Just press\nthe 'Approve' button in the Atomist dashboard or Slack.\n\n[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)\n\n---\n\nCreated by [Atomist][atomist].\nNeed Help?  [Join our Slack workspace][slack].\n\n[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)\n[slack]: https://join.atomist.com/ (Atomist Community Slack)\n","maintainers":[{"email":"neil.prosser+npmjs@gmail.com","name":"neilprosser"},{"email":"npm@atomist.com","name":"atomist-bot"},{"email":"cd@atomist.com","name":"cdupuis"},{"email":"slimslenderslacks@gmail.com","name":"slimslenderslacks"}],"time":{"modified":"2023-02-23T18:00:06.421Z","created":"2017-05-09T15:48:45.883Z","0.1.0":"2017-05-09T15:48:45.883Z","0.2.0":"2017-05-09T22:54:36.228Z","0.3.0":"2017-05-10T15:06:51.016Z","0.3.1":"2017-05-10T15:58:33.438Z","0.4.0":"2017-05-10T22:45:14.858Z","0.5.0":"2017-05-15T14:20:24.211Z","0.5.1":"2017-05-15T15:02:24.263Z","0.6.0":"2017-05-16T18:26:10.208Z","0.7.0":"2017-07-04T10:22:11.085Z","0.8.0":"2017-08-14T19:31:43.504Z","0.9.0":"2017-08-17T08:40:29.433Z","0.10.0":"2017-08-18T17:58:42.720Z","0.11.0":"2017-08-18T19:28:41.955Z","0.12.0":"2017-09-20T10:26:30.427Z","0.12.1":"2017-11-09T19:31:58.621Z","1.0.0-master.20180829132449":"2018-08-29T13:26:00.446Z","1.0.0-master.20180830183648":"2018-08-30T18:37:56.993Z","1.0.0-master.20180830185933":"2018-08-30T19:00:49.068Z","1.0.0":"2018-08-30T19:06:51.025Z","1.0.1-master.20180830190736":"2018-08-30T19:08:47.596Z","1.0.1-master.20181109094511":"2018-11-09T09:46:10.101Z","1.0.1":"2018-11-09T09:47:17.614Z","1.0.2-master.20181115140150":"2018-11-15T14:02:50.363Z","1.0.2-master.20181115151310":"2018-11-15T15:14:01.059Z","1.1.0-master.20181115202354":"2018-11-15T20:24:46.219Z","1.1.0":"2018-11-15T20:25:51.371Z","1.1.1-master.20190205203349":"2019-02-05T20:34:55.913Z","1.1.1-master.20190217194316":"2019-02-17T19:44:52.417Z","1.1.1-master.20190618205814":"2019-06-18T20:59:43.115Z","1.1.1":"2019-06-18T21:06:59.898Z","1.1.2-master.20190716171319":"2019-07-16T17:14:52.046Z","1.1.2-atomist.anq2qhoid.typescript-version.master.20190904142734":"2019-09-04T14:29:25.136Z","1.1.2-atomist.a260p86nh.typescript-version.master.20190915195615":"2019-09-15T19:57:46.432Z","1.1.2-master.20190916021445":"2019-09-16T02:16:17.330Z","1.1.2-master.20200108150633":"2020-01-08T15:07:18.462Z","1.1.2-master.20200430150635":"2020-04-30T15:07:26.812Z","1.2.0-master.20200806083357":"2020-08-06T08:35:04.047Z","1.2.0-master.20200806083522":"2020-08-06T08:36:26.532Z","1.2.0-master.20200806083959":"2020-08-06T08:41:05.597Z","1.2.0-master.20200806084935":"2020-08-06T08:50:40.703Z","1.2.0-master.20200806090151":"2020-08-06T09:02:54.449Z","1.2.0-master.20200806120304":"2020-08-06T12:04:06.602Z","1.2.0-master.20200806132057":"2020-08-06T13:22:02.269Z","1.2.0-master.20201007124259":"2020-10-07T12:44:02.076Z","1.2.0":"2020-10-07T12:45:32.043Z","1.2.1-master.20201124151723":"2020-11-24T15:18:31.738Z","1.2.1":"2020-11-24T15:19:21.617Z","1.2.2-master.20210108045512":"2021-01-08T04:57:17.429Z","1.2.2-atomist.npm-update-master.20210201152343":"2021-02-01T15:25:08.688Z","1.2.2-atomist.npm-audit-master.20210224150904":"2021-02-24T15:10:17.040Z","1.2.2-master.20210224151204":"2021-02-24T15:13:25.570Z","1.2.2-atomist.npm-update-master.20210224151330":"2021-02-24T15:14:41.894Z","1.2.2-master.20210224151634":"2021-02-24T15:18:06.939Z","1.2.2-master.20210315175954":"2021-03-15T18:01:00.325Z","1.2.2-atomist.npm-update-master.20210315180049":"2021-03-15T18:01:49.663Z","1.2.2-master.20210315180324":"2021-03-15T18:04:28.742Z","1.2.2-atomist.npm-update-master.20210315180424":"2021-03-15T18:05:26.870Z","1.2.2-master.20210315181159":"2021-03-15T18:13:01.695Z","1.2.2-master.20210315181220":"2021-03-15T18:13:25.281Z","1.2.2":"2021-03-15T18:13:56.478Z"},"homepage":"https://github.com/atomist/slack-messages#readme","keywords":["atomist","automation","sdm","slack"],"repository":{"type":"git","url":"git+https://github.com/atomist/slack-messages.git"},"author":{"name":"Atomist","email":"support@atomist.com","url":"https://atomist.com/"},"bugs":{"url":"https://github.com/atomist/slack-messages/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}