Media Storage Javascript Library using Ricoh API.
You need
Ricoh API Client Credentials (client_id & client_secret)
Ricoh ID (user_id & password)
If you don't have them, please register them at THETA Developers Website.
$ npm install ricohapi-mstorage
const MStorage = require('ricohapi-mstorage').MStorage;
const AuthClient = require('ricohapi-mstorage').AuthClient;
const client = new AuthClient('<your_client_id>', '<your_client_secret>');
client.setResourceOwnerCreds('<your_user_id>', '<your_password>');
const mstorage = new MStorage(client);
mstorage.connect()
.then(() => mstorage.upload('./upload_file_path.jpg'))
.then(() => console.log('uploaded')
.catch(e => console.log(e));
const client = new AuthClient('<your_client_id>', '<your_client_secret>');
client.setResourceOwnerCreds('<your_user_id>', '<your_password>');
const mstorage = new MStorage(<AuthClient object>);
mstorage.connect()
A Promise is returned.
mstorage.upload('./upload_file_path.jpg')
A Promise is returned.
mstorage.downloadTo('<media_id>', './download_file_path.jpg')
A Promise is returned.
mstorage.list()
.then(list => console.log(list));
mstorage.list({limit: 25, after: '<cursor-id>'})
.then(list => console.log(list));
mstorage.delete('<media_id>')
A Promise is returned.
mstorage.info('<media_id>')
.then(info => console.log(info))
mstorage.inspect('<media_id>')
.then(meta => console.log(meta))