Skip to content

Commit

Permalink
Add endpoint for transferred stats
Browse files Browse the repository at this point in the history
  • Loading branch information
negative0 committed Aug 5, 2021
1 parent 571e8a5 commit d356512
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,10 @@ const urls = {
* Executes rclone in a seperate process for output
*/
coreCommand: "core/command",

/**
* Transferred jobs for rclone.
*/
transferred: 'core/transferred',
};
export default urls;
15 changes: 15 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,18 @@ export const coreCommand = ( arg, opt) => {
})
});
}


/**
* getTransferredStats returns transferred job stats.
* @returns {Promise<unknown>}
*/
export const getTransferredStats = () => {
return new Promise((resolve, reject) => {
axiosInstance.post(urls.transferred).then(res => {
resolve(res.data);
}, error => {
reject(error);
})
})
}

0 comments on commit d356512

Please sign in to comment.