Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
eywa-dropbox
Advanced tools
Implemented following the API V2 http documentation here: https://www.dropbox.com/developers/documentation/http/documentation
Before you can use this, you need to first setup a test app on Dropbox, and generate an access token for test.
Two helper functions are included to help with the OAuth2 process:
After you have done these, you can use eywa-dropbox
as below:
import DropboxApi, {requestAccessToken, parseTokenQueryString} from "eywa-dropbox";
var dp = new Dropbox(clientId, redirectURI)
// you can either set the `accessToken` by:
dp.updateAccessToken(accessToken);
// or use the Redirect method to parse the token from the redirect url.
dp.onRedirect(state);
// To triger the OAuth process, just call: (state is optional)
dp.requestAuth(state);
/* simple api methods */
dp.list_files()
dp.getAccountInfo()
dp.list()
dp.createFolder('/test_folder_1')
dp.remove('/test_folder_1')
/* to upload a file */
var mockContent = JSON.stringify({field: "this is working!"});
dp.upload("/file_upload_folder_1/example.json", mockContent);
/* to download a file */
dp.download("/file_upload_folder_1/example.json")
.then(res=> {
expect(res.meta).toBeDefined();
expect(res.content).toBeDefined();
expect(res.content).toEqual(mockContent);
})
/* to search for files */
dp.search("you query here", path, start, max_results, mode)
// where mode is one of [filename, filename_and_content, deleted_filename]
To test, run karma. I'm using webstorm's karma integration to run the tests.
During development, it is important to test across major browser vendors, because some of the transport configurations are browser specific. For example, Chrome handles CORS headers differently from Safari despite that they are both webkit.
However, if you set Karma to use three browsers, the test might conflict with each other. I haven't updated the test to support simultaneous test (with multiple browsers) yet, so for now you should manually change the karma config file to go through different browsers manually.
Currently Not Working You can also use
# in shell session A
npm run karma-start
# then in shell session B
npm run test
to execute the tests.
FAQs
a dropbox file sync driver for the browser
The npm package eywa-dropbox receives a total of 3 weekly downloads. As such, eywa-dropbox popularity was classified as not popular.
We found that eywa-dropbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.