{"action":"created","comment":{"url":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/comments/179523021","pull_request_review_id":109780351,"id":179523021,"diff_hunk":"@@ -0,0 +1,148 @@\n+import {App} from \"../../ManagementConsole\";\n+import {IRestRequest} from \"./IRestRequest\";\n+import {ISocketBinding} from \"../socket-binding/ISocketBinding\";\n+import {SocketBindingService} from \"../socket-binding/SocketBindingService\";\n+import IHttpPromise = angular.IHttpPromise;\n+\n+const module: ng.IModule = App.module(\"managementConsole.services.rest\", []);\n+\n+export class RestService {\n+\n+  static $inject: string[] = [\"$http\", \"$cacheFactory\", \"$q\", \"$location\", \"socketBindingService\"];\n+\n+  private restBinding: ISocketBinding;\n+\n+  constructor(private $http: ng.IHttpService,\n+              private $cacheFactory: ng.ICacheFactoryService,\n+              private $q: ng.IQService,\n+              private $location: ng.ILocationService,\n+              private socketBindingService: SocketBindingService) {\n+\n+    // TODO somehow discover installed rest binding better than this?\n+    socketBindingService.getDefaultSocketBindingGroup().then((result: ISocketBinding []) => {\n+      angular.forEach(result, (value) => {\n+        if (value.name === \"rest\") {\n+          this.restBinding = value;\n+        }\n+      });\n+    });\n+  }\n+\n+  executeCacheGet(cacheTarget: string, key: string): ng.IPromise<any> {\n+    let request: IRestRequest = {\n+      jsonPayload: undefined,\n+      cache: cacheTarget,\n+      urlSuffix: \"/\".concat(key)\n+    };\n+    let url: string = this.generateUrl(request);\n+    return this.executeHelper(\"get\", url, request.jsonPayload, this.getDefaultHeaders());\n+  }\n+\n+  executeCacheDelete(cacheTarget: string): ng.IPromise<any> {\n+    let request: IRestRequest = {\n+      jsonPayload: undefined,\n+      cache: cacheTarget,\n+      urlSuffix: undefined\n+    };\n+    let url: string = this.generateUrl(request);\n+    return this.executeHelper(\"delete\", url, request.jsonPayload, this.getDefaultHeaders());\n+  }\n+\n+  executeCacheDeleteKey(cacheTarget: string, key: string): ng.IPromise<any> {\n+    let request: IRestRequest = {\n+      jsonPayload: undefined,\n+      cache: cacheTarget,\n+      urlSuffix: \"/\".concat(key)\n+    };\n+    let url: string = this.generateUrl(request);\n+    return this.executeHelper(\"delete\", url, request.jsonPayload, this.getDefaultHeaders());\n+  }\n+\n+  executeCachePut(cacheTarget: string, key: string, data: any): ng.IPromise<any> {\n+    let request: IRestRequest = {\n+      jsonPayload: data,\n+      cache: cacheTarget,\n+      urlSuffix: \"/\".concat(key)\n+    };\n+    let url: string = this.generateUrl(request);\n+    return this.executeHelper(\"put\", url, request.jsonPayload, this.getDefaultHeaders());\n+  }\n+\n+  executeCachePost(cacheTarget: string, key: string, data: any): ng.IPromise<any> {\n+    let request: IRestRequest = {\n+      jsonPayload: data,\n+      cache: cacheTarget,\n+      urlSuffix: \"/\".concat(key)\n+    };\n+    let url: string = this.generateUrl(request);\n+    return this.executeHelper(\"post\", url, request.jsonPayload, this.getDefaultHeaders());\n+  }\n+\n+  executeCacheQuery(cacheTarget: string, query: string): ng.IPromise<any> {\n+    let request: IRestRequest = {\n+      jsonPayload: {query: query},\n+      cache: cacheTarget,\n+      urlSuffix: \"?action=search\"\n+    };\n+    let url: string = this.generateUrl(request);\n+    return this.executeHelper(\"post\", url, request.jsonPayload, this.getDefaultHeaders());\n+  }\n+\n+  clearGetCache(): void {\n+    this.$cacheFactory.get(\"$http\").removeAll();\n+  }\n+\n+  private executeHelper(type: string, url: string, data: any, headers?: ng.IRequestShortcutConfig): ng.IPromise<any> {","path":"src/services/rest/RestService.ts","position":65,"original_position":95,"commit_id":"681d40fe51b9cd0d336fc73fb4c802b66fcf1d9d","original_commit_id":"6289bb0becebc345d0bae4206949312c562e5658","user":{"login":"ryanemerson","id":765332,"avatar_url":"https://avatars3.githubusercontent.com/u/765332?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanemerson","html_url":"https://github.com/ryanemerson","followers_url":"https://api.github.com/users/ryanemerson/followers","following_url":"https://api.github.com/users/ryanemerson/following{/other_user}","gists_url":"https://api.github.com/users/ryanemerson/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanemerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanemerson/subscriptions","organizations_url":"https://api.github.com/users/ryanemerson/orgs","repos_url":"https://api.github.com/users/ryanemerson/repos","events_url":"https://api.github.com/users/ryanemerson/events{/privacy}","received_events_url":"https://api.github.com/users/ryanemerson/received_events","type":"User","site_admin":false},"body":"This is still the case.","created_at":"2018-04-05T16:27:01Z","updated_at":"2018-04-05T16:33:56Z","html_url":"https://github.com/infinispan/infinispan-management-console/pull/235#discussion_r179523021","pull_request_url":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/comments/179523021"},"html":{"href":"https://github.com/infinispan/infinispan-management-console/pull/235#discussion_r179523021"},"pull_request":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235"}},"in_reply_to_id":179208814},"pull_request":{"url":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235","id":177461853,"html_url":"https://github.com/infinispan/infinispan-management-console/pull/235","diff_url":"https://github.com/infinispan/infinispan-management-console/pull/235.diff","patch_url":"https://github.com/infinispan/infinispan-management-console/pull/235.patch","issue_url":"https://api.github.com/repos/infinispan/infinispan-management-console/issues/235","number":235,"state":"open","locked":false,"title":"ISPN-8759 - Administration console - add data manipulation capabilities","user":{"login":"vblagoje","id":458335,"avatar_url":"https://avatars0.githubusercontent.com/u/458335?v=4","gravatar_id":"","url":"https://api.github.com/users/vblagoje","html_url":"https://github.com/vblagoje","followers_url":"https://api.github.com/users/vblagoje/followers","following_url":"https://api.github.com/users/vblagoje/following{/other_user}","gists_url":"https://api.github.com/users/vblagoje/gists{/gist_id}","starred_url":"https://api.github.com/users/vblagoje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vblagoje/subscriptions","organizations_url":"https://api.github.com/users/vblagoje/orgs","repos_url":"https://api.github.com/users/vblagoje/repos","events_url":"https://api.github.com/users/vblagoje/events{/privacy}","received_events_url":"https://api.github.com/users/vblagoje/received_events","type":"User","site_admin":false},"body":"Preview only. More UI work coming after we receive feedback from the team. See https://youtu.be/AE82JH_QDQw for more details","created_at":"2018-03-26T14:20:10Z","updated_at":"2018-04-05T16:33:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d6b2808677b340ecb8261dfeb645a5ca901bfb7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235/commits","review_comments_url":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235/comments","review_comment_url":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infinispan/infinispan-management-console/issues/235/comments","statuses_url":"https://api.github.com/repos/infinispan/infinispan-management-console/statuses/681d40fe51b9cd0d336fc73fb4c802b66fcf1d9d","head":{"label":"vblagoje:t_8759","ref":"t_8759","sha":"681d40fe51b9cd0d336fc73fb4c802b66fcf1d9d","user":{"login":"vblagoje","id":458335,"avatar_url":"https://avatars0.githubusercontent.com/u/458335?v=4","gravatar_id":"","url":"https://api.github.com/users/vblagoje","html_url":"https://github.com/vblagoje","followers_url":"https://api.github.com/users/vblagoje/followers","following_url":"https://api.github.com/users/vblagoje/following{/other_user}","gists_url":"https://api.github.com/users/vblagoje/gists{/gist_id}","starred_url":"https://api.github.com/users/vblagoje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vblagoje/subscriptions","organizations_url":"https://api.github.com/users/vblagoje/orgs","repos_url":"https://api.github.com/users/vblagoje/repos","events_url":"https://api.github.com/users/vblagoje/events{/privacy}","received_events_url":"https://api.github.com/users/vblagoje/received_events","type":"User","site_admin":false},"repo":{"id":31507376,"name":"infinispan-management-console","full_name":"vblagoje/infinispan-management-console","owner":{"login":"vblagoje","id":458335,"avatar_url":"https://avatars0.githubusercontent.com/u/458335?v=4","gravatar_id":"","url":"https://api.github.com/users/vblagoje","html_url":"https://github.com/vblagoje","followers_url":"https://api.github.com/users/vblagoje/followers","following_url":"https://api.github.com/users/vblagoje/following{/other_user}","gists_url":"https://api.github.com/users/vblagoje/gists{/gist_id}","starred_url":"https://api.github.com/users/vblagoje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vblagoje/subscriptions","organizations_url":"https://api.github.com/users/vblagoje/orgs","repos_url":"https://api.github.com/users/vblagoje/repos","events_url":"https://api.github.com/users/vblagoje/events{/privacy}","received_events_url":"https://api.github.com/users/vblagoje/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vblagoje/infinispan-management-console","description":"Infinispan Web Management Console","fork":true,"url":"https://api.github.com/repos/vblagoje/infinispan-management-console","forks_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/forks","keys_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/teams","hooks_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/hooks","issue_events_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/issues/events{/number}","events_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/events","assignees_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/assignees{/user}","branches_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/branches{/branch}","tags_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/tags","blobs_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/statuses/{sha}","languages_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/languages","stargazers_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/stargazers","contributors_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/contributors","subscribers_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/subscribers","subscription_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/subscription","commits_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/contents/{+path}","compare_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/merges","archive_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/downloads","issues_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/issues{/number}","pulls_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/pulls{/number}","milestones_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/milestones{/number}","notifications_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/labels{/name}","releases_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/releases{/id}","deployments_url":"https://api.github.com/repos/vblagoje/infinispan-management-console/deployments","created_at":"2015-03-01T19:15:36Z","updated_at":"2016-10-24T10:38:09Z","pushed_at":"2018-04-05T16:04:42Z","git_url":"git://github.com/vblagoje/infinispan-management-console.git","ssh_url":"git@github.com:vblagoje/infinispan-management-console.git","clone_url":"https://github.com/vblagoje/infinispan-management-console.git","svn_url":"https://github.com/vblagoje/infinispan-management-console","homepage":null,"size":1863,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"infinispan:master","ref":"master","sha":"7fbe1a7d6229e9814dfd6cb561ffd2ee4a591558","user":{"login":"infinispan","id":458093,"avatar_url":"https://avatars3.githubusercontent.com/u/458093?v=4","gravatar_id":"","url":"https://api.github.com/users/infinispan","html_url":"https://github.com/infinispan","followers_url":"https://api.github.com/users/infinispan/followers","following_url":"https://api.github.com/users/infinispan/following{/other_user}","gists_url":"https://api.github.com/users/infinispan/gists{/gist_id}","starred_url":"https://api.github.com/users/infinispan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinispan/subscriptions","organizations_url":"https://api.github.com/users/infinispan/orgs","repos_url":"https://api.github.com/users/infinispan/repos","events_url":"https://api.github.com/users/infinispan/events{/privacy}","received_events_url":"https://api.github.com/users/infinispan/received_events","type":"Organization","site_admin":false},"repo":{"id":27542064,"name":"infinispan-management-console","full_name":"infinispan/infinispan-management-console","owner":{"login":"infinispan","id":458093,"avatar_url":"https://avatars3.githubusercontent.com/u/458093?v=4","gravatar_id":"","url":"https://api.github.com/users/infinispan","html_url":"https://github.com/infinispan","followers_url":"https://api.github.com/users/infinispan/followers","following_url":"https://api.github.com/users/infinispan/following{/other_user}","gists_url":"https://api.github.com/users/infinispan/gists{/gist_id}","starred_url":"https://api.github.com/users/infinispan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinispan/subscriptions","organizations_url":"https://api.github.com/users/infinispan/orgs","repos_url":"https://api.github.com/users/infinispan/repos","events_url":"https://api.github.com/users/infinispan/events{/privacy}","received_events_url":"https://api.github.com/users/infinispan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infinispan/infinispan-management-console","description":"Infinispan Web Management Console","fork":false,"url":"https://api.github.com/repos/infinispan/infinispan-management-console","forks_url":"https://api.github.com/repos/infinispan/infinispan-management-console/forks","keys_url":"https://api.github.com/repos/infinispan/infinispan-management-console/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infinispan/infinispan-management-console/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infinispan/infinispan-management-console/teams","hooks_url":"https://api.github.com/repos/infinispan/infinispan-management-console/hooks","issue_events_url":"https://api.github.com/repos/infinispan/infinispan-management-console/issues/events{/number}","events_url":"https://api.github.com/repos/infinispan/infinispan-management-console/events","assignees_url":"https://api.github.com/repos/infinispan/infinispan-management-console/assignees{/user}","branches_url":"https://api.github.com/repos/infinispan/infinispan-management-console/branches{/branch}","tags_url":"https://api.github.com/repos/infinispan/infinispan-management-console/tags","blobs_url":"https://api.github.com/repos/infinispan/infinispan-management-console/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infinispan/infinispan-management-console/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infinispan/infinispan-management-console/git/refs{/sha}","trees_url":"https://api.github.com/repos/infinispan/infinispan-management-console/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infinispan/infinispan-management-console/statuses/{sha}","languages_url":"https://api.github.com/repos/infinispan/infinispan-management-console/languages","stargazers_url":"https://api.github.com/repos/infinispan/infinispan-management-console/stargazers","contributors_url":"https://api.github.com/repos/infinispan/infinispan-management-console/contributors","subscribers_url":"https://api.github.com/repos/infinispan/infinispan-management-console/subscribers","subscription_url":"https://api.github.com/repos/infinispan/infinispan-management-console/subscription","commits_url":"https://api.github.com/repos/infinispan/infinispan-management-console/commits{/sha}","git_commits_url":"https://api.github.com/repos/infinispan/infinispan-management-console/git/commits{/sha}","comments_url":"https://api.github.com/repos/infinispan/infinispan-management-console/comments{/number}","issue_comment_url":"https://api.github.com/repos/infinispan/infinispan-management-console/issues/comments{/number}","contents_url":"https://api.github.com/repos/infinispan/infinispan-management-console/contents/{+path}","compare_url":"https://api.github.com/repos/infinispan/infinispan-management-console/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infinispan/infinispan-management-console/merges","archive_url":"https://api.github.com/repos/infinispan/infinispan-management-console/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infinispan/infinispan-management-console/downloads","issues_url":"https://api.github.com/repos/infinispan/infinispan-management-console/issues{/number}","pulls_url":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls{/number}","milestones_url":"https://api.github.com/repos/infinispan/infinispan-management-console/milestones{/number}","notifications_url":"https://api.github.com/repos/infinispan/infinispan-management-console/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infinispan/infinispan-management-console/labels{/name}","releases_url":"https://api.github.com/repos/infinispan/infinispan-management-console/releases{/id}","deployments_url":"https://api.github.com/repos/infinispan/infinispan-management-console/deployments","created_at":"2014-12-04T13:38:41Z","updated_at":"2018-04-04T06:29:32Z","pushed_at":"2018-04-05T16:04:43Z","git_url":"git://github.com/infinispan/infinispan-management-console.git","ssh_url":"git@github.com:infinispan/infinispan-management-console.git","clone_url":"https://github.com/infinispan/infinispan-management-console.git","svn_url":"https://github.com/infinispan/infinispan-management-console","homepage":null,"size":1844,"stargazers_count":14,"watchers_count":14,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":22,"open_issues":3,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235"},"html":{"href":"https://github.com/infinispan/infinispan-management-console/pull/235"},"issue":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/issues/235"},"comments":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/infinispan/infinispan-management-console/statuses/681d40fe51b9cd0d336fc73fb4c802b66fcf1d9d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ryanemerson"}}