-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathdelete.js
43 lines (36 loc) · 1.08 KB
/
delete.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
'use strict';
const BoxCommand = require('../../box-command');
const chalk = require('chalk');
const SharedLinksModule = require('../../modules/shared-links');
class SharedLinksDeleteCommand extends BoxCommand {
async run() {
const { flags, args } = this.parse(SharedLinksDeleteCommand);
let sharedLinksModule = new SharedLinksModule(this.client);
let item = await sharedLinksModule.removeSharedLink(args);
this.info(chalk`{green Removed shared link from ${args.itemType} "${item.name}"}`);
}
}
SharedLinksDeleteCommand.description = 'Delete a shared link for a Box item';
SharedLinksDeleteCommand.examples = ['box shared-links:delete 22222 folder'];
SharedLinksDeleteCommand.flags = {
...BoxCommand.flags
};
SharedLinksDeleteCommand.args = [
{
name: 'itemID',
required: true,
hidden: false,
description: 'ID of the Box item to remove the shared link from',
},
{
name: 'itemType',
required: true,
hidden: false,
description: 'Type of item for shared link: either file or folder',
options: [
'file',
'folder'
],
}
];
module.exports = SharedLinksDeleteCommand;