-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathindex.js
64 lines (57 loc) · 1.43 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
'use strict';
const BoxCommand = require('../../box-command');
const { flags } = require('@oclif/command');
const UserModule = require('../../modules/user');
class UsersListCommand extends BoxCommand {
async run() {
const { flags, args } = this.parse(UsersListCommand);
let userModule = new UserModule(this.client);
let users = await userModule.listUsers(flags);
await this.output(users);
}
}
UsersListCommand.aliases = [ 'users:list' ];
UsersListCommand.description = 'List all Box users';
UsersListCommand.examples = ['box users'];
UsersListCommand._endpoint = 'get_users';
UsersListCommand.flags = {
...BoxCommand.flags,
'managed-users': flags.boolean({
char: 'm',
description: 'Limit results to managed users only',
exclusive: [
'app-users',
'all-users'
]
}),
'app-users': flags.boolean({
description: 'Limit results to app users only',
exclusive: [
'managed-users',
'all-users',
'filter'
]
}),
'external-users': flags.boolean({
char: 'e',
description: 'Limit results to external users only',
exclusive: [
'managed-users',
'all-users'
]
}),
'all-users': flags.boolean({
char: 'a',
description: 'Results from all users',
exclusive: [
'external-users',
'managed-users',
'app-users'
]
}),
filter: flags.string({
description: 'Search term to filter users on; matches prefixes of user name and login fields',
exclusive: ['app-users'],
})
};
module.exports = UsersListCommand;