-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathindex.js
41 lines (32 loc) · 1.17 KB
/
index.js
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
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
const BoxCommand = require('../../../box-command');
const { Args } = require('@oclif/core');
const PaginationUtils = require('../../../pagination-utils');
class FilesCollaborationsListCommand extends BoxCommand {
async run() {
const { flags, args } = await this.parse(FilesCollaborationsListCommand);
let options = PaginationUtils.handlePagination(flags);
if (flags.fields) {
options.fields = flags.fields;
}
let collaborations = await this.client.files.getCollaborations(args.id, options);
await this.output(collaborations);
}
}
FilesCollaborationsListCommand.aliases = [ 'files:collaborations:list' ];
FilesCollaborationsListCommand.description = 'List all collaborations on a file';
FilesCollaborationsListCommand.examples = ['box files:collaborations 11111'];
FilesCollaborationsListCommand._endpoint = 'get_files_id_collaborations';
FilesCollaborationsListCommand.flags = {
...BoxCommand.flags,
...PaginationUtils.flags,
};
FilesCollaborationsListCommand.args = {
id: Args.string({
name: 'id',
required: true,
hidden: false,
description: 'ID of the file to get collaborations for'
}),
};
module.exports = FilesCollaborationsListCommand;