{"action":"created","comment":{"url":"https://api.github.com/repos/samwise-tech/search-ql/pulls/comments/219447620","pull_request_review_id":157625937,"id":219447620,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTQ0NzYyMA==","diff_hunk":"@@ -0,0 +1,267 @@\n+/* tslint:disable:no-unused-expression */\n+import { expect } from 'chai';\n+import { Map } from 'immutable';\n+\n+import { Expression, ExpressionType, ValueType } from '../common/model';\n+import { InvalidExpression } from './expressions';\n+import { fromJS } from './from-js';\n+\n+const getErrors = (e: Expression) => e.toList()\n+  .filter(node => node instanceof InvalidExpression)\n+  .flatMap(({ errors }: InvalidExpression) => errors)\n+  .toArray();\n+\n+describe('SearchQL ast: Expression tree', () => {\n+\n+  xit('should be able to self check types', () => {\n+    expect(Expression).to.equal(Expression);\n+  });\n+\n+  describe('integrity', () => {\n+\n+    const model = Map<string, ValueType>({\n+      first_name: ValueType.Text,\n+    });\n+\n+    const validDTO = [\n+      {\n+        preparedValue: 'ccc',\n+        returnType: ValueType.Text,\n+        type: ExpressionType.Text,\n+        value: 'ccc',\n+      },\n+      {\n+        preparedValue: 123,\n+        returnType: ValueType.Number,\n+        type: ExpressionType.Number,\n+        value: '00123.00',\n+      },\n+      {\n+        preparedValue: 1533195898070,\n+        returnType: ValueType.Date,\n+        type: ExpressionType.Date,\n+        value: '2018-08-02T07:44:58.070Z',\n+      },\n+      {\n+        matchingType: ValueType.Text,\n+        preparedValue: 'first_name',\n+        returnType: ValueType.Text,\n+        type: ExpressionType.Selector,\n+        value: 'first_name',\n+      },\n+      {\n+        preparedValue: 'lorem ipsum',\n+        returnType: ValueType.Phrase,\n+        term: {\n+          preparedValue: 'lorem ipsum',\n+          returnType: ValueType.Text,\n+          type: ExpressionType.Text,\n+          value: ' lorem ipsum ',\n+        },\n+        type: ExpressionType.Phrase,\n+        value: ' lorem ipsum ',\n+      },\n+    ];\n+\n+    // {","path":"src/ast/expression.spec.ts","position":66,"original_position":66,"commit_id":"8c519d05229c212abdd2bc1fb11a37dc066bdc2f","original_commit_id":"8c519d05229c212abdd2bc1fb11a37dc066bdc2f","user":{"login":"ulfryk","id":1754948,"node_id":"MDQ6VXNlcjE3NTQ5NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1754948?v=4","gravatar_id":"","url":"https://api.github.com/users/ulfryk","html_url":"https://github.com/ulfryk","followers_url":"https://api.github.com/users/ulfryk/followers","following_url":"https://api.github.com/users/ulfryk/following{/other_user}","gists_url":"https://api.github.com/users/ulfryk/gists{/gist_id}","starred_url":"https://api.github.com/users/ulfryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulfryk/subscriptions","organizations_url":"https://api.github.com/users/ulfryk/orgs","repos_url":"https://api.github.com/users/ulfryk/repos","events_url":"https://api.github.com/users/ulfryk/events{/privacy}","received_events_url":"https://api.github.com/users/ulfryk/received_events","type":"User","site_admin":false},"body":"step by step while adding tests for next nodes","created_at":"2018-09-21T10:06:28Z","updated_at":"2018-09-21T10:06:28Z","html_url":"https://github.com/samwise-tech/search-ql/pull/60#discussion_r219447620","pull_request_url":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/samwise-tech/search-ql/pulls/comments/219447620"},"html":{"href":"https://github.com/samwise-tech/search-ql/pull/60#discussion_r219447620"},"pull_request":{"href":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60"}},"in_reply_to_id":219446026},"pull_request":{"url":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60","id":217086514,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MDg2NTE0","html_url":"https://github.com/samwise-tech/search-ql/pull/60","diff_url":"https://github.com/samwise-tech/search-ql/pull/60.diff","patch_url":"https://github.com/samwise-tech/search-ql/pull/60.patch","issue_url":"https://api.github.com/repos/samwise-tech/search-ql/issues/60","number":60,"state":"open","locked":false,"title":"PC-1293: Integrity check (TermExpression)","user":{"login":"ulfryk","id":1754948,"node_id":"MDQ6VXNlcjE3NTQ5NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1754948?v=4","gravatar_id":"","url":"https://api.github.com/users/ulfryk","html_url":"https://github.com/ulfryk","followers_url":"https://api.github.com/users/ulfryk/followers","following_url":"https://api.github.com/users/ulfryk/following{/other_user}","gists_url":"https://api.github.com/users/ulfryk/gists{/gist_id}","starred_url":"https://api.github.com/users/ulfryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulfryk/subscriptions","organizations_url":"https://api.github.com/users/ulfryk/orgs","repos_url":"https://api.github.com/users/ulfryk/repos","events_url":"https://api.github.com/users/ulfryk/events{/privacy}","received_events_url":"https://api.github.com/users/ulfryk/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-20T19:48:13Z","updated_at":"2018-09-21T10:06:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85aa64fe7fa1dbec7583bed0cb9609c15667a6b5","assignee":{"login":"ulfryk","id":1754948,"node_id":"MDQ6VXNlcjE3NTQ5NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1754948?v=4","gravatar_id":"","url":"https://api.github.com/users/ulfryk","html_url":"https://github.com/ulfryk","followers_url":"https://api.github.com/users/ulfryk/followers","following_url":"https://api.github.com/users/ulfryk/following{/other_user}","gists_url":"https://api.github.com/users/ulfryk/gists{/gist_id}","starred_url":"https://api.github.com/users/ulfryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulfryk/subscriptions","organizations_url":"https://api.github.com/users/ulfryk/orgs","repos_url":"https://api.github.com/users/ulfryk/repos","events_url":"https://api.github.com/users/ulfryk/events{/privacy}","received_events_url":"https://api.github.com/users/ulfryk/received_events","type":"User","site_admin":false},"assignees":[{"login":"ulfryk","id":1754948,"node_id":"MDQ6VXNlcjE3NTQ5NDg=","avatar_url":"https://avatars3.githubusercontent.com/u/1754948?v=4","gravatar_id":"","url":"https://api.github.com/users/ulfryk","html_url":"https://github.com/ulfryk","followers_url":"https://api.github.com/users/ulfryk/followers","following_url":"https://api.github.com/users/ulfryk/following{/other_user}","gists_url":"https://api.github.com/users/ulfryk/gists{/gist_id}","starred_url":"https://api.github.com/users/ulfryk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulfryk/subscriptions","organizations_url":"https://api.github.com/users/ulfryk/orgs","repos_url":"https://api.github.com/users/ulfryk/repos","events_url":"https://api.github.com/users/ulfryk/events{/privacy}","received_events_url":"https://api.github.com/users/ulfryk/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"dumpstate","id":5636144,"node_id":"MDQ6VXNlcjU2MzYxNDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/5636144?v=4","gravatar_id":"","url":"https://api.github.com/users/dumpstate","html_url":"https://github.com/dumpstate","followers_url":"https://api.github.com/users/dumpstate/followers","following_url":"https://api.github.com/users/dumpstate/following{/other_user}","gists_url":"https://api.github.com/users/dumpstate/gists{/gist_id}","starred_url":"https://api.github.com/users/dumpstate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dumpstate/subscriptions","organizations_url":"https://api.github.com/users/dumpstate/orgs","repos_url":"https://api.github.com/users/dumpstate/repos","events_url":"https://api.github.com/users/dumpstate/events{/privacy}","received_events_url":"https://api.github.com/users/dumpstate/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60/commits","review_comments_url":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60/comments","review_comment_url":"https://api.github.com/repos/samwise-tech/search-ql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/samwise-tech/search-ql/issues/60/comments","statuses_url":"https://api.github.com/repos/samwise-tech/search-ql/statuses/8c519d05229c212abdd2bc1fb11a37dc066bdc2f","head":{"label":"samwise-tech:feature/PC-1293-check-integrity","ref":"feature/PC-1293-check-integrity","sha":"8c519d05229c212abdd2bc1fb11a37dc066bdc2f","user":{"login":"samwise-tech","id":19862249,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5ODYyMjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/19862249?v=4","gravatar_id":"","url":"https://api.github.com/users/samwise-tech","html_url":"https://github.com/samwise-tech","followers_url":"https://api.github.com/users/samwise-tech/followers","following_url":"https://api.github.com/users/samwise-tech/following{/other_user}","gists_url":"https://api.github.com/users/samwise-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/samwise-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwise-tech/subscriptions","organizations_url":"https://api.github.com/users/samwise-tech/orgs","repos_url":"https://api.github.com/users/samwise-tech/repos","events_url":"https://api.github.com/users/samwise-tech/events{/privacy}","received_events_url":"https://api.github.com/users/samwise-tech/received_events","type":"Organization","site_admin":false},"repo":{"id":103571635,"node_id":"MDEwOlJlcG9zaXRvcnkxMDM1NzE2MzU=","name":"search-ql","full_name":"samwise-tech/search-ql","private":false,"owner":{"login":"samwise-tech","id":19862249,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5ODYyMjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/19862249?v=4","gravatar_id":"","url":"https://api.github.com/users/samwise-tech","html_url":"https://github.com/samwise-tech","followers_url":"https://api.github.com/users/samwise-tech/followers","following_url":"https://api.github.com/users/samwise-tech/following{/other_user}","gists_url":"https://api.github.com/users/samwise-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/samwise-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwise-tech/subscriptions","organizations_url":"https://api.github.com/users/samwise-tech/orgs","repos_url":"https://api.github.com/users/samwise-tech/repos","events_url":"https://api.github.com/users/samwise-tech/events{/privacy}","received_events_url":"https://api.github.com/users/samwise-tech/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/samwise-tech/search-ql","description":"QL used for advanced searches in Samwise applications","fork":false,"url":"https://api.github.com/repos/samwise-tech/search-ql","forks_url":"https://api.github.com/repos/samwise-tech/search-ql/forks","keys_url":"https://api.github.com/repos/samwise-tech/search-ql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samwise-tech/search-ql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samwise-tech/search-ql/teams","hooks_url":"https://api.github.com/repos/samwise-tech/search-ql/hooks","issue_events_url":"https://api.github.com/repos/samwise-tech/search-ql/issues/events{/number}","events_url":"https://api.github.com/repos/samwise-tech/search-ql/events","assignees_url":"https://api.github.com/repos/samwise-tech/search-ql/assignees{/user}","branches_url":"https://api.github.com/repos/samwise-tech/search-ql/branches{/branch}","tags_url":"https://api.github.com/repos/samwise-tech/search-ql/tags","blobs_url":"https://api.github.com/repos/samwise-tech/search-ql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samwise-tech/search-ql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samwise-tech/search-ql/git/refs{/sha}","trees_url":"https://api.github.com/repos/samwise-tech/search-ql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samwise-tech/search-ql/statuses/{sha}","languages_url":"https://api.github.com/repos/samwise-tech/search-ql/languages","stargazers_url":"https://api.github.com/repos/samwise-tech/search-ql/stargazers","contributors_url":"https://api.github.com/repos/samwise-tech/search-ql/contributors","subscribers_url":"https://api.github.com/repos/samwise-tech/search-ql/subscribers","subscription_url":"https://api.github.com/repos/samwise-tech/search-ql/subscription","commits_url":"https://api.github.com/repos/samwise-tech/search-ql/commits{/sha}","git_commits_url":"https://api.github.com/repos/samwise-tech/search-ql/git/commits{/sha}","comments_url":"https://api.github.com/repos/samwise-tech/search-ql/comments{/number}","issue_comment_url":"https://api.github.com/repos/samwise-tech/search-ql/issues/comments{/number}","contents_url":"https://api.github.com/repos/samwise-tech/search-ql/contents/{+path}","compare_url":"https://api.github.com/repos/samwise-tech/search-ql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samwise-tech/search-ql/merges","archive_url":"https://api.github.com/repos/samwise-tech/search-ql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samwise-tech/search-ql/downloads","issues_url":"https://api.github.com/repos/samwise-tech/search-ql/issues{/number}","pulls_url":"https://api.github.com/repos/samwise-tech/search-ql/pulls{/number}","milestones_url":"https://api.github.com/repos/samwise-tech/search-ql/milestones{/number}","notifications_url":"https://api.github.com/repos/samwise-tech/search-ql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samwise-tech/search-ql/labels{/name}","releases_url":"https://api.github.com/repos/samwise-tech/search-ql/releases{/id}","deployments_url":"https://api.github.com/repos/samwise-tech/search-ql/deployments","created_at":"2017-09-14T19:12:20Z","updated_at":"2018-09-20T14:34:21Z","pushed_at":"2018-09-21T08:58:59Z","git_url":"git://github.com/samwise-tech/search-ql.git","ssh_url":"git@github.com:samwise-tech/search-ql.git","clone_url":"https://github.com/samwise-tech/search-ql.git","svn_url":"https://github.com/samwise-tech/search-ql","homepage":null,"size":523,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"samwise-tech:develop","ref":"develop","sha":"1737527726918f4c05be2dc0a8a154454f51cb04","user":{"login":"samwise-tech","id":19862249,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5ODYyMjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/19862249?v=4","gravatar_id":"","url":"https://api.github.com/users/samwise-tech","html_url":"https://github.com/samwise-tech","followers_url":"https://api.github.com/users/samwise-tech/followers","following_url":"https://api.github.com/users/samwise-tech/following{/other_user}","gists_url":"https://api.github.com/users/samwise-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/samwise-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwise-tech/subscriptions","organizations_url":"https://api.github.com/users/samwise-tech/orgs","repos_url":"https://api.github.com/users/samwise-tech/repos","events_url":"https://api.github.com/users/samwise-tech/events{/privacy}","received_events_url":"https://api.github.com/users/samwise-tech/received_events","type":"Organization","site_admin":false},"repo":{"id":103571635,"node_id":"MDEwOlJlcG9zaXRvcnkxMDM1NzE2MzU=","name":"search-ql","full_name":"samwise-tech/search-ql","private":false,"owner":{"login":"samwise-tech","id":19862249,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5ODYyMjQ5","avatar_url":"https://avatars3.githubusercontent.com/u/19862249?v=4","gravatar_id":"","url":"https://api.github.com/users/samwise-tech","html_url":"https://github.com/samwise-tech","followers_url":"https://api.github.com/users/samwise-tech/followers","following_url":"https://api.github.com/users/samwise-tech/following{/other_user}","gists_url":"https://api.github.com/users/samwise-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/samwise-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwise-tech/subscriptions","organizations_url":"https://api.github.com/users/samwise-tech/orgs","repos_url":"https://api.github.com/users/samwise-tech/repos","events_url":"https://api.github.com/users/samwise-tech/events{/privacy}","received_events_url":"https://api.github.com/users/samwise-tech/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/samwise-tech/search-ql","description":"QL used for advanced searches in Samwise applications","fork":false,"url":"https://api.github.com/repos/samwise-tech/search-ql","forks_url":"https://api.github.com/repos/samwise-tech/search-ql/forks","keys_url":"https://api.github.com/repos/samwise-tech/search-ql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samwise-tech/search-ql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samwise-tech/search-ql/teams","hooks_url":"https://api.github.com/repos/samwise-tech/search-ql/hooks","issue_events_url":"https://api.github.com/repos/samwise-tech/search-ql/issues/events{/number}","events_url":"https://api.github.com/repos/samwise-tech/search-ql/events","assignees_url":"https://api.github.com/repos/samwise-tech/search-ql/assignees{/user}","branches_url":"https://api.github.com/repos/samwise-tech/search-ql/branches{/branch}","tags_url":"https://api.github.com/repos/samwise-tech/search-ql/tags","blobs_url":"https://api.github.com/repos/samwise-tech/search-ql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samwise-tech/search-ql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samwise-tech/search-ql/git/refs{/sha}","trees_url":"https://api.github.com/repos/samwise-tech/search-ql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samwise-tech/search-ql/statuses/{sha}","languages_url":"https://api.github.com/repos/samwise-tech/search-ql/languages","stargazers_url":"https://api.github.com/repos/samwise-tech/search-ql/stargazers","contributors_url":"https://api.github.com/repos/samwise-tech/search-ql/contributors","subscribers_url":"https://api.github.com/repos/samwise-tech/search-ql/subscribers","subscription_url":"https://api.github.com/repos/samwise-tech/search-ql/subscription","commits_url":"https://api.github.com/repos/samwise-tech/search-ql/commits{/sha}","git_commits_url":"https://api.github.com/repos/samwise-tech/search-ql/git/commits{/sha}","comments_url":"https://api.github.com/repos/samwise-tech/search-ql/comments{/number}","issue_comment_url":"https://api.github.com/repos/samwise-tech/search-ql/issues/comments{/number}","contents_url":"https://api.github.com/repos/samwise-tech/search-ql/contents/{+path}","compare_url":"https://api.github.com/repos/samwise-tech/search-ql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samwise-tech/search-ql/merges","archive_url":"https://api.github.com/repos/samwise-tech/search-ql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samwise-tech/search-ql/downloads","issues_url":"https://api.github.com/repos/samwise-tech/search-ql/issues{/number}","pulls_url":"https://api.github.com/repos/samwise-tech/search-ql/pulls{/number}","milestones_url":"https://api.github.com/repos/samwise-tech/search-ql/milestones{/number}","notifications_url":"https://api.github.com/repos/samwise-tech/search-ql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samwise-tech/search-ql/labels{/name}","releases_url":"https://api.github.com/repos/samwise-tech/search-ql/releases{/id}","deployments_url":"https://api.github.com/repos/samwise-tech/search-ql/deployments","created_at":"2017-09-14T19:12:20Z","updated_at":"2018-09-20T14:34:21Z","pushed_at":"2018-09-21T08:58:59Z","git_url":"git://github.com/samwise-tech/search-ql.git","ssh_url":"git@github.com:samwise-tech/search-ql.git","clone_url":"https://github.com/samwise-tech/search-ql.git","svn_url":"https://github.com/samwise-tech/search-ql","homepage":null,"size":523,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60"},"html":{"href":"https://github.com/samwise-tech/search-ql/pull/60"},"issue":{"href":"https://api.github.com/repos/samwise-tech/search-ql/issues/60"},"comments":{"href":"https://api.github.com/repos/samwise-tech/search-ql/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/samwise-tech/search-ql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/samwise-tech/search-ql/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/samwise-tech/search-ql/statuses/8c519d05229c212abdd2bc1fb11a37dc066bdc2f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ulfryk"}}