-
Notifications
You must be signed in to change notification settings - Fork 8
/
GetDatasetVersionDiff.ts
29 lines (26 loc) · 1.32 KB
/
GetDatasetVersionDiff.ts
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
29
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { IDatasetsRepository } from '../repositories/IDatasetsRepository'
import { DatasetVersionDiff } from '../models/DatasetVersionDiff'
export class GetDatasetVersionDiff implements UseCase<DatasetVersionDiff> {
private datasetsRepository: IDatasetsRepository
constructor(datasetsRepository: IDatasetsRepository) {
this.datasetsRepository = datasetsRepository
}
/**
* Returns a DatasetVersionDiff instance, which contains the differences between the two given versions.
* @param {number | string} [datasetId] - The dataset identifier, which can be a string (for persistent identifiers), or a number (for numeric identifiers).
* @param {string } [oldVersionId] - The dataset version identifier, which can be a version-specific numeric string (for example, 1.0) or a DatasetNotNumberedVersion enum value.
* @param {string } [newVersionId] - The dataset version identifier, which can be a version-specific numeric string (for example, 1.0) or a DatasetNotNumberedVersion enum value.
*/
async execute(
datasetId: number | string,
oldVersionId: string,
newVersionId: string
): Promise<DatasetVersionDiff> {
return await this.datasetsRepository.getDatasetVersionDiff(
datasetId,
oldVersionId,
newVersionId
)
}
}