Thanks for your great client library. I'm using it on a private project right now and I've been wrestling with some base signature errors in certain cases (mainly when transferring with filenames containing spaces, symbols etc) with the Dropbox API. I rewrote and refactored your library to better nail down these issues. It looks like both your lib and the OAuth lib were percent encoding data when they shouldn't be. My next task is to refactor the OAuth lib, which will be a much larger task ;).
I DRYed up a bunch of code and I've added support for transferring raw buffers and sandboxes as well, and also formatted it to my liking -- nothing against the comma first format, I'm just not into it, and this lib will be the core of my application so I want to be able to know it inside and out as well as edit it as I need to. Unfortunately, I did this refactor off of 0.3.0, so the file stream stuff didn't get included, however it would be trivial to add. Also, the changes I made to putFile are backwards incompatible (no longer provide a filename and a path -- just a path).
I don't expect you to actually merge this pull request as it's quite a radical change (backwards incompats, underscore dependency, constructor name change), however, I'm hoping you can use some of the code and DRY techniques in this commit and apply it to your lib. In the mean time, I'll likely split this off into it's own project with high praise and credit to you.
Rewrite / refactor. Added sandbox support. Added buffer support.
Great work! It's a bit unfortunate that you did everything in one huge single commit. Splitting the work would've made it more readable for us others. :-)
@nils-werner Ah, yeah. Sorry about that. I was on a roll and just kept on coding. That being said, if you look at the file rather than the diff, you'll be able to easily discern the differences. Github doesn't do well with rewrites :/
Removing my app specific absolute path to node-oauth.
Extra parameters weren't being handled correctly in some methods -- a…
… side effect of late night coding ;). Fixed.
Moving this rewrite to it's own project.
Removing old files.
Updating index and filenames.
Adding lib directory.
Assorted bug fixes after doing some field testing.
Does your rewrite fix the issue with unicode filenames or will that require the oAuth rewrite you mentioned? Also, would it be possible to back-port that fix into the current master-branch without applying the complete rewrite?
@nils-werner -- I believe that's an issue with the current state of the oAuth lib because they send their requests in utf8 when the dropbox api requires they be sent in binary. I posted an issue about it here but they have yet to move on it.
More rewrite tweaks, new boundary generation.
Very nice! Appreciate the fresh take on the code.
Don't console log huge errors.
Valid version number.
updating oauth dep.
Updating with new filesPut method.
I suck at json
Added mime dependency.
Sometimes json isnt json.
Removing mime dep.
Forgot to remove reference to the type variable.
A little refactoring of errors.
Dont double wrap oauth callback, added request token and access token.