{"action":"created","comment":{"url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/comments/156788788","pull_request_review_id":83309802,"id":156788788,"diff_hunk":"@@ -0,0 +1,149 @@\n+\n+const ModelWrapper = require('./ModelWrapper');\n+const error = require('./error');\n+\n+const defaultSupportedOpperators = [\n+    '=',\n+    'neq',\n+    'lt',\n+    'lte',\n+    'gt',\n+    'gte',\n+    'like',\n+    'nlike',\n+    'ilike',\n+    'nilike',\n+    'inq',\n+    'nin',\n+    'between',\n+];\n+\n+/**\n+ * @todo: add a custom error type for easier handling\n+ * @todo: add a possibility to detect invalid operators\n+ */\n+\n+module.exports = class SearchQueryNormalizer {\n+\n+    constructor(models, {\n+        supportedOperators = defaultSupportedOpperators,\n+        rejectUnknownProperties = false,\n+    } = {}) {\n+        this.models = models;\n+        this.wrappedModels = {};\n+        this.supportedOperators = supportedOperators;\n+        this.rejectUnknownProperties = rejectUnknownProperties;\n+    }\n+\n+    normalizeQuery(rootModelName, where) {\n+        return this.normalizeWhereQuery(rootModelName, where);\n+    }\n+\n+    setUnknownPropertyRejection(rejectUnknown) {\n+        this.rejectUnknownProperties = rejectUnknown === true;\n+    }\n+\n+    normalizeWhereQuery(rootModelName, where) {","path":"src/SearchQueryNormalizer.js","position":46,"original_position":46,"commit_id":"b8de6b5dda43f1277baf062149bbd16dfe521151","original_commit_id":"b8de6b5dda43f1277baf062149bbd16dfe521151","user":{"login":"eventEmitter","id":603475,"avatar_url":"https://avatars0.githubusercontent.com/u/603475?v=4","gravatar_id":"","url":"https://api.github.com/users/eventEmitter","html_url":"https://github.com/eventEmitter","followers_url":"https://api.github.com/users/eventEmitter/followers","following_url":"https://api.github.com/users/eventEmitter/following{/other_user}","gists_url":"https://api.github.com/users/eventEmitter/gists{/gist_id}","starred_url":"https://api.github.com/users/eventEmitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eventEmitter/subscriptions","organizations_url":"https://api.github.com/users/eventEmitter/orgs","repos_url":"https://api.github.com/users/eventEmitter/repos","events_url":"https://api.github.com/users/eventEmitter/events{/privacy}","received_events_url":"https://api.github.com/users/eventEmitter/received_events","type":"User","site_admin":false},"body":"a general summary of what your functions / methods do would be nice if the function is a bit more than a onliner","created_at":"2017-12-13T21:22:54Z","updated_at":"2017-12-13T21:36:47Z","html_url":"https://github.com/joinbox/loopback-component-relation-filter/pull/1#discussion_r156788788","pull_request_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/comments/156788788"},"html":{"href":"https://github.com/joinbox/loopback-component-relation-filter/pull/1#discussion_r156788788"},"pull_request":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/1","id":157595489,"html_url":"https://github.com/joinbox/loopback-component-relation-filter/pull/1","diff_url":"https://github.com/joinbox/loopback-component-relation-filter/pull/1.diff","patch_url":"https://github.com/joinbox/loopback-component-relation-filter/pull/1.patch","issue_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/1","number":1,"state":"open","locked":false,"title":"Initial setup","user":{"login":"rcky","id":851392,"avatar_url":"https://avatars3.githubusercontent.com/u/851392?v=4","gravatar_id":"","url":"https://api.github.com/users/rcky","html_url":"https://github.com/rcky","followers_url":"https://api.github.com/users/rcky/followers","following_url":"https://api.github.com/users/rcky/following{/other_user}","gists_url":"https://api.github.com/users/rcky/gists{/gist_id}","starred_url":"https://api.github.com/users/rcky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rcky/subscriptions","organizations_url":"https://api.github.com/users/rcky/orgs","repos_url":"https://api.github.com/users/rcky/repos","events_url":"https://api.github.com/users/rcky/events{/privacy}","received_events_url":"https://api.github.com/users/rcky/received_events","type":"User","site_admin":false},"body":"Basic implementation of the relation searching feature.\r\n\r\n@eventEmitter please help me to make the repos accessible for @lkappeler","created_at":"2017-12-11T15:37:40Z","updated_at":"2017-12-13T21:36:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"416b4987ed7355781f3ea133295b865298945a36","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/1/commits","review_comments_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/1/comments","review_comment_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/1/comments","statuses_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/statuses/b8de6b5dda43f1277baf062149bbd16dfe521151","head":{"label":"joinbox:initial-setup","ref":"initial-setup","sha":"b8de6b5dda43f1277baf062149bbd16dfe521151","user":{"login":"joinbox","id":1210774,"avatar_url":"https://avatars3.githubusercontent.com/u/1210774?v=4","gravatar_id":"","url":"https://api.github.com/users/joinbox","html_url":"https://github.com/joinbox","followers_url":"https://api.github.com/users/joinbox/followers","following_url":"https://api.github.com/users/joinbox/following{/other_user}","gists_url":"https://api.github.com/users/joinbox/gists{/gist_id}","starred_url":"https://api.github.com/users/joinbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joinbox/subscriptions","organizations_url":"https://api.github.com/users/joinbox/orgs","repos_url":"https://api.github.com/users/joinbox/repos","events_url":"https://api.github.com/users/joinbox/events{/privacy}","received_events_url":"https://api.github.com/users/joinbox/received_events","type":"Organization","site_admin":false},"repo":{"id":111915685,"name":"loopback-component-relation-filter","full_name":"joinbox/loopback-component-relation-filter","owner":{"login":"joinbox","id":1210774,"avatar_url":"https://avatars3.githubusercontent.com/u/1210774?v=4","gravatar_id":"","url":"https://api.github.com/users/joinbox","html_url":"https://github.com/joinbox","followers_url":"https://api.github.com/users/joinbox/followers","following_url":"https://api.github.com/users/joinbox/following{/other_user}","gists_url":"https://api.github.com/users/joinbox/gists{/gist_id}","starred_url":"https://api.github.com/users/joinbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joinbox/subscriptions","organizations_url":"https://api.github.com/users/joinbox/orgs","repos_url":"https://api.github.com/users/joinbox/repos","events_url":"https://api.github.com/users/joinbox/events{/privacy}","received_events_url":"https://api.github.com/users/joinbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joinbox/loopback-component-relation-filter","description":"Loopback component to enable where query filters on related loopback models","fork":false,"url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter","forks_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/forks","keys_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/teams","hooks_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/hooks","issue_events_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/events{/number}","events_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/events","assignees_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/assignees{/user}","branches_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/branches{/branch}","tags_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/tags","blobs_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/refs{/sha}","trees_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/statuses/{sha}","languages_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/languages","stargazers_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/stargazers","contributors_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/contributors","subscribers_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/subscribers","subscription_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/subscription","commits_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/commits{/sha}","git_commits_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/commits{/sha}","comments_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/comments{/number}","issue_comment_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/comments{/number}","contents_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/contents/{+path}","compare_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/merges","archive_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/downloads","issues_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues{/number}","pulls_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls{/number}","milestones_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/milestones{/number}","notifications_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/labels{/name}","releases_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/releases{/id}","deployments_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/deployments","created_at":"2017-11-24T12:24:16Z","updated_at":"2017-12-01T13:08:12Z","pushed_at":"2017-12-12T16:30:57Z","git_url":"git://github.com/joinbox/loopback-component-relation-filter.git","ssh_url":"git@github.com:joinbox/loopback-component-relation-filter.git","clone_url":"https://github.com/joinbox/loopback-component-relation-filter.git","svn_url":"https://github.com/joinbox/loopback-component-relation-filter","homepage":"","size":89,"stargazers_count":0,"watchers_count":0,"language":null,"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":"joinbox:master","ref":"master","sha":"47f2b9c88b3ca0801c66c2a7ad060d7c0d1f8cce","user":{"login":"joinbox","id":1210774,"avatar_url":"https://avatars3.githubusercontent.com/u/1210774?v=4","gravatar_id":"","url":"https://api.github.com/users/joinbox","html_url":"https://github.com/joinbox","followers_url":"https://api.github.com/users/joinbox/followers","following_url":"https://api.github.com/users/joinbox/following{/other_user}","gists_url":"https://api.github.com/users/joinbox/gists{/gist_id}","starred_url":"https://api.github.com/users/joinbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joinbox/subscriptions","organizations_url":"https://api.github.com/users/joinbox/orgs","repos_url":"https://api.github.com/users/joinbox/repos","events_url":"https://api.github.com/users/joinbox/events{/privacy}","received_events_url":"https://api.github.com/users/joinbox/received_events","type":"Organization","site_admin":false},"repo":{"id":111915685,"name":"loopback-component-relation-filter","full_name":"joinbox/loopback-component-relation-filter","owner":{"login":"joinbox","id":1210774,"avatar_url":"https://avatars3.githubusercontent.com/u/1210774?v=4","gravatar_id":"","url":"https://api.github.com/users/joinbox","html_url":"https://github.com/joinbox","followers_url":"https://api.github.com/users/joinbox/followers","following_url":"https://api.github.com/users/joinbox/following{/other_user}","gists_url":"https://api.github.com/users/joinbox/gists{/gist_id}","starred_url":"https://api.github.com/users/joinbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joinbox/subscriptions","organizations_url":"https://api.github.com/users/joinbox/orgs","repos_url":"https://api.github.com/users/joinbox/repos","events_url":"https://api.github.com/users/joinbox/events{/privacy}","received_events_url":"https://api.github.com/users/joinbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joinbox/loopback-component-relation-filter","description":"Loopback component to enable where query filters on related loopback models","fork":false,"url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter","forks_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/forks","keys_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/teams","hooks_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/hooks","issue_events_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/events{/number}","events_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/events","assignees_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/assignees{/user}","branches_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/branches{/branch}","tags_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/tags","blobs_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/refs{/sha}","trees_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/statuses/{sha}","languages_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/languages","stargazers_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/stargazers","contributors_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/contributors","subscribers_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/subscribers","subscription_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/subscription","commits_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/commits{/sha}","git_commits_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/git/commits{/sha}","comments_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/comments{/number}","issue_comment_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/comments{/number}","contents_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/contents/{+path}","compare_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/merges","archive_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/downloads","issues_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues{/number}","pulls_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls{/number}","milestones_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/milestones{/number}","notifications_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/labels{/name}","releases_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/releases{/id}","deployments_url":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/deployments","created_at":"2017-11-24T12:24:16Z","updated_at":"2017-12-01T13:08:12Z","pushed_at":"2017-12-12T16:30:57Z","git_url":"git://github.com/joinbox/loopback-component-relation-filter.git","ssh_url":"git@github.com:joinbox/loopback-component-relation-filter.git","clone_url":"https://github.com/joinbox/loopback-component-relation-filter.git","svn_url":"https://github.com/joinbox/loopback-component-relation-filter","homepage":"","size":89,"stargazers_count":0,"watchers_count":0,"language":null,"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/joinbox/loopback-component-relation-filter/pulls/1"},"html":{"href":"https://github.com/joinbox/loopback-component-relation-filter/pull/1"},"issue":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/1"},"comments":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/joinbox/loopback-component-relation-filter/statuses/b8de6b5dda43f1277baf062149bbd16dfe521151"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"eventEmitter"}}