From 84584e2db0f4538087084b249db05778ce207f7d Mon Sep 17 00:00:00 2001 From: jason-p-pickering Date: Wed, 19 Apr 2023 09:09:26 +0200 Subject: [PATCH 1/7] Add authorization header if using a token --- R/callDATIMapi.R | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/R/callDATIMapi.R b/R/callDATIMapi.R index c0d4b097..43a6bd65 100644 --- a/R/callDATIMapi.R +++ b/R/callDATIMapi.R @@ -92,8 +92,18 @@ api_get <- function(path, resp <- NULL resp <- try( - httr::GET(url, httr::timeout(timeout), - handle = handle) + + if (is.null(d2_session$token)) { + httr::GET(url, httr::timeout(timeout), + handle = handle) + } else { + print("Using token") + httr::GET(url, + httr::timeout(timeout), + handle = handle, + add_headers(Authorization = paste("Bearer", d2_session$token$credentials$access_key, sep = " "))) + } + ) # try is added in order to handle if resp comes back as a "try-error" class From 98fc5d8d7cb9e4dfe95e5982334feeced5d9449b Mon Sep 17 00:00:00 2001 From: jason-p-pickering Date: Wed, 19 Apr 2023 09:12:09 +0200 Subject: [PATCH 2/7] Minor --- R/callDATIMapi.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/callDATIMapi.R b/R/callDATIMapi.R index 43a6bd65..66232ff9 100644 --- a/R/callDATIMapi.R +++ b/R/callDATIMapi.R @@ -101,7 +101,7 @@ api_get <- function(path, httr::GET(url, httr::timeout(timeout), handle = handle, - add_headers(Authorization = paste("Bearer", d2_session$token$credentials$access_key, sep = " "))) + httr::add_headers(Authorization = paste("Bearer", d2_session$token$credentials$access_key, sep = " "))) } ) From 0262fa6b38a3b97c2f8aea9188118211507641d7 Mon Sep 17 00:00:00 2001 From: jason-p-pickering Date: Wed, 19 Apr 2023 09:22:15 +0200 Subject: [PATCH 3/7] Fix reference --- R/callDATIMapi.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/callDATIMapi.R b/R/callDATIMapi.R index 66232ff9..8ae57b90 100644 --- a/R/callDATIMapi.R +++ b/R/callDATIMapi.R @@ -101,7 +101,7 @@ api_get <- function(path, httr::GET(url, httr::timeout(timeout), handle = handle, - httr::add_headers(Authorization = paste("Bearer", d2_session$token$credentials$access_key, sep = " "))) + httr::add_headers(Authorization = paste("Bearer", d2_session$token$credentials$access_token, sep = " "))) } ) From 78977e4202b597cf7b12ab1a95c0c4afff448acd Mon Sep 17 00:00:00 2001 From: jason-p-pickering Date: Wed, 19 Apr 2023 10:55:52 +0200 Subject: [PATCH 4/7] Cleanup --- R/callDATIMapi.R | 9 ++++++--- R/getDataStore.R | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/R/callDATIMapi.R b/R/callDATIMapi.R index 8ae57b90..11d22314 100644 --- a/R/callDATIMapi.R +++ b/R/callDATIMapi.R @@ -92,16 +92,19 @@ api_get <- function(path, resp <- NULL resp <- try( - + #Is we are using an OAUTH token, we need to + #put the authorization code in the header. + #Otherwise, just use the cookie. if (is.null(d2_session$token)) { httr::GET(url, httr::timeout(timeout), handle = handle) } else { - print("Using token") httr::GET(url, httr::timeout(timeout), handle = handle, - httr::add_headers(Authorization = paste("Bearer", d2_session$token$credentials$access_token, sep = " "))) + httr::add_headers(Authorization = + paste("Bearer", + d2_session$token$credentials$access_token, sep = " "))) } ) diff --git a/R/getDataStore.R b/R/getDataStore.R index 0d364597..e5e7821f 100644 --- a/R/getDataStore.R +++ b/R/getDataStore.R @@ -34,8 +34,25 @@ if (!isSimpleString(namespace) || !isSimpleString(key)) { response_code <- 5 while (i <= retry && (response_code < 400 || response_code >= 500)) { - resp <- httr::GET(url, httr::timeout(timeout), - handle = d2_session$handle) + + resp <- NULL + resp <- + try(#Is we are using an OAUTH token, we need to put the authorization code in the header. + #Otherwise, just use the cookie. + if (is.null(d2_session$token)) { + httr::GET(url, httr::timeout(timeout), + handle = d2_session$handle) + } else { + httr::GET( + url, + httr::timeout(timeout), + handle = d2_session$handle, + httr::add_headers( + Authorization = paste("Bearer", d2_session$token$credentials$access_token, sep = " ") + ) + ) + }) + response_code <- httr::status_code(resp) Sys.sleep(i - 1) i <- i + 1 From 5fc8e4627887e50c5a74cb4f0062109015b9522a Mon Sep 17 00:00:00 2001 From: jason-p-pickering Date: Wed, 19 Apr 2023 15:44:39 +0200 Subject: [PATCH 5/7] Debug statement --- R/callDATIMapi.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/callDATIMapi.R b/R/callDATIMapi.R index 11d22314..60ca6c4d 100644 --- a/R/callDATIMapi.R +++ b/R/callDATIMapi.R @@ -99,6 +99,7 @@ api_get <- function(path, httr::GET(url, httr::timeout(timeout), handle = handle) } else { + print("Using token") httr::GET(url, httr::timeout(timeout), handle = handle, From e011b46a538d32df7f99238b24ed27d59fba70a9 Mon Sep 17 00:00:00 2001 From: Jason Pickering Date: Wed, 19 Apr 2023 17:53:14 +0200 Subject: [PATCH 6/7] Update callDATIMapi.R --- R/callDATIMapi.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/callDATIMapi.R b/R/callDATIMapi.R index 60ca6c4d..11d22314 100644 --- a/R/callDATIMapi.R +++ b/R/callDATIMapi.R @@ -99,7 +99,6 @@ api_get <- function(path, httr::GET(url, httr::timeout(timeout), handle = handle) } else { - print("Using token") httr::GET(url, httr::timeout(timeout), handle = handle, From cd7e37ecfe47739ac6b67c27c5969e97d209366c Mon Sep 17 00:00:00 2001 From: Jason Pickering Date: Wed, 10 May 2023 21:31:22 +0200 Subject: [PATCH 7/7] Add addition functions for working with the dataStore (#120) * Add addition functions for working with the dataStore * Update docs * Upgrade lock file --- DESCRIPTION | 2 +- NAMESPACE | 2 + R/getDataStore.R | 105 +- man/d2Session.Rd | 2 - man/getAnalytics.Rd | 2 +- man/getDataStoreNamespaceKeys.Rd | 29 + man/getDataStoreNamespaces.Rd | 28 + renv.lock | 1043 ++++++++++++----- .../dataQualityTool/settings.json-3b3c4f.json | 1 + .../dataQualityTool/test-dataStore.R | 52 + tests/testthat/test-dataStore.R | 29 +- .../api/dataStore.json-3b3c4f.json | 17 + .../dataQualityTool/foo.json-3b3c4f.R | 22 + .../api/dataStore/dedupe.json-3b3c4f.json | 6 + .../dedupe/periodSettings.json-3b3c4f.json | 1 + 15 files changed, 996 insertions(+), 345 deletions(-) create mode 100644 man/getDataStoreNamespaceKeys.Rd create mode 100644 man/getDataStoreNamespaces.Rd create mode 100644 tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/settings.json-3b3c4f.json create mode 100644 tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/test-dataStore.R create mode 100644 tests/testthat/test.datim.org/api/dataStore.json-3b3c4f.json create mode 100644 tests/testthat/test.datim.org/api/dataStore/dataQualityTool/foo.json-3b3c4f.R create mode 100644 tests/testthat/test.datim.org/api/dataStore/dedupe.json-3b3c4f.json create mode 100644 tests/testthat/test.datim.org/api/dataStore/dedupe/periodSettings.json-3b3c4f.json diff --git a/DESCRIPTION b/DESCRIPTION index 60055a67..0e007663 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,5 +44,5 @@ Suggests: License: GPL-3 + file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index eef31bb2..0ba53a4d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -38,6 +38,8 @@ export(getDataElementGroups) export(getDataElements) export(getDataSets) export(getDataStoreKey) +export(getDataStoreNamespaceKeys) +export(getDataStoreNamespaces) export(getDataValueSets) export(getDimensions) export(getIndicatorGroupSets) diff --git a/R/getDataStore.R b/R/getDataStore.R index e5e7821f..39bd78f8 100644 --- a/R/getDataStore.R +++ b/R/getDataStore.R @@ -1,4 +1,29 @@ +isSimpleString <- function(x) { + !(is.na(x) || x == "" || is.null(x)) & typeof(x) == "character" +} + +.handleDataStoreResponse <- function(path, d2_session, retry, timeout) { + resp <- + tryCatch({ + api_get( + path, + d2_session = d2_session, + retry = retry, + timeout = timeout, + verbose = TRUE + ) + }, + error = function(e) { + warning(paste(path, "could not be retreived from the server")) + return(NULL) + }) + if (inherits(resp, "list")) { + jsonlite::parse_json(httr::content(resp$api_responses, type = "text"), simplifyVector = FALSE) + } else { + return(NULL) + } +} #' @title getDataStoreKey returns a particular key from the datastore #' @description The DHIS2 datastore can be used to store arbitrary JSON objects. #' @param namespace Namespace of the datastore @@ -20,53 +45,57 @@ getDataStoreKey <- function(namespace, key, simplify = FALSE, retry = 3, timeout = 60) { -isSimpleString <- function(x) { - !(is.na(x) || x == "" || is.null(x)) & typeof(x) == "character" -} if (!isSimpleString(namespace) || !isSimpleString(key)) { stop("Please specify the namespace and key!") } - url <- paste0(d2_session$base_url, "api/dataStore/", namespace, "/", key) + path <- paste0("api/dataStore/", namespace, "/", key) - # retry api get block, only retries if reponse code not in 400s - i <- 1 - response_code <- 5 + .handleDataStoreResponse(path, d2_session, retry, timeout) +} - while (i <= retry && (response_code < 400 || response_code >= 500)) { - resp <- NULL - resp <- - try(#Is we are using an OAUTH token, we need to put the authorization code in the header. - #Otherwise, just use the cookie. - if (is.null(d2_session$token)) { - httr::GET(url, httr::timeout(timeout), - handle = d2_session$handle) - } else { - httr::GET( - url, - httr::timeout(timeout), - handle = d2_session$handle, - httr::add_headers( - Authorization = paste("Bearer", d2_session$token$credentials$access_token, sep = " ") - ) - ) - }) - response_code <- httr::status_code(resp) - Sys.sleep(i - 1) - i <- i + 1 - if (response_code == 200 && - resp$url == url && - httr::http_type(resp) == "application/json") { - break - } +#' Title getDataStoreNamespaceKeys returns all keys for a given name space +#' +#' @param namespace The name of the namespace as a string +#' @param d2_session the d2Session object, default is "d2_default_session", +#' it will be made upon login in to DATIM with loginToDATIM +#' @param retry Number of times to retry the request +#' @param timeout Timeout in number of seconds +#' @return A character vector of strings contained in the namespace. +#' +#' @export +#' +getDataStoreNamespaceKeys <- function(namespace, + d2_session = dynGet("d2_default_session", inherits = TRUE), + retry = 3, + timeout = 60) { + + if (!isSimpleString(namespace)) { + stop("Please specify the namespace as a string!") } - if (response_code == 404L) { - warning("The requested datastore object could not be found") - return(NULL) - } + path <- paste0("api/dataStore/", namespace) + + .handleDataStoreResponse(path, d2_session, retry, timeout) +} + +#' Title getDataStoreNamespaces returns a list of all namespaces present in the datastore +#' +#' @param d2_session the d2Session object, default is "d2_default_session", +#' it will be made upon login in to DATIM with loginToDATIM +#' @param retry Number of times to retry the request +#' @param timeout Timeout in number of seconds +#' @return A character vector of strings of the namespaces in the dataStore. +#' +#' @export +#' +getDataStoreNamespaces <- function(d2_session = dynGet("d2_default_session", inherits = TRUE), + retry = 3, + timeout = 60) { + + path <- paste0("api/dataStore.json") - jsonlite::parse_json(httr::content(resp, type = "text"), simplifyVector = simplify) + .handleDataStoreResponse(path, d2_session, retry, timeout) } diff --git a/man/d2Session.Rd b/man/d2Session.Rd index 4b50abe1..ef92b077 100644 --- a/man/d2Session.Rd +++ b/man/d2Session.Rd @@ -61,9 +61,7 @@ connections} \item{\code{me}}{DHIS2 me response object} - \item{\code{token}}{OAUTH2 token} - } \if{html}{\out{}} } diff --git a/man/getAnalytics.Rd b/man/getAnalytics.Rd index f91ccf59..e482208f 100644 --- a/man/getAnalytics.Rd +++ b/man/getAnalytics.Rd @@ -19,7 +19,7 @@ getAnalytics( return_names = FALSE, d2_session = dynGet("d2_default_session", inherits = TRUE), retry = 1, - timeout = 60, + timeout = 180, verbose = FALSE, quiet = TRUE ) diff --git a/man/getDataStoreNamespaceKeys.Rd b/man/getDataStoreNamespaceKeys.Rd new file mode 100644 index 00000000..93457d83 --- /dev/null +++ b/man/getDataStoreNamespaceKeys.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getDataStore.R +\name{getDataStoreNamespaceKeys} +\alias{getDataStoreNamespaceKeys} +\title{Title getDataStoreNamespaceKeys returns all keys for a given name space} +\usage{ +getDataStoreNamespaceKeys( + namespace, + d2_session = dynGet("d2_default_session", inherits = TRUE), + retry = 3, + timeout = 60 +) +} +\arguments{ +\item{namespace}{The name of the namespace as a string} + +\item{d2_session}{the d2Session object, default is "d2_default_session", +it will be made upon login in to DATIM with loginToDATIM} + +\item{retry}{Number of times to retry the request} + +\item{timeout}{Timeout in number of seconds} +} +\value{ +A character vector of strings contained in the namespace. +} +\description{ +Title getDataStoreNamespaceKeys returns all keys for a given name space +} diff --git a/man/getDataStoreNamespaces.Rd b/man/getDataStoreNamespaces.Rd new file mode 100644 index 00000000..4129a8bf --- /dev/null +++ b/man/getDataStoreNamespaces.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/getDataStore.R +\name{getDataStoreNamespaces} +\alias{getDataStoreNamespaces} +\title{Title getDataStoreNamespaceKeys returns all keys for a given name space} +\usage{ +getDataStoreNamespaces( + d2_session = dynGet("d2_default_session", inherits = TRUE), + retry = 3, + timeout = 60 +) +} +\arguments{ +\item{d2_session}{the d2Session object, default is "d2_default_session", +it will be made upon login in to DATIM with loginToDATIM} + +\item{retry}{Number of times to retry the request} + +\item{timeout}{Timeout in number of seconds} + +\item{namespace}{The name of the namespace as a string} +} +\value{ +A character vector of strings contained in the namespace. +} +\description{ +Title getDataStoreNamespaceKeys returns all keys for a given name space +} diff --git a/renv.lock b/renv.lock index ae10ec8f..38710df5 100644 --- a/renv.lock +++ b/renv.lock @@ -1,6 +1,6 @@ { "R": { - "Version": "4.2.1", + "Version": "4.3.0", "Repositories": [ { "Name": "CRAN", @@ -14,341 +14,443 @@ "Version": "2.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "470851b6d5d0ac559e9d01bb352b4021", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "470851b6d5d0ac559e9d01bb352b4021" + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.0.10", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods", + "utils" + ], + "Hash": "e749cae40fa9ef469b6050959517453c" }, "askpass": { "Package": "askpass", "Version": "1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "e8a22846fff485f0be3770c2da758713", "Requirements": [ "sys" - ] + ], + "Hash": "e8a22846fff485f0be3770c2da758713" }, "assertthat": { "Package": "assertthat", "Version": "0.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "50c838a310445e954bc13f26f26a6ecf", - "Requirements": [] + "Requirements": [ + "tools" + ], + "Hash": "50c838a310445e954bc13f26f26a6ecf" }, "backports": { "Package": "backports", "Version": "1.4.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "c39fbec8a30d23e721980b8afb31984c", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "c39fbec8a30d23e721980b8afb31984c" }, "base64enc": { "Package": "base64enc", "Version": "0.1-3", "Source": "Repository", "Repository": "CRAN", - "Hash": "543776ae6848fde2f48ff3816d0628bc", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "543776ae6848fde2f48ff3816d0628bc" }, "bit": { "Package": "bit", - "Version": "4.0.4", + "Version": "4.0.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "f36715f14d94678eea9933af927bc15d", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "d242abec29412ce988848d0294b208fd" }, "bit64": { "Package": "bit64", "Version": "4.0.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "9fe98599ca456d6552421db0d6772d8f", "Requirements": [ - "bit" - ] + "R", + "bit", + "methods", + "stats", + "utils" + ], + "Hash": "9fe98599ca456d6552421db0d6772d8f" }, "brew": { "Package": "brew", - "Version": "1.0-7", + "Version": "1.0-8", "Source": "Repository", "Repository": "CRAN", - "Hash": "38875ea52350ff4b4c03849fc69736c8", - "Requirements": [] + "Hash": "d69a786e85775b126bddbee185ae6084" }, "brio": { "Package": "brio", "Version": "1.1.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "976cf154dfb043c012d87cddd8bca363", - "Requirements": [] + "Hash": "976cf154dfb043c012d87cddd8bca363" }, "bslib": { "Package": "bslib", - "Version": "0.3.1", + "Version": "0.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "56ae7e1987b340186a8a5a157c2ec358", "Requirements": [ + "R", + "base64enc", + "cachem", + "grDevices", "htmltools", "jquerylib", "jsonlite", + "memoise", + "mime", "rlang", "sass" - ] + ], + "Hash": "a7fbf03946ad741129dc81098722fca1" }, "cachem": { "Package": "cachem", - "Version": "1.0.6", + "Version": "1.0.8", "Source": "Repository", "Repository": "CRAN", - "Hash": "648c5b3d71e6a37e3043617489a0a0e9", "Requirements": [ "fastmap", "rlang" - ] + ], + "Hash": "c35768291560ce302c0a6589f92e837d" }, "callr": { "Package": "callr", - "Version": "3.7.1", + "Version": "3.7.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "2fda237f24bc56508f31394beaa56877", "Requirements": [ + "R", "R6", - "processx" - ] + "processx", + "utils" + ], + "Hash": "9b2191ede20fa29828139b9900922e51" }, "cli": { "Package": "cli", - "Version": "3.3.0", + "Version": "3.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "23abf173c2b783dcc43379ab9bba00ee", "Requirements": [ - "glue" - ] + "R", + "utils" + ], + "Hash": "89e6d8219950eac806ae0c489052048a" }, "clipr": { "Package": "clipr", "Version": "0.8.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "3f038e5ac7f41d4ac41ce658c85e3042", - "Requirements": [] + "Requirements": [ + "utils" + ], + "Hash": "3f038e5ac7f41d4ac41ce658c85e3042" }, "codetools": { "Package": "codetools", - "Version": "0.2-18", + "Version": "0.2-19", "Source": "Repository", "Repository": "CRAN", - "Hash": "019388fc48e48b3da0d3a76ff94608a8", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "c089a619a7fae175d149d89164f8c7d8" }, "commonmark": { "Package": "commonmark", - "Version": "1.8.0", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "2ba81b120c1655ab696c935ef33ea716", - "Requirements": [] + "Hash": "d691c61bff84bd63c383874d2d0c3307" }, "cpp11": { "Package": "cpp11", - "Version": "0.4.2", + "Version": "0.4.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "fa53ce256cd280f468c080a58ea5ba8c", - "Requirements": [] + "Hash": "ed588261931ee3be2c700d22e94a29ab" }, "crayon": { "Package": "crayon", - "Version": "1.5.1", + "Version": "1.5.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "8dc45fd8a1ee067a92b85ef274e66d6a", - "Requirements": [] + "Requirements": [ + "grDevices", + "methods", + "utils" + ], + "Hash": "e8a1e41acf02548751f45c718d55aa6a" }, "credentials": { "Package": "credentials", "Version": "1.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "93762d0a34d78e6a025efdbfb5c6bb41", "Requirements": [ "askpass", "curl", "jsonlite", "openssl", "sys" - ] + ], + "Hash": "93762d0a34d78e6a025efdbfb5c6bb41" }, "curl": { "Package": "curl", - "Version": "4.3.2", + "Version": "5.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "022c42d49c28e95d69ca60446dbabf88", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "e4f97056611e8e6b8b852d13b7400cf1" }, "cyclocomp": { "Package": "cyclocomp", "Version": "1.1.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "53cbed70a2f7472d48fb6aef08442f25", "Requirements": [ "callr", "crayon", "desc", "remotes", "withr" - ] + ], + "Hash": "53cbed70a2f7472d48fb6aef08442f25" }, "desc": { "Package": "desc", - "Version": "1.4.1", + "Version": "1.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "eebd27ee58fcc58714eedb7aa07d8ad1", "Requirements": [ + "R", "R6", "cli", - "rprojroot" - ] + "rprojroot", + "utils" + ], + "Hash": "6b9602c7ebbe87101a9c8edb6e8b6d21" }, "devtools": { "Package": "devtools", - "Version": "2.4.3", + "Version": "2.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "fc35e13bb582e5fe6f63f3d647a4cbe5", "Requirements": [ - "callr", + "R", "cli", "desc", "ellipsis", "fs", - "httr", "lifecycle", "memoise", + "miniUI", "pkgbuild", + "pkgdown", "pkgload", + "profvis", "rcmdcheck", "remotes", "rlang", "roxygen2", - "rstudioapi", "rversions", "sessioninfo", + "stats", "testthat", + "tools", + "urlchecker", "usethis", + "utils", "withr" - ] + ], + "Hash": "ea5bc8b4a6a01e4f12d98b58329930bb" }, "diffobj": { "Package": "diffobj", "Version": "0.3.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8", "Requirements": [ - "crayon" - ] + "R", + "crayon", + "methods", + "stats", + "tools", + "utils" + ], + "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8" }, "digest": { "Package": "digest", - "Version": "0.6.29", + "Version": "0.6.31", "Source": "Repository", "Repository": "CRAN", - "Hash": "cf6b206a045a684728c3267ef7596190", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "8b708f296afd9ae69f450f9640be8990" + }, + "downlit": { + "Package": "downlit", + "Version": "0.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "brio", + "desc", + "digest", + "evaluate", + "fansi", + "memoise", + "rlang", + "vctrs", + "withr", + "yaml" + ], + "Hash": "79bf3f66590752ffbba20f8d2da94c7c" }, "dplyr": { "Package": "dplyr", - "Version": "1.0.9", + "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f0bda1627a7f5d3f9a0b5add931596ac", "Requirements": [ + "R", "R6", + "cli", "generics", "glue", "lifecycle", "magrittr", + "methods", "pillar", "rlang", "tibble", "tidyselect", + "utils", "vctrs" - ] + ], + "Hash": "dea6970ff715ca541c387de363ff405e" }, "ellipsis": { "Package": "ellipsis", "Version": "0.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077", "Requirements": [ + "R", "rlang" - ] + ], + "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" }, "evaluate": { "Package": "evaluate", - "Version": "0.15", + "Version": "0.21", "Source": "Repository", "Repository": "CRAN", - "Hash": "699a7a93d08c962d9f8950b2d7a227f1", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "d59f3b464e8da1aef82dc04b588b8dfb" }, "fansi": { "Package": "fansi", - "Version": "1.0.3", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "83a8afdbe71839506baa9f90eebad7ec", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "utils" + ], + "Hash": "1d9e7ad3c8312a192dea7d3db0274fde" }, "fastmap": { "Package": "fastmap", - "Version": "1.1.0", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8", - "Requirements": [] + "Hash": "f7736a18de97dea803bde0a2daaafb27" }, "filelock": { "Package": "filelock", "Version": "1.0.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "38ec653c2613bed60052ba3787bd8a2c", - "Requirements": [] + "Hash": "38ec653c2613bed60052ba3787bd8a2c" + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "htmltools", + "rlang" + ], + "Hash": "1e22b8cabbad1eae951a75e9f8b52378" }, "fs": { "Package": "fs", - "Version": "1.5.2", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "7c89603d81793f0d5486d91ab1fc6f1d", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "94af08e0aa9675a16fadbb3aaaa90d2a" }, "generics": { "Package": "generics", "Version": "0.1.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "15e9634c0fcd294799e9b2e929ed1b86", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "15e9634c0fcd294799e9b2e929ed1b86" }, "gert": { "Package": "gert", - "Version": "1.6.0", + "Version": "1.9.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "98c014c4c933f23ea5a0321a4d0b588b", "Requirements": [ "askpass", "credentials", @@ -356,135 +458,201 @@ "rstudioapi", "sys", "zip" - ] + ], + "Hash": "9122b3958e749badb5c939f498038b57" }, "gh": { "Package": "gh", - "Version": "1.3.0", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "38c2580abbda249bd6afeec00d14f531", "Requirements": [ + "R", "cli", "gitcreds", - "httr", + "httr2", "ini", - "jsonlite" - ] + "jsonlite", + "rlang" + ], + "Hash": "03533b1c875028233598f848fda44c4c" }, "gitcreds": { "Package": "gitcreds", - "Version": "0.1.1", + "Version": "0.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f3aefccc1cc50de6338146b62f115de8", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "ab08ac61f3e1be454ae21911eb8bc2fe" }, "glue": { "Package": "glue", "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e" }, "highr": { "Package": "highr", - "Version": "0.9", + "Version": "0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "8eb36c8125038e648e5d111c0d7b2ed4", "Requirements": [ + "R", "xfun" - ] + ], + "Hash": "06230136b2d2b9ba5805e1963fa6e890" }, "hms": { "Package": "hms", - "Version": "1.1.1", + "Version": "1.1.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca", "Requirements": [ - "ellipsis", "lifecycle", + "methods", "pkgconfig", "rlang", "vctrs" - ] + ], + "Hash": "b59377caa7ed00fa41808342002138f9" }, "htmltools": { "Package": "htmltools", - "Version": "0.5.2", + "Version": "0.5.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "526c484233f42522278ab06fb185cb26", "Requirements": [ + "R", "base64enc", "digest", + "ellipsis", "fastmap", - "rlang" - ] + "grDevices", + "rlang", + "utils" + ], + "Hash": "ba0240784ad50a62165058a27459304a" + }, + "htmlwidgets": { + "Package": "htmlwidgets", + "Version": "1.6.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "htmltools", + "jsonlite", + "knitr", + "rmarkdown", + "yaml" + ], + "Hash": "a865aa85bcb2697f47505bfd70422471" }, "httptest": { "Package": "httptest", "Version": "4.1.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "cd910dc78e8edbc40b9723824baa7097", "Requirements": [ + "R", "curl", "digest", "httr", "jsonlite", - "testthat" - ] + "stats", + "testthat", + "utils" + ], + "Hash": "cd910dc78e8edbc40b9723824baa7097" + }, + "httpuv": { + "Package": "httpuv", + "Version": "1.6.10", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "Rcpp", + "later", + "promises", + "utils" + ], + "Hash": "503490b202c9ae28e7f58b9b5ae21d9f" }, "httr": { "Package": "httr", - "Version": "1.4.3", + "Version": "1.4.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "88d1b310583777edf01ccd1216fb0b2b", "Requirements": [ + "R", "R6", "curl", "jsonlite", "mime", "openssl" - ] + ], + "Hash": "7e5e3cbd2a7bc07880c94e22348fb661" + }, + "httr2": { + "Package": "httr2", + "Version": "0.2.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "cli", + "curl", + "glue", + "magrittr", + "openssl", + "rappdirs", + "rlang", + "withr" + ], + "Hash": "193bb297368afbbb42dc85784a46b36e" }, "ini": { "Package": "ini", "Version": "0.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "6154ec2223172bce8162d4153cda21f7", - "Requirements": [] + "Hash": "6154ec2223172bce8162d4153cda21f7" }, "jquerylib": { "Package": "jquerylib", "Version": "0.1.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "5aab57a3bd297eee1c1d862735972182", "Requirements": [ "htmltools" - ] + ], + "Hash": "5aab57a3bd297eee1c1d862735972182" }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.0", + "Version": "1.8.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "d07e729b27b372429d42d24d503613a0", - "Requirements": [] + "Requirements": [ + "methods" + ], + "Hash": "a4269a09a9b865579b2635c77e572374" }, "keyring": { "Package": "keyring", - "Version": "1.3.0", + "Version": "1.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "f97832aee679462739f7146fead53b11", "Requirements": [ "R6", "askpass", @@ -493,49 +661,69 @@ "openssl", "rappdirs", "sodium", + "tools", + "utils", "yaml" - ] + ], + "Hash": "b7880ebefe188d62b099673bbc04afac" }, "knitr": { "Package": "knitr", - "Version": "1.39", + "Version": "1.42", "Source": "Repository", "Repository": "CRAN", - "Hash": "029ab7c4badd3cf8af69016b2ba27493", "Requirements": [ + "R", "evaluate", "highr", - "stringr", + "methods", + "tools", "xfun", "yaml" - ] + ], + "Hash": "8329a9bcc82943c8069104d4be3ee22d" + }, + "later": { + "Package": "later", + "Version": "1.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Rcpp", + "rlang" + ], + "Hash": "40401c9cf2bc2259dfe83311c9384710" }, "lazyeval": { "Package": "lazyeval", "Version": "0.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "d908914ae53b04d4c0c0fd72ecc35370", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "d908914ae53b04d4c0c0fd72ecc35370" }, "lifecycle": { "Package": "lifecycle", - "Version": "1.0.1", + "Version": "1.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "a6b6d352e3ed897373ab19d8395c98d0", "Requirements": [ + "R", + "cli", "glue", "rlang" - ] + ], + "Hash": "001cecbeac1cff9301bdc3775ee46a86" }, "lintr": { "Package": "lintr", - "Version": "3.0.0", + "Version": "3.0.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "1214604176fb93fdcac030fc5d2177d9", "Requirements": [ + "R", "backports", "codetools", "crayon", @@ -545,180 +733,284 @@ "jsonlite", "knitr", "rex", + "stats", + "utils", "xml2", "xmlparsedata" - ] + ], + "Hash": "b21ebd652d940f099915221f3328ab7b" }, "magrittr": { "Package": "magrittr", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "7ce2733a9826b3aeb1775d56fd305472", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "7ce2733a9826b3aeb1775d56fd305472" }, "memoise": { "Package": "memoise", "Version": "2.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c", "Requirements": [ "cachem", "rlang" - ] + ], + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" }, "mime": { "Package": "mime", "Version": "0.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "18e9c28c1d3ca1560ce30658b22ce104", - "Requirements": [] + "Requirements": [ + "tools" + ], + "Hash": "18e9c28c1d3ca1560ce30658b22ce104" + }, + "miniUI": { + "Package": "miniUI", + "Version": "0.1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "htmltools", + "shiny", + "utils" + ], + "Hash": "fec5f52652d60615fdb3957b3d74324a" }, "openssl": { "Package": "openssl", - "Version": "2.0.2", + "Version": "2.0.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "6d3bef2e305f55c705c674653c7d7d3d", "Requirements": [ "askpass" - ] + ], + "Hash": "0f7cd2962e3044bb940cca4f4b5cecbe" }, "pillar": { "Package": "pillar", - "Version": "1.7.0", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "51dfc97e1b7069e9f7e6f83f3589c22e", "Requirements": [ "cli", - "crayon", - "ellipsis", "fansi", "glue", "lifecycle", "rlang", "utf8", + "utils", "vctrs" - ] + ], + "Hash": "15da5a8412f317beeee6175fbc76f4bb" }, "pkgbuild": { "Package": "pkgbuild", - "Version": "1.3.0", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "ecf6582da7918fd32f6e2b7d221af818", "Requirements": [ + "R", "R6", "callr", "cli", "crayon", "desc", "prettyunits", + "processx", "rprojroot", "withr" - ] + ], + "Hash": "d6c3008d79653a0f267703288230105e" }, "pkgconfig": { "Package": "pkgconfig", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "01f28d4278f15c76cddbea05899c5d6f", - "Requirements": [] + "Requirements": [ + "utils" + ], + "Hash": "01f28d4278f15c76cddbea05899c5d6f" + }, + "pkgdown": { + "Package": "pkgdown", + "Version": "2.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "bslib", + "callr", + "cli", + "desc", + "digest", + "downlit", + "fs", + "httr", + "jsonlite", + "magrittr", + "memoise", + "purrr", + "ragg", + "rlang", + "rmarkdown", + "tibble", + "whisker", + "withr", + "xml2", + "yaml" + ], + "Hash": "16fa15449c930bf3a7761d3c68f8abf9" }, "pkgload": { "Package": "pkgload", - "Version": "1.3.0", + "Version": "1.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "4b20f937a363c78a5730265c1925f54a", "Requirements": [ + "R", "cli", "crayon", "desc", "fs", "glue", + "methods", "rlang", "rprojroot", + "utils", "withr" - ] + ], + "Hash": "6b0c222c5071efe0f3baf3dae9aa40e2" }, "praise": { "Package": "praise", "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "a555924add98c99d2f411e37e7d25e9f", - "Requirements": [] + "Hash": "a555924add98c99d2f411e37e7d25e9f" }, "prettyunits": { "Package": "prettyunits", "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "95ef9167b75dde9d2ccc3c7528393e7e", - "Requirements": [] + "Hash": "95ef9167b75dde9d2ccc3c7528393e7e" }, "processx": { "Package": "processx", - "Version": "3.7.0", + "Version": "3.8.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "f91df0f5f31ffdf88bc0b624f5ebab0f", "Requirements": [ + "R", "R6", - "ps" - ] + "ps", + "utils" + ], + "Hash": "d75b4059d781336efba24021915902b4" + }, + "profvis": { + "Package": "profvis", + "Version": "0.3.8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "htmlwidgets", + "purrr", + "rlang", + "stringr", + "vctrs" + ], + "Hash": "aa5a3864397ce6ae03458f98618395a1" }, "progress": { "Package": "progress", "Version": "1.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061", "Requirements": [ "R6", "crayon", "hms", "prettyunits" - ] + ], + "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061" + }, + "promises": { + "Package": "promises", + "Version": "1.2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "Rcpp", + "later", + "magrittr", + "rlang", + "stats" + ], + "Hash": "4ab2c43adb4d4699cf3690acd378d75d" }, "ps": { "Package": "ps", - "Version": "1.7.1", + "Version": "1.7.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "8b93531308c01ad0e56d9eadcc0c4fcd", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "709d852d33178db54b17c722e5b1e594" }, "purrr": { "Package": "purrr", - "Version": "0.3.4", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "97def703420c8ab10d8f0e6c72101e02", "Requirements": [ + "R", + "cli", + "lifecycle", "magrittr", - "rlang" - ] + "rlang", + "vctrs" + ], + "Hash": "d71c815267c640f17ddbf7f16144b4bb" + }, + "ragg": { + "Package": "ragg", + "Version": "1.2.5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "systemfonts", + "textshaping" + ], + "Hash": "690bc058ea2b1b8a407d3cfe3dce3ef9" }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "5e3c5dc0b071b21fa128676560dbe94d", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "5e3c5dc0b071b21fa128676560dbe94d" }, "rcmdcheck": { "Package": "rcmdcheck", "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "8f25ebe2ec38b1f2aef3b0d2ef76f6c4", "Requirements": [ "R6", "callr", @@ -730,17 +1022,19 @@ "prettyunits", "rprojroot", "sessioninfo", + "utils", "withr", "xopen" - ] + ], + "Hash": "8f25ebe2ec38b1f2aef3b0d2ef76f6c4" }, "readr": { "Package": "readr", - "Version": "2.1.2", + "Version": "2.1.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "9c59de1357dc209868b5feb5c9f0fe2f", "Requirements": [ + "R", "R6", "cli", "clipr", @@ -748,198 +1042,286 @@ "crayon", "hms", "lifecycle", + "methods", "rlang", "tibble", "tzdb", + "utils", "vroom" - ] + ], + "Hash": "b5047343b3825f37ad9d3b5d89aa1078" }, "rematch2": { "Package": "rematch2", "Version": "2.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "76c9e04c712a05848ae7a23d2f170a40", "Requirements": [ "tibble" - ] + ], + "Hash": "76c9e04c712a05848ae7a23d2f170a40" }, "remotes": { "Package": "remotes", "Version": "2.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "227045be9aee47e6dda9bb38ac870d67", - "Requirements": [] + "Requirements": [ + "R", + "methods", + "stats", + "tools", + "utils" + ], + "Hash": "227045be9aee47e6dda9bb38ac870d67" }, "renv": { "Package": "renv", - "Version": "0.15.5", + "Version": "0.17.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "6a38294e7d12f5d8e656b08c5bd8ae34", - "Requirements": [] + "Requirements": [ + "utils" + ], + "Hash": "4543b8cd233ae25c6aba8548be9e747e" }, "rex": { "Package": "rex", "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "ae34cd56890607370665bee5bd17812f", "Requirements": [ "lazyeval" - ] + ], + "Hash": "ae34cd56890607370665bee5bd17812f" }, "rlang": { "Package": "rlang", - "Version": "1.0.3", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "9103a8f74b2114a5ed1136b471d8feca", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.14", + "Version": "2.21", "Source": "Repository", "Repository": "CRAN", - "Hash": "31b60a882fabfabf6785b8599ffeb8ba", "Requirements": [ + "R", "bslib", "evaluate", + "fontawesome", "htmltools", "jquerylib", "jsonlite", "knitr", + "methods", "stringr", "tinytex", + "tools", + "utils", "xfun", "yaml" - ] + ], + "Hash": "493df4ae51e2e984952ea4d5c75786a3" }, "roxygen2": { "Package": "roxygen2", - "Version": "7.2.1", + "Version": "7.2.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "da1f278262e563c835345872f2fef537", "Requirements": [ + "R", "R6", "brew", "cli", "commonmark", "cpp11", "desc", - "digest", "knitr", + "methods", "pkgload", "purrr", "rlang", "stringi", "stringr", + "utils", "withr", "xml2" - ] + ], + "Hash": "7b153c746193b143c14baa072bae4e27" }, "rprojroot": { "Package": "rprojroot", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "1de7ab598047a87bba48434ba35d497d", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "1de7ab598047a87bba48434ba35d497d" }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.13", + "Version": "0.14", "Source": "Repository", "Repository": "CRAN", - "Hash": "06c85365a03fdaf699966cc1d3cf53ea", - "Requirements": [] + "Hash": "690bd2acc42a9166ce34845884459320" }, "rversions": { "Package": "rversions", - "Version": "2.1.1", + "Version": "2.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f88fab00907b312f8b23ec13e2d437cb", "Requirements": [ "curl", + "utils", "xml2" - ] + ], + "Hash": "a9881dfed103e83f9de151dc17002cd1" }, "sass": { "Package": "sass", - "Version": "0.4.1", + "Version": "0.4.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "f37c0028d720bab3c513fd65d28c7234", "Requirements": [ "R6", "fs", "htmltools", "rappdirs", "rlang" - ] + ], + "Hash": "cc3ec7dd33982ef56570229b62d6388e" }, "sessioninfo": { "Package": "sessioninfo", "Version": "1.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "3f9796a8d0a0e8c6eb49a4b029359d1f", "Requirements": [ - "cli" - ] + "R", + "cli", + "tools", + "utils" + ], + "Hash": "3f9796a8d0a0e8c6eb49a4b029359d1f" + }, + "shiny": { + "Package": "shiny", + "Version": "1.7.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "bslib", + "cachem", + "commonmark", + "crayon", + "ellipsis", + "fastmap", + "fontawesome", + "glue", + "grDevices", + "htmltools", + "httpuv", + "jsonlite", + "later", + "lifecycle", + "methods", + "mime", + "promises", + "rlang", + "sourcetools", + "tools", + "utils", + "withr", + "xtable" + ], + "Hash": "c2eae3d8c670fa9dfa35a12066f4a1d5" }, "sodium": { "Package": "sodium", "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "3606bb09e0914edd4fc8313b500dcd5e", - "Requirements": [] + "Hash": "3606bb09e0914edd4fc8313b500dcd5e" + }, + "sourcetools": { + "Package": "sourcetools", + "Version": "0.1.7-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "5f5a7629f956619d519205ec475fe647" }, "stringi": { "Package": "stringi", - "Version": "1.7.6", + "Version": "1.7.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "bba431031d30789535745a9627ac9271", - "Requirements": [] + "Requirements": [ + "R", + "stats", + "tools", + "utils" + ], + "Hash": "ca8bd84263c77310739d2cf64d84d7c9" }, "stringr": { "Package": "stringr", - "Version": "1.4.0", + "Version": "1.5.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "0759e6b6c0957edb1311028a49a35e76", "Requirements": [ + "R", + "cli", "glue", + "lifecycle", "magrittr", - "stringi" - ] + "rlang", + "stringi", + "vctrs" + ], + "Hash": "671a4d384ae9d32fc47a14e98bfa3dc8" }, "sys": { "Package": "sys", - "Version": "3.4", + "Version": "3.4.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "34c16f1ef796057bfa06d3f4ff818a5d" + }, + "systemfonts": { + "Package": "systemfonts", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "b227d13e29222b4574486cfcbde077fa", - "Requirements": [] + "Requirements": [ + "R", + "cpp11" + ], + "Hash": "90b28393209827327de889f49935140a" }, "testthat": { "Package": "testthat", - "Version": "3.1.4", + "Version": "3.1.8", "Source": "Repository", "Repository": "CRAN", - "Hash": "f76c2a02d0fdc24aa7a47ea34261a6e3", "Requirements": [ + "R", "R6", "brio", "callr", "cli", - "crayon", "desc", "digest", "ellipsis", @@ -947,93 +1329,130 @@ "jsonlite", "lifecycle", "magrittr", + "methods", "pkgload", "praise", "processx", "ps", "rlang", + "utils", "waldo", "withr" - ] + ], + "Hash": "e0eded5dd915510f8e0d6e6277506203" + }, + "textshaping": { + "Package": "textshaping", + "Version": "0.3.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "systemfonts" + ], + "Hash": "1ab6223d3670fac7143202cb6a2d43d5" }, "tibble": { "Package": "tibble", - "Version": "3.1.7", + "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "08415af406e3dd75049afef9552e7355", "Requirements": [ - "ellipsis", + "R", "fansi", "lifecycle", "magrittr", + "methods", "pillar", "pkgconfig", "rlang", + "utils", "vctrs" - ] + ], + "Hash": "a84e2cc86d07289b3b6f5069df7a004c" }, "tidyr": { "Package": "tidyr", - "Version": "1.2.0", + "Version": "1.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "d8b95b7fee945d7da6888cf7eb71a49c", "Requirements": [ + "R", + "cli", "cpp11", "dplyr", - "ellipsis", "glue", "lifecycle", "magrittr", "purrr", "rlang", + "stringr", "tibble", "tidyselect", + "utils", "vctrs" - ] + ], + "Hash": "e47debdc7ce599b070c8e78e8ac0cfcf" }, "tidyselect": { "Package": "tidyselect", - "Version": "1.1.2", + "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "17f6da8cfd7002760a859915ce7eef8f", "Requirements": [ - "ellipsis", + "R", + "cli", "glue", - "purrr", + "lifecycle", "rlang", - "vctrs" - ] + "vctrs", + "withr" + ], + "Hash": "79540e5fcd9e0435af547d885f184fd5" }, "tinytex": { "Package": "tinytex", - "Version": "0.40", + "Version": "0.45", "Source": "Repository", "Repository": "CRAN", - "Hash": "e7b654da5e77bc4e5435a966329cd25f", "Requirements": [ "xfun" - ] + ], + "Hash": "e4e357f28c2edff493936b6cb30c3d65" }, "tzdb": { "Package": "tzdb", "Version": "0.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b2e1cbce7c903eaf23ec05c58e59fb5e", "Requirements": [ + "R", "cpp11" - ] + ], + "Hash": "b2e1cbce7c903eaf23ec05c58e59fb5e" + }, + "urlchecker": { + "Package": "urlchecker", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "curl", + "tools", + "xml2" + ], + "Hash": "409328b8e1253c8d729a7836fe7f7a16" }, "usethis": { "Package": "usethis", "Version": "2.1.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "a67a22c201832b12c036cc059f1d137d", "Requirements": [ + "R", "cli", "clipr", "crayon", @@ -1050,38 +1469,45 @@ "rlang", "rprojroot", "rstudioapi", + "stats", + "utils", "whisker", "withr", "yaml" - ] + ], + "Hash": "a67a22c201832b12c036cc059f1d137d" }, "utf8": { "Package": "utf8", - "Version": "1.2.2", + "Version": "1.2.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "c9c462b759a5cc844ae25b5942654d13", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "1fe17157424bb09c48a8b3b550c753bc" }, "vctrs": { "Package": "vctrs", - "Version": "0.4.1", + "Version": "0.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "8b54f22e2a58c4f275479c92ce041a57", "Requirements": [ + "R", "cli", "glue", + "lifecycle", "rlang" - ] + ], + "Hash": "a745bda7aff4734c17294bb41d4e4607" }, "vroom": { "Package": "vroom", - "Version": "1.5.7", + "Version": "1.6.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "976507b5a105bc3bdf6a5a5f29e0684f", "Requirements": [ + "R", "bit64", "cli", "cpp11", @@ -1089,96 +1515,123 @@ "glue", "hms", "lifecycle", + "methods", "progress", "rlang", + "stats", "tibble", "tidyselect", "tzdb", "vctrs", "withr" - ] + ], + "Hash": "8318e64ffb3a70e652494017ec455561" }, "waldo": { "Package": "waldo", - "Version": "0.4.0", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "035fba89d0c86e2113120f93301b98ad", "Requirements": [ "cli", "diffobj", "fansi", "glue", + "methods", "rematch2", "rlang", "tibble" - ] + ], + "Hash": "2c993415154cdb94649d99ae138ff5e5" }, "whisker": { "Package": "whisker", - "Version": "0.4", + "Version": "0.4.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "ca970b96d894e90397ed20637a0c1bbe", - "Requirements": [] + "Hash": "c6abfa47a46d281a7d5159d0a8891e88" }, "withr": { "Package": "withr", "Version": "2.5.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c0e49a9760983e81e55cdd9be92e7182", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats" + ], + "Hash": "c0e49a9760983e81e55cdd9be92e7182" }, "xfun": { "Package": "xfun", - "Version": "0.31", + "Version": "0.39", "Source": "Repository", "Repository": "CRAN", - "Hash": "a318c6f752b8dcfe9fb74d897418ab2b", - "Requirements": [] + "Requirements": [ + "stats", + "tools" + ], + "Hash": "8f56e9acb54fb525e66464d57ab58bcb" }, "xml2": { "Package": "xml2", - "Version": "1.3.3", + "Version": "1.3.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "40682ed6a969ea5abfd351eb67833adc", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "7dc765ac9b909487326a7d471fdd3821" }, "xmlparsedata": { "Package": "xmlparsedata", "Version": "1.0.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "45e4bf3c46476896e821fc0a408fb4fc", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "45e4bf3c46476896e821fc0a408fb4fc" }, "xopen": { "Package": "xopen", "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "6c85f015dee9cc7710ddd20f86881f58", "Requirements": [ + "R", "processx" - ] + ], + "Hash": "6c85f015dee9cc7710ddd20f86881f58" + }, + "xtable": { + "Package": "xtable", + "Version": "1.8-4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats", + "utils" + ], + "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2" }, "yaml": { "Package": "yaml", - "Version": "2.3.5", + "Version": "2.3.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "458bb38374d73bf83b1bb85e353da200", - "Requirements": [] + "Hash": "0d0056cc5383fbc240ccd0cb584bf436" }, "zip": { "Package": "zip", - "Version": "2.2.0", + "Version": "2.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c7eef2996ac270a18c2715c997a727c5", - "Requirements": [] + "Hash": "d98c94dacb7e0efcf83b0a133a705504" } } } diff --git a/tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/settings.json-3b3c4f.json b/tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/settings.json-3b3c4f.json new file mode 100644 index 00000000..cb827030 --- /dev/null +++ b/tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/settings.json-3b3c4f.json @@ -0,0 +1 @@ +{"groups": [{"code": "G1", "name": "General Service Statistics", "members": ["D21"], "displayName": "General Service Statistics"}, {"code": "G2", "name": "Maternal Health", "members": ["D1", "D2", "D40", "D29", "D19"], "displayName": "Maternal Health"}, {"code": "G3", "name": "Immunization", "members": ["D3", "D4", "D10", "D24", "D12", "D13", "D25"], "displayName": "Immunization"}, {"code": "G4", "name": "HIV/Aids", "members": ["D6", "D16", "D42", "D26", "D27"], "displayName": "HIV/Aids"}, {"code": "G5", "name": "TB", "members": ["D5", "D30", "D34", "D37"], "displayName": "TB"}, {"code": "G6", "name": "TB/HIV", "members": ["D31", "D32"], "displayName": "TB/HIV"}, {"code": "G7", "name": "Malaria", "members": ["D8", "D9", "D35", "D23", "D41", "D36"], "displayName": "Malaria"}], "dataSets": [], "numerators": [{"code": "D21", "name": "OPD visits", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Total number of outpatient visits", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D1", "name": "ANC 1", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Pregnant women attending at least one ANC visit during their pregnancy", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D40", "name": "ANC 4", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Pregnant women attending at least four ANC visit during their pregnancy", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D2", "name": "Institutional deliveries", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Deliveries in health facilities", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D23", "name": "IPTp 3", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Pregnant women attending antenatal clinics who received three or more doses of intermittent preventive treatment (IPTp) for malaria.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D36", "name": "IPTp 1", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Pregnant women attending antenatal clinics who received at least one dose of intermittent preventive treatment (IPTp) for malaria.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D3", "name": "DPT 3", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Children receiving 3rd dose of DPT-containing-vaccine (PENTA)", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D4", "name": "MCV 1", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Children receiving 1st dose of MCV.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D5", "name": "TB cases (all forms) notified", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "TB cases (all forms) that have been notified.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D37", "name": "TB cases registered for treatment", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "TB cases registered (for treatment), e.g. as reported in treatment outcome reporting forms.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D30", "name": "TB cases successfully treated", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "TB cases successfully treated (cured plus treatment completed) among TB cases notified to the national health authorities in a specified time period.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D31", "name": "TB cases tested for HIV", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "New and relapse TB patients who had an HIV test recorded in the TB register.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D32", "name": "HIV-positive TB cases initiating ART", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "HIV-positive new and relapse TB patients who received ART during TB treatment", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D34", "name": "MDR-TB cases successfully treated", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Bacteriologically-confirmed RR and/or MDR-TB cases enrolled on second-line anti-TB treatment during the year of assessment who are successfully treated (cured plus completed treatment).", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D8", "name": "Confirmed malaria cases", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Confirmed malaria cases reported.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D41", "name": "Confirmed malaria treated", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Confirmed malaria cases that received first-line antimalarial treatment.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D9", "name": "Malaria cases treated", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Malaria cases (presumed and confirmed) that received first line antimalarial treatment.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D35", "name": "Malaria cases tested", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Suspected malaria cases that received a parasitological test.", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D10", "name": "DPT 1", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Children receiving 1st dose DPT-containing-vaccine (PENTA)", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D24", "name": "DPT 2", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Children receiving 2nd dose DPT-containing-vaccine (PENTA)", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D12", "name": "PCV 1", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Children receiving 1st dose of PCV-vaccine", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D25", "name": "PCV 2", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Children receiving 2nd dose of PCV-vaccine", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D13", "name": "PCV 3", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Children receiving 3rd dose of PCV-vaccine", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D16", "name": "PLHIV on ART", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "PLHIV receiving ART", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D6", "name": "Virally supressed ART-clients", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "PLHIV on ART who are virally supressed", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D26", "name": "Retained on ART 12 months after initiation", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "PLHIV still on ART 12 months after initiation (retention)", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D27", "name": "PLHIV in HIV care", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "PLHIV receiving HIV care (pre-ART and ART)", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D42", "name": "Pregnant women on ART (PMTCT)", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "HIV-positive pregnant women on ART (PMTCT)", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D29", "name": "Postpartum care within 2 days (PNC)", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Mothers and babies who received postpartum care within two days of childbirth", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}, {"code": "D19", "name": "Pregnant women receiving TT 1", "trend": "constant", "custom": false, "dataID": null, "missing": 90, "comparison": "ou", "definition": "Pregnant women who received the 1st dose of tetanus-toxoid vaccine", "consistency": 33, "extremeOutlier": 3, "moderateOutlier": 2}], "denominators": [{"code": "P1", "type": "un", "dataID": "", "lowLevel": 1}, {"code": "P2", "type": "plhiv", "dataID": "", "lowLevel": 1}, {"code": "P3", "type": "lt1", "dataID": "", "lowLevel": 1}, {"code": "P4", "type": "ep", "dataID": "", "lowLevel": 1}, {"code": "P5", "type": "total", "dataID": "", "lowLevel": 1}], "coreIndicators": ["D1", "D3", "D27", "D5", "D8"], "metaDataVersion": "1.1", "externalRelations": [{"code": "ER1", "name": "ANC 1 coverage - routine to survey", "level": null, "criteria": 33, "dataType": "", "numerator": "D1", "denominator": "P4", "externalData": ""}, {"code": "ER2", "name": "DPT 3 coverage - routine to survey", "level": null, "criteria": 33, "dataType": "", "numerator": "D3", "denominator": "P3", "externalData": ""}, {"code": "ER3", "name": "ART coverage - routine to survey", "level": null, "criteria": 33, "dataType": "", "numerator": "D16", "denominator": "P2", "externalData": ""}], "numeratorRelations": [{"A": "D1", "B": "D19", "code": "R1", "name": "ANC 1 - TT1 ratio", "type": "eq", "criteria": 10}, {"A": "D1", "B": "D36", "code": "R4", "name": "ANC 1 - IPTp1 ratio", "type": "eq", "criteria": 10}, {"A": "D10", "B": "D3", "code": "R2", "name": "DPT 1 to 3 dropout rate", "type": "do", "criteria": null}, {"A": "D27", "B": "D16", "code": "R3", "name": "PLHIV in care to PLHIV on ART", "type": "eq", "criteria": 10}, {"A": "D5", "B": "D37", "code": "R5", "name": "TB cases notified to TB cases registered for treatment", "type": "eq", "criteria": 10}, {"A": "D8", "B": "D41", "code": "R6", "name": "Confirmed malaria cases to confirmed malaria cases treated", "type": "eq", "criteria": 10}, {"A": "D35", "B": "D9", "code": "R7", "name": "Malaria cases tested to malaria cases treated", "type": "eq", "criteria": 10}], "denominatorRelations": [{"A": "P5", "B": "P1", "code": "PR1", "name": "Total population - census to UN projection", "type": "un", "criteria": 10}]} \ No newline at end of file diff --git a/tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/test-dataStore.R b/tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/test-dataStore.R new file mode 100644 index 00000000..8420dfe4 --- /dev/null +++ b/tests/testthat/play.dhis2.org/2.36.3/api/dataStore/dataQualityTool/test-dataStore.R @@ -0,0 +1,52 @@ +# code to create/update mocks +# library(httptest) +# # +# httptest::start_capturing(simplify = FALSE) +# httr::content( +# httr::GET("https://play.dhis2.org/2.36.3/api/dataStore/metabase/repositories", +# httr::authenticate("admin", "district")) +# ) +# +# httr::content( +# httr::GET("https://play.dhis2.org/2.36.3/api/dataStore/metabase/foo", +# httr::authenticate("admin", "district")) +# ) +# +# httptest::stop_capturing() + +context("Get a datastore key") +with_mock_api({ + + test_that("Get a datstore object ", { + + data <- getDataStoreKey("dataQualityTool", "settings", d2_session = play2363) + + testthat::expect_type(data, "list") + testthat::expect_equal(length(data), 2) + rm(data) }) + + test_that("Can error with missing namespace", { + expect_error(getDataStoreKey(NA, "settings", d2_session = play2363)) + }) + + test_that("Can error with missing key", { + expect_error(getDataStoreKey("dataQualityTool", NA, d2_session = play2363)) + }) + + test_that("Can error with a list as namespace", { + expect_warning(data <- getDataStoreKey("metabase", "foo", d2_session = play2363), + "The requested datastore object could not be found") + expect_null(data) + + + test_that("Can get a list of namespace keys" ,{ + mykeys <- getDataStoreNamespaceKeys("metabase", d2_session = play2363) + + expect_identical(mykeys, "repositories") + }) + + }) + + + +}) diff --git a/tests/testthat/test-dataStore.R b/tests/testthat/test-dataStore.R index 1725a4a0..4b8d92f1 100644 --- a/tests/testthat/test-dataStore.R +++ b/tests/testthat/test-dataStore.R @@ -19,24 +19,37 @@ with_mock_api({ test_that("Get a datstore object ", { - data <- getDataStoreKey("metabase", "repositories", d2_session = play2363) + data <- getDataStoreKey("dedupe", "periodSettings", d2_session = test) - testthat::expect_type(data, "list") - testthat::expect_equal(length(data), 2) - rm(data) }) + expect_named(data, c("RESULTS", "TARGETS")) + + expect_type(data, "list") + expect_equal(length(data), 2) + }) test_that("Can error with missing namespace", { - expect_error(getDataStoreKey(NA, "repositories", d2_session = play2363)) + expect_error(getDataStoreKey(NA, "bar", d2_session = test)) }) test_that("Can error with missing key", { - expect_error(getDataStoreKey("repositories", NA, d2_session = play2363)) + expect_error(getDataStoreKey("foo", NA, d2_session = test)) }) test_that("Can error with a list as namespace", { - expect_warning(data <- getDataStoreKey("metabase", "foo", d2_session = play2363), - "The requested datastore object could not be found") + expect_warning(data <- getDataStoreKey("dataQualityTool", "foo", d2_session = test), + "api/dataStore/dataQualityTool/foo could not be retreived from the server") expect_null(data) + + test_that("Can get a list of namespace keys", { + mykeys <- getDataStoreNamespaceKeys("dedupe", d2_session = test) + expect_setequal(mykeys, c("crosswalks", "periodSettings", "report", "reportSettings")) + }) + + test_that("Can get a list of namespaces from the datastore", { + mynamespaces <- getDataStoreNamespaces(d2_session = test) + expect_true(inherits(mynamespaces, "list")) + }) + }) diff --git a/tests/testthat/test.datim.org/api/dataStore.json-3b3c4f.json b/tests/testthat/test.datim.org/api/dataStore.json-3b3c4f.json new file mode 100644 index 00000000..a88aefd4 --- /dev/null +++ b/tests/testthat/test.datim.org/api/dataStore.json-3b3c4f.json @@ -0,0 +1,17 @@ +[ + "weeklyMaintenance", + "approvals", + "accessRequests", + "dataSetAssignments", + "approvalsDashboard", + "register", + "integrityChecks", + "dashboard-information", + "CSD-Loader-Last-Import", + "hrhProcessor", + "tracker-capture", + "dhiApp", + "dedupe", + "erbProcessor", + "dataElementCadence" +] diff --git a/tests/testthat/test.datim.org/api/dataStore/dataQualityTool/foo.json-3b3c4f.R b/tests/testthat/test.datim.org/api/dataStore/dataQualityTool/foo.json-3b3c4f.R new file mode 100644 index 00000000..fd3679b1 --- /dev/null +++ b/tests/testthat/test.datim.org/api/dataStore/dataQualityTool/foo.json-3b3c4f.R @@ -0,0 +1,22 @@ +structure(list(url = "https://test.datim.org/api/dataStore/dataQualityTool/foo.json?paging=false", + status_code = 404L, headers = structure(list(server = "nginx", + date = "Wed, 10 May 2023 04:55:38 GMT", `content-type` = "application/json;charset=UTF-8", + `cache-control` = "no-cache, private", `x-content-type-options` = "nosniff", + `x-xss-protection` = "1; mode=block", `x-frame-options` = "SAMEORIGIN", + `strict-transport-security` = "max-age=63072000; includeSubdomains; preload", + `content-encoding` = "gzip"), class = c("insensitive", + "list")), all_headers = list(list(status = 404L, version = "HTTP/2", + headers = structure(list(server = "nginx", date = "Wed, 10 May 2023 04:55:38 GMT", + `content-type` = "application/json;charset=UTF-8", + `cache-control` = "no-cache, private", `x-content-type-options` = "nosniff", + `x-xss-protection` = "1; mode=block", `x-frame-options` = "SAMEORIGIN", + `strict-transport-security` = "max-age=63072000; includeSubdomains; preload", + `content-encoding` = "gzip"), class = c("insensitive", + "list")))), cookies = structure(list(domain = "#HttpOnly_test.datim.org", + flag = FALSE, path = "/", secure = TRUE, expiration = structure(Inf, class = c("POSIXct", + "POSIXt")), name = "JSESSIONID", value = "REDACTED"), row.names = c(NA, + -1L), class = "data.frame"), content = charToRaw("{\"httpStatus\":\"Not Found\",\"httpStatusCode\":404,\"status\":\"ERROR\",\"message\":\"Key 'foo' not found in namespace 'dataQualityTool'\"}"), + date = structure(1683694538, class = c("POSIXct", "POSIXt" + ), tzone = "GMT"), times = c(redirect = 0, namelookup = 2.9e-05, + connect = 2.9e-05, pretransfer = 0.000105, starttransfer = 0.141035, + total = 0.141067)), class = "response") diff --git a/tests/testthat/test.datim.org/api/dataStore/dedupe.json-3b3c4f.json b/tests/testthat/test.datim.org/api/dataStore/dedupe.json-3b3c4f.json new file mode 100644 index 00000000..57e7c744 --- /dev/null +++ b/tests/testthat/test.datim.org/api/dataStore/dedupe.json-3b3c4f.json @@ -0,0 +1,6 @@ +[ +"crosswalks", +"periodSettings", +"report", +"reportSettings" +] \ No newline at end of file diff --git a/tests/testthat/test.datim.org/api/dataStore/dedupe/periodSettings.json-3b3c4f.json b/tests/testthat/test.datim.org/api/dataStore/dedupe/periodSettings.json-3b3c4f.json new file mode 100644 index 00000000..06652f6a --- /dev/null +++ b/tests/testthat/test.datim.org/api/dataStore/dedupe/periodSettings.json-3b3c4f.json @@ -0,0 +1 @@ +{"RESULTS": {"2017Q1": {"end": "2017-04-01T21:00:00+00:00", "start": "2017-09-29T20:00:00+00:00", "datasets": ["kkXf2zXqTM0", "K7FMzevlBAp", "MqNLEXmzIzr", "UZ2PLqSe5Ri", "LWE9GdlygD5", "CGoi5wjLHDy"]}, "2017Q3": {"end": "2017-12-22T20:00:00+00:00", "start": "2017-09-29T20:00:00+00:00", "datasets": ["O3VMNi8EZSV", "Ir58H3zBKEC", "uTvHPA1zqzi", "asptuHohmHt", "kuV7OezWYUj", "jTRF4LdklYA"]}, "2018Q1": {"end": "2018-06-22T15:00:00+00:00", "start": "2018-06-01T15:00:00+00:00", "datasets": ["WbszaIdCi92", "tz1bQ3ZwUKJ", "IZ71Y2mEBJF", "uN01TT331OP", "BxIx51zpAjh", "mByGopCrDvL"]}, "2018Q2": {"end": "2018-09-21T19:00:00+00:00", "start": "2018-08-31T19:00:00+00:00", "datasets": ["WbszaIdCi92", "tz1bQ3ZwUKJ", "IZ71Y2mEBJF", "uN01TT331OP", "BxIx51zpAjh", "mByGopCrDvL"]}, "2018Q3": {"end": "2018-12-21T15:00:00+00:00", "start": "2018-12-03T00:00:00+00:00", "datasets": ["WbszaIdCi92", "tz1bQ3ZwUKJ", "IZ71Y2mEBJF", "uN01TT331OP", "BxIx51zpAjh", "mByGopCrDvL"]}, "2018Q4": {"end": "2019-12-20T05:00:00+00:00", "start": "2019-12-18T05:00:00+00:00", "datasets": ["zUoy5hk8r0q", "PyD4x9oFwxJ", "KWRj80vEfHU", "fi9yMqWLWVy", "IZ71Y2mEBJF", "ndp6aR3e1X3"]}, "2019Q1": {"end": "2019-12-20T05:00:00+00:00", "start": "2019-12-18T05:00:00+00:00", "datasets": ["zUoy5hk8r0q", "PyD4x9oFwxJ", "KWRj80vEfHU", "fi9yMqWLWVy", "IZ71Y2mEBJF", "ndp6aR3e1X3"]}, "2019Q2": {"end": "2019-12-20T05:00:00+00:00", "start": "2019-12-18T05:00:00+00:00", "datasets": ["zUoy5hk8r0q", "PyD4x9oFwxJ", "KWRj80vEfHU", "fi9yMqWLWVy", "IZ71Y2mEBJF", "ndp6aR3e1X3"]}, "2019Q3": {"end": "2020-05-08T21:00:00+00:00", "start": "2019-11-30T00:00:00+00:00", "datasets": ["zUoy5hk8r0q", "PyD4x9oFwxJ", "KWRj80vEfHU", "fi9yMqWLWVy", "IZ71Y2mEBJF", "ndp6aR3e1X3"]}, "2019Q4": {"end": "2020-05-21T19:00:00+00:00", "start": "2020-01-05T20:00:00+00:00", "datasets": ["qzVASYuaIey", "BPEyzcDb8fT", "jKdHXpBfWop", "em1U5x9hhXh", "biO64JF8Ait"]}, "2020Q1": {"end": "2020-07-08T00:00:00+00:00", "start": "2020-03-31T22:00:00+00:00", "datasets": ["qzVASYuaIey", "BPEyzcDb8fT", "jKdHXpBfWop", "em1U5x9hhXh", "biO64JF8Ait"]}, "2020Q2": {"end": "2020-09-18T19:00:00+00:00", "start": "2020-06-30T22:00:00+00:00", "datasets": ["qzVASYuaIey", "BPEyzcDb8fT", "jKdHXpBfWop", "em1U5x9hhXh", "biO64JF8Ait"]}, "2020Q3": {"end": "2020-12-18T15:00:00+00:00", "start": "2020-09-30T22:00:00+00:00", "datasets": ["qzVASYuaIey", "BPEyzcDb8fT", "jKdHXpBfWop", "em1U5x9hhXh", "biO64JF8Ait"]}, "2020Q4": {"end": "2021-03-18T19:00:00+00:00", "start": "2021-01-05T22:00:00+00:00", "datasets": ["TBcmmtoaCBC", "BPEyzcDb8fT", "zL8TlPVzEBZ", "em1U5x9hhXh", "e8pCA4xmEw9"]}, "2021Q1": {"end": "2021-06-17T19:00:00+00:00", "start": "2021-03-31T22:00:00+00:00", "datasets": ["TBcmmtoaCBC", "BPEyzcDb8fT", "zL8TlPVzEBZ", "em1U5x9hhXh", "e8pCA4xmEw9"]}, "2021Q2": {"end": "2021-09-16T19:00:00+00:00", "start": "2021-06-30T22:00:00+00:00", "datasets": ["TBcmmtoaCBC", "BPEyzcDb8fT", "zL8TlPVzEBZ", "em1U5x9hhXh", "e8pCA4xmEw9"]}, "2021Q3": {"end": "2021-12-01T19:00:00+00:00", "start": "2021-09-30T22:00:00+00:00", "datasets": ["TBcmmtoaCBC", "BPEyzcDb8fT", "zL8TlPVzEBZ", "em1U5x9hhXh", "e8pCA4xmEw9"]}, "2021Q4": {"end": "2022-03-17T19:00:00+00:00", "start": "2022-01-04T13:00:00+00:00", "datasets": ["HfhTPdnRWES", "HrozVxNYFJy", "BHlhyPmRTUY", "GEBcXhZw0fD", "UzHGIQFaNeT"]}, "2022Q1": {"end": "2022-06-16T19:00:00+00:00", "start": "2022-04-01T01:00:00+00:00", "datasets": ["HfhTPdnRWES", "HrozVxNYFJy", "BHlhyPmRTUY", "GEBcXhZw0fD", "UzHGIQFaNeT"]}, "2022Q2": {"end": "2022-09-15T19:00:00+00:00", "start": "2022-07-01T01:00:00+00:00", "datasets": ["HfhTPdnRWES", "HrozVxNYFJy", "BHlhyPmRTUY", "GEBcXhZw0fD", "UzHGIQFaNeT"]}, "2022Q3": {"end": "2022-12-15T19:00:00+00:00", "start": "2022-10-03T01:00:00+00:00", "datasets": ["HfhTPdnRWES", "HrozVxNYFJy", "BHlhyPmRTUY", "GEBcXhZw0fD", "UzHGIQFaNeT"]}, "2022Q4": {"end": "2023-03-16T19:00:00+00:00", "start": "2023-01-04T13:00:00+00:00", "datasets": ["H4N0I02dn1L", "mIogpOrWQt3", "iU1zca2XkDh", "s2XLkUIr1pZ", "cgz9FFudOED"]}, "2023Q1": {"end": "2023-05-13T19:00:00+00:00", "start": "2023-04-01T01:00:00+00:00", "datasets": ["H4N0I02dn1L", "mIogpOrWQt3", "iU1zca2XkDh", "s2XLkUIr1pZ", "cgz9FFudOED"]}}, "TARGETS": {"2017Oct": {"end": "2017-01-27T22:00:00+00:00", "start": "2017-01-27T22:00:00+00:00", "datasets": ["YWZrOj5KS1c", "BuRoS9i851o", "ePndtmDbOJj", "AitXBHsC7RA"]}, "2018Oct": {"end": "2019-11-15T04:00:00+00:00", "start": "2019-09-18T00:00:00+00:00", "datasets": ["l796jk9SW7q", "BWBS39fydnX", "eyI0UOWJnDk", "X8sn5HE5inC"]}, "2019Oct": {"end": "2021-04-08T08:00:00+00:00", "start": "2019-02-08T00:00:00+00:00", "datasets": ["nIHNMxuPUOR", "C2G7IyPPrvD", "sBv1dj90IX6", "HiJieecLXxN"]}, "2020Oct": {"end": "2021-04-08T06:30:00+00:00", "start": "2020-02-14T21:00:00+00:00", "datasets": ["Pmc0yYAIi1t", "s1sxJuqXsvV"]}, "2021Oct": {"end": "2021-06-15T10:00:00+00:00", "start": "2021-04-01T21:00:00+00:00", "datasets": ["YfZot37BbTm", "cihuwjoY5xP"]}, "2022Oct": {"end": "2022-06-15T10:00:00+00:00", "start": "2022-04-01T21:00:00+00:00", "datasets": ["iADcaCD5YXh", "o71WtN5JrUu"]}, "2023Oct": {"end": "2022-06-15T10:00:00+00:00", "start": "2022-04-01T21:00:00+00:00", "datasets": ["dA9C5bL44NX", "A2GxohPT9Hw"]}}} \ No newline at end of file