trud 0.2.0
CRAN release: 2025-08-18
Major changes
-
Enhanced parameter design with enum validation:
-
get_item_metadata()andget_subscribed_metadata()now userelease_scope = c("all", "latest")parameter instead oflatest_onlyboolean. This makes function calls more expressive and eliminates boolean ambiguity. -
download_item()now usesfile_type = c("archive", "checksum", "signature", "publicKey")parameter instead ofdownload_file.
-
Added
overwriteparameter todownload_item()allowing users to explicitly control whether existing files should be overwritten.-
Breaking changes:
- Removed
TRUD_API_KEYparameter from all exported functions. API keys must now be set via theTRUD_API_KEYenvironment variable only. -
download_item()parameterdownload_filerenamed tofile_typewith enhanced validation. -
get_item_metadata()andget_subscribed_metadata()parameterlatest_onlyreplaced withrelease_scope.
- Removed
Minor changes and bug fixes
- Improved documentation and user experience:
- Enhanced subscription workflow documentation with clear step-by-step guidance.
- Added explanation that
purrr::map_at()pattern is used in examples to avoid exposing API keys. - Clarified how to obtain and use release IDs from
get_item_metadata()for downloading specific releases.
- Enhanced robustness and testing:
- Added validation warnings to
trud_items()to detect changes in NHS TRUD website structure that might break the scraper. - Refactored tests to use
withr::local_tempdir()for better test isolation and cleanup. - Improved test descriptions to be more specific and informative.
- Enhanced error handling with better retry logic and rate limiting.
- Added validation warnings to
- Technical improvements:
- Added support for custom user agent headers via
TRUD_USER_AGENTenvironment variable. - Improved file existence handling in
download_item()with clearer warning messages. - Enhanced request handling with retry logic, and rate limiting.
- Consistently return file paths invisibly from
download_item().
- Added support for custom user agent headers via
