-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
185a7cc
commit a6e438c
Showing
17 changed files
with
226 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,4 @@ | |
.#* | ||
drafts | ||
node_modules | ||
dist | ||
coverage | ||
lib | ||
test-folder | ||
log.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
# Solid-Rest-Dropbox | ||
|
||
A Solid-Rest plugin for Dropbox | ||
Treat your Dropbox storage as a Solid pod | ||
|
||
**Warning** This library is in development and should be considered experimental at this time. If you run into problems, contact me on the Solid forum (@jeffz) or Gitter channel. (@jeff-zucker). | ||
|
||
This library treats a Dropbox host as a serverless Solid Pod, accepting Solid requests (GET, PUT, etc.) and returning Solid responses (wac-allow headers, turtle representation of folders, etc.). | ||
|
||
The library may be used stand-alone (see [tests](./tests/all.js) for examples).<!-- , or as a plugin to [Solid-Node-Client](https://github.com/solid/solid-node-client) from where it can be integrated into almost any Solid library or app. Simply import Solid-Node-Client and thereafter use file:// URLs almost anywhere that https:// URLs work. See the Solid-Node-Client documentation for details. --> | ||
|
||
© 2021, Jeff Zucker, may be freely used with an MIT license. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {SolidRestDropbox} from '../'; | ||
import {credentials} from '/home/jeff/.solid-identities.js'; | ||
const client = new SolidRestDropbox(); | ||
|
||
const access_token = credentials.dropbox.access_token; | ||
const testFolder = 'dropbox:///'; | ||
const testFile = 'dropbox:///x.txt'; | ||
|
||
async function main(){ | ||
await login({access_token:access_token}); | ||
await readFolder( testFolder ); | ||
await readFile( testFile ); | ||
} | ||
main(); | ||
|
||
async function login(init){ | ||
console.log("logging in ..."); | ||
let response = await client.login(init); | ||
console.log("got status : ",response.status,response.statusText,"\n"); | ||
} | ||
async function readFile(file){ | ||
console.log("reading file ",file); | ||
let response = await client.fetch(file); | ||
console.log("got content : ",await response.text(),"\n"); | ||
console.log("got status : ",response.status,response.statusText,"\n"); | ||
} | ||
async function readFolder(folder){ | ||
console.log("reading folder ",folder); | ||
let response = await client.fetch(folder); | ||
let content = await response.text(); | ||
console.log("got container turtle : ",content.length,"\n"); | ||
console.log("got status : ",response.status,response.statusText,"\n"); | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.