IQSS / dataverse-client-javascript

A Dataverse client for JavaScript and TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modify Dataverse API calls to use 'excludeFiles' parameter

ekraffmiller opened this issue · comments

In this Dataverse PR the Dataverse API has changed to use 'excludeFiles' instead of 'includeFiles'. So the library calls to Dataverse need to use this new parameter.
IQSS/dataverse#10191

For the SPA, we need to be able to show the View Dataset page for the Deaccessioned dataset, whether or not the user has edit permissions on the dataset. So we can get the dataset by using parameters includeDeaccessioned=true & excludeFiles=true.

From the Dataverse ticket:

We agreed to change the parameter name from includeFiles with excludeFiles, this is the default and the lack of the parameter will default to false so files are expected to be included by default if this parameter is not provided.

getVersionFiles, getVersionFileCounts and getDownloadSize act exactly as before, this check would execute every time includeDeaccessioned was set to true, getDatasetVersionCitation will skip this test when includeDeaccessioned is true and getVersion will check for when includeDeaccessioned is true and excludeFiles is false. This change also replaced includeFiles with excludeFiles which is the default behaviour.

This change required to update Datasets.getDatasetVersionOrDie which impacted the following methods:

getVersion {id}/versions/{versionId: Will check file permissions when files when excludeFiles and includeDeaccessioned are true.
getVersionFiles {id}/versions/{versionId}/files: Will check file permissions when includeDeaccessioned is true.
getVersionFileCounts {id}/versions/{versionId}/files/counts: Will check file permissions when includeDeaccessioned is true.
getDownloadSize {identifier}/versions/{versionId}/downloadsize: Will check file permissions when includeDeaccessioned is true.
getDatasetVersionCitation {id}/versions/{versionId}/citation: Won't check file permissions.
listVersions {id}/versions: replaced includeFiles with excludeFiles which is the default.