Skip to content

Commit

Permalink
Update links to ODK Central API docs
Browse files Browse the repository at this point in the history
* Docs have moved to the main ODK docs
  • Loading branch information
florianm committed Mar 8, 2024
1 parent 79994e4 commit e2d452d
Show file tree
Hide file tree
Showing 66 changed files with 180 additions and 162 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Before changing anything, make sure the package still passes the below listed
flavours of `R CMD check` locally for you.

```r
goodpractice::goodpractice(quiet = FALSE, )
goodpractice::goodpractice(quiet = FALSE)
devtools::check(cran = TRUE, remote = TRUE, incoming = TRUE)
chk <- rcmdcheck::rcmdcheck(args = c("--as-cran"))
```
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This release migrates the `ruODK` test suite to a new test server

This release makes `ruODK` aware of the new ODK Central semantic version format:
Update your ODK Central version in `.Renviron` or in the credential
helper of your choice to the new format `ODKC_VERSION=2023.5.1` (with your
helper of your choice to the new format `ODKC_VERSION="2023.5.1"` (with your
current version). See the updated vignette "setup".

## Major changes
Expand Down
6 changes: 3 additions & 3 deletions R/attachment_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ get_one_attachment <- function(pth,
httr::warn_for_status(
# If the download fails, inspect src and try to curl the plain API call.
# nolint start
# https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-attachments/downloading-an-attachment
# https://docs.getodk.org/central-api-submission-management/#downloading-an-attachment
# nolint end
task = glue::glue(
"download media attachment {fn}.\n",
Expand Down Expand Up @@ -235,8 +235,8 @@ get_one_attachment <- function(pth,
#' @return The relative file path for the downloaded attachment(s)
#' @family utilities
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-form-attachments/downloading-a-form-attachment}
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/attachments/downloading-an-attachment}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#downloading-a-form-attachment}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#downloading-an-attachment}
# nolint end
#' @export
#' @examples
Expand Down
8 changes: 4 additions & 4 deletions R/attachment_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#' * exists: Whether the attachment for that submission exists on the
#' server.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/attachments/listing-expected-submission-attachments}
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-form-attachments/listing-expected-form-attachments}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#listing-expected-submission-attachments}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#listing-form-attachments}
# nolint end
#' @family utilities
#' @export
Expand Down Expand Up @@ -100,8 +100,8 @@ get_one_submission_attachment_list <- function(iid,
#' * exists: Whether the attachment for that submission exists on the
#' server.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/attachments/listing-expected-submission-attachments}
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-form-attachments/listing-expected-form-attachments}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#listing-expected-submission-attachments}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#listing-form-attachments}
# nolint end
#' @family submission-management
#' @export
Expand Down
4 changes: 2 additions & 2 deletions R/audit_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @param action string. The action to filter the logs, e.g. "user.create".
# nolint start
#' See \url{https://odkcentral.docs.apiary.io/#reference/system-endpoints/server-audit-logs/}
#' See \url{https://docs.getodk.org/central-api-system-endpoints/#getting-audit-log-entries}
# nolint end
#' for the full list of available actions.
#' @param start string. The ISO8601 timestamp of the earliest log entry to
Expand All @@ -32,7 +32,7 @@
#' according to the type of action.
#' * logged_at: dttm. Time of action on server.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/system-endpoints/server-audit-logs/getting-audit-log-entries}
#' @seealso \url{https://docs.getodk.org/central-api-system-endpoints/#getting-audit-log-entries}
# nolint end
#' @family server-management
#' @export
Expand Down
3 changes: 2 additions & 1 deletion R/encryption_key_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#' @template param-tz
#' @return A tibble of encryption keys.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/listing-encryption-keys}
#' @seealso \url{https://docs.getodk.org/central-api-encryption/}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#listing-encryption-keys}
# nolint end
#' @family submission-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/form_detail.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @template param-retries
#' @return A tibble with one row and all form metadata as columns.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-individual-form}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#getting-form-details}
# nolint end
#' @family form-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/form_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' The column `xml_form_id` is replicated as `fid` according to `ruODK` naming
#' standards.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms/forms/list-all-forms}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#list-all-forms}
# nolint end
#' @family form-management
#' @importFrom httr add_headers authenticate content GET
Expand Down
3 changes: 1 addition & 2 deletions R/form_schema.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
#' cleaned column names from \code{\link{odata_submission_rectangle}}.
#' }
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-individual-form/getting-form-schema-fields}
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-individual-form/retrieving-form-schema-json}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#getting-form-schema-fields}
# nolint end
#' @family form-management
#' @export
Expand Down
5 changes: 2 additions & 3 deletions R/form_schema_ext.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@
#'
#' }
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-individual-form/getting-form-schema-fields}
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-individual-form/retrieving-form-schema-json}
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-individual-form/retrieving-form-xml}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#getting-form-schema-fields}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#retrieving-form-xml}
# nolint end
#' @family form-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/form_xml.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @template param-retries
#' @return The form XML as a nested list.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/'-individual-form/retrieving-form-xml}
#' @seealso \url{https://docs.getodk.org/central-api-form-management/#retrieving-form-xml}
# nolint end
#' @family form-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/odata_metadata_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return A nested list containing Edmx (dataset schema definition) and
#' .attrs (Version).
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/odata-endpoints/odata-form-service/metadata-document}
#' @seealso \url{https://docs.getodk.org/central-api-odata-endpoints/#metadata-document}
# nolint end
#' @family odata-api
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/odata_service_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return A tibble with one row per submission data endpoint.
#' Columns: name, kind, url.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/odata-endpoints/odata-form-service/service-document}
#' @seealso \url{https://docs.getodk.org/central-api-odata-endpoints/#service-document}
# nolint end
#' @family odata-api
#' @export
Expand Down
9 changes: 6 additions & 3 deletions R/odata_submission_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
#' `ruODK` does not validate the query string given to `filter`.
#' It is highly recommended to refer to the ODK Central API documentation
#' as well as the
#' [OData spec on filters](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#_Toc31358948).
# nolint start
#' [OData spec on filters](
#' https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#_Toc31358948).
# nolint end
#' for filter options and capabilities.
#' @param parse Whether to parse submission data based on form schema.
#' Dates and datetimes will be parsed into local time.
Expand Down Expand Up @@ -120,8 +123,8 @@
#' \item \code{@odata.count} is the total number of rows in the table.
#' }
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/odata-endpoints/odata-form-service}
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/odata-endpoints/odata-form-service/data-document}
#' @seealso \url{https://docs.getodk.org/central-api-odata-endpoints/#odata-form-service}
#' @seealso \url{https://docs.getodk.org/central-api-odata-endpoints/#data-document}
# nolint end
#' @family odata-api
#' @importFrom rlang %||%
Expand Down
2 changes: 1 addition & 1 deletion R/project_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @return A tibble with one row per project and all project metadata
#' as columns as per ODK Central API docs.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/project-management/projects/creating-a-project}
#' @seealso \url{https://docs.getodk.org/central-api-project-management/#creating-a-project}
# nolint end
#' @family project-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/project_detail.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' * archived: FALSE (if NULL) else TRUE
#' * dates: NA if NULL
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/project-management/projects/getting-project-details}
#' @seealso \url{https://docs.getodk.org/central-api-project-management/#getting-project-details}
# nolint end
#' @family project-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/project_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @return A tibble with one row per project and all project metadata
#' as columns as per ODK Central API docs.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/project-management/projects/listing-projects}
#' @seealso \url{https://docs.getodk.org/central-api-project-management/#listing-projects}
# nolint end
#' @family project-management
#' @export
Expand Down
5 changes: 3 additions & 2 deletions R/ru_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ print.ru_settings <- function(x, ...) {
#' @param svc (character) The OData service URL of a form as provided by the
#' ODK Central form submissions tab.
# nolint start
#' Example: "https://sandbox.central.getodk.org/v1/projects/14/forms/build_Flora-Quadrat-0-2_1558575936.svc"
#' Example: "https://URL/v1/projects/PID/forms/FID.svc"
# nolint end
#' @export
#' @family ru_settings
Expand Down Expand Up @@ -189,7 +189,8 @@ odata_svc_parse <- function(svc) {
#' @param test_pw (optional, character) The valid ODK Central password for
#' \code{test_un}.
#' @param test_pp (optional, character) The valid passphrase to decrypt the
#' data of encrypted project \code{test_pid} for download. Only used for tests.
#' data of encrypted project \code{test_pid} for download,
#' only used for tests.
#' @param test_odkc_version The ODK Central test server's version as major/minor
#' version, e.g. 1.1.
#' @template param-retries
Expand Down
26 changes: 13 additions & 13 deletions R/split_geopoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#' "POINT (114.01 -31.56 23.56)"
#' )
#' )
#' df_wkt_split <- df %>% split_geopoint("loc", wkt = TRUE)
#' df_wkt_split <- df |> split_geopoint("loc", wkt = TRUE)
#' testthat::expect_equal(
#' names(df_wkt_split),
#' c("stuff", "loc", "loc_longitude", "loc_latitude", "loc_altitude")
Expand All @@ -39,15 +39,15 @@
#' data("geo_gj_raw")
#'
#' # Find variable names of geopoints
#' geo_fields <- geo_fs %>%
#' dplyr::filter(type == "geopoint") %>%
#' geo_fields <- geo_fs |>
#' dplyr::filter(type == "geopoint") |>
#' magrittr::extract2("ruodk_name")
#' geo_fields[1] # First geotrace in data: point_location_point_gps
#'
#' # Rectangle but don't parse submission data (GeoJSON and WKT)
#' geo_gj_rt <- geo_gj_raw %>%
#' geo_gj_rt <- geo_gj_raw |>
#' odata_submission_rectangle(form_schema = geo_fs)
#' geo_wkt_rt <- geo_wkt_raw %>%
#' geo_wkt_rt <- geo_wkt_raw |>
#' odata_submission_rectangle(form_schema = geo_fs)
#'
#' # Data with first geopoint split
Expand All @@ -58,22 +58,22 @@
#' wkt_first_gt$point_location_point_gps_longitude
#' }
split_geopoint <- function(data, colname, wkt = FALSE) {
col_class <- data %>%
magrittr::extract2(colname) %>%
col_class <- data |>
magrittr::extract2(colname) |>
class()

if (wkt == FALSE) {
if (col_class != "list") {
"[split_geopoint] Skipping NULL column {colname} of class {col_class}" %>%
glue::glue() %>%
"[split_geopoint] Skipping NULL column {colname} of class {col_class}" |>
glue::glue() |>
ru_msg_noop()
return(data)
}

# GeoJSON
# Task: Extract coordinates into programmatically generated variable names
# Step 1: tidyr::hoist() extracts but can't assign with :=
data %>%
data |>
# TODO hoist fails on NULL columns
tidyr::hoist(
colname,
Expand All @@ -91,12 +91,12 @@ split_geopoint <- function(data, colname, wkt = FALSE) {
} else {
# WKT
if (col_class != "character") {
"[split_geopoint] Skipping NULL column {colname}, of class {col_class}" %>%
glue::glue() %>%
"[split_geopoint] Skipping NULL column {colname} of class {col_class}" |>
glue::glue() |>
ru_msg_noop()
return(data)
}
data %>%
data |>
tidyr::extract(
dplyr::all_of(colname),
c(
Expand Down
4 changes: 2 additions & 2 deletions R/submission_audit_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @template param-retries
#' @return A nested list of submission data.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/retrieving-submission-xml}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#retrieving-audit-logs}
# nolint end
#' @family utilities
#' @export
Expand Down Expand Up @@ -95,7 +95,7 @@ get_one_submission_audit <- function(iid,
#' @template param-retries
#' @return A nested list of submission audit logs.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/retrieving-submission-xml}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#retrieving-submission-xml}
# nolint end
#' @family submission-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/submission_detail.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @template param-retries
#' @return A nested list of submission metadata.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/getting-submission-details}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#getting-submission-metadata}
# nolint end
#' @family submission-management
#' @export
Expand Down
4 changes: 2 additions & 2 deletions R/submission_export.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#'
#' ### Encryption
#' ODK Central supports two modes of encryption - learn about them
#' [here](https://odkcentral.docs.apiary.io/#reference/encryption).
#' [here](https://docs.getodk.org/central-api-encryption/).
#' `ruODK` supports project managed encryption, however the support is limited
#' to exactly one encryption key. The supplied passphrase will be used against
#' the first returned encryption key. Remaining encryption keys are ignored by
Expand Down Expand Up @@ -65,7 +65,7 @@
#' the form to avoid accidentally overwriting the ZIP export from
#' another form.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/exporting-form-submissions-to-csv}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#exporting-form-submissions-to-csv}
# nolint end
#' @family submission-management
#' @export
Expand Down
7 changes: 4 additions & 3 deletions R/submission_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @template param-retries
#' @return A nested list of submission data.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/retrieving-submission-xml}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#retrieving-submission-xml}
# nolint end
#' @family utilities
#' @export
Expand Down Expand Up @@ -82,7 +82,8 @@ get_one_submission <- function(iid,
#' `audit.csv` file, use `submission_export`.
#' Note that the submission audit is different from the server audit.
#' The submission audit logs the actions of the enumerator in ODK Collect,
#' whereas the form audit logs the actions of the project manager in ODK Central.
#' whereas the form audit logs the actions of the project manager in
#' ODK Central.
#'
#' @param iid A list of submission instance IDs, e.g. from
#' \code{\link{submission_list}$instance_id}.
Expand All @@ -93,7 +94,7 @@ get_one_submission <- function(iid,
#' @template param-retries
#' @return A nested list of submission data.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/retrieving-submission-xml}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#retrieving-submission-xml}
# nolint end
#' @family submission-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/submission_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' * created_at: time of submission upload, dttm
#' * updated_at: time of submission update on server, dttm or NA
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/forms-and-submissions/submissions/listing-all-submissions-on-a-form}
#' @seealso \url{https://docs.getodk.org/central-api-submission-management/#listing-all-submissions-on-a-form}
# nolint end
#' @family submission-management
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/user_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' @template param-verbose
#' @return A tibble with user details as per the ODK Central API docs.
# nolint start
#' @seealso \url{https://odkcentral.docs.apiary.io/#reference/accounts-and-users/users/listing-all-users}
#' @seealso \url{https://docs.getodk.org/central-api-accounts-and-users/#listing-all-users}
# nolint end
#' @seealso \url{https://www.postgresql.org/docs/9.6/pgtrgm.html}
#' @family user-management
Expand Down
Loading

0 comments on commit e2d452d

Please sign in to comment.