Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b14c8ef
Updated OAuth2 authentication process and token management
parmatys Oct 24, 2025
7ac22e0
Refactor API interaction: add new helper functions, remove deprecated…
parmatys Oct 31, 2025
1f6cf4d
Added and adjsuted functions for downloading folder/session assets, C…
parmatys Nov 12, 2025
b4e3e3d
fix(api): update get_db_stats to match new API response structure
michalhuryn-montrose Dec 8, 2025
82366c6
feat: add get_funder_by_id() for direct funder lookup by ID
michalhuryn-montrose Dec 10, 2025
79355a8
feat: add get_tag_by_id() for direct tag lookup by ID
michalhuryn-montrose Dec 10, 2025
9a9bec5
feat: add get_category_by_id() function with tests
michalhuryn-montrose Dec 10, 2025
4f10d6f
feat: add list_categories() function with tests
michalhuryn-montrose Dec 10, 2025
92ab118
feat: add list_volume_records() function with tests
michalhuryn-montrose Dec 10, 2025
6d6c0cd
feat: add get_volume_record_by_id() function with tests
michalhuryn-montrose Dec 10, 2025
d0ef941
feat: add get_volume_collaborator_by_id() function with tests
michalhuryn-montrose Dec 10, 2025
905368c
feat: add get_institution_avatar() function with tests
michalhuryn-montrose Dec 10, 2025
8b7d9f1
feat: add list_institutions() function with tests
michalhuryn-montrose Dec 10, 2025
16d8800
feat: add get_user_avatar() function with tests
michalhuryn-montrose Dec 10, 2025
d8ceda2
feat: add get_session_file function with tests
michalhuryn-montrose Dec 12, 2025
2d1737d
chore: remove get_file_duration
michalhuryn-montrose Dec 12, 2025
be72a51
feat: add get_folder_file function with tests
michalhuryn-montrose Dec 12, 2025
44a324e
Merge pull request #1 from NYU-Databrary/feature/DAT-1493
michalhuryn-montrose Dec 15, 2025
68c47f8
Merge pull request #2 from NYU-Databrary/feature/DAT-1494
michalhuryn-montrose Dec 15, 2025
22fc276
Merge pull request #3 from NYU-Databrary/feature/DAT-1495
michalhuryn-montrose Dec 15, 2025
c8cc694
chore: format changed files
michalhuryn-montrose Dec 16, 2025
09e2238
fix(doc): fix documentation for get_folder_file.
michalhuryn-montrose Dec 16, 2025
b9356e9
Merge pull request #4 from NYU-Databrary/fix/DAT-1494
parmatys Dec 16, 2025
00340d2
Test push to github with trivial change to CONSTANTS.
rogilmore Feb 2, 2026
7dcbe6b
Add doc strings to header for `vb` parameter for all documented funct…
rogilmore Feb 2, 2026
4574f6f
Merge branch 'uat-rog' of https://github.com/NYU-Databrary/databraryr…
rogilmore Feb 2, 2026
f1865ba
Change parameter documentation to include more useful default values;…
rogilmore Feb 2, 2026
5428d05
Minor edit to function documentation; Add verbose message.
rogilmore Feb 3, 2026
cb7e318
Further mods to function docs; minor change to verbose messaging.
rogilmore Feb 6, 2026
1ef7701
Use validate_flag() throughout.
rogilmore Feb 6, 2026
5a61dc4
Bump version; add Pawel as author; add NSF HNDS-I grant to DESCRIPTION.
rogilmore Feb 6, 2026
fc6ac6c
Fix typo in DESCRIPTION.
rogilmore Feb 6, 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
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Type: Package
Package: databraryr
Title: Interact with the 'Databrary.org' API
Version: 0.6.6.9002
Version: 1.0.0.9000
Authors@R: c(
person("Rick", "O. Gilmore", , "rog1@psu.edu", role = c("aut", "cre", "cph")),
person("Jeffrey", "Spies", , "cran@jeffspies.com", role = "aut"),
person("Pawel", "Armatys", "pawel.armatys@montrosesoftware.com", role="aut"),
person("National Science Foundation OAC-2032713", role = "fnd"),
person("National Institutes of Health R01HD094830", role = "fnd")
person("National Institutes of Health R01HD094830", role = "fnd"),
person("National Science Foundation BCS 2444730, 2444731", role="fnd")
)
Maintainer: Rick O. Gilmore <rog1@psu.edu>
Description: 'Databrary.org' is a restricted access repository for
Expand Down Expand Up @@ -46,4 +48,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.3
46 changes: 33 additions & 13 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,71 @@ export("%>%")
export(HHMMSSmmm_to_ms)
export(assign_constants)
export(check_ssl_certs)
export(download_party_avatar)
export(download_folder_asset)
export(download_folder_assets_fr_df)
export(download_folder_zip)
export(download_session_asset)
export(download_session_assets_fr_df)
export(download_session_csv)
export(download_session_zip)
export(download_single_folder_asset_fr_df)
export(download_single_session_asset_fr_df)
export(download_video)
export(download_volume_zip)
export(get_asset_segment_range)
export(get_category_by_id)
export(get_db_stats)
export(get_file_duration)
export(get_party_by_id)
export(get_folder_by_id)
export(get_folder_file)
export(get_funder_by_id)
export(get_institution_avatar)
export(get_institution_by_id)
export(get_permission_levels)
export(get_release_levels)
export(get_session_by_id)
export(get_session_by_name)
export(get_session_file)
export(get_supported_file_types)
export(get_tag_by_id)
export(get_user_avatar)
export(get_user_by_id)
export(get_volume_by_id)
export(is_institution)
export(is_person)
export(get_volume_collaborator_by_id)
export(get_volume_record_by_id)
export(list_asset_formats)
export(list_authorized_investigators)
export(list_party_affiliates)
export(list_party_sponsors)
export(list_party_volumes)
export(list_categories)
export(list_folder_assets)
export(list_institution_affiliates)
export(list_institutions)
export(list_session_activity)
export(list_session_assets)
export(list_sponsors)
export(list_user_affiliates)
export(list_user_history)
export(list_user_sponsors)
export(list_user_volumes)
export(list_users)
export(list_volume_activity)
export(list_volume_assets)
export(list_volume_excerpts)
export(list_volume_collaborators)
export(list_volume_folders)
export(list_volume_funding)
export(list_volume_info)
export(list_volume_links)
export(list_volume_owners)
export(list_volume_records)
export(list_volume_session_assets)
export(list_volume_sessions)
export(list_volume_tags)
export(list_volumes)
export(login_db)
export(logout_db)
export(make_default_request)
export(make_login_client)
export(search_for_funder)
export(search_for_keywords)
export(search_for_tags)
export(search_institutions)
export(search_users)
export(search_volumes)
export(whoami)
importFrom(lifecycle,deprecated)
importFrom(magrittr,"%>%")
importFrom(methods,is)
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# databraryr (development version)
# databraryr 1.0.0

## Major changes

- Adapted all package functions to Databrary 2.0 API.

# databraryr 0.6.6

Expand Down
119 changes: 55 additions & 64 deletions R/CONSTANTS.R
Original file line number Diff line number Diff line change
@@ -1,74 +1,65 @@
#' Load Package-wide Constants into Local Environment
#'
#'
# DATABRARY_BASE_URL <- Sys.getenv("DATABRARY_BASE_URL", "https://api.stg-databrary.its.nyu.edu")
DATABRARY_BASE_URL <- Sys.getenv("DATABRARY_BASE_URL", "https://api.databrary.org")

API_CONSTANTS <- "https://nyu.databrary.org/api/constants"
API_ACTIVITY_SUMMARY <- "/statistics/summary/"
API_GROUPED_FORMATS <- "/grouped-formats/"
API_USERS <- "/users/"
API_USER_DETAIL <- "/users/%s/"
API_USER_VOLUMES <- "/users/%s/volumes/"
API_USER_SPONSORSHIPS <- "/users/%s/sponsorships/"
API_USER_AFFILIATES <- "/users/%s/affiliates/"
API_USER_AVATAR <- "/users/%s/avatar/"
API_USERS_HISTORY <- "/users/%s/history/"
API_INSTITUTIONS_LIST <- "/institutions/"
API_INSTITUTIONS <- "/institutions/%s/"
API_INSTITUTION_AFFILIATES <- "/institutions/%s/affiliates/"
API_INSTITUTION_AVATAR <- "/institutions/%s/avatar/"
API_VOLUMES <- "/volumes/"
API_VOLUME_DETAIL <- "/volumes/%s/"
API_VOLUME_TAGS <- "/volumes/%s/tags/"
API_VOLUME_LINKS <- "/volumes/%s/links/"
API_VOLUME_FUNDINGS <- "/volumes/%s/fundings/"
API_VOLUME_COLLABORATORS <- "/volumes/%s/collaborators/"
API_VOLUME_COLLABORATOR_DETAIL <- "/volumes/%s/collaborators/%s/"
API_VOLUME_HISTORY <- "/volumes/%s/history/"
API_VOLUME_SESSIONS <- "/volumes/%s/sessions/"
API_VOLUME_FOLDERS <- "/volumes/%s/folders/"
API_VOLUME_RECORDS <- "/volumes/%s/records/"
API_VOLUME_RECORD_DETAIL <- "/volumes/%s/records/%s/"
API_SESSION_DETAIL <- "/volumes/%s/sessions/%s/"
API_SESSION_FILES <- "/volumes/%s/sessions/%s/files/"
API_SESSION_FILE_DETAIL <- "/volumes/%s/sessions/%s/files/%s/"
API_FILES_DOWNLOAD_LINK <- "/volumes/%s/sessions/%s/files/%s/download-link/"
API_SESSION_DOWNLOAD_LINK <- "/volumes/%s/sessions/%s/download-link/"
API_SESSION_CSV_DOWNLOAD_LINK <- "/volumes/%s/sessions/%s/csv-download-link/"
API_FOLDER_DETAIL <- "/volumes/%s/folders/%s/"
API_FOLDER_FILES <- "/volumes/%s/folders/%s/files/"
API_FOLDER_FILES_DETAIL <- "/volumes/%s/folders/%s/files/%s/"
API_FOLDER_DOWNLOAD_LINK <- "/volumes/%s/folders/%s/download-link/"
API_FOLDER_FILE_DOWNLOAD_LINK <- "/volumes/%s/folders/%s/files/%s/download-link/"
API_VOLUME_DOWNLOAD_LINK <- "/volumes/%s/download-link/"
API_VOLUME_CSV_DOWNLOAD_LINK <- "/volumes/%s/csv-download-link/"
API_SEARCH_VOLUMES <- "/search/volumes/"
API_SEARCH_USERS <- "/search/users/"
API_SEARCH_INSTITUTIONS <- "/search/institutions/"
API_FUNDERS <- "/funders/"
API_FUNDER_DETAIL <- "/funders/%s/"
API_TAG_DETAIL <- "/tags/%s/"
API_CATEGORIES <- "/categories/"
API_CATEGORY_DETAIL <- "/categories/%s/"

CREATE_SLOT <-
"https://nyu.databrary.org/api/volume/%s/slot"
CREATE_UPLOAD_FLOW <-
"https://nyu.databrary.org/api/volume/%s/upload"
CREATE_FILE_FROM_FLOW <-
"https://nyu.databrary.org/api/volume/%s/asset"

DATABRARY_API <- "https://nyu.databrary.org/api"
DOWNLOAD_FILE <-
"https://nyu.databrary.org/slot/%s/-/asset/%s/download"
DOWNLOAD_SESSION_ZIP <-
"https://nyu.databrary.org/volume/%s/slot/%s/zip/%s"
DOWNLOAD_VOLUME_ZIP <-
"https://nyu.databrary.org/volume/%s/zip/false"

GET_SESSIONS_IN_VOL <-
"https://nyu.databrary.org/api/volume/%s?records&containers=all"
GET_ACTIVITY_DATA <-
"https://nyu.databrary.org/api/activity"
GET_PARTY_BY_ID <-
"https://nyu.databrary.org/api/party/%s?parents&children&access"
GET_PARTY_NO_PARENTS_CHILDREN <- "https://nyu.databrary.org/api/party/%s"
GET_CONSTANTS <- "https://nyu.databrary.org/api/constants"
GET_PARTY_AVATAR <- "https://nyu.databrary.org/party/%s/avatar"

GET_SESSION_CSV <- "https://nyu.databrary.org/volume/%s/csv"
GET_SESSION_ACTIVITY <- "https://nyu.databrary.org/api/slot/%s/activity"
GET_SESSION_ZIP <- "https://nyu.databrary.org/volume/%s/slot/%s/zip/false"

GET_VOL_BY_ID <-
"https://nyu.databrary.org/api/volume/%s?access&citation&links&funding&top&tags&excerpts&comments&records&containers=all&metrics&state"
GET_VOLUME_FUNDING <- "https://nyu.databrary.org/api/volume/%s?funding=all"
GET_VOLUME_MINIMUM <- "https://nyu.databrary.org/api/volume/%s"
GET_VOLUME_LINKS <- "https://nyu.databrary.org/api/volume/%s?links=all"
GET_VOLUME_TAGS <- "https://nyu.databrary.org/api/volume/%s?tags=all"
GET_VOLUME_ACTIVITY <- "https://nyu.databrary.org/api/volume/%s/activity"
GET_VOLUME_ZIP <- "https://nyu.databrary.org/volume/%s/zip/false"
GET_VOLUME_EXCERPTS <- "https://nyu.databrary.org/api/volume/%s?excerpts=all"

GET_ASSET_BY_ID <- "https://nyu.databrary.org/api/asset/%s"
GET_ASSET_BY_VOLUME_SESSION_ID <-
"https://nyu.databrary.org/api/volume/%s/slot/%s/asset/%s"

LOGIN <- "https://nyu.databrary.org/api/user/login"
LOGOUT <- "https://nyu.databrary.org/api/user/logout"

QUERY_SLOT <-
"https://nyu.databrary.org/api/slot/%s/-?records&assets&excerpts&tags&comments"
QUERY_VOLUME_FUNDER <- "https://nyu.databrary.org/api/funder?query=%s"
QUERY_KEYWORDS <- "https://nyu.databrary.org/api/search?q=%s"
QUERY_TAGS <- "https://nyu.databrary.org/api/tags/%s"

SESSION_CSV <- "https://nyu.databrary.org/volume/%s/csv"

UPLOAD_CHUNK <- "https://nyu.databrary.org/api/upload"
UPDATE_SLOT <- "https://nyu.databrary.org/api/slot/%s"

# Authentication parameters
USER_AGENT <-
"databraryr (https://cran.r-project.org/package=databraryr)"
KEYRING_SERVICE <- 'org.databrary.databraryr'

# httr2 request parameters
RETRY_LIMIT <- 3
RETRY_WAIT_TIME <- 1 # seconds
RETRY_BACKOFF <- 2 # exponential backoff
REQUEST_TIMEOUT <- 5 # seconds
REQUEST_TIMEOUT_VERY_LONG <- 600


OAUTH_TOKEN_URL <- sprintf("%s/o/token/", DATABRARY_BASE_URL)
OAUTH_TEST_URL <- sprintf("%s/oauth2/test/", DATABRARY_BASE_URL)

USER_AGENT <- Sys.getenv("USER_AGENT", "SRW$*Kxy2nYdyo4LozoGV#i6LvH/")
KEYRING_SERVICE <- 'org.databrary.databraryr'
Loading
Loading