-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGetFileVersionSummaries.ts
More file actions
27 lines (24 loc) · 1.16 KB
/
GetFileVersionSummaries.ts
File metadata and controls
27 lines (24 loc) · 1.16 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
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { FileVersionSummarySubset } from '../models/FileVersionSummaryInfo'
import { IFilesRepository } from '../repositories/IFilesRepository'
export class GetFileVersionSummaries implements UseCase<FileVersionSummarySubset> {
private filesRepository: IFilesRepository
constructor(filesRepository: IFilesRepository) {
this.filesRepository = filesRepository
}
/**
* Returns a list of versions for a given file including a summary of differences between consecutive versions
*
* @param {number | string} [fileId] - The file 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<FileVersionSummarySubset>} - A FileVersionSummarySubset containing the summaries and total count.
*/
async execute(
fileId: number | string,
limit?: number,
offset?: number
): Promise<FileVersionSummarySubset> {
return await this.filesRepository.getFileVersionSummaries(fileId, limit, offset)
}
}