Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
17a0987
Complete httr→httr2 migration: drop_download, NAMESPACE, tests
Copilot May 26, 2026
7f06868
Fix syntax error in drop_copy and improve code formatting in drop_fil…
Copilot May 26, 2026
d6074aa
Add refresh token support to drop_auth and get_dropbox_token
Copilot May 26, 2026
ad2142b
Fix redirect_uri mismatch in drop_auth by pinning to port 1410
Copilot May 26, 2026
edce671
Changes before error encountered
Copilot May 26, 2026
2c4de71
Update roxygen
tadhg-moore May 27, 2026
10c50d0
Fix list to linear fun
tadhg-moore May 27, 2026
29aa7af
Add docs
tadhg-moore May 27, 2026
ac32d56
Fix req_auth_bearer_token token type error by using resolve_token()
Copilot May 27, 2026
269e5c2
Replace message/stop/print with cli::cli_inform/cli::cli_abort throug…
Copilot May 27, 2026
8535115
Merge pull request #1 from limnotrack/copilot/update-functions-with-h…
tadhg-moore May 27, 2026
f67c16b
fix: preserve refresh_token when refreshing access token
Copilot May 27, 2026
16d86f3
fix: use httr2::oauth_flow_refresh instead of non-existent oauth_toke…
Copilot May 27, 2026
d82cc3d
Merge pull request #2 from limnotrack/copilot/address-refresh-token-i…
tadhg-moore May 27, 2026
357bb96
Add drop_auth_env() for env-var token refresh and auto-fallback in ge…
Copilot May 27, 2026
c42230b
export getting token
tadhg-moore May 27, 2026
b06bdd6
Add docs
tadhg-moore May 27, 2026
9b59bf8
Merge pull request #3 from limnotrack/copilot/add-token-regeneration-…
tadhg-moore May 27, 2026
be51cff
Add cli imports
tadhg-moore May 27, 2026
0fc8548
bump version
tadhg-moore May 27, 2026
358e634
Update NEWS.md with version 0.10.0 entry
Copilot May 27, 2026
9257385
Merge pull request #4 from limnotrack/copilot/update-news-section-ver…
tadhg-moore May 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
Package: rdrop2
Title: Programmatic Interface to the 'Dropbox' API
Version: 0.8.2.2
Version: 0.10.0
Authors@R: c(person("Karthik", "Ram", email = "karthik.ram@gmail.com", role = c("aut", "cre")),
person("Clayton", "Yochum", role = "aut"),
person("Caleb", "Scheidel", role = "ctb"),
person("Akhil", "Bhel", role = "cph")
person("Akhil", "Bhel", role = "cph"),
person("Tadhg", "Moore", role = "ctb")
)
Description: Provides full programmatic access to the 'Dropbox' file hosting platform <https://dropbox.com>, including support for all standard file operations.
Depends: R (>= 3.1.1)
Description: Provides full programmatic access to the 'Dropbox' file hosting platform <https://dropbox.com>, including support for all standard file operations. Uses the 'httr2' package for HTTP requests and the Dropbox API v2.
Depends: R (>= 3.6.0)
License: MIT + file LICENSE
BugReports: https://github.com/karthik/rdrop2/issues
LazyData: true
Imports: digest,
Imports: cli,
digest,
dplyr,
httr,
httr2,
jsonlite,
magrittr,
purrr,
assertthat
Suggests: testthat,
uuid
RoxygenNote: 7.2.3
Encoding: UTF-8
Config/roxygen2/version: 8.0.0
17 changes: 16 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,37 @@
export("%>%")
export(drop_acc)
export(drop_auth)
export(drop_auth_env)
export(drop_content_hash)
export(drop_copy)
export(drop_copy_batch)
export(drop_create)
export(drop_delete)
export(drop_delete_batch)
export(drop_dir)
export(drop_download)
export(drop_exists)
export(drop_get)
export(drop_get_metadata)
export(drop_get_shared_link_file)
export(drop_get_thumbnail)
export(drop_history)
export(drop_list_shared_links)
export(drop_media)
export(drop_move)
export(drop_move_batch)
export(drop_read_csv)
export(drop_restore)
export(drop_save_url)
export(drop_search)
export(drop_search_continue)
export(drop_share)
export(drop_space_usage)
export(drop_upload)
import(httr)
export(get_dropbox_token)
import(httr2)
importFrom(cli,cli_abort)
importFrom(cli,cli_alert_danger)
importFrom(cli,cli_alert_info)
importFrom(cli,cli_alert_success)
importFrom(magrittr,"%>%")
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# rdrop2 0.10.0
* Switched from `httr` to `httr2` for all HTTP requests.
* Added `cli` package for improved user-facing messages, warnings, and errors.
* Added Tadhg Moore as a contributor.

# rdrop2 0.8.2.2
* replaced dependency package `assertive` by `assertthat`.

Expand Down
37 changes: 30 additions & 7 deletions R/drop_acc.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#' Get information about current Dropbox account.
#'
#' Fields returned will vary by account;
#' Fields returned will vary by account.
#'
#' @template token
#'
#' @import httr
#' @export
#'
#' @return
#' Nested list with elements \code{account_id},
#' \code{name} (list), \code{email}, \code{email_verified}, \code{disabled},
Expand All @@ -18,6 +15,8 @@
#'
#' @references \href{https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account}{API documentation}
#'
#' @export
#'
#' @examples
#' \dontrun{
#'
Expand All @@ -29,8 +28,32 @@
drop_acc <- function(dtoken = get_dropbox_token()) {

url <- "https://api.dropbox.com/2/users/get_current_account"
drop_request(url, dtoken)
}


#' Get Dropbox storage space usage.
#'
#' Returns how much space the current account is using and how much is
#' allocated.
#'
#' @template token
#'
#' @return A list with elements \code{used} (bytes used) and \code{allocation}
#' (a list with \code{.tag} and \code{allocated} bytes, or team-level info).
#'
#' @references \href{https://www.dropbox.com/developers/documentation/http/documentation#users-get_space_usage}{API documentation}
#'
#' @export
#'
#' @examples
#' \dontrun{
#' usage <- drop_space_usage()
#' cat("Used:", usage$used, "bytes\n")
#' cat("Allocated:", usage$allocation$allocated, "bytes\n")
#' }
drop_space_usage <- function(dtoken = get_dropbox_token()) {

# make request and parse response
req <- httr::POST(url, httr::config(token = dtoken))
httr::content(req)
url <- "https://api.dropbox.com/2/users/get_space_usage"
drop_request(url, dtoken)
}
Loading