Skip to content

Commit

Permalink
Added: table of contents to useCases md and structure tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
GPortas committed Jan 26, 2024
1 parent 9d0dbcb commit 16cdf9a
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions docs/useCases.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,48 @@ This package exposes the functionality in the form of use cases, with the main g

The different use cases currently available in the package are classified below, according to the subdomains they target:

## Table of Contents

- [Datasets](#Datasets)
- [Datasets read use cases](#datasets-read-use-cases)
- [Get a dataset](#get-a-dataset)
- [List all datasets](#list-all-datasets)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [Conclusion](#conclusion)

## Datasets

### Read operations
### Datasets read use cases

#### Get a dataset

Returns a [Dataset](../src/datasets/domain/models/Dataset.ts) instance, given the parameters that identify it.

##### Example call:

````typescript
import { getAllDatasetPreviews } from '@iqss/dataverse-client-javascript'

/* ... */

#### [GetAllDatasetPreviews](../src/datasets/domain/useCases/GetAllDatasetPreviews.ts)
const datasetId = 'doi:10.77777/FK2/AAAAAA';
const datasetVersionId = 20;

getDataset
.execute(datasetId, datasetVersionId)
.then((dataset: Dataset) => {
/* ... */
});

/* ... */
````

*See [use case](../src/datasets/domain/useCases/GetDataset.ts)* definition.


#### List all datasets

Returns an instance of [DatasetPreviewSubset](../src/datasets/domain/models/DatasetPreviewSubset.ts) that contains reduced information for each dataset that the calling user can access in the installation.

Expand All @@ -33,11 +70,11 @@ getAllDatasetPreviews
/* ... */
````

Note that `limit` and `offset` are optional parameters for pagination.
*See [use case](../src/datasets/domain/useCases/GetAllDatasetPreviews.ts) definition*.

#### [GetDataset](../src/datasets/domain/useCases/GetDataset.ts)
Note that `limit` and `offset` are optional parameters for pagination.

TODO
The `DatasetPreviewSubset`returned instance contains a property called `totalDatasetCount` which is necessary for pagination.

## Files

Expand Down

0 comments on commit 16cdf9a

Please sign in to comment.