-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGetDatasetVersionsSummaries.ts
More file actions
28 lines (25 loc) · 1.34 KB
/
GetDatasetVersionsSummaries.ts
File metadata and controls
28 lines (25 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { DatasetVersionSummarySubset } from '../models/DatasetVersionSummaryInfo'
import { IDatasetsRepository } from '../repositories/IDatasetsRepository'
export class GetDatasetVersionsSummaries implements UseCase<DatasetVersionSummarySubset> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Returns a list of versions for a given dataset including a summary of differences between consecutive versions where available.
* Draft versions will only be available to users who have permission to view unpublished drafts.
*
* @param {number | string} [datasetId] - The dataset identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
* @param {number} [limit] - Limit for pagination (optional).
* @param {number} [offset] - Offset for pagination (optional).
* @returns {Promise<DatasetVersionSummarySubset>} - A DatasetVersionSummarySubset containing the summaries and total count.
*/
async execute(
datasetId: number | string,
limit?: number,
offset?: number
): Promise<DatasetVersionSummarySubset> {
return await this.datasetsRepository.getDatasetVersionsSummaries(datasetId, limit, offset)
}
}