{"action":"created","comment":{"url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/comments/32512213","id":32512213,"diff_hunk":"@@ -389,29 +451,25 @@\n      *                             XHRs.\n      * @param {function} cb - Callback function, called with (err, res).\n      */\n-    AT.send = function (data, isInit, cb) {\n-        if (!AT._getApiKey()) {\n-            return null;\n-        }\n-\n-        if (typeof isInit === 'function') {\n-            cb = isInit;\n-            isInit = false;\n-        }\n-\n-        // if (data && data._at) {\n-        //     if (data._at.touchpointName) {\n-        //         return AT.sendTouchpoint(null, data, cb);\n-        //     }\n-        //     if (data._at.sharepointName) {\n-        //         return AT.sendSharepoint(null, data, isInit, cb);\n-        //     }\n-        // }\n-\n-        return AT.sendTouchpoint(null, data, function () {\n-            return AT.sendSharepoint(null, data, isInit, cb);\n-        });\n-    };\n+    // requireKey.send = function (data, isInit, cb) {","path":"src/sdk.js","position":277,"original_position":277,"commit_id":"58955fb50440ac4cbd39cdce05ff3cff8a67ea5a","original_commit_id":"58955fb50440ac4cbd39cdce05ff3cff8a67ea5a","user":{"login":"nbrl","id":7620088,"avatar_url":"https://avatars.githubusercontent.com/u/7620088?v=3","gravatar_id":"","url":"https://api.github.com/users/nbrl","html_url":"https://github.com/nbrl","followers_url":"https://api.github.com/users/nbrl/followers","following_url":"https://api.github.com/users/nbrl/following{/other_user}","gists_url":"https://api.github.com/users/nbrl/gists{/gist_id}","starred_url":"https://api.github.com/users/nbrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbrl/subscriptions","organizations_url":"https://api.github.com/users/nbrl/orgs","repos_url":"https://api.github.com/users/nbrl/repos","events_url":"https://api.github.com/users/nbrl/events{/privacy}","received_events_url":"https://api.github.com/users/nbrl/received_events","type":"User","site_admin":false},"body":"yep\r\n","created_at":"2015-06-16T11:34:10Z","updated_at":"2015-06-16T11:34:10Z","html_url":"https://github.com/digitalanimal/advocate-things-js-sdk/pull/50#discussion_r32512213","pull_request_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/comments/32512213"},"html":{"href":"https://github.com/digitalanimal/advocate-things-js-sdk/pull/50#discussion_r32512213"},"pull_request":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50","id":37545082,"html_url":"https://github.com/digitalanimal/advocate-things-js-sdk/pull/50","diff_url":"https://github.com/digitalanimal/advocate-things-js-sdk/pull/50.diff","patch_url":"https://github.com/digitalanimal/advocate-things-js-sdk/pull/50.patch","issue_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/issues/50","number":50,"state":"open","locked":false,"title":"Break out functions","user":{"login":"nbrl","id":7620088,"avatar_url":"https://avatars.githubusercontent.com/u/7620088?v=3","gravatar_id":"","url":"https://api.github.com/users/nbrl","html_url":"https://github.com/nbrl","followers_url":"https://api.github.com/users/nbrl/followers","following_url":"https://api.github.com/users/nbrl/following{/other_user}","gists_url":"https://api.github.com/users/nbrl/gists{/gist_id}","starred_url":"https://api.github.com/users/nbrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbrl/subscriptions","organizations_url":"https://api.github.com/users/nbrl/orgs","repos_url":"https://api.github.com/users/nbrl/repos","events_url":"https://api.github.com/users/nbrl/events{/privacy}","received_events_url":"https://api.github.com/users/nbrl/received_events","type":"User","site_admin":false},"body":"`sendSharepoint` and `sendTouchpoint` hid a lot of *magic* functionality depending on what parameters the called data object had. This functionality has been split out into 5 new functions which although is a little more manual for now make it much more obvious what is happening/will happen. The new functions are:\r\n\r\n* `createToken` - creates a token / some tokens\r\n* `updateToken` - updates the metadata associated with the given token\r\n* `lockToken` - locks the given token to prevent further updates\r\n* `consumeToken` - consumes the given token, locking it and specifying that a share has occurred.\r\n\r\nWe also have a new `gulp` task `build-local` which does as it suggests - builds the SDK as `build` would, but using local IPs. Presently it is hardcoded to `localhost:3000` / `localhost:4000`, but if we decide on some environment variables, we can use those instead.\r\n\r\nThe testing is incomplete and the documentation has not yet been updated, giving us a chance to test it to make sure if it is what we want before time is spent testing for incorrect functionality or writing irrelevent documentation.","created_at":"2015-06-12T09:19:18Z","updated_at":"2015-06-16T11:34:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b9e9fd929e6a33910adccf32314976570d2219e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50/commits","review_comments_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50/comments","review_comment_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/issues/50/comments","statuses_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/statuses/58955fb50440ac4cbd39cdce05ff3cff8a67ea5a","head":{"label":"nbrl:simplified-functions","ref":"simplified-functions","sha":"58955fb50440ac4cbd39cdce05ff3cff8a67ea5a","user":{"login":"nbrl","id":7620088,"avatar_url":"https://avatars.githubusercontent.com/u/7620088?v=3","gravatar_id":"","url":"https://api.github.com/users/nbrl","html_url":"https://github.com/nbrl","followers_url":"https://api.github.com/users/nbrl/followers","following_url":"https://api.github.com/users/nbrl/following{/other_user}","gists_url":"https://api.github.com/users/nbrl/gists{/gist_id}","starred_url":"https://api.github.com/users/nbrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbrl/subscriptions","organizations_url":"https://api.github.com/users/nbrl/orgs","repos_url":"https://api.github.com/users/nbrl/repos","events_url":"https://api.github.com/users/nbrl/events{/privacy}","received_events_url":"https://api.github.com/users/nbrl/received_events","type":"User","site_admin":false},"repo":{"id":32318178,"name":"advocate-things-js-sdk","full_name":"nbrl/advocate-things-js-sdk","owner":{"login":"nbrl","id":7620088,"avatar_url":"https://avatars.githubusercontent.com/u/7620088?v=3","gravatar_id":"","url":"https://api.github.com/users/nbrl","html_url":"https://github.com/nbrl","followers_url":"https://api.github.com/users/nbrl/followers","following_url":"https://api.github.com/users/nbrl/following{/other_user}","gists_url":"https://api.github.com/users/nbrl/gists{/gist_id}","starred_url":"https://api.github.com/users/nbrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbrl/subscriptions","organizations_url":"https://api.github.com/users/nbrl/orgs","repos_url":"https://api.github.com/users/nbrl/repos","events_url":"https://api.github.com/users/nbrl/events{/privacy}","received_events_url":"https://api.github.com/users/nbrl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nbrl/advocate-things-js-sdk","description":" Advocate Things SDK for JavaScript ","fork":true,"url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk","forks_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/forks","keys_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/teams","hooks_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/hooks","issue_events_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/events","assignees_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/tags","blobs_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/languages","stargazers_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/stargazers","contributors_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/contributors","subscribers_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/subscribers","subscription_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/subscription","commits_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/merges","archive_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/downloads","issues_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/labels{/name}","releases_url":"https://api.github.com/repos/nbrl/advocate-things-js-sdk/releases{/id}","created_at":"2015-03-16T10:42:13Z","updated_at":"2015-04-30T14:57:04Z","pushed_at":"2015-06-16T08:17:25Z","git_url":"git://github.com/nbrl/advocate-things-js-sdk.git","ssh_url":"git@github.com:nbrl/advocate-things-js-sdk.git","clone_url":"https://github.com/nbrl/advocate-things-js-sdk.git","svn_url":"https://github.com/nbrl/advocate-things-js-sdk","homepage":"","size":756,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"digitalanimal:master","ref":"master","sha":"0983085a84abd0314765a07e23516e06da6683a5","user":{"login":"digitalanimal","id":2040430,"avatar_url":"https://avatars.githubusercontent.com/u/2040430?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalanimal","html_url":"https://github.com/digitalanimal","followers_url":"https://api.github.com/users/digitalanimal/followers","following_url":"https://api.github.com/users/digitalanimal/following{/other_user}","gists_url":"https://api.github.com/users/digitalanimal/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalanimal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalanimal/subscriptions","organizations_url":"https://api.github.com/users/digitalanimal/orgs","repos_url":"https://api.github.com/users/digitalanimal/repos","events_url":"https://api.github.com/users/digitalanimal/events{/privacy}","received_events_url":"https://api.github.com/users/digitalanimal/received_events","type":"Organization","site_admin":false},"repo":{"id":32318170,"name":"advocate-things-js-sdk","full_name":"digitalanimal/advocate-things-js-sdk","owner":{"login":"digitalanimal","id":2040430,"avatar_url":"https://avatars.githubusercontent.com/u/2040430?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalanimal","html_url":"https://github.com/digitalanimal","followers_url":"https://api.github.com/users/digitalanimal/followers","following_url":"https://api.github.com/users/digitalanimal/following{/other_user}","gists_url":"https://api.github.com/users/digitalanimal/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalanimal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalanimal/subscriptions","organizations_url":"https://api.github.com/users/digitalanimal/orgs","repos_url":"https://api.github.com/users/digitalanimal/repos","events_url":"https://api.github.com/users/digitalanimal/events{/privacy}","received_events_url":"https://api.github.com/users/digitalanimal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/digitalanimal/advocate-things-js-sdk","description":"Advocate Things SDK for JavaScript","fork":false,"url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk","forks_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/forks","keys_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/teams","hooks_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/hooks","issue_events_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/events","assignees_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/tags","blobs_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/languages","stargazers_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/stargazers","contributors_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/contributors","subscribers_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/subscribers","subscription_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/subscription","commits_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/merges","archive_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/downloads","issues_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/labels{/name}","releases_url":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/releases{/id}","created_at":"2015-03-16T10:41:51Z","updated_at":"2015-04-30T10:53:31Z","pushed_at":"2015-06-16T08:17:25Z","git_url":"git://github.com/digitalanimal/advocate-things-js-sdk.git","ssh_url":"git@github.com:digitalanimal/advocate-things-js-sdk.git","clone_url":"https://github.com/digitalanimal/advocate-things-js-sdk.git","svn_url":"https://github.com/digitalanimal/advocate-things-js-sdk","homepage":"","size":598,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":21,"forks":2,"open_issues":21,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50"},"html":{"href":"https://github.com/digitalanimal/advocate-things-js-sdk/pull/50"},"issue":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/issues/50"},"comments":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/digitalanimal/advocate-things-js-sdk/statuses/58955fb50440ac4cbd39cdce05ff3cff8a67ea5a"}}}}