{"action":"created","comment":{"url":"https://api.github.com/repos/cozy/cozy-client/pulls/comments/204387940","pull_request_review_id":139457137,"id":204387940,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDM4Nzk0MA==","diff_hunk":"@@ -0,0 +1,36 @@\n+import { uri } from './utils'\n+import { normalizeDoc } from './DocumentCollection'\n+\n+/**\n+ * Abstracts a collection of documents of the same doctype, providing\n+ * CRUD methods and other helpers.\n+ */\n+export default class AppCollection {\n+  constructor(doctype, client) {\n+    this.doctype = doctype\n+    this.client = client\n+  }\n+\n+  /**\n+   * Lists all documents of the collection, without filters.\n+   *\n+   * The returned documents are not paginated by the stack.\n+   *\n+   * @return {{data, meta, skip, next}} The JSON API conformant response.\n+   * @throws {FetchError}\n+   */\n+  async all() {\n+    const path = uri`/apps/`\n+    try {\n+      const resp = await this.client.fetch('GET', path)\n+      return {\n+        data: resp.rows.map(row => normalizeDoc(row.doc, this.doctype)),\n+        meta: { count: resp.total_rows },\n+        skip: 0,\n+        next: false\n+      }\n+    } catch (error) {\n+      throw error","path":"packages/cozy-stack-client/src/AppCollection.js","position":null,"original_position":33,"commit_id":"8a27ba1d848d746691aef734f7a042a63889e483","original_commit_id":"93e0f6daacdb1654eb7a8630dc2855098a9b6140","user":{"login":"enguerran","id":701648,"node_id":"MDQ6VXNlcjcwMTY0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/701648?v=4","gravatar_id":"","url":"https://api.github.com/users/enguerran","html_url":"https://github.com/enguerran","followers_url":"https://api.github.com/users/enguerran/followers","following_url":"https://api.github.com/users/enguerran/following{/other_user}","gists_url":"https://api.github.com/users/enguerran/gists{/gist_id}","starred_url":"https://api.github.com/users/enguerran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enguerran/subscriptions","organizations_url":"https://api.github.com/users/enguerran/orgs","repos_url":"https://api.github.com/users/enguerran/repos","events_url":"https://api.github.com/users/enguerran/events{/privacy}","received_events_url":"https://api.github.com/users/enguerran/received_events","type":"User","site_admin":false},"body":"cf. https://repl.it/@enguerran/Throw-Catched-Error","created_at":"2018-07-23T12:50:41Z","updated_at":"2018-07-23T12:50:41Z","html_url":"https://github.com/cozy/cozy-client/pull/41#discussion_r204387940","pull_request_url":"https://api.github.com/repos/cozy/cozy-client/pulls/41","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-client/pulls/comments/204387940"},"html":{"href":"https://github.com/cozy/cozy-client/pull/41#discussion_r204387940"},"pull_request":{"href":"https://api.github.com/repos/cozy/cozy-client/pulls/41"}},"in_reply_to_id":204355191},"pull_request":{"url":"https://api.github.com/repos/cozy/cozy-client/pulls/41","id":199671435,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjcxNDM1","html_url":"https://github.com/cozy/cozy-client/pull/41","diff_url":"https://github.com/cozy/cozy-client/pull/41.diff","patch_url":"https://github.com/cozy/cozy-client/pull/41.patch","issue_url":"https://api.github.com/repos/cozy/cozy-client/issues/41","number":41,"state":"open","locked":false,"title":"Add AppCollection","user":{"login":"gregorylegarec","id":776764,"node_id":"MDQ6VXNlcjc3Njc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/776764?v=4","gravatar_id":"","url":"https://api.github.com/users/gregorylegarec","html_url":"https://github.com/gregorylegarec","followers_url":"https://api.github.com/users/gregorylegarec/followers","following_url":"https://api.github.com/users/gregorylegarec/following{/other_user}","gists_url":"https://api.github.com/users/gregorylegarec/gists{/gist_id}","starred_url":"https://api.github.com/users/gregorylegarec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregorylegarec/subscriptions","organizations_url":"https://api.github.com/users/gregorylegarec/orgs","repos_url":"https://api.github.com/users/gregorylegarec/repos","events_url":"https://api.github.com/users/gregorylegarec/events{/privacy}","received_events_url":"https://api.github.com/users/gregorylegarec/received_events","type":"User","site_admin":false},"body":"As apps are retrieved with a specific endpoint, they need a custom implementation into an AppCollection class.\n\nAt this time, the only method needed is `all()`","created_at":"2018-07-06T07:54:08Z","updated_at":"2018-07-23T12:50:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff517087873c861ccbcc5d107a25b3feda0404b6","assignee":{"login":"goldoraf","id":5461,"node_id":"MDQ6VXNlcjU0NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/5461?v=4","gravatar_id":"","url":"https://api.github.com/users/goldoraf","html_url":"https://github.com/goldoraf","followers_url":"https://api.github.com/users/goldoraf/followers","following_url":"https://api.github.com/users/goldoraf/following{/other_user}","gists_url":"https://api.github.com/users/goldoraf/gists{/gist_id}","starred_url":"https://api.github.com/users/goldoraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldoraf/subscriptions","organizations_url":"https://api.github.com/users/goldoraf/orgs","repos_url":"https://api.github.com/users/goldoraf/repos","events_url":"https://api.github.com/users/goldoraf/events{/privacy}","received_events_url":"https://api.github.com/users/goldoraf/received_events","type":"User","site_admin":false},"assignees":[{"login":"goldoraf","id":5461,"node_id":"MDQ6VXNlcjU0NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/5461?v=4","gravatar_id":"","url":"https://api.github.com/users/goldoraf","html_url":"https://github.com/goldoraf","followers_url":"https://api.github.com/users/goldoraf/followers","following_url":"https://api.github.com/users/goldoraf/following{/other_user}","gists_url":"https://api.github.com/users/goldoraf/gists{/gist_id}","starred_url":"https://api.github.com/users/goldoraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldoraf/subscriptions","organizations_url":"https://api.github.com/users/goldoraf/orgs","repos_url":"https://api.github.com/users/goldoraf/repos","events_url":"https://api.github.com/users/goldoraf/events{/privacy}","received_events_url":"https://api.github.com/users/goldoraf/received_events","type":"User","site_admin":false},{"login":"y-lohse","id":2261445,"node_id":"MDQ6VXNlcjIyNjE0NDU=","avatar_url":"https://avatars2.githubusercontent.com/u/2261445?v=4","gravatar_id":"","url":"https://api.github.com/users/y-lohse","html_url":"https://github.com/y-lohse","followers_url":"https://api.github.com/users/y-lohse/followers","following_url":"https://api.github.com/users/y-lohse/following{/other_user}","gists_url":"https://api.github.com/users/y-lohse/gists{/gist_id}","starred_url":"https://api.github.com/users/y-lohse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-lohse/subscriptions","organizations_url":"https://api.github.com/users/y-lohse/orgs","repos_url":"https://api.github.com/users/y-lohse/repos","events_url":"https://api.github.com/users/y-lohse/events{/privacy}","received_events_url":"https://api.github.com/users/y-lohse/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"goldoraf","id":5461,"node_id":"MDQ6VXNlcjU0NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/5461?v=4","gravatar_id":"","url":"https://api.github.com/users/goldoraf","html_url":"https://github.com/goldoraf","followers_url":"https://api.github.com/users/goldoraf/followers","following_url":"https://api.github.com/users/goldoraf/following{/other_user}","gists_url":"https://api.github.com/users/goldoraf/gists{/gist_id}","starred_url":"https://api.github.com/users/goldoraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goldoraf/subscriptions","organizations_url":"https://api.github.com/users/goldoraf/orgs","repos_url":"https://api.github.com/users/goldoraf/repos","events_url":"https://api.github.com/users/goldoraf/events{/privacy}","received_events_url":"https://api.github.com/users/goldoraf/received_events","type":"User","site_admin":false},{"login":"ptbrowne","id":465582,"node_id":"MDQ6VXNlcjQ2NTU4Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/465582?v=4","gravatar_id":"","url":"https://api.github.com/users/ptbrowne","html_url":"https://github.com/ptbrowne","followers_url":"https://api.github.com/users/ptbrowne/followers","following_url":"https://api.github.com/users/ptbrowne/following{/other_user}","gists_url":"https://api.github.com/users/ptbrowne/gists{/gist_id}","starred_url":"https://api.github.com/users/ptbrowne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptbrowne/subscriptions","organizations_url":"https://api.github.com/users/ptbrowne/orgs","repos_url":"https://api.github.com/users/ptbrowne/repos","events_url":"https://api.github.com/users/ptbrowne/events{/privacy}","received_events_url":"https://api.github.com/users/ptbrowne/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":823571943,"node_id":"MDU6TGFiZWw4MjM1NzE5NDM=","url":"https://api.github.com/repos/cozy/cozy-client/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/cozy/cozy-client/pulls/41/commits","review_comments_url":"https://api.github.com/repos/cozy/cozy-client/pulls/41/comments","review_comment_url":"https://api.github.com/repos/cozy/cozy-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cozy/cozy-client/issues/41/comments","statuses_url":"https://api.github.com/repos/cozy/cozy-client/statuses/8a27ba1d848d746691aef734f7a042a63889e483","head":{"label":"gregorylegarec:feat/appcollection","ref":"feat/appcollection","sha":"8a27ba1d848d746691aef734f7a042a63889e483","user":{"login":"gregorylegarec","id":776764,"node_id":"MDQ6VXNlcjc3Njc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/776764?v=4","gravatar_id":"","url":"https://api.github.com/users/gregorylegarec","html_url":"https://github.com/gregorylegarec","followers_url":"https://api.github.com/users/gregorylegarec/followers","following_url":"https://api.github.com/users/gregorylegarec/following{/other_user}","gists_url":"https://api.github.com/users/gregorylegarec/gists{/gist_id}","starred_url":"https://api.github.com/users/gregorylegarec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregorylegarec/subscriptions","organizations_url":"https://api.github.com/users/gregorylegarec/orgs","repos_url":"https://api.github.com/users/gregorylegarec/repos","events_url":"https://api.github.com/users/gregorylegarec/events{/privacy}","received_events_url":"https://api.github.com/users/gregorylegarec/received_events","type":"User","site_admin":false},"repo":{"id":139864739,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk4NjQ3Mzk=","name":"cozy-client","full_name":"gregorylegarec/cozy-client","owner":{"login":"gregorylegarec","id":776764,"node_id":"MDQ6VXNlcjc3Njc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/776764?v=4","gravatar_id":"","url":"https://api.github.com/users/gregorylegarec","html_url":"https://github.com/gregorylegarec","followers_url":"https://api.github.com/users/gregorylegarec/followers","following_url":"https://api.github.com/users/gregorylegarec/following{/other_user}","gists_url":"https://api.github.com/users/gregorylegarec/gists{/gist_id}","starred_url":"https://api.github.com/users/gregorylegarec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregorylegarec/subscriptions","organizations_url":"https://api.github.com/users/gregorylegarec/orgs","repos_url":"https://api.github.com/users/gregorylegarec/repos","events_url":"https://api.github.com/users/gregorylegarec/events{/privacy}","received_events_url":"https://api.github.com/users/gregorylegarec/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gregorylegarec/cozy-client","description":null,"fork":true,"url":"https://api.github.com/repos/gregorylegarec/cozy-client","forks_url":"https://api.github.com/repos/gregorylegarec/cozy-client/forks","keys_url":"https://api.github.com/repos/gregorylegarec/cozy-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gregorylegarec/cozy-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gregorylegarec/cozy-client/teams","hooks_url":"https://api.github.com/repos/gregorylegarec/cozy-client/hooks","issue_events_url":"https://api.github.com/repos/gregorylegarec/cozy-client/issues/events{/number}","events_url":"https://api.github.com/repos/gregorylegarec/cozy-client/events","assignees_url":"https://api.github.com/repos/gregorylegarec/cozy-client/assignees{/user}","branches_url":"https://api.github.com/repos/gregorylegarec/cozy-client/branches{/branch}","tags_url":"https://api.github.com/repos/gregorylegarec/cozy-client/tags","blobs_url":"https://api.github.com/repos/gregorylegarec/cozy-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gregorylegarec/cozy-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gregorylegarec/cozy-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gregorylegarec/cozy-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gregorylegarec/cozy-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gregorylegarec/cozy-client/languages","stargazers_url":"https://api.github.com/repos/gregorylegarec/cozy-client/stargazers","contributors_url":"https://api.github.com/repos/gregorylegarec/cozy-client/contributors","subscribers_url":"https://api.github.com/repos/gregorylegarec/cozy-client/subscribers","subscription_url":"https://api.github.com/repos/gregorylegarec/cozy-client/subscription","commits_url":"https://api.github.com/repos/gregorylegarec/cozy-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gregorylegarec/cozy-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gregorylegarec/cozy-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gregorylegarec/cozy-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gregorylegarec/cozy-client/contents/{+path}","compare_url":"https://api.github.com/repos/gregorylegarec/cozy-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gregorylegarec/cozy-client/merges","archive_url":"https://api.github.com/repos/gregorylegarec/cozy-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gregorylegarec/cozy-client/downloads","issues_url":"https://api.github.com/repos/gregorylegarec/cozy-client/issues{/number}","pulls_url":"https://api.github.com/repos/gregorylegarec/cozy-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gregorylegarec/cozy-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gregorylegarec/cozy-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gregorylegarec/cozy-client/labels{/name}","releases_url":"https://api.github.com/repos/gregorylegarec/cozy-client/releases{/id}","deployments_url":"https://api.github.com/repos/gregorylegarec/cozy-client/deployments","created_at":"2018-07-05T14:57:26Z","updated_at":"2018-07-05T14:57:28Z","pushed_at":"2018-07-23T12:40:21Z","git_url":"git://github.com/gregorylegarec/cozy-client.git","ssh_url":"git@github.com:gregorylegarec/cozy-client.git","clone_url":"https://github.com/gregorylegarec/cozy-client.git","svn_url":"https://github.com/gregorylegarec/cozy-client","homepage":null,"size":414,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cozy:master","ref":"master","sha":"bde7874b84240edc8954a2218a037b6db44d44dc","user":{"login":"cozy","id":7690525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2OTA1MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7690525?v=4","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"repo":{"id":119818775,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk4MTg3NzU=","name":"cozy-client","full_name":"cozy/cozy-client","owner":{"login":"cozy","id":7690525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2OTA1MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7690525?v=4","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cozy/cozy-client","description":null,"fork":false,"url":"https://api.github.com/repos/cozy/cozy-client","forks_url":"https://api.github.com/repos/cozy/cozy-client/forks","keys_url":"https://api.github.com/repos/cozy/cozy-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cozy/cozy-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cozy/cozy-client/teams","hooks_url":"https://api.github.com/repos/cozy/cozy-client/hooks","issue_events_url":"https://api.github.com/repos/cozy/cozy-client/issues/events{/number}","events_url":"https://api.github.com/repos/cozy/cozy-client/events","assignees_url":"https://api.github.com/repos/cozy/cozy-client/assignees{/user}","branches_url":"https://api.github.com/repos/cozy/cozy-client/branches{/branch}","tags_url":"https://api.github.com/repos/cozy/cozy-client/tags","blobs_url":"https://api.github.com/repos/cozy/cozy-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cozy/cozy-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cozy/cozy-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/cozy/cozy-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cozy/cozy-client/statuses/{sha}","languages_url":"https://api.github.com/repos/cozy/cozy-client/languages","stargazers_url":"https://api.github.com/repos/cozy/cozy-client/stargazers","contributors_url":"https://api.github.com/repos/cozy/cozy-client/contributors","subscribers_url":"https://api.github.com/repos/cozy/cozy-client/subscribers","subscription_url":"https://api.github.com/repos/cozy/cozy-client/subscription","commits_url":"https://api.github.com/repos/cozy/cozy-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/cozy/cozy-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/cozy/cozy-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/cozy/cozy-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/cozy/cozy-client/contents/{+path}","compare_url":"https://api.github.com/repos/cozy/cozy-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cozy/cozy-client/merges","archive_url":"https://api.github.com/repos/cozy/cozy-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cozy/cozy-client/downloads","issues_url":"https://api.github.com/repos/cozy/cozy-client/issues{/number}","pulls_url":"https://api.github.com/repos/cozy/cozy-client/pulls{/number}","milestones_url":"https://api.github.com/repos/cozy/cozy-client/milestones{/number}","notifications_url":"https://api.github.com/repos/cozy/cozy-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cozy/cozy-client/labels{/name}","releases_url":"https://api.github.com/repos/cozy/cozy-client/releases{/id}","deployments_url":"https://api.github.com/repos/cozy/cozy-client/deployments","created_at":"2018-02-01T10:13:01Z","updated_at":"2018-07-19T14:47:31Z","pushed_at":"2018-07-23T12:40:22Z","git_url":"git://github.com/cozy/cozy-client.git","ssh_url":"git@github.com:cozy/cozy-client.git","clone_url":"https://github.com/cozy/cozy-client.git","svn_url":"https://github.com/cozy/cozy-client","homepage":null,"size":425,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-client/pulls/41"},"html":{"href":"https://github.com/cozy/cozy-client/pull/41"},"issue":{"href":"https://api.github.com/repos/cozy/cozy-client/issues/41"},"comments":{"href":"https://api.github.com/repos/cozy/cozy-client/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/cozy/cozy-client/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/cozy/cozy-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cozy/cozy-client/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/cozy/cozy-client/statuses/8a27ba1d848d746691aef734f7a042a63889e483"}},"author_association":"NONE"}}
{"actor":{"display_login":"enguerran"}}