OSF API queries only return up to 10 items per page, so this helper functions checks for extra pages and returns all of them
Value
a table of the returned data. When the request could not be
completed (e.g. a private, embargoed, withdrawn, or deleted resource, or
a network failure), this is an empty list() with an osf_error
attribute set to "forbidden", "not_found", "gone", or
"request_failed" (a bare NULL cannot carry attributes in R, so it
would silently discard this) – callers that only check
length(result) == 0 keep working unchanged, and callers that need to
tell "inaccessible" apart from "genuinely empty" can check
attr(result, "osf_error").
