(argv: ArgumentsCamelCase<CommandArgs>)
| 43 | .epilog(buildEpilog({ command, apiDocs: ['executeRule'] })) |
| 44 | |
| 45 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 46 | const command = await apiCommand(argv) |
| 47 | |
| 48 | const chooseRule = chooseRuleFn(argv.location) |
| 49 | const ruleId = await chooseRule(command, argv.id, { promptMessage: 'Select a rule to execute.' }) |
| 50 | |
| 51 | const locationId = argv.location ?? (await getRuleWithLocation(command.client, ruleId, argv.location)).locationId |
| 52 | |
| 53 | const result = await command.client.rules.execute(ruleId, locationId) |
| 54 | await formatAndWriteItem<RuleExecutionResponse>( |
| 55 | command, |
| 56 | { buildTableOutput: data => buildExecuteResponseTableOutput(command.tableGenerator, data) }, |
| 57 | result, |
| 58 | ) |
| 59 | } |
| 60 | |
| 61 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 62 | export default cmd |
nothing calls this directly
no test coverage detected