-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathGetDatasetVersionsSummaries.ts
More file actions
22 lines (19 loc) · 1.12 KB
/
Copy pathGetDatasetVersionsSummaries.ts
File metadata and controls
22 lines (19 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { DatasetVersionSummaryInfo } from '../models/DatasetVersionSummaryInfo'
import { IDatasetsRepository } from '../repositories/IDatasetsRepository'
export class GetDatasetVersionsSummaries implements UseCase<DatasetVersionSummaryInfo[]> {
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).
* @returns {Promise<DatasetVersionSummaryInfo[]>} - An array of DatasetVersionSummaryInfo.
*/
async execute(datasetId: number | string): Promise<DatasetVersionSummaryInfo[]> {
return await this.datasetsRepository.getDatasetVersionsSummaries(datasetId)
}
}