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

Function handler

src/commands/capabilities/presentation.ts:63–79  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

61 .epilog(buildEpilog({ command, apiDocs: 'getCapabilityPresentation' }))
62
63const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
64 const command = await apiOrganizationCommand(argv)
65
66 const capabilityId = await chooseCapability(
67 command,
68 argv.idOrIndex,
69 argv.capabilityVersion,
70 { namespace: argv.namespace, allowIndex: true },
71 )
72 const presentation =
73 await command.client.capabilities.getPresentation(capabilityId.id, capabilityId.version)
74 await formatAndWriteItem(
75 command,
76 { buildTableOutput: data => buildTableOutput(command.tableGenerator, data) },
77 presentation,
78 )
79}
80
81const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
82export default cmd

Callers

nothing calls this directly

Calls 4

apiOrganizationCommandFunction · 0.85
formatAndWriteItemFunction · 0.85
chooseCapabilityFunction · 0.50
buildTableOutputFunction · 0.50

Tested by

no test coverage detected