MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / handler

Function handler

src/commands/rules/update.ts:53–66  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

51 .epilog(buildEpilog({ command, apiDocs: ['updateRule'] }))
52
53const 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
68const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
69export default cmd

Callers

nothing calls this directly

Calls 3

apiCommandFunction · 0.85
chooseRuleFnFunction · 0.85
getRuleWithLocationFunction · 0.85

Tested by

no test coverage detected