{"action":"created","comment":{"url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/comments/230362545","pull_request_review_id":171085693,"id":230362545,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDM2MjU0NQ==","diff_hunk":"@@ -0,0 +1,113 @@\n+import * as fileSystem from 'fs';\n+import * as path from'path';\n+import { arrayContains } from '.././utils/utils';\n+import { Request, Response } from 'express-serve-static-core';\n+\n+\n+const DB_PATH = '../db/events.json';\n+\n+\n+interface LegalParametersOfRequest {\n+  readonly queries: string[];\n+  readonly types: string[];\n+}\n+\n+interface ResponceWithEventsData extends Response {\n+  eventsData: any;\n+}\n+\n+interface RequestError extends NodeJS.ErrnoException {\n+  code: string;\n+  message: string;\n+}\n+\n+interface RequestErrors {\n+  typeIllegal: RequestError;\n+  queryIllegal: RequestError;\n+}\n+\n+\n+/** Разрешённые параметры в запросе */\n+const LEGAL_PARAMS : LegalParametersOfRequest = {\n+  queries: ['type'],\n+  types: ['critical', 'info'],\n+};\n+\n+const ERRORS : RequestErrors = {\n+  typeIllegal: {\n+    code: '400',\n+    message: 'incorrect type',\n+    name: null,\n+  },\n+  queryIllegal: {\n+    code: '400',\n+    message: 'incorrect query',\n+    name: null,\n+  },\n+};\n+\n+\n+/**\n+ * Проверяет пришедшие в теле POST-запроса query strings на легальность\n+ * Если есть нелегальные — бросает ошибку\n+ * @param {Request} req","path":"src/routes/events.ts","position":53,"original_position":53,"commit_id":"00e76e05c40f7e64ea76f106e86ce2076aec7eca","original_commit_id":"00e76e05c40f7e64ea76f106e86ce2076aec7eca","user":{"login":"sigorilla","id":1208639,"node_id":"MDQ6VXNlcjEyMDg2Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/1208639?v=4","gravatar_id":"","url":"https://api.github.com/users/sigorilla","html_url":"https://github.com/sigorilla","followers_url":"https://api.github.com/users/sigorilla/followers","following_url":"https://api.github.com/users/sigorilla/following{/other_user}","gists_url":"https://api.github.com/users/sigorilla/gists{/gist_id}","starred_url":"https://api.github.com/users/sigorilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigorilla/subscriptions","organizations_url":"https://api.github.com/users/sigorilla/orgs","repos_url":"https://api.github.com/users/sigorilla/repos","events_url":"https://api.github.com/users/sigorilla/events{/privacy}","received_events_url":"https://api.github.com/users/sigorilla/received_events","type":"User","site_admin":false},"body":"параметры в jsdoc на TS лишние, т.к. у тебя всё ниже описано","created_at":"2018-11-02T12:49:18Z","updated_at":"2018-11-02T12:53:59Z","html_url":"https://github.com/KasiMaru/shri-node-hw-4/pull/1#discussion_r230362545","pull_request_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/comments/230362545"},"html":{"href":"https://github.com/KasiMaru/shri-node-hw-4/pull/1#discussion_r230362545"},"pull_request":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/1","id":227926483,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3OTI2NDgz","html_url":"https://github.com/KasiMaru/shri-node-hw-4/pull/1","diff_url":"https://github.com/KasiMaru/shri-node-hw-4/pull/1.diff","patch_url":"https://github.com/KasiMaru/shri-node-hw-4/pull/1.patch","issue_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/1","number":1,"state":"open","locked":false,"title":"Task7","user":{"login":"sigorilla","id":1208639,"node_id":"MDQ6VXNlcjEyMDg2Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/1208639?v=4","gravatar_id":"","url":"https://api.github.com/users/sigorilla","html_url":"https://github.com/sigorilla","followers_url":"https://api.github.com/users/sigorilla/followers","following_url":"https://api.github.com/users/sigorilla/following{/other_user}","gists_url":"https://api.github.com/users/sigorilla/gists{/gist_id}","starred_url":"https://api.github.com/users/sigorilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigorilla/subscriptions","organizations_url":"https://api.github.com/users/sigorilla/orgs","repos_url":"https://api.github.com/users/sigorilla/repos","events_url":"https://api.github.com/users/sigorilla/events{/privacy}","received_events_url":"https://api.github.com/users/sigorilla/received_events","type":"User","site_admin":false},"body":"Создал PR, чтобы легче было писать комментарии. После можешь либо закрыть, либо смержить :)","created_at":"2018-11-02T12:47:46Z","updated_at":"2018-11-02T12:53:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9c01868161c2cc628ef9afdd2f36959c0bb9f09","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/1/commits","review_comments_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/1/comments","review_comment_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/1/comments","statuses_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/statuses/00e76e05c40f7e64ea76f106e86ce2076aec7eca","head":{"label":"KasiMaru:task7","ref":"task7","sha":"00e76e05c40f7e64ea76f106e86ce2076aec7eca","user":{"login":"KasiMaru","id":26373955,"node_id":"MDQ6VXNlcjI2MzczOTU1","avatar_url":"https://avatars1.githubusercontent.com/u/26373955?v=4","gravatar_id":"","url":"https://api.github.com/users/KasiMaru","html_url":"https://github.com/KasiMaru","followers_url":"https://api.github.com/users/KasiMaru/followers","following_url":"https://api.github.com/users/KasiMaru/following{/other_user}","gists_url":"https://api.github.com/users/KasiMaru/gists{/gist_id}","starred_url":"https://api.github.com/users/KasiMaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KasiMaru/subscriptions","organizations_url":"https://api.github.com/users/KasiMaru/orgs","repos_url":"https://api.github.com/users/KasiMaru/repos","events_url":"https://api.github.com/users/KasiMaru/events{/privacy}","received_events_url":"https://api.github.com/users/KasiMaru/received_events","type":"User","site_admin":false},"repo":{"id":153032264,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwMzIyNjQ=","name":"shri-node-hw-4","full_name":"KasiMaru/shri-node-hw-4","private":false,"owner":{"login":"KasiMaru","id":26373955,"node_id":"MDQ6VXNlcjI2MzczOTU1","avatar_url":"https://avatars1.githubusercontent.com/u/26373955?v=4","gravatar_id":"","url":"https://api.github.com/users/KasiMaru","html_url":"https://github.com/KasiMaru","followers_url":"https://api.github.com/users/KasiMaru/followers","following_url":"https://api.github.com/users/KasiMaru/following{/other_user}","gists_url":"https://api.github.com/users/KasiMaru/gists{/gist_id}","starred_url":"https://api.github.com/users/KasiMaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KasiMaru/subscriptions","organizations_url":"https://api.github.com/users/KasiMaru/orgs","repos_url":"https://api.github.com/users/KasiMaru/repos","events_url":"https://api.github.com/users/KasiMaru/events{/privacy}","received_events_url":"https://api.github.com/users/KasiMaru/received_events","type":"User","site_admin":false},"html_url":"https://github.com/KasiMaru/shri-node-hw-4","description":"Домашнее задание 4, Node.js","fork":false,"url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4","forks_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/forks","keys_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/teams","hooks_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/hooks","issue_events_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/events{/number}","events_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/events","assignees_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/assignees{/user}","branches_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/branches{/branch}","tags_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/tags","blobs_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/statuses/{sha}","languages_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/languages","stargazers_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/stargazers","contributors_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/contributors","subscribers_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/subscribers","subscription_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/subscription","commits_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/contents/{+path}","compare_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/merges","archive_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/downloads","issues_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues{/number}","pulls_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls{/number}","milestones_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/milestones{/number}","notifications_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/labels{/name}","releases_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/releases{/id}","deployments_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/deployments","created_at":"2018-10-15T00:35:53Z","updated_at":"2018-10-19T16:58:19Z","pushed_at":"2018-11-02T12:47:46Z","git_url":"git://github.com/KasiMaru/shri-node-hw-4.git","ssh_url":"git@github.com:KasiMaru/shri-node-hw-4.git","clone_url":"https://github.com/KasiMaru/shri-node-hw-4.git","svn_url":"https://github.com/KasiMaru/shri-node-hw-4","homepage":null,"size":98,"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":"KasiMaru:master","ref":"master","sha":"fb6a994e79567cd23688bd6898f051b878189548","user":{"login":"KasiMaru","id":26373955,"node_id":"MDQ6VXNlcjI2MzczOTU1","avatar_url":"https://avatars1.githubusercontent.com/u/26373955?v=4","gravatar_id":"","url":"https://api.github.com/users/KasiMaru","html_url":"https://github.com/KasiMaru","followers_url":"https://api.github.com/users/KasiMaru/followers","following_url":"https://api.github.com/users/KasiMaru/following{/other_user}","gists_url":"https://api.github.com/users/KasiMaru/gists{/gist_id}","starred_url":"https://api.github.com/users/KasiMaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KasiMaru/subscriptions","organizations_url":"https://api.github.com/users/KasiMaru/orgs","repos_url":"https://api.github.com/users/KasiMaru/repos","events_url":"https://api.github.com/users/KasiMaru/events{/privacy}","received_events_url":"https://api.github.com/users/KasiMaru/received_events","type":"User","site_admin":false},"repo":{"id":153032264,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwMzIyNjQ=","name":"shri-node-hw-4","full_name":"KasiMaru/shri-node-hw-4","private":false,"owner":{"login":"KasiMaru","id":26373955,"node_id":"MDQ6VXNlcjI2MzczOTU1","avatar_url":"https://avatars1.githubusercontent.com/u/26373955?v=4","gravatar_id":"","url":"https://api.github.com/users/KasiMaru","html_url":"https://github.com/KasiMaru","followers_url":"https://api.github.com/users/KasiMaru/followers","following_url":"https://api.github.com/users/KasiMaru/following{/other_user}","gists_url":"https://api.github.com/users/KasiMaru/gists{/gist_id}","starred_url":"https://api.github.com/users/KasiMaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KasiMaru/subscriptions","organizations_url":"https://api.github.com/users/KasiMaru/orgs","repos_url":"https://api.github.com/users/KasiMaru/repos","events_url":"https://api.github.com/users/KasiMaru/events{/privacy}","received_events_url":"https://api.github.com/users/KasiMaru/received_events","type":"User","site_admin":false},"html_url":"https://github.com/KasiMaru/shri-node-hw-4","description":"Домашнее задание 4, Node.js","fork":false,"url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4","forks_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/forks","keys_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/teams","hooks_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/hooks","issue_events_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/events{/number}","events_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/events","assignees_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/assignees{/user}","branches_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/branches{/branch}","tags_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/tags","blobs_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/statuses/{sha}","languages_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/languages","stargazers_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/stargazers","contributors_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/contributors","subscribers_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/subscribers","subscription_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/subscription","commits_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/contents/{+path}","compare_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/merges","archive_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/downloads","issues_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues{/number}","pulls_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls{/number}","milestones_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/milestones{/number}","notifications_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/labels{/name}","releases_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/releases{/id}","deployments_url":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/deployments","created_at":"2018-10-15T00:35:53Z","updated_at":"2018-10-19T16:58:19Z","pushed_at":"2018-11-02T12:47:46Z","git_url":"git://github.com/KasiMaru/shri-node-hw-4.git","ssh_url":"git@github.com:KasiMaru/shri-node-hw-4.git","clone_url":"https://github.com/KasiMaru/shri-node-hw-4.git","svn_url":"https://github.com/KasiMaru/shri-node-hw-4","homepage":null,"size":98,"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/KasiMaru/shri-node-hw-4/pulls/1"},"html":{"href":"https://github.com/KasiMaru/shri-node-hw-4/pull/1"},"issue":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/1"},"comments":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/KasiMaru/shri-node-hw-4/statuses/00e76e05c40f7e64ea76f106e86ce2076aec7eca"}},"author_association":"NONE"}}
{"actor":{"display_login":"sigorilla"}}