{"action":"created","comment":{"url":"https://api.github.com/repos/Portchain/auth-14-server/pulls/comments/215150618","pull_request_review_id":152352092,"id":215150618,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTE1MDYxOA==","diff_hunk":"@@ -92,12 +92,69 @@ Client.prototype.revokeApplicationAccess = function(appId, userId, callback) {\n \n Client.prototype.verifyApplicationCredentials = function(appId, appSecret, callback) {\n   this.pg.verifyApplicationCredentials(appId, appSecret, (err, result) => {\n+    if(err) {\n+      logger.error(err)\n+    }\n+    callback(err, result && result.length > 0 ? result[0] : null)\n+  })\n+}\n+\n+Client.prototype.createProfileOptionIfNotExist = function(appId, opts, callback) {\n+  this.pg.createProfileOptionIfNotExist(appId, opts.optionKey, opts.label, 'enum', opts.multichoice, (err, result) => {\n     if(err) {\n       logger.error(err)\n     }\n     callback(err, result && result.length > 0 ? result[0].isValid : false)\n   })\n }\n+Client.prototype.deleteProfileOption = function(appId, optionKey, callback) {\n+  this.pg.deleteProfileOption(appId, optionKey, (err, result) => {\n+    if(err) {\n+      logger.error(err)\n+    }\n+    callback(err, result && result.length > 0 ? result[0] : null)\n+  })\n+}\n+Client.prototype.addProfileOptionValue = function(appId, optionKey, id, label, callback) {\n+  this.pg.addProfileOptionValue(appId, \n+                                optionKey, \n+                                id, \n+                                label, \n+                                (err, result) => {\n+    if(err) {\n+      logger.error(err)\n+    }\n+    callback(err, result && result.length > 0 ? result[0] : null)\n+  })\n+}\n+\n+Client.prototype.removeProfileOptionValue = function(appId, optionKey, valueId, callback) {\n+  this.pg.removeProfileOptionValue(appId, optionKey, valueId, (err, result) => {\n+    if(err) {\n+      logger.error(err)\n+    } else if(!result || result.length ==0) {\n+      err = new Error('Could not find value to delete')\n+    }\n+    callback(err)\n+  })\n+}\n+\n+Client.prototype.getProfileOption = function(appId, optionKey, callback) {\n+  this.pg.getProfileOption(appId, optionKey, (err, result) => {\n+    if(err) {\n+      logger.error(err)\n+    }\n+    callback(err, result && result.length > 0 ? result[0] : null)\n+  })\n+}\n+Client.prototype.setProfileOptionDefaultValue = function(appId, optionKey, valueId, callback) {\n+  this.pg.setProfileOptionDefaultValue(appId, optionKey, valueId, (err, result) => {\n+    if(err) {","path":"lib/applications/index.js","position":61,"original_position":61,"commit_id":"62dc07224add158eb504148132f35fe434405365","original_commit_id":"62dc07224add158eb504148132f35fe434405365","user":{"login":"nherment","id":1041426,"node_id":"MDQ6VXNlcjEwNDE0MjY=","avatar_url":"https://avatars1.githubusercontent.com/u/1041426?v=4","gravatar_id":"","url":"https://api.github.com/users/nherment","html_url":"https://github.com/nherment","followers_url":"https://api.github.com/users/nherment/followers","following_url":"https://api.github.com/users/nherment/following{/other_user}","gists_url":"https://api.github.com/users/nherment/gists{/gist_id}","starred_url":"https://api.github.com/users/nherment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nherment/subscriptions","organizations_url":"https://api.github.com/users/nherment/orgs","repos_url":"https://api.github.com/users/nherment/repos","events_url":"https://api.github.com/users/nherment/events{/privacy}","received_events_url":"https://api.github.com/users/nherment/received_events","type":"User","site_admin":false},"body":"Yes good point. I want to move these to auto-generated typescript from SQL like we have on the SOE (and BOE I think). Most of these functions just proxy to SQL queries anyway.","created_at":"2018-09-05T06:38:39Z","updated_at":"2018-09-05T06:38:39Z","html_url":"https://github.com/Portchain/auth-14-server/pull/2#discussion_r215150618","pull_request_url":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Portchain/auth-14-server/pulls/comments/215150618"},"html":{"href":"https://github.com/Portchain/auth-14-server/pull/2#discussion_r215150618"},"pull_request":{"href":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2"}},"in_reply_to_id":215149637},"pull_request":{"url":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2","id":213021950,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMDIxOTUw","html_url":"https://github.com/Portchain/auth-14-server/pull/2","diff_url":"https://github.com/Portchain/auth-14-server/pull/2.diff","patch_url":"https://github.com/Portchain/auth-14-server/pull/2.patch","issue_url":"https://api.github.com/repos/Portchain/auth-14-server/issues/2","number":2,"state":"open","locked":false,"title":"Access controls","user":{"login":"nherment","id":1041426,"node_id":"MDQ6VXNlcjEwNDE0MjY=","avatar_url":"https://avatars1.githubusercontent.com/u/1041426?v=4","gravatar_id":"","url":"https://api.github.com/users/nherment","html_url":"https://github.com/nherment","followers_url":"https://api.github.com/users/nherment/followers","following_url":"https://api.github.com/users/nherment/following{/other_user}","gists_url":"https://api.github.com/users/nherment/gists{/gist_id}","starred_url":"https://api.github.com/users/nherment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nherment/subscriptions","organizations_url":"https://api.github.com/users/nherment/orgs","repos_url":"https://api.github.com/users/nherment/repos","events_url":"https://api.github.com/users/nherment/events{/privacy}","received_events_url":"https://api.github.com/users/nherment/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-04T15:42:56Z","updated_at":"2018-09-05T06:38:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b93a874b4cc39ac8795d226c790975ac5d59fe18","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Portchain/auth-14-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Portchain/auth-14-server/issues/2/comments","statuses_url":"https://api.github.com/repos/Portchain/auth-14-server/statuses/62dc07224add158eb504148132f35fe434405365","head":{"label":"Portchain:access_controls","ref":"access_controls","sha":"62dc07224add158eb504148132f35fe434405365","user":{"login":"Portchain","id":25925553,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1OTI1NTUz","avatar_url":"https://avatars1.githubusercontent.com/u/25925553?v=4","gravatar_id":"","url":"https://api.github.com/users/Portchain","html_url":"https://github.com/Portchain","followers_url":"https://api.github.com/users/Portchain/followers","following_url":"https://api.github.com/users/Portchain/following{/other_user}","gists_url":"https://api.github.com/users/Portchain/gists{/gist_id}","starred_url":"https://api.github.com/users/Portchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Portchain/subscriptions","organizations_url":"https://api.github.com/users/Portchain/orgs","repos_url":"https://api.github.com/users/Portchain/repos","events_url":"https://api.github.com/users/Portchain/events{/privacy}","received_events_url":"https://api.github.com/users/Portchain/received_events","type":"Organization","site_admin":false},"repo":{"id":139573632,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk1NzM2MzI=","name":"auth-14-server","full_name":"Portchain/auth-14-server","owner":{"login":"Portchain","id":25925553,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1OTI1NTUz","avatar_url":"https://avatars1.githubusercontent.com/u/25925553?v=4","gravatar_id":"","url":"https://api.github.com/users/Portchain","html_url":"https://github.com/Portchain","followers_url":"https://api.github.com/users/Portchain/followers","following_url":"https://api.github.com/users/Portchain/following{/other_user}","gists_url":"https://api.github.com/users/Portchain/gists{/gist_id}","starred_url":"https://api.github.com/users/Portchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Portchain/subscriptions","organizations_url":"https://api.github.com/users/Portchain/orgs","repos_url":"https://api.github.com/users/Portchain/repos","events_url":"https://api.github.com/users/Portchain/events{/privacy}","received_events_url":"https://api.github.com/users/Portchain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Portchain/auth-14-server","description":"Login server for Portchain","fork":false,"url":"https://api.github.com/repos/Portchain/auth-14-server","forks_url":"https://api.github.com/repos/Portchain/auth-14-server/forks","keys_url":"https://api.github.com/repos/Portchain/auth-14-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Portchain/auth-14-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Portchain/auth-14-server/teams","hooks_url":"https://api.github.com/repos/Portchain/auth-14-server/hooks","issue_events_url":"https://api.github.com/repos/Portchain/auth-14-server/issues/events{/number}","events_url":"https://api.github.com/repos/Portchain/auth-14-server/events","assignees_url":"https://api.github.com/repos/Portchain/auth-14-server/assignees{/user}","branches_url":"https://api.github.com/repos/Portchain/auth-14-server/branches{/branch}","tags_url":"https://api.github.com/repos/Portchain/auth-14-server/tags","blobs_url":"https://api.github.com/repos/Portchain/auth-14-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Portchain/auth-14-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Portchain/auth-14-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Portchain/auth-14-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Portchain/auth-14-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Portchain/auth-14-server/languages","stargazers_url":"https://api.github.com/repos/Portchain/auth-14-server/stargazers","contributors_url":"https://api.github.com/repos/Portchain/auth-14-server/contributors","subscribers_url":"https://api.github.com/repos/Portchain/auth-14-server/subscribers","subscription_url":"https://api.github.com/repos/Portchain/auth-14-server/subscription","commits_url":"https://api.github.com/repos/Portchain/auth-14-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Portchain/auth-14-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Portchain/auth-14-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Portchain/auth-14-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Portchain/auth-14-server/contents/{+path}","compare_url":"https://api.github.com/repos/Portchain/auth-14-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Portchain/auth-14-server/merges","archive_url":"https://api.github.com/repos/Portchain/auth-14-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Portchain/auth-14-server/downloads","issues_url":"https://api.github.com/repos/Portchain/auth-14-server/issues{/number}","pulls_url":"https://api.github.com/repos/Portchain/auth-14-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Portchain/auth-14-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Portchain/auth-14-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Portchain/auth-14-server/labels{/name}","releases_url":"https://api.github.com/repos/Portchain/auth-14-server/releases{/id}","deployments_url":"https://api.github.com/repos/Portchain/auth-14-server/deployments","created_at":"2018-07-03T11:29:24Z","updated_at":"2018-08-20T09:13:01Z","pushed_at":"2018-09-04T15:42:56Z","git_url":"git://github.com/Portchain/auth-14-server.git","ssh_url":"git@github.com:Portchain/auth-14-server.git","clone_url":"https://github.com/Portchain/auth-14-server.git","svn_url":"https://github.com/Portchain/auth-14-server","homepage":null,"size":2457,"stargazers_count":0,"watchers_count":0,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Portchain:master","ref":"master","sha":"28b0b525980c6db50515f0d041b7f2e6f5ea7497","user":{"login":"Portchain","id":25925553,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1OTI1NTUz","avatar_url":"https://avatars1.githubusercontent.com/u/25925553?v=4","gravatar_id":"","url":"https://api.github.com/users/Portchain","html_url":"https://github.com/Portchain","followers_url":"https://api.github.com/users/Portchain/followers","following_url":"https://api.github.com/users/Portchain/following{/other_user}","gists_url":"https://api.github.com/users/Portchain/gists{/gist_id}","starred_url":"https://api.github.com/users/Portchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Portchain/subscriptions","organizations_url":"https://api.github.com/users/Portchain/orgs","repos_url":"https://api.github.com/users/Portchain/repos","events_url":"https://api.github.com/users/Portchain/events{/privacy}","received_events_url":"https://api.github.com/users/Portchain/received_events","type":"Organization","site_admin":false},"repo":{"id":139573632,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk1NzM2MzI=","name":"auth-14-server","full_name":"Portchain/auth-14-server","owner":{"login":"Portchain","id":25925553,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1OTI1NTUz","avatar_url":"https://avatars1.githubusercontent.com/u/25925553?v=4","gravatar_id":"","url":"https://api.github.com/users/Portchain","html_url":"https://github.com/Portchain","followers_url":"https://api.github.com/users/Portchain/followers","following_url":"https://api.github.com/users/Portchain/following{/other_user}","gists_url":"https://api.github.com/users/Portchain/gists{/gist_id}","starred_url":"https://api.github.com/users/Portchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Portchain/subscriptions","organizations_url":"https://api.github.com/users/Portchain/orgs","repos_url":"https://api.github.com/users/Portchain/repos","events_url":"https://api.github.com/users/Portchain/events{/privacy}","received_events_url":"https://api.github.com/users/Portchain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Portchain/auth-14-server","description":"Login server for Portchain","fork":false,"url":"https://api.github.com/repos/Portchain/auth-14-server","forks_url":"https://api.github.com/repos/Portchain/auth-14-server/forks","keys_url":"https://api.github.com/repos/Portchain/auth-14-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Portchain/auth-14-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Portchain/auth-14-server/teams","hooks_url":"https://api.github.com/repos/Portchain/auth-14-server/hooks","issue_events_url":"https://api.github.com/repos/Portchain/auth-14-server/issues/events{/number}","events_url":"https://api.github.com/repos/Portchain/auth-14-server/events","assignees_url":"https://api.github.com/repos/Portchain/auth-14-server/assignees{/user}","branches_url":"https://api.github.com/repos/Portchain/auth-14-server/branches{/branch}","tags_url":"https://api.github.com/repos/Portchain/auth-14-server/tags","blobs_url":"https://api.github.com/repos/Portchain/auth-14-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Portchain/auth-14-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Portchain/auth-14-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Portchain/auth-14-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Portchain/auth-14-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Portchain/auth-14-server/languages","stargazers_url":"https://api.github.com/repos/Portchain/auth-14-server/stargazers","contributors_url":"https://api.github.com/repos/Portchain/auth-14-server/contributors","subscribers_url":"https://api.github.com/repos/Portchain/auth-14-server/subscribers","subscription_url":"https://api.github.com/repos/Portchain/auth-14-server/subscription","commits_url":"https://api.github.com/repos/Portchain/auth-14-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Portchain/auth-14-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Portchain/auth-14-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Portchain/auth-14-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Portchain/auth-14-server/contents/{+path}","compare_url":"https://api.github.com/repos/Portchain/auth-14-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Portchain/auth-14-server/merges","archive_url":"https://api.github.com/repos/Portchain/auth-14-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Portchain/auth-14-server/downloads","issues_url":"https://api.github.com/repos/Portchain/auth-14-server/issues{/number}","pulls_url":"https://api.github.com/repos/Portchain/auth-14-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Portchain/auth-14-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Portchain/auth-14-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Portchain/auth-14-server/labels{/name}","releases_url":"https://api.github.com/repos/Portchain/auth-14-server/releases{/id}","deployments_url":"https://api.github.com/repos/Portchain/auth-14-server/deployments","created_at":"2018-07-03T11:29:24Z","updated_at":"2018-08-20T09:13:01Z","pushed_at":"2018-09-04T15:42:56Z","git_url":"git://github.com/Portchain/auth-14-server.git","ssh_url":"git@github.com:Portchain/auth-14-server.git","clone_url":"https://github.com/Portchain/auth-14-server.git","svn_url":"https://github.com/Portchain/auth-14-server","homepage":null,"size":2457,"stargazers_count":0,"watchers_count":0,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2"},"html":{"href":"https://github.com/Portchain/auth-14-server/pull/2"},"issue":{"href":"https://api.github.com/repos/Portchain/auth-14-server/issues/2"},"comments":{"href":"https://api.github.com/repos/Portchain/auth-14-server/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Portchain/auth-14-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Portchain/auth-14-server/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Portchain/auth-14-server/statuses/62dc07224add158eb504148132f35fe434405365"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nherment"}}