(yargs: Argv)
| 36 | const describe = 'get a specific app or a list of apps' |
| 37 | |
| 38 | const builder = (yargs: Argv): Argv<CommandArgs> => |
| 39 | outputItemOrListBuilder(apiCommandBuilder(yargs)) |
| 40 | .positional('id-or-index', { describe: 'the app id or number from list', type: 'string' }) |
| 41 | .option('type', { |
| 42 | describe: 'filter results by app type', |
| 43 | type: 'string', |
| 44 | choices: Object.values(AppType), |
| 45 | coerce: arg => arg.toUpperCase() as AppType, |
| 46 | }) |
| 47 | .option('classification', { |
| 48 | describe: 'filter results by one or more classifications', |
| 49 | type: 'string', |
| 50 | array: true, |
| 51 | choices: Object.values(AppClassification), |
| 52 | coerce: arg => arg?.map((str: string) => str.toUpperCase() as AppClassification), |
| 53 | }) |
| 54 | .option('verbose', |
| 55 | { alias: 'v', describe: 'include URLs and ARNs in table output', type: 'boolean', default: false }) |
| 56 | .example([ |
| 57 | ['$0 apps', 'list all apps'], |
| 58 | ['$0 apps 1', 'display details for the first app in the list retrieved by running "smartthings apps"'], |
| 59 | ['$0 apps 5dfd6626-ab1d-42da-bb76-90def3153998', 'display details for an app by id'], |
| 60 | ['$0 apps --verbose', 'include URLs and ARNs in the output'], |
| 61 | ['$0 apps --classification SERVICE', 'list SERVICE classification apps'], |
| 62 | ['$0 apps --type API_ONLY', 'list API-only apps'], |
| 63 | ]) |
| 64 | .epilog(buildEpilog({ command, apiDocs: ['listApps', 'getApp'] })) |
| 65 | |
| 66 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 67 | const command = await apiCommand(argv) |
no test coverage detected