{"action":"created","comment":{"url":"https://api.github.com/repos/orbiting/backends/pulls/comments/206027633","pull_request_review_id":141406949,"id":206027633,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjAyNzYzMw==","diff_hunk":"@@ -0,0 +1,17 @@\n+const { Roles } = require('@orbiting/backend-modules-auth')\n+const userAccessRoles = ['admin', 'supporter']\n+const { transformUser } = require('@orbiting/backend-modules-auth')\n+\n+module.exports = {\n+  async user (device, args, { pgdb, user: me }) {\n+    const user = await pgdb.public.users.findOne({\n+      id: device.userId\n+    })\n+      .then(user => transformUser(user))\n+    Roles.ensureUserIsMeOrInRoles(user, me, userAccessRoles)\n+    return user\n+  },\n+  lastSeen (device) {","path":"packages/notifications/graphql/resolvers/Device.js","position":14,"original_position":14,"commit_id":"7b34880623e17d801bb035af52d12eadc14b915f","original_commit_id":"fd7a9ee1023b189f9dfb3daf4f19e405283378e0","user":{"login":"patrickvenetz","id":331800,"node_id":"MDQ6VXNlcjMzMTgwMA==","avatar_url":"https://avatars0.githubusercontent.com/u/331800?v=4","gravatar_id":"","url":"https://api.github.com/users/patrickvenetz","html_url":"https://github.com/patrickvenetz","followers_url":"https://api.github.com/users/patrickvenetz/followers","following_url":"https://api.github.com/users/patrickvenetz/following{/other_user}","gists_url":"https://api.github.com/users/patrickvenetz/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickvenetz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickvenetz/subscriptions","organizations_url":"https://api.github.com/users/patrickvenetz/orgs","repos_url":"https://api.github.com/users/patrickvenetz/repos","events_url":"https://api.github.com/users/patrickvenetz/events{/privacy}","received_events_url":"https://api.github.com/users/patrickvenetz/received_events","type":"User","site_admin":false},"body":"I think that is very much so ok.","created_at":"2018-07-30T06:42:02Z","updated_at":"2018-07-30T06:42:02Z","html_url":"https://github.com/orbiting/backends/pull/53#discussion_r206027633","pull_request_url":"https://api.github.com/repos/orbiting/backends/pulls/53","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/orbiting/backends/pulls/comments/206027633"},"html":{"href":"https://github.com/orbiting/backends/pull/53#discussion_r206027633"},"pull_request":{"href":"https://api.github.com/repos/orbiting/backends/pulls/53"}},"in_reply_to_id":205977560},"pull_request":{"url":"https://api.github.com/repos/orbiting/backends/pulls/53","id":192845136,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyODQ1MTM2","html_url":"https://github.com/orbiting/backends/pull/53","diff_url":"https://github.com/orbiting/backends/pull/53.diff","patch_url":"https://github.com/orbiting/backends/pull/53.patch","issue_url":"https://api.github.com/repos/orbiting/backends/issues/53","number":53,"state":"open","locked":false,"title":"WIP: App","user":{"login":"tpreusse","id":410211,"node_id":"MDQ6VXNlcjQxMDIxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/410211?v=4","gravatar_id":"","url":"https://api.github.com/users/tpreusse","html_url":"https://github.com/tpreusse","followers_url":"https://api.github.com/users/tpreusse/followers","following_url":"https://api.github.com/users/tpreusse/following{/other_user}","gists_url":"https://api.github.com/users/tpreusse/gists{/gist_id}","starred_url":"https://api.github.com/users/tpreusse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpreusse/subscriptions","organizations_url":"https://api.github.com/users/tpreusse/orgs","repos_url":"https://api.github.com/users/tpreusse/repos","events_url":"https://api.github.com/users/tpreusse/events{/privacy}","received_events_url":"https://api.github.com/users/tpreusse/received_events","type":"User","site_admin":false},"body":"Mostly doing this to create a review app ;)\r\n\r\nedit by @patte\r\nTODOs:\r\n- [x] send notifications for discussion events\r\n\r\nnot in this PR:\r\n- [ ] tests for app notifications (upsertDevice, rollDeviceToken, removeDevice)\r\n- [ ] move republik discussion into it's own package\r\n- [ ] move `servers/republik/lib/Notifications` into notifications package (depends on the task above)","created_at":"2018-06-05T21:44:25Z","updated_at":"2018-07-30T06:42:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28da81b0ed991ed8f47fa44a83206fb2bb559de1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/orbiting/backends/pulls/53/commits","review_comments_url":"https://api.github.com/repos/orbiting/backends/pulls/53/comments","review_comment_url":"https://api.github.com/repos/orbiting/backends/pulls/comments{/number}","comments_url":"https://api.github.com/repos/orbiting/backends/issues/53/comments","statuses_url":"https://api.github.com/repos/orbiting/backends/statuses/7b34880623e17d801bb035af52d12eadc14b915f","head":{"label":"orbiting:app","ref":"app","sha":"7b34880623e17d801bb035af52d12eadc14b915f","user":{"login":"orbiting","id":26253823,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MjUzODIz","avatar_url":"https://avatars1.githubusercontent.com/u/26253823?v=4","gravatar_id":"","url":"https://api.github.com/users/orbiting","html_url":"https://github.com/orbiting","followers_url":"https://api.github.com/users/orbiting/followers","following_url":"https://api.github.com/users/orbiting/following{/other_user}","gists_url":"https://api.github.com/users/orbiting/gists{/gist_id}","starred_url":"https://api.github.com/users/orbiting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orbiting/subscriptions","organizations_url":"https://api.github.com/users/orbiting/orgs","repos_url":"https://api.github.com/users/orbiting/repos","events_url":"https://api.github.com/users/orbiting/events{/privacy}","received_events_url":"https://api.github.com/users/orbiting/received_events","type":"Organization","site_admin":false},"repo":{"id":120354009,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAzNTQwMDk=","name":"backends","full_name":"orbiting/backends","owner":{"login":"orbiting","id":26253823,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MjUzODIz","avatar_url":"https://avatars1.githubusercontent.com/u/26253823?v=4","gravatar_id":"","url":"https://api.github.com/users/orbiting","html_url":"https://github.com/orbiting","followers_url":"https://api.github.com/users/orbiting/followers","following_url":"https://api.github.com/users/orbiting/following{/other_user}","gists_url":"https://api.github.com/users/orbiting/gists{/gist_id}","starred_url":"https://api.github.com/users/orbiting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orbiting/subscriptions","organizations_url":"https://api.github.com/users/orbiting/orgs","repos_url":"https://api.github.com/users/orbiting/repos","events_url":"https://api.github.com/users/orbiting/events{/privacy}","received_events_url":"https://api.github.com/users/orbiting/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/orbiting/backends","description":"monorepo for republik, publikator and assets backends based on NodeJS providing the GraphQL API used to power republik.ch.","fork":false,"url":"https://api.github.com/repos/orbiting/backends","forks_url":"https://api.github.com/repos/orbiting/backends/forks","keys_url":"https://api.github.com/repos/orbiting/backends/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orbiting/backends/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orbiting/backends/teams","hooks_url":"https://api.github.com/repos/orbiting/backends/hooks","issue_events_url":"https://api.github.com/repos/orbiting/backends/issues/events{/number}","events_url":"https://api.github.com/repos/orbiting/backends/events","assignees_url":"https://api.github.com/repos/orbiting/backends/assignees{/user}","branches_url":"https://api.github.com/repos/orbiting/backends/branches{/branch}","tags_url":"https://api.github.com/repos/orbiting/backends/tags","blobs_url":"https://api.github.com/repos/orbiting/backends/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orbiting/backends/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orbiting/backends/git/refs{/sha}","trees_url":"https://api.github.com/repos/orbiting/backends/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orbiting/backends/statuses/{sha}","languages_url":"https://api.github.com/repos/orbiting/backends/languages","stargazers_url":"https://api.github.com/repos/orbiting/backends/stargazers","contributors_url":"https://api.github.com/repos/orbiting/backends/contributors","subscribers_url":"https://api.github.com/repos/orbiting/backends/subscribers","subscription_url":"https://api.github.com/repos/orbiting/backends/subscription","commits_url":"https://api.github.com/repos/orbiting/backends/commits{/sha}","git_commits_url":"https://api.github.com/repos/orbiting/backends/git/commits{/sha}","comments_url":"https://api.github.com/repos/orbiting/backends/comments{/number}","issue_comment_url":"https://api.github.com/repos/orbiting/backends/issues/comments{/number}","contents_url":"https://api.github.com/repos/orbiting/backends/contents/{+path}","compare_url":"https://api.github.com/repos/orbiting/backends/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orbiting/backends/merges","archive_url":"https://api.github.com/repos/orbiting/backends/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orbiting/backends/downloads","issues_url":"https://api.github.com/repos/orbiting/backends/issues{/number}","pulls_url":"https://api.github.com/repos/orbiting/backends/pulls{/number}","milestones_url":"https://api.github.com/repos/orbiting/backends/milestones{/number}","notifications_url":"https://api.github.com/repos/orbiting/backends/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orbiting/backends/labels{/name}","releases_url":"https://api.github.com/repos/orbiting/backends/releases{/id}","deployments_url":"https://api.github.com/repos/orbiting/backends/deployments","created_at":"2018-02-05T19:53:28Z","updated_at":"2018-07-23T14:33:46Z","pushed_at":"2018-07-29T19:10:13Z","git_url":"git://github.com/orbiting/backends.git","ssh_url":"git@github.com:orbiting/backends.git","clone_url":"https://github.com/orbiting/backends.git","svn_url":"https://github.com/orbiting/backends","homepage":"https://api.republik.ch/graphiql","size":3709,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":3,"open_issues":7,"watchers":8,"default_branch":"master"}},"base":{"label":"orbiting:master","ref":"master","sha":"a10f3fa0fa40118e46b9de1c52e00084ce394a6a","user":{"login":"orbiting","id":26253823,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MjUzODIz","avatar_url":"https://avatars1.githubusercontent.com/u/26253823?v=4","gravatar_id":"","url":"https://api.github.com/users/orbiting","html_url":"https://github.com/orbiting","followers_url":"https://api.github.com/users/orbiting/followers","following_url":"https://api.github.com/users/orbiting/following{/other_user}","gists_url":"https://api.github.com/users/orbiting/gists{/gist_id}","starred_url":"https://api.github.com/users/orbiting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orbiting/subscriptions","organizations_url":"https://api.github.com/users/orbiting/orgs","repos_url":"https://api.github.com/users/orbiting/repos","events_url":"https://api.github.com/users/orbiting/events{/privacy}","received_events_url":"https://api.github.com/users/orbiting/received_events","type":"Organization","site_admin":false},"repo":{"id":120354009,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAzNTQwMDk=","name":"backends","full_name":"orbiting/backends","owner":{"login":"orbiting","id":26253823,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2MjUzODIz","avatar_url":"https://avatars1.githubusercontent.com/u/26253823?v=4","gravatar_id":"","url":"https://api.github.com/users/orbiting","html_url":"https://github.com/orbiting","followers_url":"https://api.github.com/users/orbiting/followers","following_url":"https://api.github.com/users/orbiting/following{/other_user}","gists_url":"https://api.github.com/users/orbiting/gists{/gist_id}","starred_url":"https://api.github.com/users/orbiting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orbiting/subscriptions","organizations_url":"https://api.github.com/users/orbiting/orgs","repos_url":"https://api.github.com/users/orbiting/repos","events_url":"https://api.github.com/users/orbiting/events{/privacy}","received_events_url":"https://api.github.com/users/orbiting/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/orbiting/backends","description":"monorepo for republik, publikator and assets backends based on NodeJS providing the GraphQL API used to power republik.ch.","fork":false,"url":"https://api.github.com/repos/orbiting/backends","forks_url":"https://api.github.com/repos/orbiting/backends/forks","keys_url":"https://api.github.com/repos/orbiting/backends/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orbiting/backends/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orbiting/backends/teams","hooks_url":"https://api.github.com/repos/orbiting/backends/hooks","issue_events_url":"https://api.github.com/repos/orbiting/backends/issues/events{/number}","events_url":"https://api.github.com/repos/orbiting/backends/events","assignees_url":"https://api.github.com/repos/orbiting/backends/assignees{/user}","branches_url":"https://api.github.com/repos/orbiting/backends/branches{/branch}","tags_url":"https://api.github.com/repos/orbiting/backends/tags","blobs_url":"https://api.github.com/repos/orbiting/backends/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orbiting/backends/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orbiting/backends/git/refs{/sha}","trees_url":"https://api.github.com/repos/orbiting/backends/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orbiting/backends/statuses/{sha}","languages_url":"https://api.github.com/repos/orbiting/backends/languages","stargazers_url":"https://api.github.com/repos/orbiting/backends/stargazers","contributors_url":"https://api.github.com/repos/orbiting/backends/contributors","subscribers_url":"https://api.github.com/repos/orbiting/backends/subscribers","subscription_url":"https://api.github.com/repos/orbiting/backends/subscription","commits_url":"https://api.github.com/repos/orbiting/backends/commits{/sha}","git_commits_url":"https://api.github.com/repos/orbiting/backends/git/commits{/sha}","comments_url":"https://api.github.com/repos/orbiting/backends/comments{/number}","issue_comment_url":"https://api.github.com/repos/orbiting/backends/issues/comments{/number}","contents_url":"https://api.github.com/repos/orbiting/backends/contents/{+path}","compare_url":"https://api.github.com/repos/orbiting/backends/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orbiting/backends/merges","archive_url":"https://api.github.com/repos/orbiting/backends/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orbiting/backends/downloads","issues_url":"https://api.github.com/repos/orbiting/backends/issues{/number}","pulls_url":"https://api.github.com/repos/orbiting/backends/pulls{/number}","milestones_url":"https://api.github.com/repos/orbiting/backends/milestones{/number}","notifications_url":"https://api.github.com/repos/orbiting/backends/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orbiting/backends/labels{/name}","releases_url":"https://api.github.com/repos/orbiting/backends/releases{/id}","deployments_url":"https://api.github.com/repos/orbiting/backends/deployments","created_at":"2018-02-05T19:53:28Z","updated_at":"2018-07-23T14:33:46Z","pushed_at":"2018-07-29T19:10:13Z","git_url":"git://github.com/orbiting/backends.git","ssh_url":"git@github.com:orbiting/backends.git","clone_url":"https://github.com/orbiting/backends.git","svn_url":"https://github.com/orbiting/backends","homepage":"https://api.republik.ch/graphiql","size":3709,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":3,"open_issues":7,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/orbiting/backends/pulls/53"},"html":{"href":"https://github.com/orbiting/backends/pull/53"},"issue":{"href":"https://api.github.com/repos/orbiting/backends/issues/53"},"comments":{"href":"https://api.github.com/repos/orbiting/backends/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/orbiting/backends/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/orbiting/backends/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/orbiting/backends/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/orbiting/backends/statuses/7b34880623e17d801bb035af52d12eadc14b915f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"patrickvenetz"}}