-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathget.js
41 lines (33 loc) · 1010 Bytes
/
get.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 { flags } = require('@oclif/command');
class SharedLinksGetCommand extends BoxCommand {
async run() {
const { flags, args } = this.parse(SharedLinksGetCommand);
let options = {};
if (flags.fields) {
options.fields = flags.fields;
}
let sharedItem = await this.client.sharedItems.get(args.url, args.password, options);
await this.output(sharedItem);
}
}
SharedLinksGetCommand.description = 'Get information from a shared item URL';
SharedLinksGetCommand.examples = ['box shared-links:get https://app.box.com/s/13ynxiqe3y4tup3j0yn4qairs5ebfxo3'];
SharedLinksGetCommand._endpoint = 'get_shared_items';
SharedLinksGetCommand.flags = {
...BoxCommand.flags,
password: flags.string({
description: 'Shared item password',
default: null
})
};
SharedLinksGetCommand.args = [
{
name: 'url',
required: true,
hidden: false,
description: 'Shared item URL to resolve',
}
];
module.exports = SharedLinksGetCommand;