@@ -37,6 +37,7 @@ The different use cases currently available in the package are classified below,
3737 - [ Create a Dataset] ( #create-a-dataset )
3838 - [ Update a Dataset] ( #update-a-dataset )
3939 - [ Publish a Dataset] ( #publish-a-dataset )
40+ - [ Deaccession a Dataset] ( #deaccession-a-dataset )
4041- [ Files] ( #Files )
4142 - [ Files read use cases] ( #files-read-use-cases )
4243 - [ Get a File] ( #get-a-file )
@@ -50,6 +51,8 @@ The different use cases currently available in the package are classified below,
5051 - [ List Files in a Dataset] ( #list-files-in-a-dataset )
5152 - [ Files write use cases] ( #files-write-use-cases )
5253 - [ File Uploading Use Cases] ( #file-uploading-use-cases )
54+ - [ Delete a File] ( #delete-a-file )
55+ - [ Restrict or Unrestrict a File] ( #restrict-or-unrestrict-a-file )
5356- [ Metadata Blocks] ( #metadata-blocks )
5457 - [ Metadata Blocks read use cases] ( #metadata-blocks-read-use-cases )
5558 - [ Get All Facetable Metadata Fields] ( #get-all-facetable-metadata-fields )
@@ -68,6 +71,8 @@ The different use cases currently available in the package are classified below,
6871 - [ Get Dataverse Backend Version] ( #get-dataverse-backend-version )
6972 - [ Get Maximum Embargo Duration In Months] ( #get-maximum-embargo-duration-in-months )
7073 - [ Get ZIP Download Limit] ( #get-zip-download-limit )
74+ - [ Contact] ( #Contact )
75+ - [ Send Feedback to Object Contacts] ( #send-feedback-to-object-contacts )
7176
7277## Collections
7378
@@ -772,6 +777,35 @@ The `versionUpdateType` parameter can be a [VersionUpdateType](../src/datasets/d
772777- ` VersionUpdateType.MAJOR `
773778- ` VersionUpdateType.UPDATE_CURRENT `
774779
780+ #### Deaccession a Dataset
781+
782+ Deaccession a Dataset, given its identifier, version, and deaccessionDatasetDTO to perform.
783+
784+ ##### Example call:
785+
786+ ``` typescript
787+ import { deaccessionDataset } from ' @iqss/dataverse-client-javascript'
788+
789+ /* ... */
790+
791+ const datasetId = 1
792+ const version = ' :latestPublished'
793+ const deaccessionDatasetDTO = {
794+ deaccessionReason: ' Description of the deaccession reason.' ,
795+ deaccessionForwardURL: ' https://demo.dataverse.org'
796+ }
797+
798+ deaccessionDataset .execute (datasetId , version , deaccessionDatasetDTO )
799+
800+ /* ... */
801+ ```
802+
803+ _ See [ use case] ( ../src/datasets/domain/useCases/DeaccessionDataset.ts ) implementation_ .
804+ The ` datasetId ` parameter can be a string for persistent identifiers, or a number for numeric identifiers.
805+ The ` version ` parameter should be a string or a [ DatasetNotNumberedVersion] ( ../src/datasets/domain/models/DatasetNotNumberedVersion.ts ) enum value.
806+
807+ You cannot deaccession a dataset more than once. If you call this endpoint twice for the same dataset version, you will get a not found error on the second call, since the dataset you are looking for will no longer be published since it is already deaccessioned.
808+
775809## Files
776810
777811### Files read use cases
@@ -1222,6 +1256,56 @@ The following error might arise from the `AddUploadedFileToDataset` use case:
12221256
12231257- AddUploadedFileToDatasetError: This error indicates that there was an error while adding the uploaded file to the dataset.
12241258
1259+ #### Delete a File
1260+
1261+ Deletes a File.
1262+
1263+ ##### Example call:
1264+
1265+ ``` typescript
1266+ import { deleteFile } from ' @iqss/dataverse-client-javascript'
1267+
1268+ /* ... */
1269+
1270+ const fileId = 12345
1271+
1272+ deleteFile .execute (fileId )
1273+
1274+ /* ... */
1275+ ```
1276+
1277+ _ See [ use case] ( ../src/files/domain/useCases/DeleteFile.ts ) implementation_ .
1278+
1279+ The ` fileId ` parameter can be a string, for persistent identifiers, or a number, for numeric identifiers.
1280+
1281+ Note that the behavior of deleting files depends on if the dataset has ever been published or not.
1282+
1283+ - If the dataset has never been published, the file will be deleted forever.
1284+ - If the dataset has published, the file is deleted from the draft (and future published versions).
1285+ - If the dataset has published, the deleted file can still be downloaded because it was part of a published version.
1286+
1287+ #### Restrict or Unrestrict a File
1288+
1289+ Restrict or unrestrict an existing file.
1290+
1291+ ##### Example call:
1292+
1293+ ``` typescript
1294+ import { restrictFile } from ' @iqss/dataverse-client-javascript'
1295+
1296+ /* ... */
1297+
1298+ const fileId = 12345
1299+
1300+ restrictFile .execute (fileId , true )
1301+
1302+ /* ... */
1303+ ```
1304+
1305+ _ See [ use case] ( ../src/files/domain/useCases/RestrictFile.ts ) implementation_ .
1306+
1307+ The ` fileId ` parameter can be a string, for persistent identifiers, or a number, for numeric identifiers.
1308+
12251309## Metadata Blocks
12261310
12271311### Metadata Blocks read use cases
@@ -1489,3 +1573,40 @@ getZipDownloadLimit.execute().then((downloadLimit: number) => {
14891573```
14901574
14911575_ See [ use case] ( ../src/info/domain/useCases/GetZipDownloadLimit.ts ) implementation_ .
1576+
1577+ ## Contact
1578+
1579+ #### Send Feedback to Object Contacts
1580+
1581+ Returns a [ Contact] ( ../src/contactInfo/domain/models/Contact.ts ) object, which contains contact return information, showing fromEmail, subject, body.
1582+
1583+ ##### Example call:
1584+
1585+ ``` typescript
1586+ import { submitContactInfo } from ' @iqss/dataverse-client-javascript'
1587+
1588+ /* ... */
1589+
1590+ const contactDTO: ContactDTO = {
1591+ targedId: 1
1592+ subject : ' Data Question' ,
1593+ body: ' Please help me understand your data. Thank you!' ,
1594+ fromEmail: ' test@gmail.com'
1595+ }
1596+
1597+ submitContactInfo .execute (contactDTO )
1598+
1599+ /* ... */
1600+ ```
1601+
1602+ _ See [ use case] ( ../src/info/domain/useCases/submitContactInfo.ts ) implementation_ .
1603+
1604+ The above example would submit feedback to all contacts of a object where the object targetId = 1.
1605+
1606+ In ContactDTO, it takes the following information:
1607+
1608+ - ** targetId** : the numeric identifier of the collection, dataset, or datafile. Persistent ids and collection aliases are not supported. (Optional)
1609+ - ** identifier** : the alias of a collection or the persistence id of a dataset or datafile. (Optional)
1610+ - ** subject** : the email subject line.
1611+ - ** body** : the email body to send.
1612+ - ** fromEmail** : the email to list in the reply-to field.
0 commit comments