-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathListDatasetTreeNode.ts
More file actions
20 lines (18 loc) · 911 Bytes
/
Copy pathListDatasetTreeNode.ts
File metadata and controls
20 lines (18 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { IDatasetsRepository, ListDatasetTreeNodeParams } from '../repositories/IDatasetsRepository'
import { FileTreePage } from '../models/FileTreePage'
export class ListDatasetTreeNode implements UseCase<FileTreePage> {
constructor(private readonly datasetsRepository: IDatasetsRepository) {}
/**
* Lists the immediate children of the given folder path inside a dataset
* version, returning a single page of folders and files.
*
* Folders are returned first, then files. Both are sorted by name. Use the
* returned `nextCursor` to keep paging the same folder. The cursor is
* opaque to callers and is server-validated; an invalid cursor yields a 400
* from the API.
*/
async execute(params: ListDatasetTreeNodeParams): Promise<FileTreePage> {
return this.datasetsRepository.listDatasetTreeNode(params)
}
}