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

Function handler

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

Source from the content-addressed store, hash-verified

46 .epilog(buildEpilog({ command }))
47
48const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
49 const command = await apiCommand(argv)
50
51 const config: OutputItemOrListConfig<OrganizationResponse> = {
52 tableFieldDefinitions,
53 primaryKeyName: 'organizationId',
54 sortKeyName: 'name',
55 listTableFieldDefinitions: ['name', 'label', 'organizationId', 'isDefaultUserOrg'],
56 }
57
58 await outputItemOrList(command, config, argv.idOrIndex,
59 () => command.client.organizations.list(),
60 id => command.client.organizations.get(id),
61 )
62}
63
64const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
65export default cmd

Callers

nothing calls this directly

Calls 2

apiCommandFunction · 0.85
outputItemOrListFunction · 0.85

Tested by

no test coverage detected