From 6afe8b54269ec0b7c77bb60704dcfcf02fb6814e Mon Sep 17 00:00:00 2001 From: mohiit1502 Date: Mon, 23 Jul 2018 02:24:19 +0530 Subject: [PATCH] teest --- dist/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/bundle.js b/dist/bundle.js index a352c50..320822c 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -215,7 +215,7 @@ eval("const Recast = __webpack_require__(/*! ./bot/recast-ops.js */ \"./src/js/b /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("const config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\nconst GithubHelper = __webpack_require__(/*! ./helper.js */ \"./src/js/helper.js\");\nconst githubHelper = new GithubHelper();\nconst DomManipulator = __webpack_require__(/*! ./dom-ops.js */ \"./src/js/dom-ops.js\");\nconst dom = new DomManipulator();\n\nmodule.exports = class Github {\n\n constructor() {\n this.authorizationToken = \"token \" + config.gitToken;\n }\n\n getToken(getTokenRequest) {\n var token = '';\n let url = 'https://github.com/login/oauth/access_token';\n fetch(url, {\n method: \"POST\",\n body: JSON.stringify(getTokenRequest)\n }).then(function (response) {\n console.log(\"token get success\");\n response.json().then(function (body) {\n console.log(response);\n repositories = body;\n console.log(body);\n console.log(repositories);\n return repositories;\n });\n // dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return repositories;\n }\n\n authenticate() {}\n\n viewRepositories() {\n var repositories = '';\n let url = 'https://api.github.com/user/repos';\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n // response.json().then(function(body){\n // repositories = body; \n // console.log(repositories); \n // return repositories;\n // });\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return repositories;\n }\n\n createRepository(newRepoJson) {\n let url = 'https://api.github.com/user/repos';\n var responsePromise = '';\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(newRepoJson)\n }).then(function (response) {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateRepository(updateRepoJson, repoName) {\n repoName = \"Hello-World3\";\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(updateRepoJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n deleteRepository(repoName) {\n repoName = \"Hello-World2\";\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName;\n fetch(url, {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createIssue(newIssueJson, repoName) {\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues';\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(newIssueJson)\n }).then(function (response) {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateIssue(updateIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n closeIssue(closeIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(closeIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n reopenIssue(reopenIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(reopenIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssue(repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n var issues = '';\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n response.json().then(function (body) {\n issues = body;\n console.log(issues);\n return issues;\n });\n }).catch(error => console.error('Fetch Error =\\n', error));\n return issues;\n }\n\n addIssueComment(commentBodyJson, repoName, issueNumber) {\n repoName = \"stack_route_prj7\";\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber + \"/comments\";\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(commentBodyJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayLastComment(repoName, issueNumber) {\n repoName = \"stack_route_prj7\";\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber + \"/comments\";\n var comments = [];\n var latestComment = \"\";\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n response.json().then(function (body) {\n comments = body;\n latestComment = githubHelper.getLatestComment(comments);\n console.log(comments);\n console.log(latestComment);\n return latestComment;\n });\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesForUser() {\n let url = 'https://api.github.com/user/issues';\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesOnRepo() {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/';\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n addCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/collaborators/' + collaborator;\n fetch(url, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n removeCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/collaborators/' + collaborator;\n fetch(url, {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createUser(newuserJson) {}\n\n updateUser(updateUserJson) {}\n\n deleteUser(userId) {}\n};\n\n//# sourceURL=webpack:///./src/js/github-ops.js?"); +eval("const config = __webpack_require__(/*! ./config.js */ \"./src/js/config.js\");\nconst GithubHelper = __webpack_require__(/*! ./helper.js */ \"./src/js/helper.js\");\nconst githubHelper = new GithubHelper();\nconst DomManipulator = __webpack_require__(/*! ./dom-ops.js */ \"./src/js/dom-ops.js\");\nconst dom = new DomManipulator();\n\nmodule.exports = class Github {\n\n constructor() {\n this.authorizationToken = \"token \" + config.gitToken;\n }\n\n getToken(getTokenRequest) {\n var token = '';\n let url = 'https://github.com/login/oauth/access_token';\n fetch(url, {\n method: \"POST\",\n body: JSON.stringify(getTokenRequest)\n }).then(function (response) {\n console.log(\"token get success\");\n response.json().then(function (body) {\n console.log(response);\n token = body.access_token;\n console.log(body);\n console.log(token);\n return token;\n });\n // dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return token;\n }\n\n authenticate() {}\n\n viewRepositories() {\n var repositories = '';\n let url = 'https://api.github.com/user/repos';\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n // response.json().then(function(body){\n // repositories = body; \n // console.log(repositories); \n // return repositories;\n // });\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n return repositories;\n }\n\n createRepository(newRepoJson) {\n let url = 'https://api.github.com/user/repos';\n var responsePromise = '';\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(newRepoJson)\n }).then(function (response) {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateRepository(updateRepoJson, repoName) {\n repoName = \"Hello-World3\";\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(updateRepoJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n deleteRepository(repoName) {\n repoName = \"Hello-World2\";\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName;\n fetch(url, {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createIssue(newIssueJson, repoName) {\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues';\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(newIssueJson)\n }).then(function (response) {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n updateIssue(updateIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n closeIssue(closeIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(closeIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n reopenIssue(reopenIssueJson, repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(reopenIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssue(repoName, issueNumber) {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;\n var issues = '';\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n response.json().then(function (body) {\n issues = body;\n console.log(issues);\n return issues;\n });\n }).catch(error => console.error('Fetch Error =\\n', error));\n return issues;\n }\n\n addIssueComment(commentBodyJson, repoName, issueNumber) {\n repoName = \"stack_route_prj7\";\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber + \"/comments\";\n fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(commentBodyJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayLastComment(repoName, issueNumber) {\n repoName = \"stack_route_prj7\";\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber + \"/comments\";\n var comments = [];\n var latestComment = \"\";\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n response.json().then(function (body) {\n comments = body;\n latestComment = githubHelper.getLatestComment(comments);\n console.log(comments);\n console.log(latestComment);\n return latestComment;\n });\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesForUser() {\n let url = 'https://api.github.com/user/issues';\n fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n displayIssuesOnRepo() {\n repoName = 'stack_route_prj7';\n issueNumber = 2;\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/';\n fetch(url, {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"Authorization\": this.authorizationToken\n },\n body: JSON.stringify(updateIssueJson)\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n addCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/collaborators/' + collaborator;\n fetch(url, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": this.authorizationToken\n }\n }).then(function (response) {\n dom.toggleModals(response);\n }).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n removeCollaborator(repoName, collaborator) {\n repoName = 'stack_route_prj7';\n collaborator = 'swat1508';\n let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/collaborators/' + collaborator;\n fetch(url, {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": this.authorizationToken\n }\n }).then(response => response.json()).catch(error => console.error('Fetch Error =\\n', error));\n }\n\n createUser(newuserJson) {}\n\n updateUser(updateUserJson) {}\n\n deleteUser(userId) {}\n};\n\n//# sourceURL=webpack:///./src/js/github-ops.js?"); /***/ }),