{"action":"opened","number":282,"pull_request":{"url":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/282","id":167780870,"html_url":"https://github.com/DoSomething/gambit-conversations/pull/282","diff_url":"https://github.com/DoSomething/gambit-conversations/pull/282.diff","patch_url":"https://github.com/DoSomething/gambit-conversations/pull/282.patch","issue_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/282","number":282,"state":"open","locked":false,"title":"v2 Messages: Front and Signup ","user":{"login":"aaronschachter","id":1236811,"avatar_url":"https://avatars2.githubusercontent.com/u/1236811?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronschachter","html_url":"https://github.com/aaronschachter","followers_url":"https://api.github.com/users/aaronschachter/followers","following_url":"https://api.github.com/users/aaronschachter/following{/other_user}","gists_url":"https://api.github.com/users/aaronschachter/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronschachter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronschachter/subscriptions","organizations_url":"https://api.github.com/users/aaronschachter/orgs","repos_url":"https://api.github.com/users/aaronschachter/repos","events_url":"https://api.github.com/users/aaronschachter/events{/privacy}","received_events_url":"https://api.github.com/users/aaronschachter/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\n\r\nSplits out the `POST /v1/send-message` which we use for both Signup and Front messages into separate routes, and cleans up middleware accordingly.\r\n\r\n* Refactors the `POST /v1/send-message` to only send a Signup message (removing feature to send a Front message)\r\n* Adds a `POST /v2/messages?origin=front` route to be used by our Front custom channel to post messages from agents -- we need to update our Front Custom Channel's Outbound API configuration when this is deployed.\r\n* Adds a `POST /v2/messages?origin=signup` route that posts to same Signup route as `/v1/send-message`\r\n\r\n#### How should this be reviewed?\r\n* `POST /v1/send-message` should work as expected for a Signup message, no longer need to pass a `template` parameter.\r\n* `POST /v2/messages?origin=front` should work as expected for a Support message from our Front channel. \r\n* `POST /v2/messages?origin=signup` should work as expected for a Signup message.\r\n\r\n#### Any background context you want to provide?\r\n* This doesn't add much test coverage - wanted to add it in a future PR to help keep this reviewable.\r\n\r\n* Didn't add extract the Front message parsing into a helper function yet. Once a helpers/front exists, we could potentially move functions like `getSupportMessagePath` there, although kind of questionable to have a `lib/front` and `lib/helpers/front`... \r\n\r\n#### Relevant tickets\r\nhttps://github.com/orgs/DoSomething/teams/team-odoyle/discussions/1\r\n\r\n#### Checklist\r\n- [ ] Documentation added for new features/changed endpoints.\r\n- [ ] Tested on staging.","created_at":"2018-02-07T19:04:13Z","updated_at":"2018-02-07T19:04:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/282/commits","review_comments_url":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/282/comments","review_comment_url":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/282/comments","statuses_url":"https://api.github.com/repos/DoSomething/gambit-conversations/statuses/e213b3adc551e83605f45645c6e448fa9d04b89a","head":{"label":"DoSomething:cleanup/send-message","ref":"cleanup/send-message","sha":"e213b3adc551e83605f45645c6e448fa9d04b89a","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":93206005,"name":"gambit-conversations","full_name":"DoSomething/gambit-conversations","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/gambit-conversations","description":":black_joker: The DoSomething.org chatbot service for multi-platform conversations.","fork":false,"url":"https://api.github.com/repos/DoSomething/gambit-conversations","forks_url":"https://api.github.com/repos/DoSomething/gambit-conversations/forks","keys_url":"https://api.github.com/repos/DoSomething/gambit-conversations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/gambit-conversations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/gambit-conversations/teams","hooks_url":"https://api.github.com/repos/DoSomething/gambit-conversations/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/gambit-conversations/events","assignees_url":"https://api.github.com/repos/DoSomething/gambit-conversations/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/gambit-conversations/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/gambit-conversations/tags","blobs_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/gambit-conversations/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/gambit-conversations/languages","stargazers_url":"https://api.github.com/repos/DoSomething/gambit-conversations/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/gambit-conversations/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/gambit-conversations/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/gambit-conversations/subscription","commits_url":"https://api.github.com/repos/DoSomething/gambit-conversations/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/gambit-conversations/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/gambit-conversations/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/gambit-conversations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/gambit-conversations/merges","archive_url":"https://api.github.com/repos/DoSomething/gambit-conversations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/gambit-conversations/downloads","issues_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/gambit-conversations/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/gambit-conversations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/gambit-conversations/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/gambit-conversations/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/gambit-conversations/deployments","created_at":"2017-06-02T21:42:25Z","updated_at":"2017-12-09T00:49:04Z","pushed_at":"2018-02-07T07:25:23Z","git_url":"git://github.com/DoSomething/gambit-conversations.git","ssh_url":"git@github.com:DoSomething/gambit-conversations.git","clone_url":"https://github.com/DoSomething/gambit-conversations.git","svn_url":"https://github.com/DoSomething/gambit-conversations","homepage":"","size":849,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":17,"watchers":1,"default_branch":"master"}},"base":{"label":"DoSomething:master","ref":"master","sha":"2547ee0f1c496db7ee74ba12e79f02ab8b2117a0","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":93206005,"name":"gambit-conversations","full_name":"DoSomething/gambit-conversations","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/gambit-conversations","description":":black_joker: The DoSomething.org chatbot service for multi-platform conversations.","fork":false,"url":"https://api.github.com/repos/DoSomething/gambit-conversations","forks_url":"https://api.github.com/repos/DoSomething/gambit-conversations/forks","keys_url":"https://api.github.com/repos/DoSomething/gambit-conversations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/gambit-conversations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/gambit-conversations/teams","hooks_url":"https://api.github.com/repos/DoSomething/gambit-conversations/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/gambit-conversations/events","assignees_url":"https://api.github.com/repos/DoSomething/gambit-conversations/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/gambit-conversations/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/gambit-conversations/tags","blobs_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/gambit-conversations/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/gambit-conversations/languages","stargazers_url":"https://api.github.com/repos/DoSomething/gambit-conversations/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/gambit-conversations/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/gambit-conversations/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/gambit-conversations/subscription","commits_url":"https://api.github.com/repos/DoSomething/gambit-conversations/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/gambit-conversations/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/gambit-conversations/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/gambit-conversations/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/gambit-conversations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/gambit-conversations/merges","archive_url":"https://api.github.com/repos/DoSomething/gambit-conversations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/gambit-conversations/downloads","issues_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/gambit-conversations/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/gambit-conversations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/gambit-conversations/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/gambit-conversations/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/gambit-conversations/deployments","created_at":"2017-06-02T21:42:25Z","updated_at":"2017-12-09T00:49:04Z","pushed_at":"2018-02-07T07:25:23Z","git_url":"git://github.com/DoSomething/gambit-conversations.git","ssh_url":"git@github.com:DoSomething/gambit-conversations.git","clone_url":"https://github.com/DoSomething/gambit-conversations.git","svn_url":"https://github.com/DoSomething/gambit-conversations","homepage":"","size":849,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":17,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/282"},"html":{"href":"https://github.com/DoSomething/gambit-conversations/pull/282"},"issue":{"href":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/282"},"comments":{"href":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/gambit-conversations/statuses/e213b3adc551e83605f45645c6e448fa9d04b89a"}},"author_association":"OWNER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":14,"additions":332,"deletions":208,"changed_files":20}}
{"actor":{"display_login":"aaronschachter"}}