{"action":"created","comment":{"url":"https://api.github.com/repos/zooniverse/geordi-client/pulls/comments/66235995","id":66235995,"diff_hunk":"@@ -1,48 +1,52 @@\n+require( 'es6-promise').polyfill()\n ZooUserStringGetter = require 'zooniverse-user-string-getter'\n \n module.exports = class GeordiClient\n \n-  GEORDI_STAGING_SERVER_URL:\n-    'https://geordi.staging.zooniverse.org/api/events/'\n-  GEORDI_PRODUCTION_SERVER_URL:\n-    'https://geordi.zooniverse.org/api/events/'\n-\n+  GEORDI_SERVER_URL:\n+    staging: 'https://geordi.staging.zooniverse.org/api/events/'\n+    production: 'https://geordi.zooniverse.org/api/events/'\n+  \n+  GEORDI_DATABASE_FIELDS: [\n+      \"userID\"\n+      \"subjectID\"\n+      \"relatedID\"\n+      \"errorCode\"\n+      \"errorDescription\"\n+      \"projectToken\"\n+      \"serverURL\"\n+      \"experiment\"\n+      \"cohort\"\n+      \"type\"\n+      \"userSeq\"\n+      \"sessionNumber\"\n+      \"eventNumber\"\n+      \"userAgent\"\n+      \"clientIP\"\n+    ]\n+\n+  # Default config parameters\n   gettingCohort: false\n-\n-  _defaultSubjectGetter: ->\n-    \"(N/A)\"\n-\n-  _defaultSubjectGetterParameter: ->\n+  env: 'staging'\n+  projectToken: 'unspecified' \n+  subjectGetter: () ->\n     \"(N/A)\"\n-\n-  _defaultLastKnownCohortGetter: ->\n+  zooUserIDGetter: () ->\n     null\n-\n-  _defaultZooUserIDGetter: ->\n-    null\n-\n-  _defaultProjectToken: \"unspecified\"\n-\n-  _getCurrentSubject: @_defaultSubjectGetter\n-  _getCurrentUserID: @_defaultZooUserIDGetter\n-\n-  constructor: (config) ->\n-    config[\"server\"] = \"staging\" if not \"server\" of config\n-    config[\"projectToken\"] = @_defaultProjectToken if (not \"projectToken\" of config) or (not config[\"projectToken\"] instanceof String) or (not config[\"projectToken\"].length>0)\n-    config[\"zooUserIDGetter\"] = @_defaultZooUserIDGetter if (not \"zooUserIDGetter\" of config) or (not config[\"zooUserIDGetter\"] instanceof Function)\n-    config[\"subjectGetter\"] = @_defaultSubjectGetter if (not \"subjectGetter\" of config) or (not config[\"subjectGetter\"] instanceof Function)\n-    config[\"subjectGetterParameter\"] = @_defaultSubjectGetterParameter if (not \"subjectGetterParameter\" of config)\n-    if config[\"server\"] == \"production\"\n-      @GEORDI_SERVER_URL = @GEORDI_PRODUCTION_SERVER_URL\n-    else\n-      @GEORDI_SERVER_URL = @GEORDI_STAGING_SERVER_URL\n-    @experimentServerClient = config[\"experimentServerClient\"] if \"experimentServerClient\" of config\n-    @_getCurrentSubject = config[\"subjectGetter\"]\n-    @_getCurrentSubjectParameter = config[\"subjectGetterParameter\"]\n-    @_getCurrentUserID = config[\"zooUserIDGetter\"]\n-    @_getCurrentUserIDParameter = config[\"zooUserIDGetterParameter\"]\n-    @_projectToken = config[\"projectToken\"]\n-    @UserStringGetter = new ZooUserStringGetter(@_getCurrentUserID,@_getCurrentUserIDParameter)\n+  zooUserIDGetterParameter: null\n+\n+  constructor: (config = {}) ->","path":"src/index.coffee","position":76,"original_position":76,"commit_id":"1570a382e88964ccf7edbb77fd544159bcb997ad","original_commit_id":"1570a382e88964ccf7edbb77fd544159bcb997ad","user":{"login":"alexbfree","id":1473244,"avatar_url":"https://avatars.githubusercontent.com/u/1473244?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbfree","html_url":"https://github.com/alexbfree","followers_url":"https://api.github.com/users/alexbfree/followers","following_url":"https://api.github.com/users/alexbfree/following{/other_user}","gists_url":"https://api.github.com/users/alexbfree/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbfree/subscriptions","organizations_url":"https://api.github.com/users/alexbfree/orgs","repos_url":"https://api.github.com/users/alexbfree/repos","events_url":"https://api.github.com/users/alexbfree/events{/privacy}","received_events_url":"https://api.github.com/users/alexbfree/received_events","type":"User","site_admin":false},"body":"So much nicer! thanks!\r\n","created_at":"2016-06-08T11:08:02Z","updated_at":"2016-06-08T11:08:02Z","html_url":"https://github.com/zooniverse/geordi-client/pull/8#discussion_r66235995","pull_request_url":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/zooniverse/geordi-client/pulls/comments/66235995"},"html":{"href":"https://github.com/zooniverse/geordi-client/pull/8#discussion_r66235995"},"pull_request":{"href":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8","id":72378761,"html_url":"https://github.com/zooniverse/geordi-client/pull/8","diff_url":"https://github.com/zooniverse/geordi-client/pull/8.diff","patch_url":"https://github.com/zooniverse/geordi-client/pull/8.patch","issue_url":"https://api.github.com/repos/zooniverse/geordi-client/issues/8","number":8,"state":"open","locked":false,"title":"WIP: Panoptes client","user":{"login":"eatyourgreens","id":59547,"avatar_url":"https://avatars.githubusercontent.com/u/59547?v=3","gravatar_id":"","url":"https://api.github.com/users/eatyourgreens","html_url":"https://github.com/eatyourgreens","followers_url":"https://api.github.com/users/eatyourgreens/followers","following_url":"https://api.github.com/users/eatyourgreens/following{/other_user}","gists_url":"https://api.github.com/users/eatyourgreens/gists{/gist_id}","starred_url":"https://api.github.com/users/eatyourgreens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eatyourgreens/subscriptions","organizations_url":"https://api.github.com/users/eatyourgreens/orgs","repos_url":"https://api.github.com/users/eatyourgreens/repos","events_url":"https://api.github.com/users/eatyourgreens/events{/privacy}","received_events_url":"https://api.github.com/users/eatyourgreens/received_events","type":"User","site_admin":false},"body":"Basically removes jQuery and allows for updating client settings via eg. `client.update( {projectToken: 'my new project'})`.\r\n\r\nMakes some pretty major changes to the constructor, so this needs testing.","created_at":"2016-06-02T16:39:44Z","updated_at":"2016-06-08T11:08:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a82efe1da03103954be671c33710a6a84b5c376","assignee":{"login":"alexbfree","id":1473244,"avatar_url":"https://avatars.githubusercontent.com/u/1473244?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbfree","html_url":"https://github.com/alexbfree","followers_url":"https://api.github.com/users/alexbfree/followers","following_url":"https://api.github.com/users/alexbfree/following{/other_user}","gists_url":"https://api.github.com/users/alexbfree/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbfree/subscriptions","organizations_url":"https://api.github.com/users/alexbfree/orgs","repos_url":"https://api.github.com/users/alexbfree/repos","events_url":"https://api.github.com/users/alexbfree/events{/privacy}","received_events_url":"https://api.github.com/users/alexbfree/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8/commits","review_comments_url":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8/comments","review_comment_url":"https://api.github.com/repos/zooniverse/geordi-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zooniverse/geordi-client/issues/8/comments","statuses_url":"https://api.github.com/repos/zooniverse/geordi-client/statuses/1570a382e88964ccf7edbb77fd544159bcb997ad","head":{"label":"zooniverse:panoptes-client","ref":"panoptes-client","sha":"1570a382e88964ccf7edbb77fd544159bcb997ad","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":41852752,"name":"geordi-client","full_name":"zooniverse/geordi-client","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/geordi-client","description":"A JavaScript client for the Geordi analytics capture engine","fork":false,"url":"https://api.github.com/repos/zooniverse/geordi-client","forks_url":"https://api.github.com/repos/zooniverse/geordi-client/forks","keys_url":"https://api.github.com/repos/zooniverse/geordi-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/geordi-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/geordi-client/teams","hooks_url":"https://api.github.com/repos/zooniverse/geordi-client/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/geordi-client/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/geordi-client/events","assignees_url":"https://api.github.com/repos/zooniverse/geordi-client/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/geordi-client/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/geordi-client/tags","blobs_url":"https://api.github.com/repos/zooniverse/geordi-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/geordi-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/geordi-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/geordi-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/geordi-client/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/geordi-client/languages","stargazers_url":"https://api.github.com/repos/zooniverse/geordi-client/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/geordi-client/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/geordi-client/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/geordi-client/subscription","commits_url":"https://api.github.com/repos/zooniverse/geordi-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/geordi-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/geordi-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/geordi-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/geordi-client/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/geordi-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/geordi-client/merges","archive_url":"https://api.github.com/repos/zooniverse/geordi-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/geordi-client/downloads","issues_url":"https://api.github.com/repos/zooniverse/geordi-client/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/geordi-client/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/geordi-client/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/geordi-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/geordi-client/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/geordi-client/releases{/id}","deployments_url":"https://api.github.com/repos/zooniverse/geordi-client/deployments","created_at":"2015-09-03T09:52:54Z","updated_at":"2016-02-03T16:14:45Z","pushed_at":"2016-06-08T09:09:24Z","git_url":"git://github.com/zooniverse/geordi-client.git","ssh_url":"git@github.com:zooniverse/geordi-client.git","clone_url":"https://github.com/zooniverse/geordi-client.git","svn_url":"https://github.com/zooniverse/geordi-client","homepage":null,"size":65,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"zooniverse:master","ref":"master","sha":"1ad9254a638e7565242755600304d6d37836f39b","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":41852752,"name":"geordi-client","full_name":"zooniverse/geordi-client","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/geordi-client","description":"A JavaScript client for the Geordi analytics capture engine","fork":false,"url":"https://api.github.com/repos/zooniverse/geordi-client","forks_url":"https://api.github.com/repos/zooniverse/geordi-client/forks","keys_url":"https://api.github.com/repos/zooniverse/geordi-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/geordi-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/geordi-client/teams","hooks_url":"https://api.github.com/repos/zooniverse/geordi-client/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/geordi-client/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/geordi-client/events","assignees_url":"https://api.github.com/repos/zooniverse/geordi-client/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/geordi-client/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/geordi-client/tags","blobs_url":"https://api.github.com/repos/zooniverse/geordi-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/geordi-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/geordi-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/geordi-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/geordi-client/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/geordi-client/languages","stargazers_url":"https://api.github.com/repos/zooniverse/geordi-client/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/geordi-client/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/geordi-client/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/geordi-client/subscription","commits_url":"https://api.github.com/repos/zooniverse/geordi-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/geordi-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/geordi-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/geordi-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/geordi-client/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/geordi-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/geordi-client/merges","archive_url":"https://api.github.com/repos/zooniverse/geordi-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/geordi-client/downloads","issues_url":"https://api.github.com/repos/zooniverse/geordi-client/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/geordi-client/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/geordi-client/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/geordi-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/geordi-client/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/geordi-client/releases{/id}","deployments_url":"https://api.github.com/repos/zooniverse/geordi-client/deployments","created_at":"2015-09-03T09:52:54Z","updated_at":"2016-02-03T16:14:45Z","pushed_at":"2016-06-08T09:09:24Z","git_url":"git://github.com/zooniverse/geordi-client.git","ssh_url":"git@github.com:zooniverse/geordi-client.git","clone_url":"https://github.com/zooniverse/geordi-client.git","svn_url":"https://github.com/zooniverse/geordi-client","homepage":null,"size":65,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8"},"html":{"href":"https://github.com/zooniverse/geordi-client/pull/8"},"issue":{"href":"https://api.github.com/repos/zooniverse/geordi-client/issues/8"},"comments":{"href":"https://api.github.com/repos/zooniverse/geordi-client/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/zooniverse/geordi-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zooniverse/geordi-client/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/zooniverse/geordi-client/statuses/1570a382e88964ccf7edbb77fd544159bcb997ad"}}}}
{"actor":{"display_login":"alexbfree"}}