(argv: ArgumentsCamelCase<CommandArgs>)
| 51 | .epilog(buildEpilog({ command, apiDocs: ['updateRule'] })) |
| 52 | |
| 53 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 54 | const command = await apiCommand(argv) |
| 55 | |
| 56 | const chooseRule = chooseRuleFn(argv.location) |
| 57 | const id = await chooseRule(command, argv.id, { promptMessage: 'Select a rule to update.' }) |
| 58 | |
| 59 | await inputAndOutputItem<RuleRequest, Rule>( |
| 60 | command, |
| 61 | { tableFieldDefinitions }, |
| 62 | async (_, data) => { |
| 63 | const rule = await getRuleWithLocation(command.client, id, argv.location) |
| 64 | return command.client.rules.update(id, data, rule.locationId) |
| 65 | }) |
| 66 | } |
| 67 | |
| 68 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 69 | export default cmd |
nothing calls this directly
no test coverage detected