Skip to content

Commit cb05b61

Browse files
authored
Misc Bug Fixes (#307)
* Bug Fixes - Update files to include in distributable - Bind window to fetch function - Bump version to 6.0.2 - Add DropboxResponse translation to upgrading
1 parent 03c2e41 commit cb05b61

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

UPGRADING.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Can be rewritten as:
3636

3737
```
3838
var dbx = new Dropbox({
39-
accessToken: 'my_token'
39+
accessToken: 'my_token',
4040
selectUser: 'my_user_id'
4141
});
4242
dbx.usersGetcurrentAccount();
@@ -80,4 +80,28 @@ Would become:
8080
const result: Dropbox.users.FullAccount dbx.usersGetCurrentAccount();
8181
```
8282

83+
## 4. Updating the Response object
84+
85+
We have wrapped the raw responses into the `DropboxResponse` object in order to expose more information out to users. This change looks like:
86+
87+
```
88+
var response = dbx.usersGetcurrentAccount();
89+
console.log(response.fileBlob); //or fileBinary if using workers
90+
```
91+
92+
Would become:
93+
94+
```
95+
var response = dbx.usersGetcurrentAccount();
96+
console.log(response.result.fileBlob); //or fileBinary if using workers
97+
```
98+
99+
This also exposes the other components of the response like the status and headers which was not previously available.
100+
101+
```
102+
var response = dbx.usersGetcurrentAccount();
103+
console.log(response.status);
104+
console.log(response.headers);
105+
```
106+
83107
[contributing]: https://github.com/dropbox/dropbox-sdk-js/blob/master/CONTRIBUTING.md

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dropbox",
3-
"version": "6.0.1",
3+
"version": "6.0.2",
44
"registry": "npm",
55
"description": "The Dropbox JavaScript SDK is a lightweight, promise based interface to the Dropbox v2 API that works in both nodejs and browser environments.",
66
"main": "cjs/index.js",
@@ -30,11 +30,10 @@
3030
"files": [
3131
"*.md",
3232
"LICENSE",
33-
".jsdoc.json",
34-
"rollup.config.js",
35-
"generator",
33+
"index.js",
3634
"src",
3735
"lib",
36+
"types",
3837
"dist",
3938
"es",
4039
"cjs"

src/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let fetch;
55
try {
66
fetch = require('node-fetch'); // eslint-disable-line global-require
77
} catch (Exception) {
8-
fetch = window.fetch;
8+
fetch = window.fetch.bind(window);
99
}
1010

1111
let crypto;

src/dropbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let fetch;
1616
try {
1717
fetch = require('node-fetch'); // eslint-disable-line global-require
1818
} catch (Exception) {
19-
fetch = window.fetch;
19+
fetch = window.fetch.bind(window);
2020
}
2121

2222
/**

0 commit comments

Comments
 (0)