{"action":"created","issue":{"url":"https://api.github.com/repos/silexlabs/unifile/issues/36","labels_url":"https://api.github.com/repos/silexlabs/unifile/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/silexlabs/unifile/issues/36/comments","events_url":"https://api.github.com/repos/silexlabs/unifile/issues/36/events","html_url":"https://github.com/silexlabs/unifile/issues/36","id":118196419,"number":36,"title":"Unifile next steps","user":{"login":"lexoyo","id":715377,"avatar_url":"https://avatars.githubusercontent.com/u/715377?v=3","gravatar_id":"","url":"https://api.github.com/users/lexoyo","html_url":"https://github.com/lexoyo","followers_url":"https://api.github.com/users/lexoyo/followers","following_url":"https://api.github.com/users/lexoyo/following{/other_user}","gists_url":"https://api.github.com/users/lexoyo/gists{/gist_id}","starred_url":"https://api.github.com/users/lexoyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lexoyo/subscriptions","organizations_url":"https://api.github.com/users/lexoyo/orgs","repos_url":"https://api.github.com/users/lexoyo/repos","events_url":"https://api.github.com/users/lexoyo/events{/privacy}","received_events_url":"https://api.github.com/users/lexoyo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/silexlabs/unifile/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-21T13:22:06Z","updated_at":"2016-01-18T09:11:29Z","closed_at":null,"body":"@KrishnaPG got me thinking about the next version of unifile\r\n\r\nHere is what I think we should do\r\n\r\n* Refactor the API: no more config but option of the API, and the API which could be used in nodejs or with the command line cli or with HTTP calls as it is today\r\n* Make the HTTP API better: use GET, POST, UPDATE, DELETE... \r\n* Better doc and a website\r\n* Coding style refactoring: Everything should be cleaned up and ported to ES2015, whith promise, the API should mimic Node.js File System api\r\n\r\nAnd here is the details, feel free to help me on this definition of unifile v1\r\n\r\n### Refactor the API\r\n\r\nIn node, for use with slenium or on the server side when you already have a token (the user has authorized the app)\r\n```\r\nvar unifile = require('unifile')\r\nvar dropbox = new unifile.Dropbox({\r\n    root : 'dropbox',\r\n    app_key : 'ngk5t8312eo4agh',\r\n    app_secret : '7uxqr625pct7zbl'\r\n})\r\ndropbox.connect(function (authorizeUrl) {\r\n    // open authorizeUrl, login and authorise the app\r\n    // then call this\r\n    dropbox.setSession({\r\n        access_token: 'the access_token from dropbox'\r\n    })\r\n    dropbox.ls('/', function(files) {\r\n        console.log('files and folder at the root of your dropbox:', files);\r\n    });\r\n});\r\n```\r\nUse with CLI\r\n```\r\n$ unifile dropbox ls /\r\nwaiting for you to authorize the app (a browser window has opened)\r\napp authorized\r\nfile 81 Nov 20 23:22 admin.html\r\nfile 302 Nov 20 21:24 login.html\r\nfolder 136 Nov 20 23:34 node_modules\r\n```\r\nUse the middleware to activate a service and expose the HTTP route\r\n```\r\nvar unifile = require('unifile')\r\nvar dropbox = new unifile.Dropbox({\r\n    root : 'dropbox',\r\n    app_key : 'ngk5t8312eo4agh',\r\n    app_secret : '7uxqr625pct7zbl'\r\n})\r\nvar router = new unifile.Router(dropbox);\r\nvar connect = require('connect')\r\nvar app = connect()\r\napp.use('/api/dropbox', router)\r\n```\r\n### Make the HTTP API better\r\n\r\nuse GET, POST, UPDATE, DELETE... \r\n\r\nSee these interesting links\r\n*[Google Cloud Storage API Reference](https://cloud.google.com/storage/docs/json_api/v1/)\r\n\r\n### Better doc and a website\r\n\r\n### Coding style refactoring\r\n\r\nEverything should be cleaned up and ported to ES2015, whith promise, the API should mimic Node.js File System api\r\n\r\nSee these links for the API methods specs\r\n* https://www.chromestatus.com/feature/5452478162141184\r\n* http://cloud-elements.com/hubs/cloud-storage-documents-hub/"},"comment":{"url":"https://api.github.com/repos/silexlabs/unifile/issues/comments/172470805","html_url":"https://github.com/silexlabs/unifile/issues/36#issuecomment-172470805","issue_url":"https://api.github.com/repos/silexlabs/unifile/issues/36","id":172470805,"user":{"login":"lexoyo","id":715377,"avatar_url":"https://avatars.githubusercontent.com/u/715377?v=3","gravatar_id":"","url":"https://api.github.com/users/lexoyo","html_url":"https://github.com/lexoyo","followers_url":"https://api.github.com/users/lexoyo/followers","following_url":"https://api.github.com/users/lexoyo/following{/other_user}","gists_url":"https://api.github.com/users/lexoyo/gists{/gist_id}","starred_url":"https://api.github.com/users/lexoyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lexoyo/subscriptions","organizations_url":"https://api.github.com/users/lexoyo/orgs","repos_url":"https://api.github.com/users/lexoyo/repos","events_url":"https://api.github.com/users/lexoyo/events{/privacy}","received_events_url":"https://api.github.com/users/lexoyo/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T09:11:29Z","updated_at":"2016-01-18T09:11:29Z","body":":+1: nice project!\r\nAnd the idea of using nodejs API is a very good one !\r\n"}}