├── .gitignore ├── .npmignore ├── .travis.yml ├── Cakefile ├── LICENSE ├── README-en.md ├── README.md ├── TODO.md ├── images ├── icons │ ├── bitbucket@2x.png │ ├── bughd@2x.png │ ├── buildkite@2x.png │ ├── circleci@2x.png │ ├── cloudinsight@2x.png │ ├── codeship@2x.png │ ├── coding@2x.png │ ├── csdn@2x.png │ ├── douban@2x.png │ ├── email@2x.png │ ├── firim@2x.png │ ├── gitcafe@2x.png │ ├── github@2x.png │ ├── gitlab@2x.png │ ├── goldxitudaily@2x.png │ ├── heroku@2x.png │ ├── incoming@2x.png │ ├── jenkins@2x.png │ ├── jiankongbao@2x.png │ ├── jinshuju@2x.png │ ├── jira@2x.png │ ├── jobtong@2x.png │ ├── kf5@2x.png │ ├── magnumci@2x.png │ ├── mailgun@2x.png │ ├── mikecrm@2x.png │ ├── newrelic@2x.png │ ├── oschina@2x.png │ ├── outgoing@2x.png │ ├── pingxx@2x.png │ ├── qingcloud@2x.png │ ├── robot@2x.png │ ├── rss@2x.png │ ├── swathub@2x.png │ ├── talkai@2x.png │ ├── teambition@2x.png │ ├── travis@2x.png │ ├── trello@2x.png │ └── weibo@2x.png └── inte-guide │ ├── buildkite-1.png │ ├── buildkite-2.png │ ├── jenkins-1.png │ ├── jenkins-2.png │ ├── jenkins-3.png │ ├── jenkins-4.png │ ├── jenkins-5.png │ ├── jenkins-6.png │ ├── jenkins-7.png │ ├── jenkins-8.png │ ├── jobtong-1.png │ ├── kf5-1.png │ ├── kf5-2.png │ ├── kf5-3.png │ ├── kf5-4.png │ ├── kf5-5.png │ ├── kf5-6.png │ ├── kf5-7.png │ ├── magnumci-1.png │ ├── mailgun-1.png │ ├── mikecrm-1.png │ ├── mikecrm-2.jpeg │ ├── newrelic-1.png │ ├── newrelic-2.png │ ├── newrelic-3.png │ ├── newrelic-4.png │ ├── notice-coding.png │ ├── notice-firim.png │ ├── notice-github.png │ ├── notice-gitlab.png │ ├── notice-jiankongbao.png │ ├── notice-jinshuju.png │ ├── notice-webhook.png │ ├── pingxx-1.jpeg │ ├── sample-cloudinsight-1.png │ ├── sample-cloudinsight-2.png │ ├── sample-cloudinsight-3.png │ ├── sample-cloudinsight-4.png │ ├── sample-codeship-1.png │ ├── sample-codeship-2.png │ ├── sample-coding-1.png │ ├── sample-coding-2.png │ ├── sample-csdn-1.png │ ├── sample-csdn-2.png │ ├── sample-firim-1.png │ ├── sample-firim-2.png │ ├── sample-firim-3.png │ ├── sample-github.png │ ├── sample-gitlab-1.png │ ├── sample-jiankongbao.png │ ├── sample-jinshuju-1.png │ ├── sample-jinshuju-2.png │ ├── sample-oschina-1.png │ ├── sample-oschina-2.png │ ├── sample-outgoing-1.png │ ├── sample-qingcloud.png │ ├── sample-rss.png │ ├── sample-webhook-1.png │ ├── sample-webhook-2.png │ ├── sample-webhook.png │ ├── sample-weibo.png │ ├── swathub-1.png │ └── swathub-2.png ├── manuals ├── bitbucket-en.md ├── bitbucket-zh.md ├── bughd-en.md ├── bughd-zh.md ├── buildkite-en.md ├── buildkite-zh.md ├── circleci-en.md ├── circleci-zh.md ├── cloudinsight-en.md ├── cloudinsight-zh.md ├── codeship-en.md ├── codeship-zh.md ├── coding-en.md ├── coding-zh.md ├── csdn-en.md ├── csdn-zh.md ├── firim-en.md ├── firim-zh.md ├── gitcafe-en.md ├── gitcafe-zh.md ├── gitlab-en.md ├── gitlab-zh.md ├── goldxitudaily-en.md ├── goldxitudaily-zh.md ├── heroku-en.md ├── heroku-zh.md ├── incoming-en.md ├── incoming-zh.md ├── jenkins-en.md ├── jenkins-zh.md ├── jiankongbao-en.md ├── jiankongbao-zh.md ├── jinshuju-en.md ├── jinshuju-zh.md ├── jira-en.md ├── jira-zh.md ├── jobtong-en.md ├── jobtong-zh.md ├── kf5-en.md ├── kf5-zh.md ├── magnumci-en.md ├── magnumci-zh.md ├── mailgun-en.md ├── mailgun-zh.md ├── mikecrm-en.md ├── mikecrm-zh.md ├── newrelic-en.md ├── newrelic-zh.md ├── oschina-en.md ├── oschina-zh.md ├── outgoing-en.md ├── outgoing-zh.md ├── pingxx-en.md ├── pingxx-zh.md ├── qingcloud-en.md ├── qingcloud-zh.md ├── robot-en.md ├── robot-zh.md ├── swathub-en.md ├── swathub-zh.md ├── travis-en.md └── travis-zh.md ├── package.json ├── src ├── loader.coffee ├── service.coffee ├── services │ ├── bitbucket.coffee │ ├── bughd.coffee │ ├── buildkite.coffee │ ├── circleci.coffee │ ├── cloudinsight.coffee │ ├── codeship.coffee │ ├── coding.coffee │ ├── csdn.coffee │ ├── email.coffee │ ├── firim.coffee │ ├── gitcafe.coffee │ ├── github.coffee │ ├── gitlab.coffee │ ├── goldxitudaily.coffee │ ├── heroku.coffee │ ├── incoming.coffee │ ├── jenkins.coffee │ ├── jiankongbao.coffee │ ├── jinshuju.coffee │ ├── jira.coffee │ ├── jobtong.coffee │ ├── kf5.coffee │ ├── magnumci.coffee │ ├── mailgun.coffee │ ├── mikecrm.coffee │ ├── newrelic.coffee │ ├── oschina.coffee │ ├── outgoing.coffee │ ├── pingxx.coffee │ ├── qingcloud.coffee │ ├── robot.coffee │ ├── rss.coffee │ ├── swathub.coffee │ ├── talkai.coffee │ ├── teambition.coffee │ ├── travis.coffee │ ├── trello.coffee │ └── weibo.coffee └── util.coffee └── test ├── loader.coffee ├── main.coffee ├── scripts ├── send-firim-msg.coffee ├── send-gitlab-msg.coffee └── send-incoming-msg.coffee ├── servers ├── account.coffee ├── app.coffee ├── github.coffee ├── rss.coffee ├── teambition.coffee └── trello.coffee ├── services ├── bitbucket.coffee ├── bitbucket_assets │ ├── invalid_event.json │ ├── invalid_issue_action.json │ ├── invalid_pr_action.json │ ├── invalid_repo_action.json │ ├── issue_comment_created.json │ ├── issue_created.json │ ├── issue_updated.json │ ├── pullrequest_comment_created.json │ ├── pullrequest_comment_deleted.json │ ├── pullrequest_created.json │ ├── pullrequest_fulfilled.json │ ├── pullrequest_rejected.json │ ├── pullrequest_updated.json │ ├── repo_commit_comment_created.json │ └── repo_push.json ├── bughd.coffee ├── buildkite.coffee ├── buildkite_assets │ └── payload.json ├── circleci.coffee ├── circleci_assets │ ├── fail.json │ └── success.json ├── cloudinsight.coffee ├── codeship.coffee ├── coding.coffee ├── coding_assets │ ├── create_dir.json │ ├── finish_task.json │ ├── member.json │ ├── merge_merge_request.json │ ├── merge_request.json │ ├── new_topic.json │ ├── push.json │ ├── reassign_task.json │ ├── refuse_merge_request.json │ ├── restore_task.json │ ├── star.json │ ├── task.json │ ├── update_dir.json │ ├── update_task_deadline.json │ ├── update_task_priority.json │ ├── update_topic.json │ ├── upload_file.json │ ├── watch.json │ └── zen.json ├── csdn.coffee ├── email.coffee ├── firim.coffee ├── gitcafe.coffee ├── gitcafe_assets │ ├── commit_comment.json │ ├── empty_event.json │ ├── pull_request.json │ ├── pull_request_comment.json │ ├── push.json │ ├── ticket.json │ └── ticket_comment.json ├── github.coffee ├── github_assets │ ├── commit-comment.json │ ├── create.json │ ├── delete.json │ ├── fork.json │ ├── issue-comment.json │ ├── issues.json │ ├── pull-request-review-comment.json │ ├── pull-request.json │ └── push.json ├── gitlab.coffee ├── gitlab_assets │ ├── build.json │ ├── issue.json │ ├── merge.json │ ├── new-branch.json │ └── push.json ├── goldxitudaily.coffee ├── heroku.coffee ├── incoming.coffee ├── jenkins.coffee ├── jiankongbao.coffee ├── jinshuju.coffee ├── jira.coffee ├── jira_assets │ ├── create-issue.json │ ├── empty-event.json │ ├── jira-1435750928943.json │ ├── jira-1435750936962.json │ ├── jira-1435750968358.json │ ├── jira-1435750984969.json │ ├── jira-1435751006805.json │ └── update-issue.json ├── jobtong.coffee ├── kf5.coffee ├── magnumci.coffee ├── magnumci_assets │ ├── fail.json │ └── pass.json ├── mailgun.coffee ├── mailgun_assets │ ├── clicks.json │ ├── delivered.json │ ├── dropped.json │ ├── hard.json │ ├── open.json │ ├── spam.json │ └── unsubscribe.json ├── mikecrm.coffee ├── newrelic.coffee ├── oschina.coffee ├── outgoing.coffee ├── pingxx.coffee ├── pingxx_assets │ ├── charge.succeeded.json │ ├── refund.succeeded.json │ ├── summary.daily.available.json │ ├── summary.monthly.available.json │ └── summary.weekly.available.json ├── qingcloud.coffee ├── robot.coffee ├── rss.coffee ├── rss_assets │ ├── baidu.xml │ └── v2ex.xml ├── swathub.coffee ├── talkai.coffee ├── teambition.coffee ├── teambition_assets │ ├── entry.create.json │ ├── entry.update.involveMembers.json │ ├── entry.update.json │ ├── event.create.json │ ├── event.remove.json │ ├── event.update.involveMembers.json │ ├── event.update.json │ ├── file.create.json │ ├── file.move.json │ ├── file.remove.json │ ├── file.rename.json │ ├── file.update.involveMembers.json │ ├── file.update.version.json │ ├── post.create.json │ ├── post.remove.json │ ├── post.update.involveMembers.json │ ├── post.update.json │ ├── project.archive.json │ ├── project.member.create.json │ ├── project.member.remove.json │ ├── project.rename.json │ ├── project.unarchive.json │ ├── stage.create.json │ ├── stage.rename.json │ ├── subtask.create.json │ ├── subtask.done.json │ ├── subtask.remove.json │ ├── subtask.update.content.json │ ├── subtask.update.executor.json │ ├── tag.create.json │ ├── tag.remove.json │ ├── task.create.json │ ├── task.done.json │ ├── task.move.json │ ├── task.remove.executor.json │ ├── task.remove.json │ ├── task.rename.json │ ├── task.update.dueDate.json │ ├── task.update.executor.json │ ├── task.update.involveMembers.json │ ├── task.update.priority.json │ ├── tasklist.create.json │ ├── tasklist.remove.json │ └── tasklist.rename.json ├── travis.coffee ├── travis_assets │ ├── fail.json │ └── pass.json ├── trello.coffee ├── trello_assets │ ├── addAttachmentToCard.json │ ├── addChecklistToCard.json │ ├── commentCard.json │ ├── createCard.json │ ├── createCheckItem.json │ ├── updateBoard-close.json │ ├── updateBoard-rename.json │ ├── updateCard-close.json │ ├── updateCard-due.json │ ├── updateCard-move.json │ ├── updateCard-rename.json │ ├── updateCheckItem.json │ ├── updateCheckItemStateOnCard.json │ ├── updateChecklist.json │ └── updateComment.json └── weibo.coffee └── util.coffee /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | *.swp 10 | *.DS_Store 11 | 12 | pids 13 | logs 14 | results 15 | 16 | npm-debug.log 17 | node_modules 18 | 19 | *.orig 20 | /lib 21 | _book/ 22 | test/config.json 23 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | test/ 3 | src/ 4 | docs/ 5 | .DS_Store 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.11" 5 | - "0.12" 6 | - "4" 7 | - "5" 8 | -------------------------------------------------------------------------------- /Cakefile: -------------------------------------------------------------------------------- 1 | require('cake-dog')() 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 teambition 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/TODO.md -------------------------------------------------------------------------------- /images/icons/bitbucket@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/bitbucket@2x.png -------------------------------------------------------------------------------- /images/icons/bughd@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/bughd@2x.png -------------------------------------------------------------------------------- /images/icons/buildkite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/buildkite@2x.png -------------------------------------------------------------------------------- /images/icons/circleci@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/circleci@2x.png -------------------------------------------------------------------------------- /images/icons/cloudinsight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/cloudinsight@2x.png -------------------------------------------------------------------------------- /images/icons/codeship@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/codeship@2x.png -------------------------------------------------------------------------------- /images/icons/coding@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/coding@2x.png -------------------------------------------------------------------------------- /images/icons/csdn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/csdn@2x.png -------------------------------------------------------------------------------- /images/icons/douban@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/douban@2x.png -------------------------------------------------------------------------------- /images/icons/email@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/email@2x.png -------------------------------------------------------------------------------- /images/icons/firim@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/firim@2x.png -------------------------------------------------------------------------------- /images/icons/gitcafe@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/gitcafe@2x.png -------------------------------------------------------------------------------- /images/icons/github@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/github@2x.png -------------------------------------------------------------------------------- /images/icons/gitlab@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/gitlab@2x.png -------------------------------------------------------------------------------- /images/icons/goldxitudaily@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/goldxitudaily@2x.png -------------------------------------------------------------------------------- /images/icons/heroku@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/heroku@2x.png -------------------------------------------------------------------------------- /images/icons/incoming@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/incoming@2x.png -------------------------------------------------------------------------------- /images/icons/jenkins@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/jenkins@2x.png -------------------------------------------------------------------------------- /images/icons/jiankongbao@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/jiankongbao@2x.png -------------------------------------------------------------------------------- /images/icons/jinshuju@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/jinshuju@2x.png -------------------------------------------------------------------------------- /images/icons/jira@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/jira@2x.png -------------------------------------------------------------------------------- /images/icons/jobtong@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/jobtong@2x.png -------------------------------------------------------------------------------- /images/icons/kf5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/kf5@2x.png -------------------------------------------------------------------------------- /images/icons/magnumci@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/magnumci@2x.png -------------------------------------------------------------------------------- /images/icons/mailgun@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/mailgun@2x.png -------------------------------------------------------------------------------- /images/icons/mikecrm@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/mikecrm@2x.png -------------------------------------------------------------------------------- /images/icons/newrelic@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/newrelic@2x.png -------------------------------------------------------------------------------- /images/icons/oschina@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/oschina@2x.png -------------------------------------------------------------------------------- /images/icons/outgoing@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/outgoing@2x.png -------------------------------------------------------------------------------- /images/icons/pingxx@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/pingxx@2x.png -------------------------------------------------------------------------------- /images/icons/qingcloud@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/qingcloud@2x.png -------------------------------------------------------------------------------- /images/icons/robot@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/robot@2x.png -------------------------------------------------------------------------------- /images/icons/rss@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/rss@2x.png -------------------------------------------------------------------------------- /images/icons/swathub@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/swathub@2x.png -------------------------------------------------------------------------------- /images/icons/talkai@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/talkai@2x.png -------------------------------------------------------------------------------- /images/icons/teambition@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/teambition@2x.png -------------------------------------------------------------------------------- /images/icons/travis@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/travis@2x.png -------------------------------------------------------------------------------- /images/icons/trello@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/trello@2x.png -------------------------------------------------------------------------------- /images/icons/weibo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/icons/weibo@2x.png -------------------------------------------------------------------------------- /images/inte-guide/buildkite-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/buildkite-1.png -------------------------------------------------------------------------------- /images/inte-guide/buildkite-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/buildkite-2.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-1.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-2.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-3.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-4.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-5.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-6.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-7.png -------------------------------------------------------------------------------- /images/inte-guide/jenkins-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jenkins-8.png -------------------------------------------------------------------------------- /images/inte-guide/jobtong-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/jobtong-1.png -------------------------------------------------------------------------------- /images/inte-guide/kf5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/kf5-1.png -------------------------------------------------------------------------------- /images/inte-guide/kf5-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/kf5-2.png -------------------------------------------------------------------------------- /images/inte-guide/kf5-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/kf5-3.png -------------------------------------------------------------------------------- /images/inte-guide/kf5-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/kf5-4.png -------------------------------------------------------------------------------- /images/inte-guide/kf5-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/kf5-5.png -------------------------------------------------------------------------------- /images/inte-guide/kf5-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/kf5-6.png -------------------------------------------------------------------------------- /images/inte-guide/kf5-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/kf5-7.png -------------------------------------------------------------------------------- /images/inte-guide/magnumci-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/magnumci-1.png -------------------------------------------------------------------------------- /images/inte-guide/mailgun-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/mailgun-1.png -------------------------------------------------------------------------------- /images/inte-guide/mikecrm-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/mikecrm-1.png -------------------------------------------------------------------------------- /images/inte-guide/mikecrm-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/mikecrm-2.jpeg -------------------------------------------------------------------------------- /images/inte-guide/newrelic-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/newrelic-1.png -------------------------------------------------------------------------------- /images/inte-guide/newrelic-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/newrelic-2.png -------------------------------------------------------------------------------- /images/inte-guide/newrelic-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/newrelic-3.png -------------------------------------------------------------------------------- /images/inte-guide/newrelic-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/newrelic-4.png -------------------------------------------------------------------------------- /images/inte-guide/notice-coding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/notice-coding.png -------------------------------------------------------------------------------- /images/inte-guide/notice-firim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/notice-firim.png -------------------------------------------------------------------------------- /images/inte-guide/notice-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/notice-github.png -------------------------------------------------------------------------------- /images/inte-guide/notice-gitlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/notice-gitlab.png -------------------------------------------------------------------------------- /images/inte-guide/notice-jiankongbao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/notice-jiankongbao.png -------------------------------------------------------------------------------- /images/inte-guide/notice-jinshuju.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/notice-jinshuju.png -------------------------------------------------------------------------------- /images/inte-guide/notice-webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/notice-webhook.png -------------------------------------------------------------------------------- /images/inte-guide/pingxx-1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/pingxx-1.jpeg -------------------------------------------------------------------------------- /images/inte-guide/sample-cloudinsight-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-cloudinsight-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-cloudinsight-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-cloudinsight-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-cloudinsight-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-cloudinsight-3.png -------------------------------------------------------------------------------- /images/inte-guide/sample-cloudinsight-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-cloudinsight-4.png -------------------------------------------------------------------------------- /images/inte-guide/sample-codeship-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-codeship-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-codeship-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-codeship-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-coding-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-coding-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-coding-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-coding-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-csdn-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-csdn-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-csdn-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-csdn-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-firim-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-firim-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-firim-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-firim-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-firim-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-firim-3.png -------------------------------------------------------------------------------- /images/inte-guide/sample-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-github.png -------------------------------------------------------------------------------- /images/inte-guide/sample-gitlab-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-gitlab-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-jiankongbao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-jiankongbao.png -------------------------------------------------------------------------------- /images/inte-guide/sample-jinshuju-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-jinshuju-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-jinshuju-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-jinshuju-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-oschina-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-oschina-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-oschina-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-oschina-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-outgoing-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-outgoing-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-qingcloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-qingcloud.png -------------------------------------------------------------------------------- /images/inte-guide/sample-rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-rss.png -------------------------------------------------------------------------------- /images/inte-guide/sample-webhook-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-webhook-1.png -------------------------------------------------------------------------------- /images/inte-guide/sample-webhook-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-webhook-2.png -------------------------------------------------------------------------------- /images/inte-guide/sample-webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-webhook.png -------------------------------------------------------------------------------- /images/inte-guide/sample-weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/sample-weibo.png -------------------------------------------------------------------------------- /images/inte-guide/swathub-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/swathub-1.png -------------------------------------------------------------------------------- /images/inte-guide/swathub-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/images/inte-guide/swathub-2.png -------------------------------------------------------------------------------- /manuals/bitbucket-en.md: -------------------------------------------------------------------------------- 1 | 2 | **Step One** Log in Bitbucket, choose "Webhooks" and add a new Webhook. 3 | 4 | **Step two** Fill the "title" you love, and fill the "URL" with [LOCALE_LINK](LOCALE_LINK) provided by talk.ai. 5 | 6 | **Step Three** Write in the name, description and lovely avatar in Talk.ai, and press Save. Horray! 7 | -------------------------------------------------------------------------------- /manuals/bitbucket-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 进入 Bitbucket 仓库设置页面,选择 Webhooks,点击 Add webhook 添加新的 webhook。 3 | 4 | **第二步** 填入合适的 Title,并在 URL 字段中填入 [LOCALE_LINK](LOCALE_LINK)。 5 | 6 | **第三步** 回到简聊,你可以为该 Bitbucket 聚合自定义名称、描述和头像。修改后点击保存。 7 | -------------------------------------------------------------------------------- /manuals/bughd-en.md: -------------------------------------------------------------------------------- 1 | 1. Click "添加 WebHook" on "项目设置"——>"WebHook 设置" 2 | 3 | ![BugHD_01.png](http://firclub.qiniudn.com/FrT1YQ6n3qT59krHcKpOmVLw9kD2) 4 | 5 | 2. Choose BugHD integration of jianliao.com, receive your webhook url. 6 | 7 | ![BugHD_02.png](http://firclub.qiniudn.com/FoBxaOiU1rv1tv0g6eRrwRMSdk32) 8 | 9 | 3. Add webhook url to your BugHD's project 10 | 11 | ![BugHD_03.png](http://firclub.qiniudn.com/Foon44cwCbEZlj_GldFEPfdAv4Ow) 12 | 13 | ![BugHD_04.png](http://firclub.qiniudn.com/Fp9eei7EZeq4yxwA4eQhMSPvclIi) 14 | -------------------------------------------------------------------------------- /manuals/bughd-zh.md: -------------------------------------------------------------------------------- 1 | ### 第一步:在项目的"项目设置"——>"WebHook 设置"中点击"添加 WebHook" 2 | 3 | ![BugHD_01.png](http://firclub.qiniudn.com/FrT1YQ6n3qT59krHcKpOmVLw9kD2) 4 | ### 第二步:在简聊的聚合服务中选择BugHD,获取 Webhook地址 5 | 6 | ![BugHD_02.png](http://firclub.qiniudn.com/FoBxaOiU1rv1tv0g6eRrwRMSdk32) 7 | 8 | ### 第三步:在 Webhook 地址处添加简聊的 WebHook地址 9 | 10 | ![BugHD_03.png](http://firclub.qiniudn.com/Foon44cwCbEZlj_GldFEPfdAv4Ow) 11 | 12 | 配置成功后显示WebHook 列表,可在列表新增,修改或者关闭 Webhook 消息推送。 13 | ![BugHD_04.png](http://firclub.qiniudn.com/Fp9eei7EZeq4yxwA4eQhMSPvclIi) -------------------------------------------------------------------------------- /manuals/buildkite-en.md: -------------------------------------------------------------------------------- 1 | **First Step** Click Settings - Notifications and add a webhook url 2 | 3 | ![](/images/inte-guide/buildkite-1.png) 4 | 5 | **Second Step** Fill in the webhook url [LOCALE_LINK](LOCALE_LINK) and click save. 6 | 7 | ![](/images/inte-guide/buildkite-2.png) 8 | 9 | **Third Step** The optional token will be used if you set token in settings of the integration. 10 | -------------------------------------------------------------------------------- /manuals/buildkite-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 在 buildkite.com 选择 Settings - Notifications,点击添加 Webhook 3 | 4 | ![](/images/inte-guide/buildkite-1.png) 5 | 6 | **第二步** 在输入框中粘贴 [LOCALE_LINK](LOCALE_LINK),点击保存。 7 | 8 | ![](/images/inte-guide/buildkite-2.png) 9 | 10 | **第三步** 如果你在简聊中填写 token,则会被用作校验。 11 | -------------------------------------------------------------------------------- /manuals/circleci-en.md: -------------------------------------------------------------------------------- 1 | Configure webhook in your [circle.yml](https://circleci.com/docs/configuration#notify) file. 2 | 3 | ```yml 4 | notify: 5 | webhooks: 6 | # A list of hook hashes, containing the url field 7 | - url: LOCALE_LINK 8 | ``` 9 | -------------------------------------------------------------------------------- /manuals/circleci-zh.md: -------------------------------------------------------------------------------- 1 | 你可以在项目中配置 [circle.yml](https://circleci.com/docs/configuration#notify) 来让 Circle CI 构建后发送 Webhook 请求: 2 | 3 | ```yml 4 | notify: 5 | webhooks: 6 | # A list of hook hashes, containing the url field 7 | - url: LOCALE_LINK 8 | ``` 9 | -------------------------------------------------------------------------------- /manuals/cloudinsight-en.md: -------------------------------------------------------------------------------- 1 | 1. Login [OneAPM](http://www.oneapm.com/), then select [Cloud Insight](https://cloud.oneapm.com). 2 | ![](/images/inte-guide/sample-cloudinsight-1.png) 3 | 4 | 2. Follow step : [设置] -> [配置平台服务] -> [简聊]. 5 | ![](/images/inte-guide/sample-cloudinsight-2.png) 6 | 7 | 3. Click [简聊] LOGO, and copy [Generate WebHook url] in current page to clipboard. 8 | ![](/images/inte-guide/sample-cloudinsight-3.png) 9 | 10 | 4. Paste the content of clipboard to input form, finally click [提交] to finish setup. 11 | ![](/images/inte-guide/sample-cloudinsight-4.png) -------------------------------------------------------------------------------- /manuals/cloudinsight-zh.md: -------------------------------------------------------------------------------- 1 | 1. 登录 [OneAPM](http://www.oneapm.com/),并选择 [Cloud Insight](https://cloud.oneapm.com)。 2 | ![](/images/inte-guide/sample-cloudinsight-1.png) 3 | 4 | 2. 前往「设置」•「配置平台服务」,找到简聊。 5 | ![](/images/inte-guide/sample-cloudinsight-2.png) 6 | 7 | 3. 单击简聊 LOGO,并复制简聊中「生成 WebHook 地址」至剪切板。 8 | ![](/images/inte-guide/sample-cloudinsight-3.png) 9 | 10 | 4. 粘贴剪切板内容至输入框,并点击「提交」。 11 | ![](/images/inte-guide/sample-cloudinsight-4.png) -------------------------------------------------------------------------------- /manuals/codeship-en.md: -------------------------------------------------------------------------------- 1 | **First step** Click "Project Settings" of your codeship's project, choose "Notifications". 2 | ![](/images/inte-guide/sample-codeship-1.png) 3 | 4 | **Second step** Find "webhook" tab, choose "Enabled" and paste webhook LOCALE_LINK to the input box. Click button to save the settings. 5 | ![](/images/inte-guide/sample-codeship-2.png) 6 | 7 | **Third step** Then you can customize name, description and logo of your integration in Jianliao.com. 8 | -------------------------------------------------------------------------------- /manuals/codeship-zh.md: -------------------------------------------------------------------------------- 1 | **第一步** 在 codeship.com 中进入想要推送消息的项目,点击右上角的 "Project Settings", 选择 "Notifications" 2 | ![](/images/inte-guide/sample-codeship-1.png) 3 | 4 | **第二步** 找到列表最下方的"webhook"卡片,勾选"Enabled",并在"Webhook URL"输入框中粘贴:[LOCALE_LINK](LOCALE_LINK),点击保存。 5 | 现在 codeship.com 已经能推送消息到简聊相应话题。 6 | ![](/images/inte-guide/sample-codeship-2.png) 7 | 8 | **第三步** 回到简聊,你可以为该 codeship.com 聚合自定义名称、描述和头像。修改后点击保存。 9 | -------------------------------------------------------------------------------- /manuals/coding-en.md: -------------------------------------------------------------------------------- 1 | 2 | **First Step** To enable notifications for Coding.net, locate project settings. Select WebHook to add a new one. 3 | ![](/images/inte-guide/sample-coding-1.png) 4 | 5 | **Second Step** Copy & paste the following link to the input box: [LOCALE_LINK](LOCALE_LINK) 6 | Save and Talk will receive relative notification from Coding.net. 7 | ![](/images/inte-guide/sample-coding-2.png) 8 | 9 | **Third Step** Go back here, customize name, description and icon, then save your preference. Coding.net integration message will be pushed to your selected topic as the screenshot below. 10 | ![](/images/inte-guide/notice-coding.png) 11 | -------------------------------------------------------------------------------- /manuals/coding-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 在 Coding.net 中进入想要推送消息的项目,选择设置下的WebHook。选择 点击添加 3 | ![](/images/inte-guide/sample-coding-1.png) 4 | 5 | **第二步** 在输入框中粘贴:[LOCALE_LINK](LOCALE_LINK),点击保存。 6 | 现在 Coding.net 已经能推送消息到简聊相应话题。 7 | ![](/images/inte-guide/sample-coding-2.png) 8 | 9 | **第三步** 回到简聊,你可以为该 Coding.net 聚合自定义名称、描述和头像。修改后点击保存。 10 | Coding.net的聚合消息将如下图展示。 11 | ![](/images/inte-guide/notice-coding.png) 12 | -------------------------------------------------------------------------------- /manuals/csdn-en.md: -------------------------------------------------------------------------------- 1 | **First step** Click "Project Settings" of your csdn's project. 2 | ![](/images/inte-guide/sample-csdn-1.png) 3 | 4 | **Second step** Find "Web URL" table, and paste webhook LOCALE_LINK to the input box.And then click the 'Add' button to save the settings. 5 | ![](/images/inte-guide/sample-csdn-2.png) 6 | 7 | **Third step** Then you can customize name, description and logo of your integration in Jianliao.com. 8 | -------------------------------------------------------------------------------- /manuals/csdn-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 在 code.csdn.net 中进入想要推送消息的项目,点击右上角的"项目设置" 3 | ![](/images/inte-guide/sample-csdn-1.png) 4 | 5 | **第二步** 选择左侧列表中的"Hooks",在右边的"Web URL"栏中的"URL"项的输入框中粘贴:[LOCALE_LINK](LOCALE_LINK),然后点击"添加"按钮.现在 code.csdn.net 已经能推送消息到简聊相应话题。 6 | ![](/images/inte-guide/sample-csdn-2.png) 7 | 8 | **第三步** 回到简聊,你可以为该 code.csdn.net 聚合自定义名称、描述和头像。修改后点击保存。 9 | code.csdn.net的聚合消息将如下图展示。 10 | ![](/images/inte-guide/notice-csdn.png) 11 | -------------------------------------------------------------------------------- /manuals/firim-en.md: -------------------------------------------------------------------------------- 1 | 2 | **First Step** Locate my apps at fir.im, and select the project that you want to get notified. 3 | ![](/images/inte-guide/sample-firim-1.png) 4 | 5 | **Second Step** Select third-party service, locate Talk, then configure integration. 6 | ![](/images/inte-guide/sample-firim-2.png) 7 | 8 | **Third Step** Copy and paste the following link to the input box: [LOCALE_LINK](LOCALE_LINK) 9 | Save and Talk will receive relative notification from fir.im. 10 | ![](/images/inte-guide/sample-firim-3.png) 11 | 12 | **Forth Step** Customize name, description and icon at Talk integration settings, and save your preference. fir.im integration message will be pushed to selected topic as the picture below. 13 | ![](/images/inte-guide/notice-firim.png) 14 | -------------------------------------------------------------------------------- /manuals/firim-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 在 fir.im 中进入"我的应用",点击想要推送消息的项目。 3 | ![](/images/inte-guide/sample-firim-1.png) 4 | 5 | **第二步** 选择第三方服务,点击该项目的"添加配置"。 6 | ![](/images/inte-guide/sample-firim-2.png) 7 | 8 | **第三步** 在输入框中粘贴:[LOCALE_LINK](LOCALE_LINK),点击保存。 9 | 现在 fir.im 已经能推送消息到简聊相应话题。 10 | ![](/images/inte-guide/sample-firim-3.png) 11 | 12 | **第四步** 回到简聊,你可以为该 fir.im 聚合自定义名称、描述和头像。修改后点击保存。 13 | fir.im 的聚合消息将如下图展示。 14 | ![](/images/inte-guide/notice-firim.png) 15 | -------------------------------------------------------------------------------- /manuals/gitcafe-en.md: -------------------------------------------------------------------------------- 1 | **First Step** Locate your project settings at GitCafe. Select Webhooks and Create Webook. 2 | 3 | **Second Step** Copy & paste the following link [LOCALE_LINK](LOCALE_LINK) to the URL Address. Choose the GitCafe events that you want posted to Talk. Save your configuration. 4 | 5 | **Third Step** Go back here, customize name, description and icon, then save your preference. GitCafe integration message will be push to choosen topic. -------------------------------------------------------------------------------- /manuals/gitcafe-zh.md: -------------------------------------------------------------------------------- 1 | **第一步** 在 GitCafe 中进入想要推送消息的项目,选择设置下的 Webhooks,点击创建 webhook 按钮。 2 | 3 | **第二步** 在 Url 地址中输入 [LOCALE_LINK](LOCALE_LINK) ,选择需要推送的事件,然后保存配置。 4 | 5 | **第三步** 回到这里,在下方为该 GitCafe 聚合自定义名称、描述和头像。修改后点击保存。GitCafe 的聚合消息将推送到话题中。 6 | -------------------------------------------------------------------------------- /manuals/gitlab-en.md: -------------------------------------------------------------------------------- 1 | 2 | **First Step** To enable notifications for GitLab, locate WebHook Settings. Copy & paste the following link to the URL input box: [LOCALE_LINK](LOCALE_LINK) 3 | ![](/images/inte-guide/sample-gitlab-1.png) 4 | 5 | **Second Step** Go back here, customize name, description and icon, then save your preference.GitLab integration message will be pushed to your selected topic as the screenshot below. 6 | ![](/images/inte-guide/notice-gitlab.png) 7 | -------------------------------------------------------------------------------- /manuals/gitlab-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 在 GitLab 中进入想要推送消息的项目,选择 Settings下的 WebHooks。在 URL 中粘贴: 3 | [LOCALE_LINK](LOCALE_LINK) 4 | ![](/images/inte-guide/sample-gitlab-1.png) 5 | 6 | **第二步** 回到这里,在下方为该 GitLab 聚合自定义名称、描述和头像。修改后点击保存。GitLab 的聚合消息将如下图展示 7 | ![](/images/inte-guide/notice-gitlab.png) 8 | -------------------------------------------------------------------------------- /manuals/goldxitudaily-en.md: -------------------------------------------------------------------------------- 1 | Gold Daily digg the best of internet technology, you will receive the most popular internet technologies every day after subscribe this feed. 2 | -------------------------------------------------------------------------------- /manuals/goldxitudaily-zh.md: -------------------------------------------------------------------------------- 1 | 稀土掘金日报致力于挖掘最优质的互联网技术,订阅日报后您每天会在中午接收到最新的互联网资讯 2 | -------------------------------------------------------------------------------- /manuals/heroku-en.md: -------------------------------------------------------------------------------- 1 | We'll be adding a deploy hook from the Heroku command-line tool. Log in to Heroku from your command shell and run the following command to set up the HTTP Post hook: 2 | ```shell 3 | $ heroku addons:create deployhooks:http --url LOCALE_LINK 4 | ``` 5 | 6 | Note: If you have multiple Heroku apps, you'll need to specify the app (see below) or run the above command from the app's folder. 7 | ```shell 8 | $ heroku addons:create deployhooks:http --url LOCALE_LINK --app your-heroku-app-name 9 | ``` 10 | -------------------------------------------------------------------------------- /manuals/heroku-zh.md: -------------------------------------------------------------------------------- 1 | 可以手动复制下面的命令然后在终端中执行: 2 | ```shell 3 | $ heroku addons:create deployhooks:http --url LOCALE_LINK 4 | ``` 5 | 6 | 注意: 如果您有多个Heroku应用, 你需要在命令中指定对应的应用. 7 | ```shell 8 | $ heroku addons:create deployhooks:http --url LOCALE_LINK --app your-heroku-app-name 9 | ``` 10 | -------------------------------------------------------------------------------- /manuals/incoming-en.md: -------------------------------------------------------------------------------- 1 | **First Step** WebHook link is [LOCALE_LINK](LOCALE_LINK) 2 | When WebHook receive POST request, the selected topic will receive notification. Here's an example for request-header field and content. 3 | 4 | ```json 5 | { 6 | "authorName": "Stack", // 消息发送者的姓名,如果留空将显示为配置中的聚合标题 7 | "title": "Winter is coming", // 聚合消息标题 8 | "text": "", // 聚合消息正文 9 | "redirectUrl": "https://talk.ai/site", // 跳转链接 10 | "imageUrl": "http://your.image.url" // 消息中可添加一张预览图片 11 | } 12 | ``` 13 | 14 | Here's another example for curl request. 15 | 16 | ```shell 17 | curl -d authorName=小艾 -d title=大家好 -d text=打个招呼吧 -d redirectUrl=https://talk.ai/site LOCALE_LINK 18 | ``` 19 | 20 | **Second Step** Customize name, description and icon. Save your preference. 21 | WebHook integration message will be pushed to selected topics as the picture below. 22 | ![](/images/inte-guide/notice-webhook.png) 23 | -------------------------------------------------------------------------------- /manuals/incoming-zh.md: -------------------------------------------------------------------------------- 1 | **第一步** 生成的webhook地址为 [LOCALE_LINK](LOCALE_LINK) 2 | 该 WebHook 地址收到 POST 请求时,对应的话题中将收到推送通知,请求字段和内容可参考下例: 3 | 4 | ```json 5 | { 6 | "authorName": "Stack", // 消息发送者的姓名,如果留空将显示为配置中的聚合标题 7 | "title": "Winter is coming", // 聚合消息标题 8 | "text": "", // 聚合消息正文 9 | "redirectUrl": "https://talk.ai/site", // 跳转链接 10 | "imageUrl": "http://your.image.url" // 消息中可添加一张预览图片 11 | } 12 | ``` 13 | 14 | 以下例子使用 curl 请求: 15 | 16 | ```shell 17 | curl -d authorName=小艾 -d title=大家好 -d text=打个招呼吧 -d redirectUrl=https://talk.ai/site LOCALE_LINK 18 | ``` 19 | 20 | **第二步** 填写 Incoming Webhook 自定义名称、描述和头像。 21 | 修改后点击保存。消息将如下图所示 22 | 23 | ![](/images/inte-guide/notice-webhook.png) 24 | -------------------------------------------------------------------------------- /manuals/jenkins-en.md: -------------------------------------------------------------------------------- 1 | 1. In your Jenkins dashboard, click on Manage Jenkins from the left navigation. 2 | 3 | ![](/images/inte-guide/jenkins-1.png) 4 | 5 | 2. Click on Manage Plugins 6 | 7 | ![](/images/inte-guide/jenkins-2.png) 8 | 9 | 3. Search for Jianliao and install the plugin. 10 | 11 | ![](/images/inte-guide/jenkins-3.png) 12 | 13 | 4. Go to System Settings after completing installation. Configure Webhook link and 14 | 15 | ![](/images/inte-guide/jenkins-4.png) 16 | 17 | ![](/images/inte-guide/jenkins-5.png) 18 | 19 | 5. Choose Configure from the project’s menu. In the Jianliao Notifications section, choose the events you’d like to be notified about, or configure a single Webhook link for this task. 20 | 21 | ![](/images/inte-guide/jenkins-6.png) 22 | 23 | ![](/images/inte-guide/jenkins-7.png) 24 | 25 | 6. You will get notified from Jenkins after this configuration. 26 | 27 | ![](/images/inte-guide/jenkins-8.png) -------------------------------------------------------------------------------- /manuals/jenkins-zh.md: -------------------------------------------------------------------------------- 1 | 1. 进入 Jenkins 首页,点击左侧系统管理链接 2 | 3 | ![](/images/inte-guide/jenkins-1.png) 4 | 5 | 2. 选择管理插件 6 | 7 | ![](/images/inte-guide/jenkins-2.png) 8 | 9 | 3. 搜索 'jianliao',安装简聊插件 10 | 11 | ![](/images/inte-guide/jenkins-3.png) 12 | 13 | 4. 安装完成后进入系统设置,配置聚合 Webhook 链接和 jenkins 域名以备简聊能正确的跳转回 jenkins 14 | 15 | ![](/images/inte-guide/jenkins-4.png) 16 | 17 | ![](/images/inte-guide/jenkins-5.png) 18 | 19 | 5. 在项目中选择配置菜单,在 Jianliao Notifications 中选择你希望收到推送的事件,也可以此任务配置单独的 Webhook 链接 20 | 21 | ![](/images/inte-guide/jenkins-6.png) 22 | 23 | ![](/images/inte-guide/jenkins-7.png) 24 | 25 | 6. 配置完成后,就可以等待简聊推送构建任务信息啦 26 | 27 | ![](/images/inte-guide/jenkins-8.png) 28 | -------------------------------------------------------------------------------- /manuals/jiankongbao-en.md: -------------------------------------------------------------------------------- 1 | 2 | **First Step** Log in 监控宝, locate 用户中心-通知设置-URL回调, and make sure "开启 URL 回调接收故障告警消息" is checked. 3 | ![](/images/inte-guide/sample-jiankongbao.png) 4 | 5 | **Second Step** Copy & paste the following link to the "URL 回调" input box: [LOCALE_LINK](LOCALE_LINK) . Copy "回调 Token" from 监控宝. 6 | 7 | **Third Step** Go back here, paste it to the Token box. Customize name, description and icon, then save your preference. 8 | 监控宝 integration message will be pushed to your selected topic as the screenshot below. 9 | ![](/images/inte-guide/notice-jiankongbao.png) 10 | -------------------------------------------------------------------------------- /manuals/jiankongbao-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 登录监控宝,进入用户中心-通知设置-URL回调,勾选下方"开启 URL回调接收故障告警消息"。 3 | ![](/images/inte-guide/sample-jiankongbao.png) 4 | 5 | **第二步** 将简聊中生成的 Webhook 地址[LOCALE_LINK](LOCALE_LINK) 6 | 填入回调 URL 框内,复制监控宝处的回调 Token。 7 | 8 | **第三步** 回到简聊,回到简聊,粘贴至回调 Token 框内。你可以为该聚合自定义名称、描述和头像。修改后点击保存。 9 | 监控宝的聚合消息将如下图展示。 10 | ![](/images/inte-guide/notice-jiankongbao.png) 11 | -------------------------------------------------------------------------------- /manuals/jinshuju-en.md: -------------------------------------------------------------------------------- 1 | 2 | **First Step** Log in 金数据, locate the sheet that you want to get notified. Select 数据提交 at 设置 tab. 3 | ![](/images/inte-guide/sample-jinshuju-1.png) 4 | 5 | **Second Step** Scroll down and make sure "将数据以JSON格式发送给第三方" is checked. Copy & paste [LOCALE_LINK](LOCALE_LINK) to "HTTP POST地址". 6 | Save and Talk will receive relative notification from 金数据. 7 | ![](/images/inte-guide/sample-jinshuju-2.png) 8 | 9 | **Third Step** Go back here, customize name, description and icon. Save your preference, and 金数据 integration message will be pushed to selected topics as the picture below. 10 | ![](/images/inte-guide/notice-jinshuju.png) 11 | -------------------------------------------------------------------------------- /manuals/jinshuju-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 登录金数据,进入要推送的表单,选择设置下的数据提交。 3 | ![](/images/inte-guide/sample-jinshuju-1.png) 4 | 5 | **第二步** 拉到页面最下方"将数据以 JSON 格式发送给第三方",打勾,粘贴:[LOCALE_LINK](LOCALE_LINK),保存设置。 6 | 现在金数据已经能推送消息到简聊相应话题。 7 | ![](/images/inte-guide/sample-jinshuju-2.png) 8 | 9 | **第三步** 回到简聊,你可以为金数据聚合自定义名称、描述和头像。修改后点击保存。 10 | 金数据的聚合消息将如下图展示。 11 | ![](/images/inte-guide/notice-jinshuju.png) 12 | -------------------------------------------------------------------------------- /manuals/jira-en.md: -------------------------------------------------------------------------------- 1 | 2 | **Step One** login on to Jira as system admin , find the gear on the top right side, choose "System" 3 | 4 | **Step Two** on the left side of the page, find "Webhooks" in "Advanced" 5 | 6 | **Step Three** add a new Webhook, fill URL with [LOCALE_LINK](LOCALE_LINK), check what issues you need in Events and press Save. Horray! 7 | -------------------------------------------------------------------------------- /manuals/jira-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 使用系统管理员身份登录JIRA,找到系统设置,选择System。 3 | 4 | **第二步** 在左侧 Advanced 中找到 WebHooks。 5 | 6 | **第三步** 添加新的 Webhook,在URL中填入[LOCALE_LINK](LOCALE_LINK),根据需要配置 Events 中 Issue,最后保存 WebHook 完成配置。 7 | -------------------------------------------------------------------------------- /manuals/jobtong-en.md: -------------------------------------------------------------------------------- 1 | 1. Log in Jobtong by enterprise account,locate 账号设置->简聊Webhook 2 | 3 | ![](/images/inte-guide/jobtong-1.png) 4 | 5 | 2. Copy and paste Talk.ai's LOCALE_LINK to the "Webhook URL" input box, then click the "提交" button. 6 | -------------------------------------------------------------------------------- /manuals/jobtong-zh.md: -------------------------------------------------------------------------------- 1 | 1. 登陆周伯通的企业账号,进入账号设置->简聊Webhook 2 | 3 | ![](/images/inte-guide/jobtong-1.png) 4 | 5 | 2. 将简聊中生成的 Webhook 地址 LOCALE_LINK 填入 “Webhook URL” 框内,并点击提交。 6 | -------------------------------------------------------------------------------- /manuals/kf5-en.md: -------------------------------------------------------------------------------- 1 | 1. Login with KF5.com, go to Feature Settings (功能管理)> Notification Target Webhook (提醒目标Webhook). 2 | 3 | ![](/images/inte-guide/kf5-1.png) 4 | 5 | 2. In the redirect page, click on the Add New Notificaition Target(添加新的提醒目标). 6 | 7 | ![](/images/inte-guide/kf5-2.png) 8 | 9 | 3. Select Talk Webhook (简聊Webhook). Fill in target name, Webhook address, name, and integration title. 10 | ![](/images/inte-guide/kf5-3.png) 11 | 12 | 4. Click Test(测试) to run a communication test. 13 | 14 | ![](/images/inte-guide/kf5-4.png) 15 | 16 | ![](/images/inte-guide/kf5-5.png) 17 | 18 | 5. Configure Event Triger Notificaition Target at Feature Settings (功能管理)> Trigger Task(触发器任务). 19 | 20 | ![](/images/inte-guide/kf5-6.png) 21 | 22 | 6. Add several trigger conditions. For example, if create a ticket, then send a message to intended target. 23 | 24 | ![](/images/inte-guide/kf5-7.png) 25 | -------------------------------------------------------------------------------- /manuals/kf5-zh.md: -------------------------------------------------------------------------------- 1 | 1. 在您的逸创云客服平台中,进入 功能管理> 提醒目标webhook 2 | 3 | ![](/images/inte-guide/kf5-1.png) 4 | 5 | 2. 在打开的页面中点击 添加新的提醒目标 6 | 7 | ![](/images/inte-guide/kf5-2.png) 8 | 9 | 3. 在提醒目标里选择简聊webhook,在配置表单中,填写提醒目标名称,输入WEBHOOK地址,姓名,及聚合信息标题 10 | 11 | ![](/images/inte-guide/kf5-3.png) 12 | 13 | 4. 填写完后点击右下角按钮进行通信测试 14 | 15 | ![](/images/inte-guide/kf5-4.png) 16 | 17 | ![](/images/inte-guide/kf5-5.png) 18 | 19 | 5. 在功能管理 > 触发器任务,配置事件触发提醒目标 20 | 21 | ![](/images/inte-guide/kf5-6.png) 22 | 23 | 6. 添加一个或多个触发器,设置适当的条件,如: 工单被创建,执行动作设置为 发送消息到指定目标 简聊webhook(您之前取的提醒目标名称) 24 | 25 | ![](/images/inte-guide/kf5-7.png) 26 | -------------------------------------------------------------------------------- /manuals/magnumci-en.md: -------------------------------------------------------------------------------- 1 | Configure webhook in your Magnum-CI projects. 2 | 3 | ![](/images/inte-guide/magnumci-1.png) 4 | -------------------------------------------------------------------------------- /manuals/magnumci-zh.md: -------------------------------------------------------------------------------- 1 | 你可以在 Magnum CI 的项目中配置 Webhook 链接来接收消息推送 2 | 3 | ![](/images/inte-guide/magnumci-1.png) 4 | -------------------------------------------------------------------------------- /manuals/mailgun-en.md: -------------------------------------------------------------------------------- 1 | 1. Login [Mailgun](https://www.mailgun.com) and click webhook tab 2 | 3 | ![](/images/inte-guide/mailgun-1.png) 4 | 5 | 2. Add a new webhooks event,input your webhooks address. 6 | -------------------------------------------------------------------------------- /manuals/mailgun-zh.md: -------------------------------------------------------------------------------- 1 | 1. 登录 [Mailgun](https://www.mailgun.com),点击 webhook 标签 2 | 3 | ![](/images/inte-guide/mailgun-1.png) 4 | 5 | 2. 新建一个 Webhook 事件,将「简聊」生成的 Webhook 地址填入 6 | -------------------------------------------------------------------------------- /manuals/mikecrm-en.md: -------------------------------------------------------------------------------- 1 | 1. Enter the webhook page of MikeCRM, click "set URL" button. (Webhook URL: http://www.mikecrm.com/webhookSetting.php) 2 | 3 | ![](/images/inte-guide/mikecrm-1.png) 4 | 5 | 2. Fill in the url (LOCALE_LINK) which generated by jianliao.com and save the settings. 6 | 7 | ![](/images/inte-guide/mikecrm-2.jpeg) 8 | -------------------------------------------------------------------------------- /manuals/mikecrm-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第1步** 进入麦客CRM的Webhook设置页面,在需要设置的表单后面点击"设置URL" 按钮。 ( webhook 地址: http://www.mikecrm.com/webhookSetting.php ) 3 | ![](/images/inte-guide/mikecrm-1.png) 4 | 5 | **第2步** 在对话框中输入简聊生成的链接 () 后点击“添加”完成并保存配置,即可收到来自麦客CRM的表单反馈信息。 6 | ![](/images/inte-guide/mikecrm-2.jpeg) -------------------------------------------------------------------------------- /manuals/newrelic-en.md: -------------------------------------------------------------------------------- 1 | 1. Log into New Relic, click Alerts in the upper bar, click Notification Channels, then click Create. 2 | 3 | ![](/images/inte-guide/newrelic-1.png) 4 | 5 | 2. Choose Webhook from the channel list, and click Create. 6 | 7 | ![](/images/inte-guide/newrelic-2.png) 8 | 9 | 3. Put in the WebHooks generated URL. 10 | 11 | ![](/images/inte-guide/newrelic-3.png) 12 | 13 | 4. Click Use Custom Payload, Default payload is recommended, and JSON format, done. 14 | 15 | ![](/images/inte-guide/newrelic-4.png) 16 | 17 | 5. Now you can add this channel to Alert policies. 18 | -------------------------------------------------------------------------------- /manuals/newrelic-zh.md: -------------------------------------------------------------------------------- 1 | 1. 登录 New Relic, 点击上方按钮 Alerts, 选择 Notification Channels, 点击按钮 Create. 2 | 3 | ![](/images/inte-guide/newrelic-1.png) 4 | 5 | 2. 在 Channels 列表中找到 Webhook, 点击按钮 Create. 6 | 7 | ![](/images/inte-guide/newrelic-2.png) 8 | 9 | 3. 将「简聊」生成的 WebHooks 地址输入到 URL 输入框. 10 | 11 | ![](/images/inte-guide/newrelic-3.png) 12 | 13 | 4. 点击 Use Custom Payload, 使用默认值, JSON格式, 创建成功. 14 | 15 | ![](/images/inte-guide/newrelic-4.png) 16 | 17 | 5. 然后就可以在 Alert policies 中使用这条渠道了. 18 | -------------------------------------------------------------------------------- /manuals/oschina-en.md: -------------------------------------------------------------------------------- 1 | 2 | **First Step** Click the 'Manage' button of your project in git.oschina.net 3 | ![](/images/inte-guide/sample-oschina-1.png) 4 | 5 | **Second Step** Choose "Push Hooks", check "Enable Hooks", and paste webhook LOCALE_LINK to the input box. Click button to save the settings. 6 | ![](/images/inte-guide/sample-oschina-2.png) 7 | 8 | **Third step** Then you can customize name, description and logo of your integration in Jianliao.com. -------------------------------------------------------------------------------- /manuals/oschina-zh.md: -------------------------------------------------------------------------------- 1 | 2 | **第一步** 在 git.oschina.net 中进入想要推送消息的项目,点击右上角的"管理" 3 | ![](/images/inte-guide/sample-oschina-1.png) 4 | 5 | **第二步** 选择左侧列表的"Push钩子",勾选"开启钩子",并在"钩子地址"输入框中粘贴:[LOCALE_LINK](LOCALE_LINK),点击保存。 6 | 现在 git.oschina.net 已经能推送消息到简聊相应话题。 7 | ![](/images/inte-guide/sample-oschina-2.png) 8 | 9 | **第三步** 回到简聊,你可以为该 git.oschina.net 聚合自定义名称、描述和头像。修改后点击保存。 10 | git.oschina.net的聚合消息将如下图展示。 11 | ![](/images/inte-guide/notice-oschina.png) 12 | -------------------------------------------------------------------------------- /manuals/outgoing-en.md: -------------------------------------------------------------------------------- 1 | When a message is sent to the bind topic (integration messages, system messages, files are not included), a POST will be sent to the configured URL. 2 | 3 | Message Structure 4 | 5 | ```json 6 | { 7 | "_id": "549908a78cd040715c48caf2", 8 | "body": "Winter is coming", // Message Body 9 | "room": { 10 | "_id": "549908a68cd040715c48cadf", 11 | "topic": "Game of Throne", // Topic Name 12 | "email": "room.r2e29c2a0@talk.ai" // Topic Email Address 13 | // … 14 | }, 15 | "creator": { 16 | "_id": "549908a68cd040715c48cad1", 17 | "name": "Stack" // Sender’s Name 18 | // … 19 | }, 20 | "_teamId": "549908a68cd040715c48cad3", // Team ID 21 | "createdAt": "2014-12-23T06:16:06.999Z", // Date Created 22 | "updatedAt": "2014-12-23T06:16:06.999Z" // Date Modified 23 | // … 24 | } 25 | ``` 26 | 27 | If the handler wishes to post a response, the following JSON should be returned as the body of the response. 28 | 29 | ```json 30 | { 31 | "text": "Got it", // Message reply 32 | "authorName": "Little Finger", // Name display in the reply (optional) 33 | "redirectUrl": "http://you.service.com" // Link redirect (optianal) 34 | } 35 | ``` 36 | 37 | ![](/images/inte-guide/sample-outgoing-1.png) 38 | -------------------------------------------------------------------------------- /manuals/outgoing-zh.md: -------------------------------------------------------------------------------- 1 | 当被绑定话题中成员发送消息时(聚合消息,系统消息与文件上传不在此列),简聊会给你配置的链接发送一个 POST 请求 2 | 3 | 消息结构 4 | 5 | ```json 6 | { 7 | "_id": "549908a78cd040715c48caf2", 8 | "body": "Winter is coming", // 消息正文 9 | "room": { 10 | "_id": "549908a68cd040715c48cadf", 11 | "topic": "Game of Throne", // 话题名称 12 | "email": "room.r2e29c2a0@talk.ai" // 话题绑定邮箱 13 | // ... 14 | }, 15 | "creator": { 16 | "_id": "549908a68cd040715c48cad1", 17 | "name": "Stack" // 发送者姓名 18 | // ... 19 | }, 20 | "_teamId": "549908a68cd040715c48cad3", // 团队 id 21 | "createdAt": "2014-12-23T06:16:06.999Z", // 创建时间 22 | "updatedAt": "2014-12-23T06:16:06.999Z" // 更新时间 23 | // ... 24 | } 25 | ``` 26 | 27 | 如果你希望给这条消息发送一个回复,需要以 JSON 格式返回响应内容,在结果中包含以下结构 28 | 29 | ```json 30 | { 31 | "text": "Got it", // 回复消息内容 32 | "authorName": "Little Finger", // 在回复消息中显示的用户名(可选) 33 | "redirectUrl": "http://you.service.com" // 跳转链接(可选) 34 | } 35 | ``` 36 | 37 | ![](/images/inte-guide/sample-outgoing-1.png) 38 | -------------------------------------------------------------------------------- /manuals/pingxx-en.md: -------------------------------------------------------------------------------- 1 | 1.Visit [Dashboard](https://dashboard.pingxx.com). Click your profile on the upper-right corner, Select "Webhooks" 2 | 3 | 2.Add a new Webhooks event,input the talk.ai Generated Webhooks address, app name , Live/Test mode, and events。 4 | 5 | ![](/images/inte-guide/pingxx-1.jpeg) 6 | -------------------------------------------------------------------------------- /manuals/pingxx-zh.md: -------------------------------------------------------------------------------- 1 | 1. 访问 [Dashboard](https://dashboard.pingxx.com),点击右上角头像,选择 Webhooks 2 | 3 | 2. 新建一个 Webhooks 事件,将「简聊」生成的 Webhooks 地址填入,设置好模式、对象和事件类型。 4 | 5 | ![](/images/inte-guide/pingxx-1.jpeg) 6 | -------------------------------------------------------------------------------- /manuals/qingcloud-en.md: -------------------------------------------------------------------------------- 1 | 1. Enter the setting page of webhook URL and complete your settings. 2 | 3 | ![webhook page](/images/inte-guide/sample-qingcloud.png) 4 | -------------------------------------------------------------------------------- /manuals/qingcloud-zh.md: -------------------------------------------------------------------------------- 1 | 监控告警功能是基于资源层面的监控数据,设置告警条件和通知列表, 有助于及时了解资源使用情况和处理突发事件。 2 | 3 | Webhook 可以让你的系统直接收到青云的通知。当监控告警发生时,青云系统会以 HTTP POST 的方式将通知信息发送到指定 URL ,你可以在这个 URL 的接收逻辑中自行处理通知信息。 4 | 5 | 每加入一条新的 Webhook URL 都需要先进行验证。验证方法是在 URL Response 中返回指定的 token ,一旦通过验证就无需再在 Response 中保留这个 token 。 每个 URL 对于同一个用户只需验证一次。 6 | 7 | ![webhook 设置界面](/images/inte-guide/sample-qingcloud.png) -------------------------------------------------------------------------------- /manuals/swathub-en.md: -------------------------------------------------------------------------------- 1 | **Step 1** Login SWATHub, enter your workspace -> settings -> integrations, click the plus icon in the Talk.ai entry. 2 | {Image 1} 3 | 4 | **Step 2** Copy and Webhook URL generated by Talk.ai, paste it into the popup dialog and then save the changes. 5 | 6 | **Step 3** Go back to Talk.ai, customize your own title, description and icon for the SWATHub integration. The push message looks like the below. 7 | {Image 2} 8 | -------------------------------------------------------------------------------- /manuals/swathub-zh.md: -------------------------------------------------------------------------------- 1 | **第一步** 登录SWATHub,进入相关项目->设置->服务集成,点击简聊服务右方的添加按钮,即显示下图中的对话框。 2 | 3 | ![](/images/inte-guide/swathub-1.png) 4 | 5 | **第二步** 将简聊中生成的Webhook地址填入上图中的对话框,点击增加。 6 | 7 | **第三步** 回到简聊,你可以继续为聚合服务设置自定义名称、描述和头像,点击保存修改。SWATHub的聚合信息将如下图所示。 8 | 9 | ![](/images/inte-guide/swathub-2.png) 10 | -------------------------------------------------------------------------------- /manuals/travis-en.md: -------------------------------------------------------------------------------- 1 | Please put this url "LOCALE_LINK" in your .travis.yml file: 2 | 3 | ```yml 4 | notifications: 5 | webhooks: 6 | - LOCALE_LINK 7 | ``` 8 | -------------------------------------------------------------------------------- /manuals/travis-zh.md: -------------------------------------------------------------------------------- 1 | 在 .travis.yml 文件中配置 notifications 节点,添加简聊 Webhook URL: LOCALE_LINK 2 | 3 | ```yml 4 | notifications: 5 | webhooks: 6 | - LOCALE_LINK 7 | ``` 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "talk-services", 3 | "version": "3.1.2", 4 | "description": "talk-services", 5 | "main": "./lib/loader.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "NODE_ENV=test ./node_modules/.bin/mocha --require coffee-script/register --require should --reporter spec test/main.coffee", 11 | "prepublish": "rm -rf lib && coffee -o lib -c src", 12 | "deploy": "npm run uploadcdn && npm publish", 13 | "doc": "cd docs && gitbook build", 14 | "uploadcdn": "osscmd uploadfromdir images oss://dn-talk/images" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git@github.com:teambition/talk-services.git" 19 | }, 20 | "author": { 21 | "name": "Xu Jingxin", 22 | "email": "sailxjx@gmail.com" 23 | }, 24 | "license": "MIT", 25 | "devDependencies": { 26 | "body-parser": "^1.14.1", 27 | "express": "^4.13.3", 28 | "mocha": "^2.3.4", 29 | "should": "^7.1.1" 30 | }, 31 | "dependencies": { 32 | "bluebird": "^3.0.5", 33 | "charset": "^1.0.0", 34 | "coffee-script": "^1.10.0", 35 | "err1st": "^0.2.5", 36 | "feedparser": "^1.1.4", 37 | "glob": "^6.0.1", 38 | "graceful-logger": "^0.4.3", 39 | "he": "^0.5.0", 40 | "iconv-lite": "^0.4.13", 41 | "jschardet": "^1.4.1", 42 | "lodash": "^3.10.1", 43 | "marked": "^0.3.5", 44 | "moment": "^2.10.6", 45 | "moment-timezone": "^0.4.1", 46 | "request": "^2.67.0", 47 | "require-dir": "^0.3.0", 48 | "validator": "^4.3.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/loader.coffee: -------------------------------------------------------------------------------- 1 | Promise = require 'bluebird' 2 | Err = require 'err1st' 3 | 4 | class ServiceLoader 5 | 6 | config: {} 7 | 8 | $_services: {} 9 | 10 | ###* 11 | * Load a service 12 | * @param {String} name - Service name 13 | * @param {Function} regFn - Register function, if this function is not exists, auto load the service from module 14 | * @return {Promise} Service instance 15 | ### 16 | load: (name, regFn) -> 17 | unless @$_services[name] 18 | 19 | Service = require './service' 20 | 21 | @$_services[name] = Promise.resolve(new Service(name)).then (service) -> 22 | 23 | Promise.resolve(service.register()).then -> 24 | try 25 | initializer = require "./services/#{name}" 26 | catch err 27 | unless toString.call(regFn) is '[object Function]' 28 | throw new Err("INVALID_SERVICE", name) 29 | return 30 | initializer.call service, service 31 | .then -> service 32 | 33 | if toString.call(regFn) is '[object Function]' 34 | @$_services[name] = @$_services[name].then (service) -> 35 | Promise.resolve(regFn.call service, service) 36 | .then -> service 37 | 38 | @$_services[name] 39 | 40 | loader = new ServiceLoader 41 | 42 | module.exports = loader 43 | -------------------------------------------------------------------------------- /src/services/bughd.coffee: -------------------------------------------------------------------------------- 1 | moment = require 'moment-timezone' 2 | 3 | util = require '../util' 4 | 5 | _receiveWebhook = ({body}) -> 6 | payload = body 7 | return unless (payload.user_name == 'BugHD') 8 | info = payload.datas[0] 9 | title = "#{info.project_name} #{info.project_version}" 10 | text = "" 11 | text += "TITLE: #{info.issue_title}\n" if info.issue_title 12 | text += "STACK: #{info.issue_stack}\n" if info.issue_stack 13 | text += "CREATED_AT: #{moment(Number(info.created_at) * 1000).tz('Asia/Shanghai').format('YYYY-MM-DD hh:mm:ss')}" if info.created_at 14 | 15 | message = 16 | attachments: [ 17 | category: 'quote' 18 | data: 19 | title: title 20 | text: text 21 | redirectUrl: if info.uri?.length then info.uri else undefined 22 | ] 23 | 24 | message 25 | 26 | module.exports = -> 27 | 28 | @title = 'BugHD' 29 | 30 | @template = 'webhook' 31 | 32 | @summary = util.i18n 33 | zh: '实时收集应用崩溃信息,定位应用崩溃原因。' 34 | en: 'BugHD is a real-time crashes collection tool, it can find out the reasons of app crashes.' 35 | 36 | @description = util.i18n 37 | zh: 'BugHD 可实时收集应用崩溃信息,帮你定位应用崩溃原因。可提供详尽的崩溃分析报告,快速地定位崩溃到代码行。' 38 | en: 'BugHD is a real-time crashes collection tool, it can find out the reasons of app crashes. 39 | It also provides detailed reports of crash analysis, which can help you find out the wrong lines of code quickly.' 40 | 41 | @iconUrl = util.static 'images/icons/bughd@2x.png' 42 | 43 | @_fields.push 44 | key: 'webhookUrl' 45 | type: 'text' 46 | readonly: true 47 | description: util.i18n 48 | zh: '复制 web hook 地址到你的 BugHD 中使用。' 49 | en: 'Copy this web hook to your BugHD account to use it.' 50 | 51 | @registerEvent 'service.webhook', _receiveWebhook 52 | -------------------------------------------------------------------------------- /src/services/buildkite.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _receiveWebhook = ({integration, body, headers}) -> 4 | payload = body or {} 5 | build = payload.build or {} 6 | project = payload.project or {} 7 | 8 | return unless build.state and project.name 9 | 10 | if integration.token and headers["X-Buildkite-Token"] isnt integration.token 11 | throw new Error('Invalid token') 12 | 13 | title = "[#{build.state}] " + 14 | "#{project.name} ##{build.number} " + 15 | "(#{build.branch} - #{build.commit?[0...7]}) by #{payload.sender?.name}" 16 | 17 | message = 18 | attachments: [ 19 | category: 'quote' 20 | data: 21 | title: title 22 | text: build.message 23 | redirectUrl: build.web_url 24 | ] 25 | 26 | message 27 | 28 | module.exports = -> 29 | 30 | @title = 'Buildkite' 31 | 32 | @template = 'webhook' 33 | 34 | @summary = util.i18n 35 | zh: '持续集成服务' 36 | en: 'A continuous integration service.' 37 | 38 | @description = util.i18n 39 | zh: 'Buildkite 是一个在线的持续集成服务,用来构建及测试你的代码。' 40 | en: 'Buildkite is a continuous integration service.' 41 | 42 | @iconUrl = util.static 'images/icons/buildkite@2x.png' 43 | 44 | @_fields.push 45 | key: 'token' 46 | type: 'text' 47 | description: util.i18n 48 | zh: '可选' 49 | en: 'Optional' 50 | 51 | @_fields.push 52 | key: 'webhookUrl' 53 | type: 'text' 54 | readonly: true 55 | description: util.i18n 56 | zh: '复制 web hook 地址到 buildkite.com 中使用' 57 | en: 'Copy this web hook to your buildkite.com to use it.' 58 | 59 | @registerEvent 'service.webhook', _receiveWebhook 60 | -------------------------------------------------------------------------------- /src/services/circleci.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _receiveWebhook = ({body}) -> 4 | payload = body?.payload 5 | 6 | return unless payload 7 | 8 | message = {} 9 | attachment = category: 'quote', data: {} 10 | 11 | if payload?.outcome is 'success' 12 | attachment.data.title = "[#{payload.reponame}] Build success: #{payload.subject}" 13 | else 14 | attachment.data.title = "[#{payload.reponame}] Build fail: #{payload.outcome}" 15 | if toString.call(payload.messages) is '[object Array]' 16 | attachment.data.text = payload.messages?.map (message) -> message?.message or '' 17 | .join '
' 18 | 19 | attachment.data.redirectUrl = payload.build_url 20 | message.attachments = [attachment] 21 | message 22 | 23 | module.exports = -> 24 | 25 | @title = 'Circle CI' 26 | 27 | @template = 'webhook' 28 | 29 | @summary = util.i18n 30 | zh: '持续集成平台' 31 | en: 'Hosted Continuous Integration for web applications.' 32 | 33 | @description = util.i18n 34 | zh: '持续集成平台' 35 | en: 'Hosted Continuous Integration for web applications. Set up your application for testing in one click, on the fastest testing platform on the internet.' 36 | 37 | @iconUrl = util.static 'images/icons/circleci@2x.png' 38 | 39 | @_fields.push 40 | key: 'webhookUrl' 41 | type: 'text' 42 | readonly: true 43 | description: util.i18n 44 | zh: '复制 web hook 地址到 .circle.yml 中使用。' 45 | en: 'Copy this web hook to .circle.yml to use it.' 46 | 47 | @registerEvent 'service.webhook', _receiveWebhook 48 | -------------------------------------------------------------------------------- /src/services/cloudinsight.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | util = require '../util' 3 | 4 | _receiveWebhook = ({query, body}) -> 5 | payload = _.assign {} 6 | , query or {} 7 | , body or {} 8 | 9 | {content, authorName, title, text, redirectUrl, imageUrl} = payload 10 | 11 | throw new Error("Title and text can not be empty") unless title?.length or text?.length or content?.length 12 | 13 | message = 14 | body: content 15 | authorName: authorName 16 | 17 | if title or text or redirectUrl or imageUrl 18 | message.attachments = [ 19 | category: 'quote' 20 | data: 21 | title: title 22 | text: text 23 | redirectUrl: redirectUrl 24 | imageUrl: imageUrl 25 | ] 26 | 27 | message 28 | 29 | module.exports = -> 30 | 31 | @title = 'Cloud Insight' 32 | 33 | @template = 'webhook' 34 | 35 | @summary = util.i18n 36 | zh: '系统监控工具' 37 | en: 'System Monitoring Tool' 38 | 39 | @description = util.i18n 40 | zh: 'Cloud Insight 是一个次世代系统监控工具,支持 Ubuntu 多种操作系统监控,MySQL 多种数据库监控,和 Tomcat 多种中间件监控,以及 Docker Mesos 的监控。' 41 | en: 'Cloud Insight is a next-generation system monitoring tool which supports operation system monitoring, like Ubuntu, CentOS and so on. In addition, it also can used in database and middleware monitoring including 28 integrations such as Tomcat, Docker, Mesos etc.' 42 | 43 | @iconUrl = util.static 'images/icons/cloudinsight@2x.png' 44 | 45 | @_fields.push 46 | key: 'webhookUrl' 47 | type: 'text' 48 | readOnly: true 49 | description: util.i18n 50 | zh: '复制 web hook 地址到你的 cloud insight 当中使用。你也可以在管理界面当中找到这个 web hook 地址。' 51 | en: 'Copy this web hook to your Cloud Insight to use it. You may also find this url in the manager tab。' 52 | 53 | @registerEvent 'service.webhook', _receiveWebhook 54 | -------------------------------------------------------------------------------- /src/services/email.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | module.exports = -> 4 | 5 | @title = 'Email' 6 | 7 | @isHidden = true 8 | 9 | @iconUrl = util.static 'images/icons/email@2x.png' 10 | -------------------------------------------------------------------------------- /src/services/firim.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _receiveWebhook = ({integration, body}) -> 4 | payload = body 5 | return unless payload.msg 6 | title = "fir.im: #{payload.msg}" 7 | text = "" 8 | text += "BUILD #{payload.build}\n" if payload.build 9 | text += "PLATFORM #{payload.platform}\n" if payload.platform 10 | text += "CHANGELOG\n#{payload.changelog}" if payload.changelog?.length 11 | 12 | message = 13 | attachments: [ 14 | category: 'quote' 15 | data: 16 | title: title 17 | text: text 18 | redirectUrl: payload.link 19 | userAvatarUrl: payload.icon 20 | imageUrl: 'https://tools.teambition.net/qr.png?text=' + encodeURIComponent payload.link 21 | ] 22 | 23 | message 24 | 25 | module.exports = -> 26 | 27 | @title = 'fir.im' 28 | 29 | @template = 'webhook' 30 | 31 | @summary = util.i18n 32 | zh: 'App 免费内测托管平台。' 33 | en: 'fir.im is a beta testing platform that distribute beta versions of your apps and get feedback from users.' 34 | 35 | @description = util.i18n 36 | zh: 'fir.im 是一个 app 免费内测托管平台。为某个话题添加 fir.im 聚合后,你就能够在简聊上收取与绑定应用相关的系统消息。' 37 | en: 'fir.im is a beta testing platform that distribute beta versions of your apps and get feedback from users. This integration allows you receive notifications from fir.im.' 38 | 39 | @iconUrl = util.static 'images/icons/firim@2x.png' 40 | 41 | @_fields.push 42 | key: 'webhookUrl' 43 | type: 'text' 44 | readonly: true 45 | description: util.i18n 46 | zh: '复制 web hook 地址到你的 fir.im 的配置当中使用。你也可以在管理界面当中找到这个 web hook 地址。' 47 | en: 'Copy this web hook to your fir.im account to use it. You may also find this url in the manager tab.' 48 | 49 | @registerEvent 'service.webhook', _receiveWebhook 50 | -------------------------------------------------------------------------------- /src/services/goldxitudaily.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | Promise = require 'bluebird' 3 | 4 | util = require '../util' 5 | 6 | rssUrl = 'http://dev.gold.avosapps.com/jianliao/rss' 7 | 8 | # 添加稀土掘金 Feed 为默认 Url 9 | _addRSSUrl = ({integration}) -> 10 | integration.url = rssUrl 11 | return integration 12 | 13 | module.exports = -> 14 | 15 | service = this 16 | 17 | @title = '稀土掘金日报' 18 | 19 | @template = 'form' 20 | 21 | @group = 'rss' 22 | 23 | @summary = util.i18n 24 | zh: '挖掘最优质的互联网技术' 25 | en: 'Digging the best of Internet technology' 26 | 27 | @description = util.i18n 28 | zh: '挖掘最优质的互联网技术' 29 | en: 'Digging the best of Internet technology' 30 | 31 | @iconUrl = util.static 'images/icons/goldxitudaily@2x.png' 32 | 33 | if process.env.NODE_ENV in ['ga', 'prod'] 34 | @serviceUrl = 'http://apps.teambition.corp:7411' 35 | else 36 | @serviceUrl = 'http://localhost:7411' 37 | 38 | @registerEvent 'before.integration.create', _addRSSUrl 39 | 40 | events = ['integration.create', 'integration.remove', 'integration.update'] 41 | 42 | events.forEach (event) -> 43 | service.registerEvent event, (req) -> 44 | service.httpPost service.serviceUrl, 45 | event: event 46 | data: req.integration 47 | -------------------------------------------------------------------------------- /src/services/heroku.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | Promise = require 'bluebird' 3 | 4 | util = require '../util' 5 | 6 | ###* 7 | * Define handler when receive incoming webhook from heroku 8 | * @param {Object} req Express request object 9 | * @param {Object} res Express response object 10 | * @param {Function} callback 11 | * @return {Promise} 12 | ### 13 | 14 | _receiveWebhook = ({body}) -> 15 | payload = body 16 | 17 | return unless payload 18 | 19 | message = 20 | attachments: [ 21 | category: 'quote' 22 | data: 23 | redirectUrl: payload.url 24 | text: """ 25 | #{ payload.user } deployed version #{ payload.head }, 26 | git log: #{ payload.git_log } 27 | """ 28 | title: "#{ payload.app }" 29 | ] 30 | 31 | message 32 | 33 | module.exports = -> 34 | 35 | @title = 'Heroku' 36 | 37 | @template = 'webhook' 38 | 39 | @summary = util.i18n 40 | zh: '支持多种编程语言的云平台即服务。' 41 | en: 'A cloud platform as a service (PaaS).' 42 | 43 | @description = util.i18n 44 | zh: 'Heroku 是支持多种编程语言的云平台即服务(PaaS)。接入后可以收到部署的通知。' 45 | en: 'Heroku is a cloud platform as a service (PaaS) supporting several programming languages.' 46 | 47 | @iconUrl = util.static 'images/icons/heroku@2x.png' 48 | 49 | @_fields.push 50 | key: 'webhookUrl' 51 | type: 'text' 52 | readonly: true 53 | description: util.i18n 54 | zh: '复制 web hook 地址到你的 Heroku 中使用。' 55 | en: 'Copy this web hook to your Heroku account to use it.' 56 | 57 | # Apply function on `webhook` event 58 | @registerEvent 'service.webhook', _receiveWebhook 59 | -------------------------------------------------------------------------------- /src/services/incoming.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | util = require '../util' 3 | 4 | _receiveWebhook = ({query, body}) -> 5 | payload = _.assign {} 6 | , query or {} 7 | , body or {} 8 | 9 | {content, authorName, title, text, redirectUrl, imageUrl} = payload 10 | 11 | throw new Error("Title and text can not be empty") unless title?.length or text?.length or content?.length 12 | 13 | message = 14 | body: content 15 | authorName: authorName 16 | displayType: payload.displayType 17 | 18 | if title or text or redirectUrl or imageUrl 19 | message.attachments = [ 20 | category: 'quote' 21 | color: payload.color 22 | data: 23 | title: title 24 | text: text 25 | redirectUrl: redirectUrl 26 | imageUrl: imageUrl 27 | ] 28 | 29 | message 30 | 31 | module.exports = -> 32 | 33 | @title = 'Incoming Webhook' 34 | 35 | @template = 'webhook' 36 | 37 | @isCustomized = true 38 | 39 | @summary = util.i18n 40 | zh: 'Incoming Webhook 是使用普通的 HTTP 请求与 JSON 数据从外部向简聊发送消息的简单方案。' 41 | en: 'Incoming Webhook makes use of normal HTTP requests with a JSON payload.' 42 | 43 | @description = util.i18n 44 | zh: 'Incoming Webhook 是使用普通的 HTTP 请求与 JSON 数据从外部向简聊发送消息的简单方案。你可以将 Webook 地址复制到第三方服务,通过简单配置来自定义收取相应的推送消息。' 45 | en: 'Incoming Webhook makes use of normal HTTP requests with a JSON payload. Copy your webhook address to third-party services to configure push notifications.' 46 | 47 | @iconUrl = util.static 'images/icons/incoming@2x.png' 48 | 49 | @_fields.push 50 | key: 'webhookUrl' 51 | type: 'text' 52 | readOnly: true 53 | description: util.i18n 54 | zh: '复制 web hook 地址到你的应用中来启用 Incoming Webhook。' 55 | en: 'To start using incoming webhook, copy this url to your application' 56 | 57 | @registerEvent 'service.webhook', _receiveWebhook 58 | -------------------------------------------------------------------------------- /src/services/jenkins.coffee: -------------------------------------------------------------------------------- 1 | Promise = require 'bluebird' 2 | marked = require 'marked' 3 | 4 | util = require '../util' 5 | 6 | ###* 7 | * Define handler when receive incoming webhook from jenkins 8 | * @param {Object} req Express request object 9 | * @param {Object} res Express response object 10 | * @param {Function} callback 11 | * @return {Promise} 12 | ### 13 | _receiveWebhook = ({body}) -> 14 | payload = body or {} 15 | 16 | {content, authorName, title, text, redirectUrl, imageUrl} = payload 17 | 18 | throw new Error("Title and text can not be empty") unless title?.length or text?.length or content?.length 19 | 20 | message = 21 | body: content 22 | authorName: authorName 23 | attachments: [ 24 | category: 'quote' 25 | data: 26 | title: title 27 | text: text 28 | redirectUrl: redirectUrl 29 | imageUrl: imageUrl 30 | ] 31 | 32 | message 33 | 34 | module.exports = -> 35 | @title = 'Jenkins' 36 | 37 | @template = 'webhook' 38 | 39 | @summary = util.i18n 40 | zh: '开源持续集成服务' 41 | en: 'An open source continuous integration server.' 42 | 43 | @description = util.i18n 44 | zh: 'Jenkins 是一个开源持续集成服务。它提供超过 800 个插件来支持各种项目的构建和测试。' 45 | en: 'Jenkins CI is the leading open-source continuous integration server. It provides over 800 plugins to support building and testing virtually any project.' 46 | 47 | @iconUrl = util.static 'images/icons/jenkins@2x.png' 48 | 49 | @_fields.push 50 | key: 'webhookUrl' 51 | type: 'text' 52 | readOnly: true 53 | description: util.i18n 54 | zh: '复制 web hook 地址到你的 Jenkins 当中使用。你也可以在管理界面当中找到这个 web hook 地址。' 55 | en: 'Copy this web hook to your Jenkins server to use it. You may also find this url in the manager tab.' 56 | 57 | # Apply function on `webhook` event 58 | @registerEvent 'service.webhook', _receiveWebhook 59 | -------------------------------------------------------------------------------- /src/services/jiankongbao.coffee: -------------------------------------------------------------------------------- 1 | crypto = require 'crypto' 2 | 3 | util = require '../util' 4 | 5 | jkbUrl = 'https://qiye.jiankongbao.com' 6 | 7 | _receiveWebhook = ({integration, method, body, query}) -> 8 | if method is 'GET' then payload = query else payload = body 9 | {msg_id, task_id, task_type, fault_time, token, content} = payload 10 | 11 | if integration.token and 12 | crypto.createHash('md5').update("#{msg_id}#{task_id}#{fault_time}#{integration.token}").digest('hex') isnt token 13 | throw new Error("Invalid jiankongbao token #{token}, msg_id: #{msg_id}") 14 | 15 | unless task_type and task_id 16 | throw new Error('Invalid jiankongbao payload') 17 | 18 | message = 19 | attachments: [ 20 | category: 'quote' 21 | data: 22 | text: decodeURIComponent content or '' 23 | redirectUrl: "#{jkbUrl}/task/#{task_type}/#{task_id}" 24 | ] 25 | 26 | message 27 | 28 | module.exports = -> 29 | 30 | @title = '监控宝' 31 | 32 | @template = 'webhook' 33 | 34 | @summary = util.i18n 35 | zh: '端到端一体化云监控。' 36 | en: 'Jiankongbao is able to monitor website, servers, network, database, API, applications, performance, etc.' 37 | 38 | @description = util.i18n 39 | zh: '监控宝能够实时监控网站、服务器、网络、数据库、API、应用程序、页面性能等。为话题添加监控宝聚合后,你就可以在简聊上收取相关的告警通知。' 40 | en: 'Jiankongbao is able to monitor website, servers, network, database, API, applications, performance, etc. Add after Jiankongbao aggregation for a topic, you can catch up on Talk received the warning notice.' 41 | 42 | @iconUrl = util.static 'images/icons/jiankongbao@2x.png' 43 | 44 | @_fields.push 45 | key: 'token' 46 | type: 'text' 47 | description: util.i18n 48 | zh: '可选' 49 | en: 'Optional' 50 | 51 | @_fields.push 52 | key: 'webhookUrl' 53 | type: 'text' 54 | readonly: true 55 | description: util.i18n 56 | zh: '复制 web hook 地址到你的监控宝当中使用。你也可以在管理界面当中找到这个 web hook 地址。' 57 | en: 'Copy this web hook to your Jiankongbao to use it. You may also find this url in the manager tab.' 58 | 59 | @registerEvent 'service.webhook', _receiveWebhook 60 | -------------------------------------------------------------------------------- /src/services/jinshuju.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _receiveWebhook = ({body}) -> 4 | payload = body 5 | 6 | message = 7 | attachments: [ 8 | category: 'quote' 9 | data: 10 | text: "#{payload.entry?.creator_name} 添加了新的数据" 11 | redirectUrl: "https://jinshuju.net/forms/#{payload.form}/entries" 12 | ] 13 | 14 | message 15 | 16 | module.exports = -> 17 | 18 | @title = '金数据' 19 | 20 | @template = 'webhook' 21 | 22 | @summary = util.i18n 23 | zh: '在线表单设计、数据收集、统计和分享工具。' 24 | en: 'Jinshuju.net is an online form design, data collection, statistics and sharing tools.' 25 | 26 | @description = util.i18n 27 | zh: '金数据是一款在线表单设计、数据收集、统计和分享工具。在金数据表单设置中填写 Webhook 地址后,你就可以在简聊话题内收取表单新的填写记录通知。使用 Teambition 账号登录金数据' 28 | en: 'Jinshuju.net is an online form design, data collection, statistics and sharing tools. Fill in the data form setting Webhook address, you can simply receive new topics within a form to fill out log notification in Talk.Log in Jinshuju with Teambition account' 29 | 30 | @iconUrl = util.static 'images/icons/jinshuju@2x.png' 31 | 32 | @_fields.push 33 | key: 'webhookUrl' 34 | type: 'text' 35 | readonly: true 36 | description: util.i18n 37 | zh: '您可以在表单的"设置 —— 数据提交"页面的底部找到"将数据以 JSON 格式发送给第三方",填写 webhook 地址即可接收推送通知。' 38 | en: 'At the bottom of the page "Settings -- Data" you may find "Sends the data in JSON format to third parties", fill out the webhook address to receive push notifications.' 39 | 40 | @registerEvent 'service.webhook', _receiveWebhook 41 | -------------------------------------------------------------------------------- /src/services/jira.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _receiveWebhook = ({body}) -> 4 | payload = body 5 | 6 | message = {} 7 | attachment = category: 'quote', data: {} 8 | 9 | JIRA_CREATE_EVENT = "jira:issue_created" 10 | JIRA_UPDATE_EVENT = "jira:issue_updated" 11 | 12 | if body.webhookEvent is JIRA_CREATE_EVENT 13 | attachment.data.title = "#{body.user.displayName} created an issue for project #{body.issue.fields.project.name}" 14 | attachment.data.text = "Summary: #{body.issue.fields.summary}" 15 | else if body.webhookEvent is JIRA_UPDATE_EVENT 16 | attachment.data.title = "#{body.user.displayName} updated an issue for project #{body.issue.fields.project.name}" 17 | attachment.data.text = "Summary: #{body.issue.fields.summary}" 18 | else 19 | throw new Error("Unknown Jira event type") 20 | 21 | message.attachments = [attachment] 22 | message 23 | 24 | module.exports = -> 25 | 26 | @title = 'Jira' 27 | 28 | @template = 'webhook' 29 | 30 | @summary = util.i18n 31 | zh: '项目管理和事务追踪' 32 | en: 'The flexible and scalable issue tracker for software teams.' 33 | 34 | @description = util.i18n 35 | zh: 'JIRA是Atlassian公司出品的项目与事务跟踪工具,被广泛应用于缺陷跟踪、客户服务、需求收集、流程审批、任务跟踪、项目跟踪和敏捷管理等工作领域。' 36 | en: 'Track and manage everything with JIRA project and issue tracking software by Atlassian.' 37 | 38 | @iconUrl = util.static 'images/icons/jira@2x.png' 39 | 40 | @_fields.push 41 | key: 'webhookUrl' 42 | type: 'text' 43 | readonly: true 44 | description: util.i18n 45 | zh: '复制 webhook 地址到你的 Jira 的项目配置当中使用。' 46 | en: 'Copy this webhook to your Jira project setting to use it.' 47 | 48 | @registerEvent 'service.webhook', _receiveWebhook 49 | -------------------------------------------------------------------------------- /src/services/jobtong.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | util = require '../util' 3 | 4 | _receiveWebhook = ({body}) -> 5 | payload = body or {} 6 | 7 | texts = [] 8 | 9 | texts.push "性别:#{payload.sex}" if payload.sex 10 | texts.push "年龄:#{payload.age}" if payload.age 11 | texts.push "学历:#{payload.degree}" if payload.degree 12 | texts.push "经验年限:#{payload.experience}" if payload.experience 13 | texts.push "当前公司:#{payload.company}" if payload.company 14 | texts.push "当前职位:#{payload.job_name}" if payload.job_name 15 | texts.push "简历投递日期:#{payload.apply_at}" if payload.apply_at 16 | 17 | message = 18 | attachments: [ 19 | category: 'quote' 20 | data: 21 | title: payload.title 22 | text: texts.join '\n' 23 | redirectUrl: payload.url 24 | imageUrl: payload.face_url 25 | ] 26 | 27 | message 28 | 29 | module.exports = -> 30 | 31 | @title = '周伯通招聘' 32 | 33 | @template = 'webhook' 34 | 35 | @summary = util.i18n 36 | zh: '周伯通,招人喜欢' 37 | en: 'Jobtong makes job search more enjoyable.' 38 | 39 | @description = util.i18n 40 | zh: '周伯通招聘( http://www.jobtong.com ),2014年重装上阵,打造最懂互联网的招聘社区。是国内最知名的社会化招聘平台之一,倡导营销化、社会化的招聘服务,引领网络招聘行业新变革!' 41 | en: "Jobtong (http://www.jobtong.com), starting in 2014, is trying to build a recruitment community that is most familiar with Internet. It's one of the most famous social recruitment platform in China. We are advocacing marketing and socialization recruitment services and leading the new revolution of online recruitment industry!" 42 | 43 | @iconUrl = util.static 'images/icons/jobtong@2x.png' 44 | 45 | @_fields.push 46 | key: 'webhookUrl' 47 | type: 'text' 48 | readOnly: true 49 | description: util.i18n 50 | zh: 'Webhook URL' 51 | en: 'Webhook URL' 52 | 53 | @registerEvent 'service.webhook', _receiveWebhook 54 | -------------------------------------------------------------------------------- /src/services/kf5.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | 3 | util = require '../util' 4 | 5 | _receiveWebhook = ({integration, query, body}) -> 6 | payload = _.assign {} 7 | , query or {} 8 | , body or {} 9 | 10 | { 11 | content 12 | authorName 13 | title 14 | text 15 | redirectUrl 16 | imageUrl 17 | } = payload 18 | 19 | throw new Error("Title and text can not be empty") unless title?.length or text?.length or content?.length 20 | 21 | message = 22 | body: content 23 | authorName: authorName 24 | attachments: [ 25 | category: 'quote' 26 | data: 27 | title: title 28 | text: text 29 | redirectUrl: redirectUrl 30 | imageUrl: imageUrl 31 | ] 32 | 33 | message 34 | 35 | module.exports = -> 36 | 37 | @title = '逸创云客服' 38 | 39 | @template = 'webhook' 40 | 41 | @summary = util.i18n 42 | zh: '逸创云客服是一款多客服渠道整合的客服 Saas 产品。' 43 | en: 'Kf5.com is a Saas helpdesk service converging all support channels.' 44 | 45 | @description = util.i18n 46 | zh: '逸创云客服是一个聚合邮件、电话语音、IM交谈、移动端/网页表单、微信、微博、API接口、移动SDK等各种支持渠道的云端SaaS客服系统产品,让企业的客服以工单的形式统一响应和管理。' 47 | en: 'kf5.com is a customer helpdesk SaaS service converging all support channels such as email, voice, livechat, PC/mobile form, wechat, weibo, restful api and mobile sdk, and convert all support requests into ticket, making enterprise agents handling and managing in one place.' 48 | 49 | @iconUrl = util.static 'images/icons/kf5@2x.png' 50 | 51 | @_fields.push 52 | key: 'webhookUrl' 53 | type: 'text' 54 | readOnly: true 55 | description: util.i18n 56 | zh: '复制 web hook 地址到逸创云客服的配置中' 57 | en: 'Copy and paste this url to start using kf5 webhook' 58 | 59 | @registerEvent 'service.webhook', _receiveWebhook 60 | -------------------------------------------------------------------------------- /src/services/magnumci.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _receiveWebhook = ({body}) -> 4 | payload = body?.payload 5 | 6 | try 7 | if toString.call(payload) is '[object String]' 8 | payload = JSON.parse payload 9 | return false unless toString.call(payload) is '[object Object]' 10 | catch err 11 | return false 12 | 13 | throw new Error('Params missing') unless payload.title 14 | 15 | message = 16 | attachments: [ 17 | category: 'quote' 18 | data: 19 | title: payload.title 20 | text: payload.message 21 | redirectUrl: payload.build_url 22 | ] 23 | 24 | message 25 | 26 | module.exports = -> 27 | 28 | @title = 'Magnum CI' 29 | 30 | @template = 'webhook' 31 | 32 | @summary = util.i18n 33 | zh: '可用于私有项目的持续集成平台' 34 | en: 'Hosted Continuous Integration Platform for Private Repositories' 35 | 36 | @description = util.i18n 37 | zh: '可用于私有项目的持续集成平台' 38 | en: 'Hosted Continuous Integration Platform for Private Repositories' 39 | 40 | @iconUrl = util.static 'images/icons/magnumci@2x.png' 41 | 42 | @_fields.push 43 | key: 'webhookUrl' 44 | type: 'text' 45 | readonly: true 46 | description: util.i18n 47 | zh: '复制 web hook 地址到你的 Magnum CI 中使用。' 48 | en: 'Copy this web hook to your Magnum CI account to use it.' 49 | 50 | @registerEvent 'service.webhook', _receiveWebhook 51 | -------------------------------------------------------------------------------- /src/services/mailgun.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | util = require '../util' 3 | 4 | _receiveWebhook = ({body}) -> 5 | payload = body or {} 6 | 7 | switch payload.event 8 | when 'delivered' 9 | text = ''' 10 | Delivered messages 11 | ''' 12 | when 'dropped' 13 | text = """ 14 | Dropped messages 15 | reason: #{payload.reason} 16 | """ 17 | when 'bounced' 18 | text = """ 19 | Hard bounces 20 | error: #{payload.error} 21 | """ 22 | when 'complained' 23 | text = """ 24 | Spam complaints 25 | """ 26 | when 'unsubscribed' 27 | text = """ 28 | Unsubscribes 29 | user-agent: #{payload['user-agent']} 30 | """ 31 | when 'clicked' 32 | text = """ 33 | Clicks 34 | url: #{payload['url']} 35 | user-agent: #{payload['user-agent']} 36 | """ 37 | when 'opened' 38 | text = """ 39 | Opens 40 | user-agent: #{payload['user-agent']} 41 | """ 42 | else return 43 | 44 | if payload['message-headers'] 45 | text += '\n\n' + JSON.parse(payload['message-headers']).map (header) -> 46 | header[0] + ': ' + header[1] if typeof header[1] is 'string' 47 | .filter (header) -> header 48 | .join '\n' 49 | 50 | message = 51 | attachments: [ 52 | category: 'quote' 53 | data: 54 | text: text 55 | ] 56 | 57 | message 58 | 59 | module.exports = -> 60 | 61 | @title = 'Mailgun' 62 | 63 | @template = 'webhook' 64 | 65 | @summary = util.i18n 66 | zh: '邮件发送服务' 67 | en: 'Email service' 68 | 69 | @description = util.i18n 70 | zh: '邮件发送服务' 71 | en: 'Email service' 72 | 73 | @iconUrl = util.static 'images/icons/mailgun@2x.png' 74 | 75 | @_fields.push 76 | key: 'webhookUrl' 77 | type: 'text' 78 | readOnly: true 79 | description: util.i18n 80 | zh: '复制 web hook 地址到你的应用中来启用 Mailgun 聚合' 81 | en: 'To start using mailgun integration, copy this url to your application' 82 | 83 | @registerEvent 'service.webhook', _receiveWebhook 84 | -------------------------------------------------------------------------------- /src/services/newrelic.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | Promise = require 'bluebird' 3 | 4 | util = require '../util' 5 | 6 | ###* 7 | * Define handler when receive incoming webhook from new relic 8 | * @param {Object} req Express request object 9 | * @param {Object} res Express response object 10 | * @param {Function} callback 11 | * @return {Promise} 12 | ### 13 | 14 | _receiveWebhook = ({ integration, body }) -> 15 | payload = body 16 | 17 | return unless payload 18 | 19 | title = [] 20 | title.push payload.event_type, ': ' 21 | if payload.condition_name isnt '' 22 | title.push payload.condition_name 23 | 24 | text = [] 25 | if payload.owner isnt '' 26 | text.push 'Owner: ', payload.owner, '\n' 27 | if payload.details isnt '' 28 | text.push 'Incident: ', payload.details 29 | 30 | message = 31 | attachments: [ 32 | category: 'quote' 33 | data: 34 | redirectUrl: payload.incident_url 35 | title: title.join '' 36 | text: text.join '' 37 | ] 38 | 39 | message 40 | 41 | module.exports = -> 42 | 43 | @title = 'New Relic' 44 | 45 | @template = 'webhook' 46 | 47 | @summary = util.i18n 48 | zh: 'New Relic 是应用分析和监控平台。' 49 | en: 'New Relic is an APM platform.' 50 | 51 | @description = util.i18n 52 | zh: 'New Relic 是应用分析和监控平台。接入后可以收到应用和服务错误报警的实时通知。' 53 | en: 'New Relic is an APM platform. High-performing apps. Delightful customer experiences. Better business results. Discover the power of Software Analytics.' 54 | 55 | @iconUrl = util.static 'images/icons/newrelic@2x.png' 56 | 57 | @_fields.push 58 | key: 'webhookUrl' 59 | type: 'text' 60 | readonly: true 61 | description: util.i18n 62 | zh: '复制 web hook 地址到你的 New Relic 中使用。' 63 | en: 'Copy this web hook to your New Relic account to use it.' 64 | 65 | # Apply function on `webhook` event 66 | @registerEvent 'service.webhook', _receiveWebhook 67 | -------------------------------------------------------------------------------- /src/services/outgoing.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | Promise = require 'bluebird' 3 | validator = require 'validator' 4 | 5 | util = require '../util' 6 | 7 | _checkIntegration = ({integration}) -> 8 | unless validator.isURL(integration.url) 9 | throw new Error('Invalid url field') 10 | 11 | module.exports = -> 12 | 13 | @title = 'Outgoing Webhook' 14 | 15 | @template = 'form' 16 | 17 | @isCustomized = true 18 | 19 | @summary = util.i18n 20 | zh: 'Outgoing Webhook 以 JSON 格式将消息数据推送给你的服务' 21 | en: 'Outgoing Webhook send messages to your service with a JSON formatted payload.' 22 | 23 | @description = util.i18n 24 | zh: 'Outgoing Webhook 通过 POST 请求将话题中的消息数据推送给你,你可以在配置中修改接受请求的服务地址。' 25 | en: 'Outgoing Webhook makes use of normal HTTP requests with a JSON payload. Let use know your service url and wait for the messages.' 26 | 27 | @iconUrl = util.static 'images/icons/outgoing@2x.png' 28 | 29 | @_fields.push 30 | key: 'url' 31 | type: 'text' 32 | required: true 33 | description: util.i18n 34 | zh: '请填写你的 Webhook url' 35 | en: 'Webhook url of your application' 36 | 37 | @_fields.push 38 | key: 'token' 39 | type: 'text' 40 | autoGen: true 41 | description: util.i18n 42 | zh: 'Token 会被包含在发送给你的消息中' 43 | en: 'Token will include in the received message' 44 | 45 | @registerEvent 'before.integration.create', _checkIntegration 46 | -------------------------------------------------------------------------------- /src/services/robot.coffee: -------------------------------------------------------------------------------- 1 | Promise = require 'bluebird' 2 | _ = require 'lodash' 3 | 4 | util = require '../util' 5 | 6 | module.exports = -> 7 | 8 | @title = '自定义机器人' 9 | 10 | @template = 'form' 11 | 12 | @isCustomized = true 13 | 14 | @showRobot = true 15 | 16 | @summary = util.i18n 17 | zh: '我们提供了开放的数据接口,你可以利用自定义机器人开发各种应用和服务。' 18 | en: 'A robot act as a real user' 19 | 20 | @description = util.i18n 21 | zh: '自定义机器人的功能不限,你可以利用我们提供的开放数据接口,开发更多简聊的相关应用和服务。' 22 | en: 'A robot act as a real user' 23 | 24 | @iconUrl = util.static 'images/icons/robot@2x.png' 25 | 26 | @headerFields = [] 27 | 28 | @fields = [ 29 | key: 'url' 30 | type: 'text' 31 | description: util.i18n 32 | zh: '(可选)你可以通过 Webhook URL 来接收用户发送给机器人的消息' 33 | en: '(Optional) Webhook url of your application' 34 | , 35 | key: 'token' 36 | type: 'text' 37 | autoGen: true 38 | description: util.i18n 39 | zh: '(可选)Token 会被包含在发送给你的消息中' 40 | en: '(Optional) Token will include in the received message' 41 | , 42 | key: 'webhookUrl' 43 | type: 'text' 44 | readonly: true 45 | showOnSaved: true 46 | description: util.i18n 47 | zh: '通过 Webhook URL 发送消息给话题或成员' 48 | en: 'Send messages to users or channels through webhook URL' 49 | ] 50 | -------------------------------------------------------------------------------- /src/services/swathub.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | 3 | util = require '../util' 4 | 5 | _receiveWebhook = ({query, body}) -> 6 | payload = _.assign {} 7 | , query or {} 8 | , body or {} 9 | 10 | { 11 | content 12 | authorName 13 | title 14 | text 15 | redirectUrl 16 | imageUrl 17 | } = payload 18 | 19 | throw new Error("Title and text can not be empty") unless title?.length or text?.length or content?.length 20 | 21 | message = 22 | body: content 23 | authorName: authorName 24 | attachments: [ 25 | category: 'quote' 26 | data: 27 | title: title 28 | text: text 29 | redirectUrl: redirectUrl 30 | imageUrl: imageUrl 31 | ] 32 | 33 | message 34 | 35 | module.exports = -> 36 | 37 | @title = 'SWATHub' 38 | 39 | @template = 'webhook' 40 | 41 | @summary = util.i18n 42 | zh: '简单、高效的云端自动化测试平台。' 43 | en: 'Simple and Efficient Test Automation on Cloud' 44 | 45 | @description = util.i18n 46 | zh: '无需学习任何编程语言,SWATHub让你在云端快速创建和实施自动化测试。添加SWATHub聚合服务之后,你可以在简聊中收取自动化测试的状态信息和结果报告。' 47 | en: 'SWATHub enables building automated test scenarios on cloud in a code-less way. You can receive the test automation status messages, and execution reports in Talk.ai, by means of this SWATHub integration.' 48 | 49 | @iconUrl = util.static 'images/icons/swathub@2x.png' 50 | 51 | @_fields.push 52 | key: 'webhookUrl' 53 | type: 'text' 54 | readOnly: true 55 | description: util.i18n 56 | zh: 'Webhook url' 57 | en: 'Webhook url' 58 | 59 | @registerEvent 'service.webhook', _receiveWebhook 60 | -------------------------------------------------------------------------------- /src/services/travis.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _receiveWebhook = ({body}) -> 4 | payload = body?.payload 5 | 6 | try 7 | if toString.call(payload) is '[object String]' 8 | payload = JSON.parse payload 9 | return false unless toString.call(payload) is '[object Object]' 10 | catch err 11 | return false 12 | 13 | throw new Error('Params missing') unless payload.status_message 14 | 15 | title = "[#{payload.status_message}] " + 16 | "#{payload.repository?.name} ##{payload.number} " + 17 | "(#{payload.branch} - #{payload.commit[0...7]}) by #{payload.author_name}" 18 | 19 | message = 20 | attachments: [ 21 | category: 'quote' 22 | data: 23 | title: title 24 | text: payload.message 25 | redirectUrl: payload.build_url 26 | ] 27 | 28 | message 29 | 30 | module.exports = -> 31 | 32 | @title = 'Travis CI' 33 | 34 | @template = 'webhook' 35 | 36 | @summary = util.i18n 37 | zh: '分布式持续集成服务' 38 | en: 'A distributed continuous integration @' 39 | 40 | @description = util.i18n 41 | zh: 'Travis CI 是一个在线的,分布式的持续集成服务,用来构建及测试在 GitHub 托管的代码。' 42 | en: 'Travis CI is a distributed continuous integration @' 43 | 44 | @iconUrl = util.static 'images/icons/travis@2x.png' 45 | 46 | @_fields.push 47 | key: 'webhookUrl' 48 | type: 'text' 49 | readonly: true 50 | description: util.i18n 51 | zh: '复制 web hook 地址到 .travis.yml 中使用。' 52 | en: 'Copy this web hook to your .travis.yml to use it.' 53 | 54 | @registerEvent 'service.webhook', _receiveWebhook 55 | -------------------------------------------------------------------------------- /src/services/weibo.coffee: -------------------------------------------------------------------------------- 1 | util = require '../util' 2 | 3 | _getEvents = -> 4 | [ 5 | key: 'mention' 6 | label: util.i18n 7 | zh: '@我' 8 | en: '@me' 9 | , 10 | key: 'repost' 11 | label: util.i18n 12 | zh: '转发' 13 | en: 'Repost' 14 | , 15 | key: 'comment' 16 | label: util.i18n 17 | zh: '评论' 18 | en: 'Comment' 19 | ] 20 | 21 | module.exports = -> 22 | 23 | service = this 24 | 25 | @title = '微博' 26 | 27 | @summary = util.i18n 28 | zh: '通过关注机制分享简短实时信息的社交网络平台。' 29 | en: 'Weibo is one of the most popular social network in China.' 30 | 31 | @description = util.i18n 32 | zh: '微博是中国最流行的社交媒体平台之一。通过添加微博聚合,你可以设置将绑定账号的提及、转发和评论消息推送到你所选择的简聊话题中。' 33 | en: 'Weibo is one of the most popular social network in China. This integration allows you recieve mentions, reposts and replies.' 34 | 35 | @iconUrl = util.static 'images/icons/weibo@2x.png' 36 | 37 | @_fields.push 38 | key: 'events' 39 | items: _getEvents.apply this 40 | 41 | if process.env.NODE_ENV in ['ga', 'prod'] 42 | @serviceUrl = 'http://apps.teambition.corp:7410' 43 | else 44 | @serviceUrl = 'http://localhost:7410' 45 | 46 | events = ['integration.create', 'integration.remove', 'integration.update'] 47 | 48 | events.forEach (event) -> 49 | service.registerEvent event, (req) -> 50 | service.httpPost service.serviceUrl, 51 | event: event 52 | data: req.integration 53 | -------------------------------------------------------------------------------- /test/loader.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | Promise = require 'bluebird' 3 | _ = require 'lodash' 4 | loader = require '../src/loader' 5 | Service = require '../src/service' 6 | 7 | describe 'Loader#LoadAll', -> 8 | 9 | it 'should services', (done) -> 10 | 11 | $incoming = loader.load 'incoming' 12 | $teambition = loader.load 'teambition' 13 | $rss = loader.load 'rss' 14 | 15 | Promise.all [$incoming, $teambition, $rss] 16 | .then (services) -> 17 | services.length.should.above 0 18 | services.forEach (service) -> service.should.instanceOf Service 19 | .nodeify done 20 | 21 | it 'should load a service and apply reg function again', (done) -> 22 | 23 | $custom = loader.load 'custom', (custom) -> 24 | Promise.delay(100).then -> custom.customName = 'customName' 25 | 26 | $custom = loader.load('custom').then (custom) -> 27 | custom.customName.should.eql 'customName' 28 | 29 | $custom.nodeify done 30 | 31 | it 'should get an error message when service register was not existing and reg function was not provided', (done) -> 32 | 33 | loader.load 'unknown' 34 | .then -> done new Error('Should not pass') 35 | .catch (err) -> done() 36 | -------------------------------------------------------------------------------- /test/main.coffee: -------------------------------------------------------------------------------- 1 | # Initialize service 2 | requireDir = require 'require-dir' 3 | # Load mocked servers 4 | require './servers/app' 5 | 6 | loader = require '../src/loader' 7 | loader.config = 8 | apiHost: "" 9 | cdnPrefix: "" 10 | talkAccountApiUrl: "http://127.0.0.1:7632/account" 11 | teambition: 12 | clientSecret: 'abc' 13 | host: 'http://127.0.0.1:7632/tb' 14 | rss: 15 | serviceUrl: 'http://127.0.0.1:7632/rss/worker' 16 | github: 17 | apiHost: 'http://127.0.0.1:7632/github' 18 | talkai: 19 | apikey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 20 | devid: "123456" 21 | trello: 22 | apiKey: 'aaa' 23 | apiHost: 'http://127.0.0.1:7632/trello' 24 | 25 | # Load all services 26 | require './loader' 27 | 28 | require './servers/app' 29 | 30 | requireDir './services' 31 | -------------------------------------------------------------------------------- /test/scripts/send-firim-msg.coffee: -------------------------------------------------------------------------------- 1 | request = require 'request' 2 | _ = require 'lodash' 3 | 4 | options = 5 | method: 'POST' 6 | headers: "Content-Type": "application/json" 7 | json: true 8 | url: 'http://talk.bi/v1/services/webhook/75391804bb31576d4a476d65489f3f6d6b5d379a' 9 | body: { 10 | "msg": "小叮当的梦想国-更新", 11 | "icon": "http://firicon.fir.im/3f8e9549b93029b9e18828f67af17b0d77525990", 12 | "link": "http://fir.im/6gca", 13 | "name": "小叮当的梦想国", 14 | "changelog": "测试webhook\r\n测试内容:\r\n修改bug", 15 | "platform": "Android", 16 | "build": "2" 17 | } 18 | 19 | request options, (err, res, body) -> console.log body 20 | -------------------------------------------------------------------------------- /test/scripts/send-gitlab-msg.coffee: -------------------------------------------------------------------------------- 1 | request = require 'request' 2 | _ = require 'lodash' 3 | 4 | options = 5 | method: 'POST' 6 | headers: "Content-Type": "application/json" 7 | json: true 8 | url: 'http://talk.bi/v2/services/webhook/c417d7990227e7b1835d55e3339474c400ccbbde' 9 | 10 | [ 11 | 'push' 12 | # 'issue' 13 | # 'merge' 14 | # 'new-branch' 15 | ].forEach (payloadName) -> 16 | payload = require "../services/gitlab_assets/#{payloadName}" 17 | _options = _.assign {}, options, body: payload 18 | request _options, (err, res, body) -> console.log body 19 | -------------------------------------------------------------------------------- /test/scripts/send-incoming-msg.coffee: -------------------------------------------------------------------------------- 1 | request = require 'request' 2 | _ = require 'lodash' 3 | 4 | options = 5 | method: 'POST' 6 | headers: "Content-Type": "application/json" 7 | json: true 8 | url: 'http://talk.ci/v2/services/webhook/57c732af45437c0cbfe87efe8236cc71cedf8d4d' 9 | body: { 10 | "body": "", 11 | "title": "消息标题", 12 | "text": "消息内容" 13 | } 14 | 15 | request options, (err, res, body) -> console.log body 16 | -------------------------------------------------------------------------------- /test/servers/account.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | express = require 'express' 3 | should = require 'should' 4 | 5 | app = express() 6 | 7 | app.get '/v1/user/get', (req, res) -> 8 | req.query.should.have.properties 'accountToken' 9 | res.status(200).json 10 | _id: '1' 11 | unions: [ 12 | refer: 'teambition' 13 | accessToken: 'some account token' 14 | , 15 | refer: 'trello' 16 | accessToken: 'trello token' 17 | ] 18 | 19 | module.exports = app 20 | -------------------------------------------------------------------------------- /test/servers/app.coffee: -------------------------------------------------------------------------------- 1 | express = require 'express' 2 | bodyParser = require 'body-parser' 3 | 4 | module.exports = app = express() 5 | 6 | app.use bodyParser.json() 7 | app.use bodyParser.urlencoded(extended: true) 8 | 9 | app.use (err, req, res, next) -> 10 | res.status(400).json 11 | code: 400 12 | message: err.message 13 | 14 | app.use '/tb', require './teambition' 15 | app.use '/account', require './account' 16 | app.use '/rss', require './rss' 17 | app.use '/github', require './github' 18 | app.use '/trello', require './trello' 19 | 20 | app.listen 7632 21 | -------------------------------------------------------------------------------- /test/servers/github.coffee: -------------------------------------------------------------------------------- 1 | express = require 'express' 2 | 3 | reposToHook = awesome: id: 1 4 | 5 | app = express() 6 | 7 | app.post '/repos/:user/:repos/hooks', (req, res) -> 8 | res.json reposToHook[req.params.repos] 9 | 10 | module.exports = app 11 | -------------------------------------------------------------------------------- /test/servers/rss.coffee: -------------------------------------------------------------------------------- 1 | express = require 'express' 2 | fs = require 'fs' 3 | should = require 'should' 4 | 5 | app = express() 6 | 7 | app.get '/:feed', (req, res) -> 8 | {feed} = req.params 9 | res.send(fs.readFileSync "#{__dirname}/../services/rss_assets/#{feed}") 10 | 11 | app.post '/worker', (req, res) -> 12 | req.body.should.have.properties 'event', 'data' 13 | req.body.data.should.have.properties 'category', 'url' 14 | req.body.data.category.should.eql 'rss' 15 | 16 | res.send ok: 1 17 | 18 | module.exports = app 19 | -------------------------------------------------------------------------------- /test/servers/teambition.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'lodash' 2 | express = require 'express' 3 | 4 | app = express() 5 | 6 | projects = 7 | "5632dc1a065565ad690266a0": 8 | _id: "5632dc1a065565ad690266a0", 9 | name: "Discover Teambition", 10 | _creatorId: "55c060be2944cfe95e75a088", 11 | logo: "http://project.ci/api/images/covers/cover-other.jpg", 12 | py: "discoverteambition", 13 | pinyin: "discoverteambition" 14 | "5632dc1a065565ad690266a1": 15 | _id: "5632dc1a065565ad690266a1", 16 | name: "Discover Teambition 2", 17 | _creatorId: "55c060be2944cfe95e75a088", 18 | logo: "http://project.ci/api/images/covers/cover-other.jpg", 19 | py: "discoverteambition", 20 | pinyin: "discoverteambition" 21 | 22 | hooks = 23 | "5632dc1a065565ad690266a0": 24 | _id: "5632dc1a065565ad690266a2" 25 | "5632dc1a065565ad690266a1": 26 | _id: "5632dc1a065565ad690266a3" 27 | 28 | app.get '/api/projects', (req, res) -> 29 | req.headers.authorization.should.containEql "OAuth2 some account token" 30 | res.status(200).json _.values(projects) 31 | 32 | app.post '/api/projects/:_id/hooks', (req, res) -> 33 | req.headers.authorization.should.containEql "OAuth2 some account token" 34 | res.status(200).json hooks[req.params._id] 35 | 36 | app.put '/api/projects/:_id/hooks/:_hookId', (req, res) -> 37 | req.headers.authorization.should.containEql "OAuth2 some account token" 38 | req.params._hookId.should.eql hooks[req.params._id]._id 39 | res.status(200).json hooks[req.params._id] 40 | 41 | app.delete '/api/projects/:_id/hooks/:_hookId', (req, res) -> 42 | req.headers.authorization.should.containEql "OAuth2 some account token" 43 | req.params._hookId.should.eql hooks[req.params._id]._id 44 | res.status(200).json {} 45 | 46 | module.exports = app 47 | -------------------------------------------------------------------------------- /test/services/bughd.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $bughd = loader.load 'bughd' 5 | 6 | describe 'BugHD#Webhook', -> 7 | 8 | it 'receive webhook', (done) -> 9 | 10 | req.body = { 11 | "user_name": "BugHD", 12 | "datas": [ 13 | { 14 | 'project_name': 'SDKTestApp', 15 | 'project_version': '1.1.6(Build 1)', 16 | 'issue_title': '*** -[__NSArrayI objectAtIndex:]: index 5 beyond bounds [0 .. 1]', 17 | 'issue_stack': '0 CoreFoundation 0x0000000187391e64 + 160', 18 | 'created_at': '1423584178', 19 | "uri": "http://bughd.com/project/5620****************000c/issue/5630****************0008" 20 | } 21 | ] 22 | } 23 | 24 | req.integration = _id: 1 25 | 26 | $bughd.then (bughd) -> bughd.receiveEvent 'service.webhook', req 27 | .then (message) -> 28 | message.attachments[0].data.should.have.properties 'title', 'text', 'redirectUrl' 29 | message.attachments[0].data.title.should.eql 'SDKTestApp 1.1.6(Build 1)' 30 | message.attachments[0].data.text.should.eql ''' 31 | TITLE: *** -[__NSArrayI objectAtIndex:]: index 5 beyond bounds [0 .. 1] 32 | STACK: 0 CoreFoundation 0x0000000187391e64 + 160 33 | CREATED_AT: 2015-02-11 12:02:58 34 | ''' 35 | .nodeify done 36 | -------------------------------------------------------------------------------- /test/services/buildkite.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $buildkite = loader.load 'buildkite' 5 | 6 | describe 'Buildkite#Webhook', -> 7 | 8 | it 'receive webhook', (done) -> 9 | 10 | req.body = require './buildkite_assets/payload.json' 11 | req.headers = 12 | "X-Buildkite-Event": "build.scheduled" 13 | "X-Buildkite-Token": "02ddb822d4000975005c76484364f1ee" 14 | "X-Buildkite-Request": "65f07186-541f-41db-90dd-ca393070c170" 15 | req.integration = 16 | _id: 1 17 | token: '02ddb822d4000975005c76484364f1ee' 18 | 19 | $buildkite.then (buildkite) -> buildkite.receiveEvent 'service.webhook', req 20 | .then (message) -> 21 | message.attachments[0].data.title.should.eql '[scheduled] drips #4 (master - 91f48ae) by Xu Jingxin' 22 | message.attachments[0].data.text.should.eql 'Fix build' 23 | message.attachments[0].data.redirectUrl.should.eql 'https://buildkite.com/teambition/drips/builds/4' 24 | .nodeify done 25 | -------------------------------------------------------------------------------- /test/services/circleci.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $circleci = loader.load 'circleci' 5 | 6 | describe 'CircleCI#Webhook', -> 7 | 8 | it 'build success', -> 9 | req.body = require './circleci_assets/success' 10 | req.integration = _id: 1 11 | 12 | $circleci.then (circleci) -> circleci.receiveEvent 'service.webhook', req 13 | .then (message) -> 14 | message.attachments[0].data.title.should.eql "[drips] Build success: add test" 15 | message.attachments[0].data.redirectUrl.should.eql 'https://circleci.com/gh/sailxjx/drips/5' 16 | 17 | it 'build fail', -> 18 | req.body = require './circleci_assets/fail' 19 | req.integration = _id: 1 20 | 21 | $circleci.then (circleci) -> circleci.receiveEvent 'service.webhook', req 22 | .then (message) -> 23 | message.attachments[0].data.title.should.eql '[drips] Build fail: no_tests' 24 | message.attachments[0].data.text.should.eql "It looks like we couldn't infer test settings for your project. Refer to our \"Setting your build up manually\" document to get started. It should only take a few minutes." 25 | message.attachments[0].data.redirectUrl.should.eql 'https://circleci.com/gh/sailxjx/drips/2' 26 | -------------------------------------------------------------------------------- /test/services/cloudinsight.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | 3 | loader = require '../../src/loader' 4 | {req} = require '../util' 5 | $cloudinsight = loader.load 'cloudinsight' 6 | 7 | describe 'cloudinsight#Webhook', -> 8 | 9 | it 'receive webhook', (done) -> 10 | req.body = 11 | authorName: '路人甲' 12 | title: '你好' 13 | text: '天气不错' 14 | redirectUrl: 'https://talk.ai/site' 15 | imageUrl: 'https://dn-talk.oss.aliyuncs.com/site/images/workspace-84060cfd.jpg' 16 | 17 | $cloudinsight.then (cloudinsight) -> 18 | cloudinsight.receiveEvent 'service.webhook', req 19 | .then (message) -> 20 | message.should.have.properties 'authorName' 21 | message.attachments[0].data.should.have.properties 'title', 'text', 'redirectUrl', 'imageUrl' 22 | .nodeify done 23 | -------------------------------------------------------------------------------- /test/services/coding_assets/create_dir.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "document": { 9 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/attachment/default/preview/156105", 10 | "name": "新建文件夹" 11 | }, 12 | "repository": { 13 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 14 | "description": "test webhook", 15 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 16 | "name": "test-webhook", 17 | "project_id": "47074", 18 | "owner": { 19 | "email": "sailxjx@gmail.com", 20 | "name": "sailxjx" 21 | }, 22 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 23 | }, 24 | "event": "document", 25 | "action": "create", 26 | "type": "dir", 27 | "token": "abc" 28 | } 29 | -------------------------------------------------------------------------------- /test/services/coding_assets/finish_task.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 10 | "description": "test webhook", 11 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 12 | "name": "test-webhook", 13 | "project_id": "47074", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 19 | }, 20 | "task": { 21 | "creator": { 22 | "global_key": "sailxjx", 23 | "name": "sailxjx", 24 | "path": "/u/sailxjx", 25 | "avatar": "/static/fruit_avatar/Fruit-9.png" 26 | }, 27 | "deadline": 1430323200000, 28 | "owner": { 29 | "global_key": "coding", 30 | "name": "coding", 31 | "path": "/u/coding", 32 | "avatar": "https://dn-coding-net-production-static.qbox.me/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0" 33 | }, 34 | "content": "测试", 35 | "priority": 1 36 | }, 37 | "event": "task", 38 | "action": "finish", 39 | "token": "abc" 40 | } 41 | -------------------------------------------------------------------------------- /test/services/coding_assets/member.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 10 | "description": "test webhook", 11 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 12 | "name": "test-webhook", 13 | "project_id": "47074", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 19 | }, 20 | "target_user": { 21 | "global_key": "coding", 22 | "name": "coding", 23 | "path": "/u/coding", 24 | "avatar": "https://dn-coding-net-production-static.qbox.me/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0" 25 | }, 26 | "event": "member", 27 | "action": "create", 28 | "token": "abc" 29 | } 30 | -------------------------------------------------------------------------------- /test/services/coding_assets/merge_merge_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "merge_request": { 3 | "target_branch": "master", 4 | "body": "* cccccc\n\n", 5 | "title": "啊啊啊啊", 6 | "status": "ACCEPTED", 7 | "source_branch": "newbr", 8 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/git/merge/6", 9 | "action": "merge", 10 | "number": 6 11 | }, 12 | "repository": { 13 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 14 | "description": "test webhook", 15 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 16 | "name": "test-webhook", 17 | "project_id": "47074", 18 | "owner": { 19 | "email": "sailxjx@gmail.com", 20 | "name": "sailxjx" 21 | }, 22 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 23 | }, 24 | "event": "merge_request", 25 | "token": "abc" 26 | } 27 | -------------------------------------------------------------------------------- /test/services/coding_assets/merge_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "merge_request": { 3 | "target_branch": "master", 4 | "body": "* cccccc\n* 1\n* 2", 5 | "title": "标题标题", 6 | "status": "CANMERGE", 7 | "source_branch": "newbr", 8 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/git/merge/5", 9 | "action": "create", 10 | "number": 5, 11 | "merge_commit_sha": "e16b002b1cab32c413637120da131600be19210a" 12 | }, 13 | "repository": { 14 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 15 | "description": "test webhook", 16 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 17 | "name": "test-webhook", 18 | "project_id": "47074", 19 | "owner": { 20 | "email": "sailxjx@gmail.com", 21 | "name": "sailxjx" 22 | }, 23 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 24 | }, 25 | "event": "merge_request", 26 | "token": "abc" 27 | } 28 | -------------------------------------------------------------------------------- /test/services/coding_assets/new_topic.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic": { 3 | "title": "新项目讨论", 4 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/topic/29644", 5 | "author": { 6 | "global_key": "sailxjx", 7 | "name": "sailxjx", 8 | "path": "/u/sailxjx", 9 | "avatar": "/static/fruit_avatar/Fruit-9.png" 10 | } 11 | }, 12 | "repository": { 13 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 14 | "description": "test webhook", 15 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 16 | "name": "test-webhook", 17 | "project_id": "47074", 18 | "owner": { 19 | "email": "sailxjx@gmail.com", 20 | "name": "sailxjx" 21 | }, 22 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 23 | }, 24 | "event": "topic", 25 | "action": "create", 26 | "token": "abc" 27 | } 28 | -------------------------------------------------------------------------------- /test/services/coding_assets/push.json: -------------------------------------------------------------------------------- 1 | { 2 | "after": "5e321dae429679a4b9ad9e06b543eed5610ff9af", 3 | "ref": "master", 4 | "token": "abc", 5 | "repository": { 6 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 7 | "description": "test webhook", 8 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 9 | "name": "test-webhook", 10 | "project_id": "47074", 11 | "owner": { 12 | "email": "sailxjx@gmail.com", 13 | "name": "sailxjx" 14 | }, 15 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 16 | }, 17 | "before": "494fc9037544d04ba0a55cc38b377f021f155c23", 18 | "commits": [ 19 | { 20 | "sha": "5e321dae429679a4b9ad9e06b543eed5610ff9af", 21 | "short_message": "Merge branch 'newbb'", 22 | "committer": { 23 | "email": "sailxjx@gmail.com", 24 | "name": "Xu Jingxin" 25 | } 26 | }, 27 | { 28 | "sha": "1b6019319ab12d432108d65caa018a37f062f306", 29 | "short_message": "add makefile", 30 | "committer": { 31 | "email": "sailxjx@gmail.com", 32 | "name": "Xu Jingxin" 33 | } 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /test/services/coding_assets/reassign_task.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 10 | "description": "test webhook", 11 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 12 | "name": "test-webhook", 13 | "project_id": "47074", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 19 | }, 20 | "task": { 21 | "creator": { 22 | "global_key": "sailxjx", 23 | "name": "sailxjx", 24 | "path": "/u/sailxjx", 25 | "avatar": "/static/fruit_avatar/Fruit-9.png" 26 | }, 27 | "deadline": 1430323200000, 28 | "owner": { 29 | "global_key": "coding", 30 | "name": "coding", 31 | "path": "/u/coding", 32 | "avatar": "https://dn-coding-net-production-static.qbox.me/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0" 33 | }, 34 | "content": "测试", 35 | "priority": 1 36 | }, 37 | "event": "task", 38 | "action": "reassign", 39 | "token": "abc" 40 | } 41 | -------------------------------------------------------------------------------- /test/services/coding_assets/refuse_merge_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "merge_request": { 3 | "target_branch": "master", 4 | "body": "* cccccc\n* 1\n* 2", 5 | "title": "标题标题", 6 | "status": "REFUSED", 7 | "source_branch": "newbr", 8 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/git/merge/5", 9 | "action": "refuse", 10 | "number": 5, 11 | "merge_commit_sha": "757bb39278a40e1bab568b654d8d011da36dc2a8" 12 | }, 13 | "repository": { 14 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 15 | "description": "test webhook", 16 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 17 | "name": "test-webhook", 18 | "project_id": "47074", 19 | "owner": { 20 | "email": "sailxjx@gmail.com", 21 | "name": "sailxjx" 22 | }, 23 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 24 | }, 25 | "event": "merge_request", 26 | "token": "abc" 27 | } 28 | -------------------------------------------------------------------------------- /test/services/coding_assets/restore_task.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 10 | "description": "test webhook", 11 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 12 | "name": "test-webhook", 13 | "project_id": "47074", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 19 | }, 20 | "task": { 21 | "creator": { 22 | "global_key": "sailxjx", 23 | "name": "sailxjx", 24 | "path": "/u/sailxjx", 25 | "avatar": "/static/fruit_avatar/Fruit-9.png" 26 | }, 27 | "deadline": 1430323200000, 28 | "owner": { 29 | "global_key": "coding", 30 | "name": "coding", 31 | "path": "/u/coding", 32 | "avatar": "https://dn-coding-net-production-static.qbox.me/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0" 33 | }, 34 | "content": "测试", 35 | "priority": 1 36 | }, 37 | "event": "task", 38 | "action": "restore", 39 | "token": "abc" 40 | } 41 | -------------------------------------------------------------------------------- /test/services/coding_assets/star.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/alalalalalala.git", 10 | "description": "aaaaa", 11 | "web_url": "https://coding.net/u/sailxjx/p/alalalalalala", 12 | "name": "alalalalalala", 13 | "project_id": "89463", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "git_url": "git://git.coding.net/sailxjx/alalalalalala.git", 19 | "ssh_url": "git@git.coding.net:sailxjx/alalalalalala.git" 20 | }, 21 | "event": "star", 22 | "action": "star", 23 | "token": "abc" 24 | } 25 | -------------------------------------------------------------------------------- /test/services/coding_assets/task.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 10 | "description": "test webhook", 11 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 12 | "name": "test-webhook", 13 | "project_id": "47074", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 19 | }, 20 | "task": { 21 | "creator": { 22 | "global_key": "sailxjx", 23 | "name": "sailxjx", 24 | "path": "/u/sailxjx", 25 | "avatar": "/static/fruit_avatar/Fruit-9.png" 26 | }, 27 | "deadline": 253402185600000, 28 | "owner": { 29 | "global_key": "sailxjx", 30 | "name": "sailxjx", 31 | "path": "/u/sailxjx", 32 | "avatar": "/static/fruit_avatar/Fruit-9.png" 33 | }, 34 | "content": "测试", 35 | "priority": 2 36 | }, 37 | "event": "task", 38 | "action": "create", 39 | "token": "abc" 40 | } 41 | -------------------------------------------------------------------------------- /test/services/coding_assets/update_dir.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "document": { 9 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/attachment/default/preview/156104", 10 | "name": "测试" 11 | }, 12 | "repository": { 13 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 14 | "description": "test webhook", 15 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 16 | "name": "test-webhook", 17 | "project_id": "47074", 18 | "owner": { 19 | "email": "sailxjx@gmail.com", 20 | "name": "sailxjx" 21 | }, 22 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 23 | }, 24 | "event": "document", 25 | "action": "update", 26 | "type": "dir", 27 | "token": "abc" 28 | } 29 | -------------------------------------------------------------------------------- /test/services/coding_assets/update_task_deadline.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 10 | "description": "test webhook", 11 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 12 | "name": "test-webhook", 13 | "project_id": "47074", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 19 | }, 20 | "task": { 21 | "creator": { 22 | "global_key": "sailxjx", 23 | "name": "sailxjx", 24 | "path": "/u/sailxjx", 25 | "avatar": "/static/fruit_avatar/Fruit-9.png" 26 | }, 27 | "deadline": 1430323200000, 28 | "owner": { 29 | "global_key": "sailxjx", 30 | "name": "sailxjx", 31 | "path": "/u/sailxjx", 32 | "avatar": "/static/fruit_avatar/Fruit-9.png" 33 | }, 34 | "content": "测试", 35 | "priority": 2 36 | }, 37 | "event": "task", 38 | "action": "update_deadline", 39 | "token": "abc" 40 | } 41 | -------------------------------------------------------------------------------- /test/services/coding_assets/update_task_priority.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 10 | "description": "test webhook", 11 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 12 | "name": "test-webhook", 13 | "project_id": "47074", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 19 | }, 20 | "task": { 21 | "creator": { 22 | "global_key": "sailxjx", 23 | "name": "sailxjx", 24 | "path": "/u/sailxjx", 25 | "avatar": "/static/fruit_avatar/Fruit-9.png" 26 | }, 27 | "deadline": 1430323200000, 28 | "owner": { 29 | "global_key": "coding", 30 | "name": "coding", 31 | "path": "/u/coding", 32 | "avatar": "https://dn-coding-net-production-static.qbox.me/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0" 33 | }, 34 | "content": "测试", 35 | "priority": 1 36 | }, 37 | "event": "task", 38 | "action": "update_priority", 39 | "token": "abc" 40 | } 41 | -------------------------------------------------------------------------------- /test/services/coding_assets/update_topic.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic": { 3 | "title": "新项目讨论", 4 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/topic/29644", 5 | "author": { 6 | "global_key": "sailxjx", 7 | "name": "sailxjx", 8 | "path": "/u/sailxjx", 9 | "avatar": "/static/fruit_avatar/Fruit-9.png" 10 | } 11 | }, 12 | "repository": { 13 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 14 | "description": "test webhook", 15 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 16 | "name": "test-webhook", 17 | "project_id": "47074", 18 | "owner": { 19 | "email": "sailxjx@gmail.com", 20 | "name": "sailxjx" 21 | }, 22 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 23 | }, 24 | "event": "topic", 25 | "action": "update", 26 | "token": "abc" 27 | } 28 | -------------------------------------------------------------------------------- /test/services/coding_assets/upload_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "sailxjx", 4 | "name": "sailxjx", 5 | "path": "/u/sailxjx", 6 | "avatar": "/static/fruit_avatar/Fruit-9.png" 7 | }, 8 | "document": { 9 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook/attachment/default/preview/156107", 10 | "name": "4.jpg" 11 | }, 12 | "repository": { 13 | "https_url": "https://git.coding.net/sailxjx/test-webhook.git", 14 | "description": "test webhook", 15 | "web_url": "https://coding.net/u/sailxjx/p/test-webhook", 16 | "name": "test-webhook", 17 | "project_id": "47074", 18 | "owner": { 19 | "email": "sailxjx@gmail.com", 20 | "name": "sailxjx" 21 | }, 22 | "ssh_url": "git@git.coding.net:sailxjx/test-webhook.git" 23 | }, 24 | "event": "document", 25 | "action": "upload", 26 | "type": "file", 27 | "token": "abc" 28 | } 29 | -------------------------------------------------------------------------------- /test/services/coding_assets/watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "global_key": "jiyinyiyong", 4 | "name": "jiyinyiyong", 5 | "path": "/u/jiyinyiyong", 6 | "avatar": "https://dn-coding-net-production-static.qbox.me/49d5a46383ea29666593e53c9851c58f.jpg" 7 | }, 8 | "repository": { 9 | "https_url": "https://git.coding.net/sailxjx/alalalalalala.git", 10 | "description": "aaaaa", 11 | "web_url": "https://coding.net/u/sailxjx/p/alalalalalala", 12 | "name": "alalalalalala", 13 | "project_id": "89463", 14 | "owner": { 15 | "email": "sailxjx@gmail.com", 16 | "name": "sailxjx" 17 | }, 18 | "git_url": "git://git.coding.net/sailxjx/alalalalalala.git", 19 | "ssh_url": "git@git.coding.net:sailxjx/alalalalalala.git" 20 | }, 21 | "event": "watch", 22 | "action": "watch", 23 | "token": "abc" 24 | } 25 | -------------------------------------------------------------------------------- /test/services/coding_assets/zen.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "abc", 3 | "zen": "Coding! 让开发更简单" 4 | } 5 | -------------------------------------------------------------------------------- /test/services/email.coffee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/test/services/email.coffee -------------------------------------------------------------------------------- /test/services/firim.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $firim = loader.load 'firim' 5 | 6 | describe 'Firim#Webhook', -> 7 | 8 | it 'receive webhook', (done) -> 9 | req.body = { 10 | "msg": "小叮当的梦想国-更新", 11 | "icon": "http://firicon.fir.im/3f8e9549b93029b9e18828f67af17b0d77525990", 12 | "link": "http://fir.im/6gca", 13 | "name": "小叮当的梦想国", 14 | "changelog": "测试webhook\r\n测试内容:\r\n修改bug", 15 | "platform": "Android", 16 | "build": "2" 17 | } 18 | req.integration = _id: 1 19 | 20 | $firim.then (firim) -> 21 | firim.receiveEvent 'service.webhook', req 22 | .then (message) -> 23 | message.attachments[0].data.title.should.eql 'fir.im: 小叮当的梦想国-更新' 24 | message.attachments[0].data.text.should.eql ''' 25 | BUILD 2 26 | PLATFORM Android 27 | CHANGELOG 28 | 测试webhook\r\n测试内容:\r\n修改bug 29 | ''' 30 | message.attachments[0].data.redirectUrl.should.eql 'http://fir.im/6gca' 31 | message.attachments[0].data.imageUrl.should.eql 'https://tools.teambition.net/qr.png?text=http%3A%2F%2Ffir.im%2F6gca' 32 | .nodeify done 33 | -------------------------------------------------------------------------------- /test/services/gitcafe_assets/empty_event.json: -------------------------------------------------------------------------------- 1 | { 2 | "headers": { 3 | "x-real-ip": "101.231.114.44", 4 | "x-forwarded-for": "101.231.114.44", 5 | "host": "talk.ai", 6 | "x-nginx-proxy": "true", 7 | "connection": "Upgrade", 8 | "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 9 | "accept-encoding": "gzip, deflate", 10 | "accept-language": "zh-cn", 11 | "cookie": "_ga=GA1.2.583542870.1424792532; Hm_lpvt_6c88c7aa9cc95e23f10e37fdd1a73c30=1435632232; Hm_lvt_6c88c7aa9cc95e23f10e37fdd1a73c30=1434608409,1434683437,1435245452,1435541873; mp_2fa08c155ec778a576474191f22a6c80_mixpanel=%7B%22distinct_id%22%3A%20%2214bbc414c3d613-01eab1c09-7d7c3c63-fa000-14bbc414c3e676%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Faccount.teambition.com%2Fsignin%3Fservice%3Dtalk%22%2C%22%24initial_referring_domain%22%3A%20%22account.teambition.com%22%7D; sid=s%3AqVEknt91OkBTyBt6Ayu4IFnuTSISYUxk.eOJ6sVjZUed%2B2oFCBvJS9UIR0Hw%2FewhexjPOUq2zgdU", 12 | "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3" 13 | }, 14 | "query": {}, 15 | "body": {} 16 | } -------------------------------------------------------------------------------- /test/services/gitlab_assets/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "object_kind": "build", 3 | "ref": "v3.1.1-rc5", 4 | "tag": true, 5 | "before_sha": "0000000000000000000000000000000000000000", 6 | "sha": "c68ce36e991ee739f00c9ca0a9a4e1b2d3cf9204", 7 | "build_id": 88, 8 | "build_name": "test_job", 9 | "build_stage": "test", 10 | "build_status": "failed", 11 | "build_started_at": "2016-02-16 17:33:39 +0800", 12 | "build_finished_at": "2016-02-16 17:34:36 +0800", 13 | "build_duration": 57.486490465, 14 | "build_allow_failure": false, 15 | "project_id": 20, 16 | "project_name": "Talk / talk-web", 17 | "user": { 18 | "id": 73, 19 | "name": "Boshen", 20 | "email": "boshen@teambition.com" 21 | }, 22 | "commit": { 23 | "id": 55, 24 | "sha": "c68ce36e991ee739f00c9ca0a9a4e1b2d3cf9204", 25 | "message": "3.1.1-rc5\n", 26 | "author_name": "Boshen", 27 | "author_email": "boshen@teambition.com", 28 | "status": "failed", 29 | "duration": 142, 30 | "started_at": "2016-02-16 17:32:13 +0800", 31 | "finished_at": "2016-02-16 17:34:36 +0800" 32 | }, 33 | "repository": { 34 | "name": "talk-web", 35 | "url": "git@code.teambition.com:talk/talk-web.git", 36 | "description": "", 37 | "homepage": "https://code.teambition.com/talk/talk-web", 38 | "git_http_url": "https://code.teambition.com/talk/talk-web.git", 39 | "git_ssh_url": "git@code.teambition.com:talk/talk-web.git", 40 | "visibility_level": 0 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /test/services/gitlab_assets/issue.json: -------------------------------------------------------------------------------- 1 | { 2 | "object_kind": "issue", 3 | "user": { 4 | "name": "sailxjx", 5 | "username": "sailxjx", 6 | "avatar_url": "https://code.teambition.com//uploads/user/avatar/7/sailxjx.png" 7 | }, 8 | "object_attributes": { 9 | "id": 10, 10 | "title": "Some Issue", 11 | "assignee_id": null, 12 | "author_id": 7, 13 | "project_id": 21, 14 | "created_at": "2015-01-26 10:01:20 +0800", 15 | "updated_at": "2015-01-26 10:01:20 +0800", 16 | "position": 0, 17 | "branch_name": null, 18 | "description": "```\r\nSomeCode\r\n```", 19 | "milestone_id": null, 20 | "state": "opened", 21 | "iid": 1, 22 | "url": "https://code.teambition.com/talk/talk-core/issues/1", 23 | "action": "open" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/services/gitlab_assets/merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "object_kind": "merge_request", 3 | "user": { 4 | "name": "sailxjx", 5 | "username": "sailxjx", 6 | "avatar_url": "https://code.teambition.com//uploads/user/avatar/7/sailxjx.png" 7 | }, 8 | "object_attributes": { 9 | "id": 465, 10 | "target_branch": "master", 11 | "source_branch": "feature/gitlab", 12 | "source_project_id": 21, 13 | "author_id": 7, 14 | "assignee_id": null, 15 | "title": "Feature/gitlab", 16 | "created_at": "2015-01-26 09:56:49 +0800", 17 | "updated_at": "2015-01-26 09:56:49 +0800", 18 | "milestone_id": null, 19 | "state": "opened", 20 | "merge_status": "unchecked", 21 | "target_project_id": 21, 22 | "iid": 2, 23 | "description": "Merge GitLab Feature", 24 | "position": 0, 25 | "locked_at": null, 26 | "source": { 27 | "name": "talk-core", 28 | "ssh_url": "git@code.teambition.com:talk/talk-core.git", 29 | "http_url": "https://code.teambition.com/talk/talk-core.git", 30 | "namespace": "Talk", 31 | "visibility_level": 0 32 | }, 33 | "target": { 34 | "name": "talk-core", 35 | "ssh_url": "git@code.teambition.com:talk/talk-core.git", 36 | "http_url": "https://code.teambition.com/talk/talk-core.git", 37 | "namespace": "Talk", 38 | "visibility_level": 0 39 | }, 40 | "last_commit": { 41 | "id": "e523992d8b2f2adb720224868e26cce1c81e061a", 42 | "message": "add gitlab repository homepage\n", 43 | "timestamp": "2015-01-26T09:55:51+08:00", 44 | "url": "https://code.teambition.com/talk/talk-core/commit/e523992d8b2f2adb720224868e26cce1c81e061a", 45 | "author": { 46 | "name": "Xu Jingxin", 47 | "email": "sailxjx@gmail.com" 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /test/services/gitlab_assets/new-branch.json: -------------------------------------------------------------------------------- 1 | { 2 | "before": "0000000000000000000000000000000000000000", 3 | "after": "8dfb272d9e9bc2276c0c72e391318c4ec29bcb4c", 4 | "ref": "refs/heads/feature/gitlab", 5 | "checkout_sha": "8dfb272d9e9bc2276c0c72e391318c4ec29bcb4c", 6 | "user_id": 7, 7 | "user_name": "sailxjx", 8 | "project_id": 21, 9 | "repository": { 10 | "name": "talk-core", 11 | "url": "git@code.teambition.com:talk/talk-core.git", 12 | "description": "", 13 | "homepage": "https://code.teambition.com/talk/talk-core" 14 | }, 15 | "commits": [], 16 | "total_commits_count": 0 17 | } 18 | -------------------------------------------------------------------------------- /test/services/gitlab_assets/push.json: -------------------------------------------------------------------------------- 1 | { 2 | "before": "95790bf891e76fee5e1747ab589903a6a1f80f22", 3 | "after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", 4 | "ref": "refs/heads/master", 5 | "user_id": 4, 6 | "user_name": "John Smith", 7 | "project_id": 15, 8 | "repository": { 9 | "name": "Diaspora", 10 | "url": "git@localhost:diaspora.git", 11 | "description": "", 12 | "homepage": "http://localhost/diaspora" 13 | }, 14 | "commits": [ 15 | { 16 | "id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", 17 | "message": "Update Catalan translation to e38cb41.", 18 | "timestamp": "2011-12-12T14:27:31+02:00", 19 | "url": "http://localhost/diaspora/commits/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327", 20 | "author": { 21 | "name": "Jordi Mallach", 22 | "email": "jordi@softcatala.org" 23 | } 24 | }, 25 | { 26 | "id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", 27 | "message": "fixed readme", 28 | "timestamp": "2012-01-03T23:36:29+02:00", 29 | "url": "http://localhost/diaspora/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7", 30 | "author": { 31 | "name": "GitLab dev user", 32 | "email": "gitlabdev@dv6700.(none)" 33 | } 34 | } 35 | ], 36 | "total_commits_count": 4 37 | } 38 | -------------------------------------------------------------------------------- /test/services/goldxitudaily.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $goldxitudaily = loader.load 'goldxitudaily' 5 | 6 | describe 'Goldxitudaily#BeforeIntegrationCreate', -> 7 | 8 | it 'should modify the url of integration to xitu\'s feed url', (done) -> 9 | integration = category: 'goldxitudaily' 10 | req.integration = integration 11 | 12 | $goldxitudaily.then (goldxitudaily) -> goldxitudaily.receiveEvent 'before.integration.create', req 13 | .then -> integration.url.should.eql 'http://dev.gold.avosapps.com/jianliao/rss' 14 | .nodeify done 15 | -------------------------------------------------------------------------------- /test/services/heroku.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $heroku = loader.load 'heroku' 5 | 6 | payload = 7 | app: "test-app" 8 | user: "test_user@heroku.com" 9 | url: "http://test-app.herokuapp.com" 10 | head: "0b5fb19" 11 | head_long: "0b5fb19f982713183e27abb3a7231018169a150d" 12 | git_log: "*Sample commit message" 13 | 14 | describe 'Heroku#Webhook', -> 15 | 16 | req.integration = _id: '123' 17 | 18 | it 'receive webhook', (done) -> 19 | req.body = payload 20 | 21 | $heroku.then (heroku) -> heroku.receiveEvent 'service.webhook', req 22 | .then (message) -> 23 | message.attachments[0].data.redirectUrl.should.eql payload.url 24 | message.attachments[0].data.should.have.properties 'title', 'text', 'redirectUrl' 25 | .nodeify done 26 | -------------------------------------------------------------------------------- /test/services/incoming.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | Promise = require 'bluebird' 3 | 4 | loader = require '../../src/loader' 5 | {req} = require '../util' 6 | $incoming = loader.load 'incoming' 7 | 8 | describe 'Incoming#Webhook', -> 9 | 10 | it 'receive webhook', (done) -> 11 | req.body = 12 | authorName: '路人甲' 13 | title: '你好' 14 | text: '天气不错' 15 | redirectUrl: 'https://talk.ai/site' 16 | imageUrl: 'https://dn-talk.oss.aliyuncs.com/site/images/workspace-84060cfd.jpg' 17 | 18 | $incoming.then (incoming) -> 19 | 20 | incoming.receiveEvent 'service.webhook', req 21 | 22 | .then (message) -> 23 | message.should.have.properties 'authorName' 24 | message.attachments[0].data.should.have.properties 'title', 'text', 'redirectUrl', 'imageUrl' 25 | 26 | .nodeify done 27 | -------------------------------------------------------------------------------- /test/services/jenkins.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $jenkins = loader.load 'jenkins' 5 | 6 | describe 'Jenkins#Webhook', -> 7 | 8 | req.integration = _id: '123' 9 | 10 | it 'receive webhook', (done) -> 11 | 12 | req.body = 13 | authorName: '路人甲' 14 | title: '你好' 15 | text: '天气不错' 16 | redirectUrl: 'https://talk.ai/site' 17 | imageUrl: 'https://dn-talk.oss.aliyuncs.com/site/images/workspace-84060cfd.jpg' 18 | 19 | $jenkins.then (jenkins) -> jenkins.receiveEvent 'service.webhook', req 20 | .then (message) -> 21 | message.should.have.properties 'authorName' 22 | message.attachments[0].data.should.have.properties 'title', 'text', 'redirectUrl', 'imageUrl' 23 | .nodeify done 24 | -------------------------------------------------------------------------------- /test/services/jiankongbao.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $jiankongbao = loader.load 'jiankongbao' 5 | 6 | payload = 7 | msg_id: 1 8 | task_id: 2 9 | task_type: 'http' 10 | fault_time: 1421050275 11 | content: '测试消息' 12 | token: 'a821dc01d5eb3056fddbccf21cc24966' 13 | 14 | describe 'Jiankongbao#Webhook', -> 15 | 16 | req.integration = _id: 123 17 | 18 | it 'should create new message when receive jiankongbao webhook', (done) -> 19 | req.body = payload 20 | 21 | $jiankongbao.then (jiankongbao) -> jiankongbao.receiveEvent 'service.webhook', req 22 | .then (message) -> 23 | message.attachments[0].data.text.should.eql payload.content 24 | message.attachments[0].data.redirectUrl.should.eql 'https://qiye.jiankongbao.com/task/http/2' 25 | .nodeify done 26 | -------------------------------------------------------------------------------- /test/services/jinshuju.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $jinshuju = loader.load 'jinshuju' 5 | 6 | payload = { 7 | "form": "PXmEGx", 8 | "entry": { 9 | "serial_number": 2, 10 | "field_1": "“学霸”6号", 11 | "field_2": [ 12 | "“小姐”2号", 13 | "“导员”3号", 14 | "“阿呆“5号" 15 | ], 16 | "field_4": " “超人”1号", 17 | "field_5": " “小姐”2号", 18 | "field_6": "“导员”3号", 19 | "creator_name": "sailxjx", 20 | "created_at": "2015-01-06T02:36:44Z", 21 | "updated_at": "2015-01-06T02:36:44Z", 22 | "info_remote_ip": "101.231.114.44" 23 | } 24 | } 25 | 26 | describe 'Jinshuju#Webhook', -> 27 | 28 | req.integration = _id: 1 29 | 30 | it 'should create new message when receive jinshuju webhook', (done) -> 31 | req.body = payload 32 | 33 | $jinshuju.then (jinshuju) -> jinshuju.receiveEvent 'service.webhook', req 34 | .then (message) -> 35 | message.attachments[0].data.text.should.eql "sailxjx 添加了新的数据" 36 | message.attachments[0].data.redirectUrl.should.eql "https://jinshuju.net/forms/PXmEGx/entries" 37 | .nodeify done 38 | -------------------------------------------------------------------------------- /test/services/jira.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | requireDir = require 'require-dir' 3 | 4 | loader = require '../../src/loader' 5 | {req} = require '../util' 6 | $jira = loader.load 'jira' 7 | 8 | payloads = requireDir './jira_assets' 9 | 10 | describe 'Jira#Webhook', -> 11 | 12 | req.integration = 13 | _id: 'xxx' 14 | _teamId: '123' 15 | _roomId: '456' 16 | 17 | it 'receive unknown type webhook', (done) -> 18 | 19 | req = payloads['empty-event'] 20 | 21 | $jira.then (jira) -> jira.receiveEvent 'service.webhook', req 22 | .then -> done new Error 'Should not pass' 23 | .catch (err) -> 24 | err.message.should.eql 'Unknown Jira event type' 25 | done() 26 | 27 | it 'receive create type webhook', (done) -> 28 | 29 | req = payloads['create-issue'] 30 | 31 | $jira.then (jira) -> jira.receiveEvent 'service.webhook', req 32 | .then (message) -> 33 | message.attachments[0].data.title.should.eql 'Destec Zhang [Administrator] created an issue for project test project' 34 | message.attachments[0].data.text.should.eql 'Summary: test bug' 35 | .nodeify done 36 | 37 | it 'receive update type webhook', (done) -> 38 | 39 | req = payloads['update-issue'] 40 | 41 | $jira.then (jira) -> jira.receiveEvent 'service.webhook', req 42 | .then (message) -> 43 | message.attachments[0].data.title.should.eql 'Destec Zhang [Administrator] updated an issue for project test project' 44 | message.attachments[0].data.text.should.eql 'Summary: test bug' 45 | .nodeify done 46 | -------------------------------------------------------------------------------- /test/services/jobtong.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $jobtong = loader.load 'jobtong' 5 | 6 | describe 'Jobtong#Webhook', -> 7 | 8 | it 'receive webhook', (done) -> 9 | req.body = 10 | 'url': 'http://www.url.com' 11 | 'title': '天朝来的求职者' 12 | 'face_url': 'http://www.face.com' 13 | 'sex': 'gay' 14 | 'age': '0' 15 | 'degree': '小学辍学' 16 | 'experience': '+10086' 17 | 'company': '宇宙真理公司' 18 | 'job_name': '酱油' 19 | 'apply_at': "2015-07-02T02:52:55.563Z" 20 | req.integration = _id: 1 21 | 22 | $jobtong.then (jobtong) -> 23 | jobtong.receiveEvent 'service.webhook', req 24 | .then (message) -> 25 | message.attachments[0].data.title.should.eql '天朝来的求职者' 26 | message.attachments[0].data.text.should.eql """ 27 | 性别:gay 28 | 年龄:0 29 | 学历:小学辍学 30 | 经验年限:+10086 31 | 当前公司:宇宙真理公司 32 | 当前职位:酱油 33 | 简历投递日期:2015-07-02T02:52:55.563Z 34 | """ 35 | message.attachments[0].data.redirectUrl.should.eql 'http://www.url.com' 36 | message.attachments[0].data.imageUrl.should.eql 'http://www.face.com' 37 | .nodeify done 38 | -------------------------------------------------------------------------------- /test/services/kf5.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $kf5 = loader.load 'kf5' 5 | 6 | describe 'Kf5#Webhook', -> 7 | 8 | req.integration = _id: '123' 9 | 10 | it 'receive webhook', (done) -> 11 | req.body = 12 | authorName: '路人甲' 13 | title: '你好' 14 | text: '天气不错' 15 | redirectUrl: 'https://talk.ai/site' 16 | imageUrl: 'https://dn-talk.oss.aliyuncs.com/site/images/workspace-84060cfd.jpg' 17 | 18 | $kf5.then (kf5) -> kf5.receiveEvent 'service.webhook', req 19 | .then (message) -> 20 | message.should.have.properties 'authorName' 21 | message.attachments[0].data.should.have.properties 'title', 'text', 'redirectUrl', 'imageUrl' 22 | .nodeify done 23 | -------------------------------------------------------------------------------- /test/services/magnumci.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $magnumci = loader.load 'magnumci' 5 | 6 | describe 'Magnumci#Webhook', -> 7 | 8 | it 'receive webhook', (done) -> 9 | req.body = require './magnumci_assets/fail.json' 10 | req.integration = _id: 1 11 | 12 | $magnumci.then (magnumci) -> magnumci.receiveEvent 'service.webhook', req 13 | .then (message) -> 14 | message.attachments[0].data.title.should.eql '[FAIL] drips #1 (master - master) by Magnum CI' 15 | message.attachments[0].data.text.should.eql 'Test build' 16 | message.attachments[0].data.redirectUrl.should.eql 'http://magnum-ci.com/projects/2986/builds/172696' 17 | .nodeify done 18 | -------------------------------------------------------------------------------- /test/services/magnumci_assets/fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": "{\"id\":172696,\"project_id\":2986,\"title\":\"[FAIL] drips #1 (master - master) by Magnum CI\",\"number\":1,\"commit\":\"master\",\"author\":\"Magnum CI\",\"committer\":\"Magnum CI\",\"message\":\"Test build\",\"branch\":\"master\",\"state\":\"finished\",\"status\":\"fail\",\"result\":2,\"duration\":5.0,\"duration_string\":\"5s\",\"commit_url\":null,\"compare_url\":null,\"started_at\":\"2015-06-30T03:46:03-05:00\",\"finished_at\":\"2015-06-30T03:46:08-05:00\",\"build_url\":\"http://magnum-ci.com/projects/2986/builds/172696\"}" 3 | } 4 | -------------------------------------------------------------------------------- /test/services/magnumci_assets/pass.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": "{\"id\":172701,\"project_id\":2986,\"title\":\"[PASS] drips #2 (master - afc184a9) by Xu Jingxin\",\"number\":2,\"commit\":\"afc184a9aced8e5eba716d1cc39800054448e67f\",\"author\":\"Xu Jingxin\",\"committer\":\"Xu Jingxin\",\"message\":\"add test\",\"branch\":\"master\",\"state\":\"finished\",\"status\":\"pass\",\"result\":0,\"duration\":5.0,\"duration_string\":\"5s\",\"commit_url\":\"https://github.com/sailxjx/drips/commit/afc184a9aced8e5eba716d1cc39800054448e67f\",\"compare_url\":\"https://github.com/sailxjx/drips/compare/eeda35fefbb9...afc184a9aced\",\"started_at\":\"2015-06-30T03:51:04-05:00\",\"finished_at\":\"2015-06-30T03:51:09-05:00\",\"build_url\":\"http://magnum-ci.com/projects/2986/builds/172701\"}" 3 | } 4 | -------------------------------------------------------------------------------- /test/services/mailgun_assets/clicks.json: -------------------------------------------------------------------------------- 1 | { 2 | "headers": { 3 | "x-real-ip": "173.203.37.69", 4 | "x-forwarded-for": "173.203.37.69", 5 | "host": "jianliao.com", 6 | "x-nginx-proxy": "true", 7 | "connection": "Upgrade", 8 | "content-length": "578", 9 | "content-type": "application/x-www-form-urlencoded", 10 | "accept-encoding": "gzip", 11 | "accept": "*/*", 12 | "user-agent": "mailgun/treq-15.0.0" 13 | }, 14 | "query": {}, 15 | "body": { 16 | "city": "San Francisco", 17 | "domain": "mail.jianliao.com", 18 | "device-type": "desktop", 19 | "my_var_1": "Mailgun Variable #1", 20 | "country": "US", 21 | "region": "CA", 22 | "client-name": "Chrome", 23 | "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31", 24 | "client-os": "Linux", 25 | "my-var-2": "awesome", 26 | "url": "http://mailgun.net", 27 | "ip": "50.56.129.169", 28 | "client-type": "browser", 29 | "recipient": "alice@example.com", 30 | "event": "clicked", 31 | "timestamp": "1453443177", 32 | "body-plain": "" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/services/mailgun_assets/delivered.json: -------------------------------------------------------------------------------- 1 | { 2 | "headers": { 3 | "x-real-ip": "173.203.37.68", 4 | "x-forwarded-for": "173.203.37.68", 5 | "host": "jianliao.com", 6 | "x-nginx-proxy": "true", 7 | "connection": "Upgrade", 8 | "content-length": "1207", 9 | "content-type": "application/x-www-form-urlencoded", 10 | "accept-encoding": "gzip", 11 | "accept": "*/*", 12 | "user-agent": "mailgun/treq-15.0.0" 13 | }, 14 | "query": {}, 15 | "body": { 16 | "domain": "mail.jianliao.com", 17 | "my_var_1": "Mailgun Variable #1", 18 | "my-var-2": "awesome", 19 | "message-headers": "[[\"Received\", \"by luna.mailgun.net with SMTP mgrt 8734663311733; Fri, 03 May 2013 18:26:27 +0000\"], [\"Content-Type\", [\"multipart/alternative\", {\"boundary\": \"eb663d73ae0a4d6c9153cc0aec8b7520\"}]], [\"Mime-Version\", \"1.0\"], [\"Subject\", \"Test deliver webhook\"], [\"From\", \"Bob \"], [\"To\", \"Alice \"], [\"Message-Id\", \"<20130503182626.18666.16540@mail.jianliao.com>\"], [\"X-Mailgun-Variables\", \"{\\\"my_var_1\\\": \\\"Mailgun Variable #1\\\", \\\"my-var-2\\\": \\\"awesome\\\"}\"], [\"Date\", \"Fri, 03 May 2013 18:26:27 +0000\"], [\"Sender\", \"bob@mail.jianliao.com\"]]", 20 | "Message-Id": "<20130503182626.18666.16540@mail.jianliao.com>", 21 | "recipient": "alice@example.com", 22 | "event": "delivered", 23 | "timestamp": "1453443045", 24 | "body-plain": "" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/services/mailgun_assets/dropped.json: -------------------------------------------------------------------------------- 1 | { 2 | "headers": { 3 | "x-real-ip": "173.203.37.70", 4 | "x-forwarded-for": "173.203.37.70", 5 | "host": "jianliao.com", 6 | "x-nginx-proxy": "true", 7 | "connection": "Upgrade", 8 | "content-length": "4178", 9 | "content-type": "multipart/form-data; boundary=0d7c1288-bd35-4687-b5cb-9e5f0977bd36", 10 | "accept-encoding": "gzip", 11 | "accept": "*/*", 12 | "user-agent": "mailgun/treq-15.0.0" 13 | }, 14 | "query": {}, 15 | "body": { 16 | "Message-Id": "<20130503192659.13651.20287@mail.jianliao.com>", 17 | "X-Mailgun-Sid": "WyIwNzI5MCIsICJpZG91YnR0aGlzb25lZXhpc3RzQGdtYWlsLmNvbSIsICI2Il0=", 18 | "attachment-count": "1", 19 | "code": "605", 20 | "description": "Not delivering to previously bounced address", 21 | "domain": "mail.jianliao.com", 22 | "event": "dropped", 23 | "message-headers": "[[\"Received\", \"by luna.mailgun.net with SMTP mgrt 8755546751405; Fri, 03 May 2013 19:26:59 +0000\"], [\"Content-Type\", [\"multipart/alternative\", {\"boundary\": \"23041bcdfae54aafb801a8da0283af85\"}]], [\"Mime-Version\", \"1.0\"], [\"Subject\", \"Test drop webhook\"], [\"From\", \"Bob \"], [\"To\", \"Alice \"], [\"Message-Id\", \"<20130503192659.13651.20287@mail.jianliao.com>\"], [\"List-Unsubscribe\", \"\"], [\"X-Mailgun-Sid\", \"WyIwNzI5MCIsICJpZG91YnR0aGlzb25lZXhpc3RzQGdtYWlsLmNvbSIsICI2Il0=\"], [\"X-Mailgun-Variables\", \"{\\\"my_var_1\\\": \\\"Mailgun Variable #1\\\", \\\"my-var-2\\\": \\\"awesome\\\"}\"], [\"Date\", \"Fri, 03 May 2013 19:26:59 +0000\"], [\"Sender\", \"bob@mail.jianliao.com\"]]", 24 | "my-var-2": "awesome", 25 | "my_var_1": "Mailgun Variable #1", 26 | "reason": "hardfail", 27 | "recipient": "alice@example.com", 28 | "timestamp": "1453442986" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/services/mailgun_assets/open.json: -------------------------------------------------------------------------------- 1 | { 2 | "headers": { 3 | "x-real-ip": "173.203.37.68", 4 | "x-forwarded-for": "173.203.37.68", 5 | "host": "jianliao.com", 6 | "x-nginx-proxy": "true", 7 | "connection": "Upgrade", 8 | "content-length": "548", 9 | "content-type": "application/x-www-form-urlencoded", 10 | "accept-encoding": "gzip", 11 | "accept": "*/*", 12 | "user-agent": "mailgun/treq-15.0.0" 13 | }, 14 | "query": {}, 15 | "body": { 16 | "city": "San Francisco", 17 | "domain": "mail.jianliao.com", 18 | "device-type": "desktop", 19 | "my_var_1": "Mailgun Variable #1", 20 | "country": "US", 21 | "region": "CA", 22 | "client-name": "Chrome", 23 | "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31", 24 | "client-os": "Linux", 25 | "my-var-2": "awesome", 26 | "ip": "50.56.129.169", 27 | "client-type": "browser", 28 | "recipient": "alice@example.com", 29 | "event": "opened", 30 | "timestamp": "1453443238", 31 | "body-plain": "" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/services/mailgun_assets/unsubscribe.json: -------------------------------------------------------------------------------- 1 | { 2 | "headers": { 3 | "x-real-ip": "173.203.37.68", 4 | "x-forwarded-for": "173.203.37.68", 5 | "host": "jianliao.com", 6 | "x-nginx-proxy": "true", 7 | "connection": "Upgrade", 8 | "content-length": "562", 9 | "content-type": "application/x-www-form-urlencoded", 10 | "accept-encoding": "gzip", 11 | "accept": "*/*", 12 | "user-agent": "mailgun/treq-15.0.0" 13 | }, 14 | "query": {}, 15 | "body": { 16 | "ip": "50.56.129.169", 17 | "city": "San Francisco", 18 | "domain": "mail.jianliao.com", 19 | "device-type": "desktop", 20 | "my_var_1": "Mailgun Variable #1", 21 | "country": "US", 22 | "region": "CA", 23 | "client-name": "Chrome", 24 | "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31", 25 | "client-os": "Linux", 26 | "my-var-2": "awesome", 27 | "client-type": "browser", 28 | "tag": "*", 29 | "recipient": "alice@example.com", 30 | "event": "unsubscribed", 31 | "timestamp": "1453443158", 32 | "body-plain": "" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/services/mikecrm.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $mikecrm = loader.load 'mikecrm' 5 | 6 | describe 'MikeCRM#Webhook', -> 7 | 8 | it 'receive webhook', (done) -> 9 | req.body = { 10 | "form": { 11 | "name": "hello", 12 | "title": "麦客宣讲会活动报名表", 13 | "subtitle": "9月12日,看麦客如何“重新定义信息收集”!", 14 | "url": "http://www.mikecrm.com/formFeedback.php?ID=566933" 15 | }, 16 | "component": { 17 | "0": { 18 | "name": "basic_name", 19 | "title": "您的姓名", 20 | "value": "测试" 21 | }, 22 | "1": { 23 | "name": "basic_email", 24 | "title": "E-mail", 25 | "value": "ceshi@teambition.com" 26 | }, 27 | "2": { 28 | "name": "basic_mobile", 29 | "title": "联系电话", 30 | "value": "18700004300" 31 | } 32 | } 33 | } 34 | 35 | req.integration = _id: 1 36 | 37 | $mikecrm.then (mikecrm) -> mikecrm.receiveEvent 'service.webhook', req 38 | .then (message) -> 39 | message.attachments[0].data.title.should.eql 'MikeCRM: hello 麦客宣讲会活动报名表' 40 | message.attachments[0].data.text.should.eql ''' 41 | 您的姓名 : 测试 42 | E-mail : ceshi@teambition.com 43 | 联系电话 : 18700004300 44 | ''' 45 | message.attachments[0].data.redirectUrl.should.eql 'http://www.mikecrm.com/formFeedback.php?ID=566933' 46 | .nodeify done 47 | -------------------------------------------------------------------------------- /test/services/newrelic.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $newrelic = loader.load 'newrelic' 5 | 6 | payload = 7 | policy_url: "https://alerts.newrelic.com/accounts/1065273/policies/0" 8 | condition_id: 0 9 | condition_name: "New Relic Alert - Test Condition" 10 | account_id: 1065273 11 | event_type: "NOTIFICATION" 12 | runbook_url: "http://localhost/runbook/url" 13 | severity: "INFO" 14 | incident_id: 0 15 | account_name: "Teambition_4" 16 | timestamp: 1439535842735 17 | details: "New Relic Alert - Channel Test" 18 | incident_acknowledge_url: "https://alerts.newrelic.com/accounts/1065273/incidents/0/acknowledge" 19 | owner: "Test User" 20 | policy_name: "New Relic Alert - Test Policy" 21 | incident_url: "https://alerts.newrelic.com/accounts/1065273/incidents/0" 22 | current_state: "test" 23 | targets: [ 24 | id: "12345" 25 | name: "Test Target" 26 | link: "http://localhost/sample/callback/link/12345" 27 | labels: 28 | label: "value" 29 | product: "TESTING" 30 | type: "test" 31 | ] 32 | 33 | describe 'NewRelic#Webhook', -> 34 | 35 | req.integration = _id: '123' 36 | 37 | it 'receive webhook', (done) -> 38 | req.body = payload 39 | 40 | $newrelic.then (newrelic) -> newrelic.receiveEvent 'service.webhook', req 41 | .then (message) -> 42 | message.attachments[0].data.redirectUrl.should.eql payload.incident_url 43 | message.attachments[0].data.title.should.eql ''' 44 | NOTIFICATION: New Relic Alert - Test Condition 45 | ''' 46 | message.attachments[0].data.text.should.eql ''' 47 | Owner: Test User 48 | Incident: New Relic Alert - Channel Test 49 | ''' 50 | .nodeify done 51 | -------------------------------------------------------------------------------- /test/services/outgoing.coffee: -------------------------------------------------------------------------------- 1 | # Moved to talk-api 2 | -------------------------------------------------------------------------------- /test/services/pingxx.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $pingxx = loader.load 'pingxx' 5 | requireDir = require 'require-dir' 6 | 7 | payloads = requireDir './pingxx_assets' 8 | 9 | describe 'Pingxx#Webhook', -> 10 | 11 | it 'receive charge.succeeded', (done) -> 12 | req.body = payloads['charge.succeeded'] 13 | req.integration = _id: 1 14 | 15 | $pingxx.then (pingxx) -> pingxx.receiveEvent 'service.webhook', req 16 | 17 | .then (message) -> 18 | message.attachments[0].data.title.should.eql "付款成功 Your Subject" 19 | message.attachments[0].data.text.indexOf ''' 20 | 订单号:123456789 21 | 金额:1 CNY 22 | 商品描述:Your Body 23 | ''' 24 | .should.eql 0 25 | message.attachments[0].data.redirectUrl.should.eql 'https://dashboard.pingxx.com/app/detail?app_id=app_1234567890abcDEF' 26 | 27 | .nodeify done 28 | 29 | it 'receive summary.daily.available', (done) -> 30 | req.body = payloads['summary.daily.available'] 31 | req.integration = _id: 1 32 | 33 | $pingxx.then (pingxx) -> pingxx.receiveEvent 'service.webhook', req 34 | 35 | .then (message) -> 36 | message.attachments[0].data.title.should.eql "日统计 Company Name" 37 | message.attachments[0].data.text.indexOf ''' 38 | 交易金额:10 元 39 | 交易量:100 笔 40 | ''' 41 | .should.eql 0 42 | 43 | .nodeify done 44 | -------------------------------------------------------------------------------- /test/services/pingxx_assets/charge.succeeded.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "evt_ugB6x3K43D16wXCcqbplWAJo", 3 | "created": 1427555101, 4 | "livemode": true, 5 | "type": "charge.succeeded", 6 | "data": { 7 | "object": { 8 | "id": "ch_Xsr7u35O3m1Gw4ed2ODmi4Lw", 9 | "object": "charge", 10 | "created": 1427555076, 11 | "livemode": true, 12 | "paid": true, 13 | "refunded": false, 14 | "app": "app_1234567890abcDEF", 15 | "channel": "upacp", 16 | "order_no": "123456789", 17 | "client_ip": "127.0.0.1", 18 | "amount": 100, 19 | "amount_settle": 0, 20 | "currency": "cny", 21 | "subject": "Your Subject", 22 | "body": "Your Body", 23 | "extra": {}, 24 | "time_paid": 1427555101, 25 | "time_expire": 1427641476, 26 | "time_settle": null, 27 | "transaction_no": "1224524301201505066067849274", 28 | "refunds": { 29 | "object": "list", 30 | "url": "/v1/charges/ch_L8qn10mLmr1GS8e5OODmHaL4/refunds", 31 | "has_more": false, 32 | "data": [] 33 | }, 34 | "amount_refunded": 0, 35 | "failure_code": null, 36 | "failure_msg": null, 37 | "metadata": {}, 38 | "credential": {}, 39 | "description": null 40 | } 41 | }, 42 | "object": "event", 43 | "pending_webhooks": 0, 44 | "request": "iar_qH4y1KbTy5eLGm1uHSTS00s" 45 | } 46 | -------------------------------------------------------------------------------- /test/services/pingxx_assets/refund.succeeded.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "evt_gJKelawq06CiPojS5gt3noQA", 3 | "created": 1427555348, 4 | "livemode": true, 5 | "type": "refund.succeeded", 6 | "data": { 7 | "object": { 8 | "id": "re_SG0mnjTD3jAHimbvDKjnXLC9", 9 | "object": "refund", 10 | "order_no": "SG0mnjTD3jAHimbvDKjnXLC9", 11 | "amount": 100, 12 | "created": 1427555346, 13 | "succeed": true, 14 | "time_succeed": 1427555348, 15 | "description": "Refund Description", 16 | "failure_code": null, 17 | "failure_msg": null, 18 | "metadata": {}, 19 | "charge": "ch_Xsr7u35O3m1Gw4ed2ODmi4Lw" 20 | } 21 | }, 22 | "object": "event", 23 | "pending_webhooks": 0, 24 | "request": "iar_Ca1Oe10OqTSOPOmzX9Hi1a5" 25 | } 26 | -------------------------------------------------------------------------------- /test/services/pingxx_assets/summary.daily.available.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "evt_cKAOfpRo2XgCvZ3dzI9AIlgb", 3 | "created": 1427555016, 4 | "livemode": false, 5 | "type": "summary.daily.available", 6 | "data": { 7 | "object": { 8 | "acct_id": "acct_0eHSiDyzv9G09ejT", 9 | "object": "account_daily_summary", 10 | "acct_display_name": "Company Name", 11 | "created": 1425139260, 12 | "summary_from": 1425052800, 13 | "summary_to": 1425139199, 14 | "charges_amount": 1000, 15 | "charges_count" : 100 16 | } 17 | }, 18 | "object": "event", 19 | "pending_webhooks": 0, 20 | "request": null 21 | } 22 | -------------------------------------------------------------------------------- /test/services/pingxx_assets/summary.monthly.available.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "evt_tvWU4AvNz79mgOE0MCPN21CM", 3 | "created": 1427555016, 4 | "livemode": false, 5 | "type": "summary.monthly.available", 6 | "data": { 7 | "object": { 8 | "acct_id": "acct_0eHSiDyzv9G09ejT", 9 | "object": "account_monthly_summary", 10 | "acct_display_name": "Company Name", 11 | "created": 1425139260, 12 | "summary_from": 1422720000, 13 | "summary_to": 1425139199, 14 | "charges_amount": 3000, 15 | "charges_count" : 300 16 | } 17 | }, 18 | "object": "event", 19 | "pending_webhooks": 0, 20 | "request": null 21 | } 22 | -------------------------------------------------------------------------------- /test/services/pingxx_assets/summary.weekly.available.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "evt_15lLTI2eZvKYlo2CcIuYBxl7", 3 | "created": 1427555016, 4 | "livemode": false, 5 | "type": "summary.weekly.available", 6 | "data": { 7 | "object": { 8 | "acct_id": "acct_0eHSiDyzv9G09ejT", 9 | "object": "account_weekly_summary", 10 | "acct_display_name": "Company Name", 11 | "created": 1425830460, 12 | "summary_from": 1425225600, 13 | "summary_to": 1425830399, 14 | "charges_amount": 2000, 15 | "charges_count" : 200 16 | } 17 | }, 18 | "object": "event", 19 | "pending_webhooks": 0, 20 | "request": null 21 | } 22 | -------------------------------------------------------------------------------- /test/services/robot.coffee: -------------------------------------------------------------------------------- 1 | # Moved to talk-api 2 | -------------------------------------------------------------------------------- /test/services/rss.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | Promise = require 'bluebird' 3 | 4 | loader = require '../../src/loader' 5 | {req, res} = require '../util' 6 | 7 | $rss = loader.load 'rss' 8 | 9 | describe 'RSS', -> 10 | 11 | it 'should parse the title and description of rss feed', (done) -> 12 | req.set 'url', 'http://127.0.0.1:7632/rss/v2ex.xml' 13 | $rss.then (rss) -> 14 | rss.receiveApi 'checkRSS', req, res 15 | .then (body) -> 16 | body.should.have.properties 'title', 'description' 17 | body.title.should.eql 'V2EX' 18 | body.description.should.eql 'way to explore' 19 | .nodeify done 20 | 21 | it 'should fit for the GBK encoding site', (done) -> 22 | req.set 'url', 'http://127.0.0.1:7632/rss/baidu.xml' 23 | $rss.then (rss) -> 24 | rss.receiveApi 'checkRSS', req, res 25 | .then (body) -> 26 | body.title.should.eql '百度国内焦点新闻' 27 | .nodeify done 28 | 29 | it 'should receive new integration.create', (done) -> 30 | integration = 31 | category: 'rss' 32 | url: 'http://127.0.0.1:7632/rss/baidu.xml' 33 | 34 | req.integration = integration 35 | 36 | $rss.then (rss) -> rss.receiveEvent 'integration.create', req 37 | .nodeify done 38 | -------------------------------------------------------------------------------- /test/services/rss_assets/baidu.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/test/services/rss_assets/baidu.xml -------------------------------------------------------------------------------- /test/services/swathub.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $swathub = loader.load 'swathub' 5 | 6 | describe 'SWATHub#Webhook', -> 7 | 8 | req.integration = _id: '123' 9 | 10 | it 'receive webhook', (done) -> 11 | 12 | req.body = 13 | authorName: '路人甲' 14 | title: '你好' 15 | text: '天气不错' 16 | redirectUrl: 'https://talk.ai/site' 17 | imageUrl: 'https://dn-talk.oss.aliyuncs.com/site/images/workspace-84060cfd.jpg' 18 | 19 | $swathub.then (swathub) -> swathub.receiveEvent 'service.webhook', req 20 | .then (message) -> 21 | message.should.have.properties 'authorName' 22 | message.attachments[0].data.should.have.properties 'title', 'text', 'redirectUrl', 'imageUrl' 23 | .nodeify done 24 | -------------------------------------------------------------------------------- /test/services/teambition_assets/entry.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "entry.create", 3 | "data": { 4 | "entry": { 5 | "_id": "5541d6e984b8b4a859be8df1", 6 | "content": "incoming", 7 | "type": 1, 8 | "amount": 10, 9 | "url": "http://project.ci/project/554063098f408b186ab54b89/bookkeeping/entry/5541d6e984b8b4a859be8df1" 10 | }, 11 | "project": { 12 | "_id": "554063098f408b186ab54b89", 13 | "name": "新名", 14 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 15 | }, 16 | "user": { 17 | "_id": "553dfb95a0417c2260207be5", 18 | "name": "二师兄", 19 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/entry.update.involveMembers.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "entry.update.involveMembers", 3 | "data": { 4 | "del": [], 5 | "add": [ 6 | "553dd73a307022fe2b7f6d81" 7 | ], 8 | "entry": { 9 | "_id": "5541d6e984b8b4a859be8df1", 10 | "content": "incoming", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/bookkeeping/entry/5541d6e984b8b4a859be8df1" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/entry.update.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "entry.update", 3 | "data": { 4 | "entry": { 5 | "_id": "5540864196dd69787885c066", 6 | "content": "income", 7 | "type": 1, 8 | "amount": 12, 9 | "url": "http://project.ci/project/554063098f408b186ab54b89/bookkeeping/entry/5540864196dd69787885c066" 10 | }, 11 | "user": { 12 | "_id": "553dfb95a0417c2260207be5", 13 | "name": "二师兄", 14 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 15 | }, 16 | "project": { 17 | "_id": "554063098f408b186ab54b89", 18 | "name": "新名", 19 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 20 | }, 21 | "old": {} 22 | } 23 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/event.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "event.create", 3 | "data": { 4 | "event": { 5 | "_id": "5541d6ade37bab3455d0f468", 6 | "title": "event", 7 | "content": "haha", 8 | "startDate": "2015-04-30T08:15:00.000Z", 9 | "endDate": "2015-04-30T09:15:00.000Z", 10 | "location": "office", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/events/event/5541d6ade37bab3455d0f468" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/services/teambition_assets/event.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "event.remove", 3 | "data": { 4 | "event": { 5 | "_id": "5541d6ade37bab3455d0f468", 6 | "title": "event" 7 | }, 8 | "user": { 9 | "_id": "553dfb95a0417c2260207be5", 10 | "name": "二师兄", 11 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 12 | }, 13 | "project": { 14 | "_id": "554063098f408b186ab54b89", 15 | "name": "新名", 16 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/event.update.involveMembers.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "event.update.involveMembers", 3 | "data": { 4 | "del": [], 5 | "add": [ 6 | "553dd73a307022fe2b7f6d81" 7 | ], 8 | "event": { 9 | "_id": "5541d6ade37bab3455d0f468", 10 | "title": "event", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/events/event/5541d6ade37bab3455d0f468" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/event.update.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "event.update", 3 | "data": { 4 | "event": { 5 | "_id": "5541d6ade37bab3455d0f468", 6 | "title": "event", 7 | "content": "note", 8 | "startDate": "2015-04-30T12:15:00.000Z", 9 | "endDate": "2015-04-30T13:15:00.000Z", 10 | "location": "office", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/events/event/5541d6ade37bab3455d0f468" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | }, 23 | "old": {} 24 | } 25 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/file.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "file.create", 3 | "data": { 4 | "file": [ 5 | { 6 | "_id": "5541d671e37bab3455d0f461", 7 | "fileName": "5.jpg", 8 | "thumbnail": "https://striker.teambition.net/thumbnail/1103a8b11e73cf66dd43102a62b2b8d57bd1/w/200/h/200", 9 | "fileType": "jpg", 10 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/5541d66be37bab3455d0f460/work/5541d671e37bab3455d0f461" 11 | } 12 | ], 13 | "collection": { 14 | "_id": "554063098f408b186ab54b8a", 15 | "title": "Root", 16 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/554063098f408b186ab54b8a" 17 | }, 18 | "user": { 19 | "_id": "553dfb95a0417c2260207be5", 20 | "name": "二师兄", 21 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 22 | }, 23 | "project": { 24 | "_id": "554063098f408b186ab54b89", 25 | "name": "新名", 26 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/services/teambition_assets/file.move.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "file.move", 3 | "data": { 4 | "file": { 5 | "_id": "5541d671e37bab3455d0f461", 6 | "fileName": "5.jpg", 7 | "collection": { 8 | "_id": "5541d66be37bab3455d0f460", 9 | "title": "dir", 10 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/5541d66be37bab3455d0f460" 11 | }, 12 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/5541d66be37bab3455d0f460/work/5541d671e37bab3455d0f461" 13 | }, 14 | "project": { 15 | "_id": "554063098f408b186ab54b89", 16 | "name": "新名", 17 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 18 | }, 19 | "user": { 20 | "_id": "553dfb95a0417c2260207be5", 21 | "name": "二师兄", 22 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 23 | }, 24 | "old": { 25 | "collection": { 26 | "_id": "554063098f408b186ab54b8a", 27 | "title": "Root", 28 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/554063098f408b186ab54b8a" 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/file.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "file.remove", 3 | "data": { 4 | "file": { 5 | "_id": "5541d671e37bab3455d0f461", 6 | "fileName": "123.jpg" 7 | }, 8 | "user": { 9 | "_id": "553dfb95a0417c2260207be5", 10 | "name": "二师兄", 11 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 12 | }, 13 | "project": { 14 | "_id": "554063098f408b186ab54b89", 15 | "name": "新名", 16 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/file.rename.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "file.rename", 3 | "data": { 4 | "file": { 5 | "_id": "5541d671e37bab3455d0f461", 6 | "fileName": "123.jpg", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/5541d66be37bab3455d0f460/work/5541d671e37bab3455d0f461" 8 | }, 9 | "user": { 10 | "_id": "553dfb95a0417c2260207be5", 11 | "name": "二师兄", 12 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 13 | }, 14 | "project": { 15 | "_id": "554063098f408b186ab54b89", 16 | "name": "新名", 17 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 18 | }, 19 | "old": { 20 | "fileName": "4.jpg" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/file.update.involveMembers.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "file.update.involveMembers", 3 | "data": { 4 | "del": [], 5 | "add": [ 6 | "553dd73a307022fe2b7f6d81" 7 | ], 8 | "file": { 9 | "_id": "5541d671e37bab3455d0f461", 10 | "fileName": "123.jpg", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/5541d66be37bab3455d0f460/work/5541d671e37bab3455d0f461" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/file.update.version.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "file.update.version", 3 | "data": { 4 | "file": { 5 | "_id": "5541d671e37bab3455d0f461", 6 | "fileName": "4.jpg", 7 | "fileType": "jpg", 8 | "url": "http://project.ci/project/554063098f408b186ab54b89/files/5541d66be37bab3455d0f460/work/5541d671e37bab3455d0f461" 9 | }, 10 | "user": { 11 | "_id": "553dfb95a0417c2260207be5", 12 | "name": "二师兄", 13 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 14 | }, 15 | "project": { 16 | "_id": "554063098f408b186ab54b89", 17 | "name": "新名", 18 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/post.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "post.create", 3 | "data": { 4 | "post": { 5 | "_id": "5541d65be37bab3455d0f45b", 6 | "title": "Mardown", 7 | "content": "```javascript\r\nvar a = 1\r\n```", 8 | "postMode": "md", 9 | "url": "http://project.ci/project/554063098f408b186ab54b89/posts/post/5541d65be37bab3455d0f45b" 10 | }, 11 | "user": { 12 | "_id": "553dfb95a0417c2260207be5", 13 | "name": "二师兄", 14 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 15 | }, 16 | "project": { 17 | "_id": "554063098f408b186ab54b89", 18 | "name": "新名", 19 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/post.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "post.remove", 3 | "data": { 4 | "post": { 5 | "_id": "5541d62e84b8b4a859be8dca", 6 | "title": "Markdown" 7 | }, 8 | "user": { 9 | "_id": "553dfb95a0417c2260207be5", 10 | "name": "二师兄", 11 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 12 | }, 13 | "project": { 14 | "_id": "554063098f408b186ab54b89", 15 | "name": "新名", 16 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/post.update.involveMembers.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "post.update.involveMembers", 3 | "data": { 4 | "del": [ 5 | "553dd73a307022fe2b7f6d81" 6 | ], 7 | "add": [], 8 | "post": { 9 | "_id": "5541d5f384b8b4a859be8dba", 10 | "title": "post", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/posts/post/5541d5f384b8b4a859be8dba" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/post.update.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "post.update", 3 | "data": { 4 | "post": { 5 | "_id": "5541d5f384b8b4a859be8dba", 6 | "title": "post", 7 | "content": "

分享内容

分享2
", 8 | "postMode": "html", 9 | "url": "http://project.ci/project/554063098f408b186ab54b89/posts/post/5541d5f384b8b4a859be8dba" 10 | }, 11 | "user": { 12 | "_id": "553dfb95a0417c2260207be5", 13 | "name": "二师兄", 14 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 15 | }, 16 | "project": { 17 | "_id": "554063098f408b186ab54b89", 18 | "name": "新名", 19 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 20 | }, 21 | "old": { 22 | "content": "

分享内容

" 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/project.archive.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "project.archive", 3 | "data": { 4 | "project": { 5 | "_id": "554063098f408b186ab54b89", 6 | "name": "新名", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 8 | }, 9 | "user": { 10 | "_id": "553dfb95a0417c2260207be5", 11 | "name": "二师兄", 12 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/project.member.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "project.member.create", 3 | "data": { 4 | "member": [ 5 | { 6 | "_id": "553dd73a307022fe2b7f6d81", 7 | "name": "大师兄", 8 | "avatarUrl": "https://mailimg.teambition.com/logos/5.png" 9 | } 10 | ], 11 | "user": { 12 | "_id": "553dfb95a0417c2260207be5", 13 | "name": "二师兄", 14 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 15 | }, 16 | "project": { 17 | "_id": "554063098f408b186ab54b89", 18 | "name": "新名", 19 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 20 | }, 21 | "type": "invite" 22 | } 23 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/project.member.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "project.member.remove", 3 | "data": { 4 | "member": { 5 | "_id": "553dd73a307022fe2b7f6d81", 6 | "name": "大师兄", 7 | "avatarUrl": "https://mailimg.teambition.com/logos/5.png" 8 | }, 9 | "user": { 10 | "_id": "553dfb95a0417c2260207be5", 11 | "name": "二师兄", 12 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 13 | }, 14 | "project": { 15 | "_id": "554063098f408b186ab54b89", 16 | "name": "新名", 17 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 18 | }, 19 | "type": "remove" 20 | } 21 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/project.rename.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "project.rename", 3 | "data": { 4 | "project": { 5 | "_id": "554063098f408b186ab54b89", 6 | "name": "新名", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 8 | }, 9 | "user": { 10 | "_id": "553dfb95a0417c2260207be5", 11 | "name": "二师兄", 12 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 13 | }, 14 | "old": { 15 | "name": "改名" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/project.unarchive.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "project.unarchive", 3 | "data": { 4 | "project": { 5 | "_id": "554063098f408b186ab54b89", 6 | "name": "新名", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 8 | }, 9 | "user": { 10 | "_id": "553dfb95a0417c2260207be5", 11 | "name": "二师兄", 12 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/stage.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "stage.create", 3 | "data": { 4 | "stage": { 5 | "_id": "5541d52ae37bab3455d0f44a", 6 | "name": "DOING", 7 | "tasklist": { 8 | "_id": "5541d51fe37bab3455d0f446", 9 | "title": "tasklist", 10 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446" 11 | } 12 | }, 13 | "project": { 14 | "_id": "554063098f408b186ab54b89", 15 | "name": "新名", 16 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 17 | }, 18 | "user": { 19 | "_id": "553dfb95a0417c2260207be5", 20 | "name": "二师兄", 21 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/stage.rename.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "stage.rename", 3 | "data": { 4 | "stage": { 5 | "_id": "5541d51fe37bab3455d0f447", 6 | "name": "TODO", 7 | "tasklist": { 8 | "_id": "5541d51fe37bab3455d0f446", 9 | "title": "tasklist", 10 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446" 11 | } 12 | }, 13 | "project": { 14 | "_id": "554063098f408b186ab54b89", 15 | "name": "新名", 16 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 17 | }, 18 | "user": { 19 | "_id": "553dfb95a0417c2260207be5", 20 | "name": "二师兄", 21 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 22 | }, 23 | "old": { 24 | "name": "stage.planning" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/subtask.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "subtask.create", 3 | "data": { 4 | "subtask": { 5 | "_id": "5541d76884b8b4a859be8e06", 6 | "content": "subtask", 7 | "task": { 8 | "_id": "55408a3602e7e97278b13bb3", 9 | "content": "subtask", 10 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/554063098f408b186ab54b90/task/55408a3602e7e97278b13bb3" 11 | } 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/subtask.done.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "subtask.done", 3 | "data": { 4 | "subtask": { 5 | "_id": "5541d74e84b8b4a859be8df9", 6 | "content": "subtask" 7 | }, 8 | "project": { 9 | "_id": "554063098f408b186ab54b89", 10 | "name": "新名", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/subtask.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "subtask.remove", 3 | "data": { 4 | "subtask": { 5 | "_id": "5541d75284b8b4a859be8dfe", 6 | "content": "subtask" 7 | }, 8 | "project": { 9 | "_id": "554063098f408b186ab54b89", 10 | "name": "新名", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/subtask.update.content.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "subtask.update.content", 3 | "data": { 4 | "subtask": { 5 | "_id": "5541d76884b8b4a859be8e06", 6 | "content": "subtask 1" 7 | }, 8 | "project": { 9 | "_id": "554063098f408b186ab54b89", 10 | "name": "新名", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "old": { 19 | "content": "subtask" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/subtask.update.executor.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "subtask.update.executor", 3 | "data": { 4 | "subtask": { 5 | "_id": "5541d75284b8b4a859be8dfe", 6 | "content": "subtask", 7 | "executor": { 8 | "_id": "553dd73a307022fe2b7f6d81", 9 | "name": "大师兄", 10 | "avatarUrl": "https://mailimg.teambition.com/logos/5.png" 11 | } 12 | }, 13 | "project": { 14 | "_id": "554063098f408b186ab54b89", 15 | "name": "新名", 16 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 17 | }, 18 | "user": { 19 | "_id": "553dfb95a0417c2260207be5", 20 | "name": "二师兄", 21 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/tag.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "tag.create", 3 | "data": { 4 | "tag": { 5 | "_id": "5541d5d084b8b4a859be8db9", 6 | "name": "tag4", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tags/tag/5541d5d084b8b4a859be8db9" 8 | }, 9 | "project": { 10 | "_id": "554063098f408b186ab54b89", 11 | "name": "新名", 12 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 13 | }, 14 | "user": { 15 | "_id": "553dfb95a0417c2260207be5", 16 | "name": "二师兄", 17 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/tag.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "tag.remove", 3 | "data": { 4 | "tag": { 5 | "_id": "5540851002e7e97278b13b34", 6 | "name": "tag3" 7 | }, 8 | "project": { 9 | "_id": "554063098f408b186ab54b89", 10 | "name": "新名", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.create", 3 | "data": { 4 | "task": { 5 | "_id": "5541d52de37bab3455d0f44b", 6 | "content": "task", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446/task/5541d52de37bab3455d0f44b" 8 | }, 9 | "project": { 10 | "_id": "554063098f408b186ab54b89", 11 | "name": "新名", 12 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 13 | }, 14 | "user": { 15 | "_id": "553dfb95a0417c2260207be5", 16 | "name": "二师兄", 17 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.done.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.done", 3 | "data": { 4 | "task": { 5 | "_id": "5541d52de37bab3455d0f44b", 6 | "content": "task", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446/task/5541d52de37bab3455d0f44b" 8 | }, 9 | "project": { 10 | "_id": "554063098f408b186ab54b89", 11 | "name": "新名", 12 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 13 | }, 14 | "user": { 15 | "_id": "553dfb95a0417c2260207be5", 16 | "name": "二师兄", 17 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.move.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.move", 3 | "data": { 4 | "task": { 5 | "_id": "5541d52de37bab3455d0f44b", 6 | "content": "task", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446/task/5541d52de37bab3455d0f44b" 8 | }, 9 | "stage": { 10 | "_id": "5541d52ae37bab3455d0f44a", 11 | "name": "DOING" 12 | }, 13 | "tasklist": { 14 | "_id": "5541d51fe37bab3455d0f446", 15 | "title": "tasklist" 16 | }, 17 | "project": { 18 | "_id": "554063098f408b186ab54b89", 19 | "name": "新名", 20 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 21 | }, 22 | "user": { 23 | "_id": "553dfb95a0417c2260207be5", 24 | "name": "二师兄", 25 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/services/teambition_assets/task.remove.executor.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.update.executor", 3 | "data": { 4 | "task": { 5 | "_id": "5541d52de37bab3455d0f44b", 6 | "content": "task", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446/task/5541d52de37bab3455d0f44b", 8 | "executor": null 9 | }, 10 | "project": { 11 | "_id": "554063098f408b186ab54b89", 12 | "name": "新名", 13 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 14 | }, 15 | "user": { 16 | "_id": "553dfb95a0417c2260207be5", 17 | "name": "二师兄", 18 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.remove", 3 | "data": { 4 | "task": { 5 | "_id": "5541d56974a47c8601ae4cae", 6 | "content": "task" 7 | }, 8 | "project": { 9 | "_id": "554063098f408b186ab54b89", 10 | "name": "新名", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.rename.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.rename", 3 | "data": { 4 | "task": { 5 | "_id": "5540885902e7e97278b13ba7", 6 | "content": "newtask", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/554063098f408b186ab54b90/task/5540885902e7e97278b13ba7" 8 | }, 9 | "project": { 10 | "_id": "554063098f408b186ab54b89", 11 | "name": "新名", 12 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 13 | }, 14 | "user": { 15 | "_id": "553dfb95a0417c2260207be5", 16 | "name": "二师兄", 17 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 18 | }, 19 | "old": { 20 | "content": "task" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.update.dueDate.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.update.dueDate", 3 | "data": { 4 | "task": { 5 | "_id": "5541d52de37bab3455d0f44b", 6 | "content": "task", 7 | "dueDate": "2015-04-21T16:00:00.000Z", 8 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446/task/5541d52de37bab3455d0f44b" 9 | }, 10 | "project": { 11 | "_id": "554063098f408b186ab54b89", 12 | "name": "新名", 13 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 14 | }, 15 | "user": { 16 | "_id": "553dfb95a0417c2260207be5", 17 | "name": "二师兄", 18 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 19 | }, 20 | "old": { 21 | "dueDate": null 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.update.executor.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.update.executor", 3 | "data": { 4 | "task": { 5 | "_id": "5541d52de37bab3455d0f44b", 6 | "content": "task", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446/task/5541d52de37bab3455d0f44b", 8 | "executor": { 9 | "_id": "553dd73a307022fe2b7f6d81", 10 | "name": "大师兄", 11 | "avatarUrl": "https://mailimg.teambition.com/logos/5.png" 12 | } 13 | }, 14 | "project": { 15 | "_id": "554063098f408b186ab54b89", 16 | "name": "新名", 17 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 18 | }, 19 | "user": { 20 | "_id": "553dfb95a0417c2260207be5", 21 | "name": "二师兄", 22 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/services/teambition_assets/task.update.involveMembers.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.update.involveMembers", 3 | "data": { 4 | "del": [ 5 | "553dd73a307022fe2b7f6d81" 6 | ], 7 | "add": [], 8 | "task": { 9 | "_id": "5541d52de37bab3455d0f44b", 10 | "content": "task", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446/task/5541d52de37bab3455d0f44b" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | }, 18 | "project": { 19 | "_id": "554063098f408b186ab54b89", 20 | "name": "新名", 21 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/task.update.priority.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "task.update.priority", 3 | "data": { 4 | "task": { 5 | "_id": "55408a3602e7e97278b13bb3", 6 | "content": "subtask", 7 | "priority": "urgent", 8 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/554063098f408b186ab54b90/task/55408a3602e7e97278b13bb3" 9 | }, 10 | "project": { 11 | "_id": "554063098f408b186ab54b89", 12 | "name": "新名", 13 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 14 | }, 15 | "user": { 16 | "_id": "553dfb95a0417c2260207be5", 17 | "name": "二师兄", 18 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 19 | }, 20 | "old": { 21 | "priority": "normal" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/tasklist.create.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "tasklist.create", 3 | "data": { 4 | "tasklist": { 5 | "_id": "5541d51fe37bab3455d0f446", 6 | "title": "tasklist", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446" 8 | }, 9 | "project": { 10 | "_id": "554063098f408b186ab54b89", 11 | "name": "新名", 12 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 13 | }, 14 | "user": { 15 | "_id": "553dfb95a0417c2260207be5", 16 | "name": "二师兄", 17 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/tasklist.remove.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "tasklist.remove", 3 | "data": { 4 | "tasklist": { 5 | "_id": "5541d51fe37bab3455d0f446", 6 | "title": "new tasklist" 7 | }, 8 | "project": { 9 | "_id": "554063098f408b186ab54b89", 10 | "name": "新名", 11 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 12 | }, 13 | "user": { 14 | "_id": "553dfb95a0417c2260207be5", 15 | "name": "二师兄", 16 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /test/services/teambition_assets/tasklist.rename.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "tasklist.rename", 3 | "data": { 4 | "tasklist": { 5 | "_id": "5541d51fe37bab3455d0f446", 6 | "title": "new tasklist", 7 | "url": "http://project.ci/project/554063098f408b186ab54b89/tasks/scrum/5541d51fe37bab3455d0f446" 8 | }, 9 | "project": { 10 | "_id": "554063098f408b186ab54b89", 11 | "name": "新名", 12 | "url": "http://project.ci/project/554063098f408b186ab54b89/home" 13 | }, 14 | "user": { 15 | "_id": "553dfb95a0417c2260207be5", 16 | "name": "二师兄", 17 | "avatarUrl": "https://mailimg.teambition.com/logos/20.png" 18 | }, 19 | "old": { 20 | "title": "tasklist" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /test/services/travis.coffee: -------------------------------------------------------------------------------- 1 | should = require 'should' 2 | loader = require '../../src/loader' 3 | {req} = require '../util' 4 | $travis = loader.load 'travis' 5 | 6 | describe 'Travis#Webhook', -> 7 | 8 | it 'receive webhook', (done) -> 9 | 10 | req.body = require './travis_assets/fail.json' 11 | req.integration = _id: 1 12 | 13 | $travis.then (travis) -> travis.receiveEvent 'service.webhook', req 14 | .then (message) -> 15 | message.attachments.length.should.eql 1 16 | attachment = message.attachments[0] 17 | {category, data} = attachment 18 | category.should.eql 'quote' 19 | data.title.should.eql '[Broken] drips #8 (master - ab6cc90) by Xu Jingxin' 20 | data.text.should.eql 'Test fail' 21 | data.redirectUrl.should.eql 'https://travis-ci.org/sailxjx/drips/builds/69093771' 22 | .nodeify done 23 | -------------------------------------------------------------------------------- /test/services/travis_assets/fail.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": "{\"id\":69093771,\"repository\":{\"id\":676727,\"name\":\"drips\",\"owner_name\":\"sailxjx\",\"url\":\"\"},\"number\":\"8\",\"config\":{\"language\":\"ruby\",\"branches\":{\"only\":[\"master\"]},\"script\":[\"make test\"],\"notifications\":{\"webhooks\":[\"https://talk.ai/webhook-receiver/travis\"]},\".result\":\"configured\",\"os\":\"linux\"},\"status\":1,\"result\":1,\"status_message\":\"Broken\",\"result_message\":\"Broken\",\"started_at\":\"2015-07-01T07:03:02Z\",\"finished_at\":\"2015-07-01T07:03:06Z\",\"duration\":4,\"build_url\":\"https://travis-ci.org/sailxjx/drips/builds/69093771\",\"commit_id\":19723615,\"commit\":\"ab6cc90ab6a4925c02ea17a23c07fd6dd87c5327\",\"base_commit\":null,\"head_commit\":null,\"branch\":\"master\",\"message\":\"Test fail\",\"compare_url\":\"https://github.com/sailxjx/drips/compare/6f47f657ee71...ab6cc90ab6a4\",\"committed_at\":\"2015-07-01T07:01:52Z\",\"author_name\":\"Xu Jingxin\",\"author_email\":\"sailxjx@gmail.com\",\"committer_name\":\"Xu Jingxin\",\"committer_email\":\"sailxjx@gmail.com\",\"matrix\":[{\"id\":69093772,\"repository_id\":676727,\"parent_id\":69093771,\"number\":\"8.1\",\"state\":\"finished\",\"config\":{\"language\":\"ruby\",\"branches\":{\"only\":[\"master\"]},\"script\":[\"make test\"],\"notifications\":{\"webhooks\":[\"https://talk.ai/webhook-receiver/travis\"]},\".result\":\"configured\",\"os\":\"linux\"},\"status\":1,\"result\":1,\"commit\":\"ab6cc90ab6a4925c02ea17a23c07fd6dd87c5327\",\"branch\":\"master\",\"message\":\"Test fail\",\"compare_url\":\"https://github.com/sailxjx/drips/compare/6f47f657ee71...ab6cc90ab6a4\",\"committed_at\":\"2015-07-01T07:01:52Z\",\"author_name\":\"Xu Jingxin\",\"author_email\":\"sailxjx@gmail.com\",\"committer_name\":\"Xu Jingxin\",\"committer_email\":\"sailxjx@gmail.com\",\"allow_failure\":false,\"finished_at\":\"2015-07-01T07:03:06Z\"}],\"type\":\"push\",\"state\":\"failed\",\"pull_request\":false,\"pull_request_number\":null,\"pull_request_title\":null,\"tag\":null}" 3 | } 4 | -------------------------------------------------------------------------------- /test/services/travis_assets/pass.json: -------------------------------------------------------------------------------- 1 | { 2 | "payload": "{\"id\":69092814,\"repository\":{\"id\":676727,\"name\":\"drips\",\"owner_name\":\"sailxjx\",\"url\":\"\"},\"number\":\"7\",\"config\":{\"language\":\"ruby\",\"branches\":{\"only\":[\"master\"]},\"script\":[\"make test\"],\"notifications\":{\"webhooks\":[\"https://talk.ai/webhook-receiver/travis\"]},\".result\":\"configured\",\"os\":\"linux\"},\"status\":0,\"result\":0,\"status_message\":\"Passed\",\"result_message\":\"Passed\",\"started_at\":\"2015-07-01T06:51:42Z\",\"finished_at\":\"2015-07-01T06:51:46Z\",\"duration\":4,\"build_url\":\"https://travis-ci.org/sailxjx/drips/builds/69092814\",\"commit_id\":19723328,\"commit\":\"6f47f657ee71c7efcbf0c8d32363361b49f609c4\",\"base_commit\":null,\"head_commit\":null,\"branch\":\"master\",\"message\":\"Add travis.yml\",\"compare_url\":\"https://github.com/sailxjx/drips/compare/afc184a9aced...6f47f657ee71\",\"committed_at\":\"2015-07-01T06:50:27Z\",\"author_name\":\"Xu Jingxin\",\"author_email\":\"sailxjx@gmail.com\",\"committer_name\":\"Xu Jingxin\",\"committer_email\":\"sailxjx@gmail.com\",\"matrix\":[{\"id\":69092815,\"repository_id\":676727,\"parent_id\":69092814,\"number\":\"7.1\",\"state\":\"finished\",\"config\":{\"language\":\"ruby\",\"branches\":{\"only\":[\"master\"]},\"script\":[\"make test\"],\"notifications\":{\"webhooks\":[\"https://talk.ai/webhook-receiver/travis\"]},\".result\":\"configured\",\"os\":\"linux\"},\"status\":0,\"result\":0,\"commit\":\"6f47f657ee71c7efcbf0c8d32363361b49f609c4\",\"branch\":\"master\",\"message\":\"Add travis.yml\",\"compare_url\":\"https://github.com/sailxjx/drips/compare/afc184a9aced...6f47f657ee71\",\"committed_at\":\"2015-07-01T06:50:27Z\",\"author_name\":\"Xu Jingxin\",\"author_email\":\"sailxjx@gmail.com\",\"committer_name\":\"Xu Jingxin\",\"committer_email\":\"sailxjx@gmail.com\",\"allow_failure\":false,\"finished_at\":\"2015-07-01T06:51:46Z\"}],\"type\":\"push\",\"state\":\"passed\",\"pull_request\":false,\"pull_request_number\":null,\"pull_request_title\":null,\"tag\":null}" 3 | } 4 | -------------------------------------------------------------------------------- /test/services/weibo.coffee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jianliaoim/talk-services/fcdec13dbb4c79d9bb201ef454e26bc944853748/test/services/weibo.coffee -------------------------------------------------------------------------------- /test/util.coffee: -------------------------------------------------------------------------------- 1 | # Test utils 2 | http = require 'http' 3 | Promise = require 'bluebird' 4 | 5 | util = {} 6 | 7 | Object.defineProperty util, 'req', 8 | get: -> 9 | req = new http.IncomingMessage 10 | req._params = {} 11 | req.headers = {} 12 | req.get = (key) -> if key then @_params[key] else @_params 13 | req.set = (key, val) -> @_params[key] = val 14 | req 15 | 16 | Object.defineProperty util, 'res', -> 17 | get: -> 18 | res = new http.ServerResponse 19 | res 20 | 21 | module.exports = util 22 | --------------------------------------------------------------------------------