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

Function handler

src/commands/virtualdevices/create.ts:159–172  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

157}
158
159const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
160 const command = await apiOrganizationCommand(argv)
161
162 const createDevice = async (_: void, data: VirtualDeviceCreateRequest): Promise<Device> =>
163 command.client.virtualDevices.create(mergeCreateFlagValues(argv, data))
164
165 await inputAndOutputItem(
166 command,
167 {
168 buildTableOutput: (data: Device) => buildTableOutput(command.tableGenerator, data),
169 },
170 createDevice, userInputProcessor(() => getInputFromUser(command)),
171 )
172}
173
174const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
175export default cmd

Callers

nothing calls this directly

Calls 5

apiOrganizationCommandFunction · 0.85
inputAndOutputItemFunction · 0.85
userInputProcessorFunction · 0.85
getInputFromUserFunction · 0.70
buildTableOutputFunction · 0.50

Tested by

no test coverage detected