-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlist.js
33 lines (26 loc) · 1 KB
/
list.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
const { TwilioClientCommand } = require("@twilio/cli-core").baseCommands,
AutopilotCore = require("@dabblelab/autopilot-core"),
ora = require("ora"),
{ convertYargsOptionsToOclifFlags, normalizeFlags } = require("../../utils"),
{ options, describe } = require("../../lib/options/list");
class ListAssistants extends TwilioClientCommand {
async run() {
await super.run();
const spinner = ora().start("Getting assistants...\n");
try {
let { flags } = await this.parse(ListAssistants);
flags = normalizeFlags(flags);
const fullData = await AutopilotCore.listAssistant(this.twilioClient);
spinner.stop();
this.output(fullData, flags.properties);
} catch (err) {
spinner.stop();
console.error(`ERROR: ${err}`);
}
}
}
ListAssistants.description = describe;
ListAssistants.flags = Object.assign(convertYargsOptionsToOclifFlags(options), {
profile: TwilioClientCommand.flags.profile,
});
module.exports = ListAssistants;