MCPcopy Index your code
hub / github.com/SmartThingsCommunity/smartthings-cli / handler

Function handler

src/commands/locations.ts:34–48  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

32 .epilog(buildEpilog({ command, apiDocs: ['listLocations', 'getLocation'] }))
33
34const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
35 const command = await apiCommand(argv)
36 const config: OutputItemOrListConfig<Location, LocationItem> = {
37 primaryKeyName: 'locationId',
38 sortKeyName: 'name',
39 tableFieldDefinitions,
40 }
41 await outputItemOrList<Location, LocationItem>(
42 command,
43 config,
44 argv.idOrIndex,
45 () => command.client.locations.list(),
46 id => command.client.locations.get(id),
47 )
48}
49
50const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
51export default cmd

Callers

nothing calls this directly

Calls 1

apiCommandFunction · 0.85

Tested by

no test coverage detected