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

Function handler

src/commands/installedschema/delete.ts:44–63  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

42 .epilog(buildEpilog({ command, apiDocs: 'deleteIsaByIsaId' }))
43
44const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
45 const command = await apiCommand(argv)
46
47 const config: SelectFromListConfig<InstalledSchemaApp & WithNamedLocation> = {
48 primaryKeyName: 'isaId',
49 sortKeyName: 'appName',
50 listTableFieldDefinitions: ['appName', 'partnerName', 'partnerSTConnection', 'isaId'],
51 }
52 if (argv.verbose) {
53 config.listTableFieldDefinitions.splice(3, 0, 'location')
54 }
55
56 const id = await selectFromList(command, config, {
57 preselectedId: argv.id,
58 listItems: () => installedSchemaInstances(command.client, argv.location, { verbose: argv.verbose }),
59 promptMessage: 'Select an installed Schema App to delete.',
60 })
61 await command.client.schema.deleteInstalledApp(id)
62 console.log(`Installed Schema App ${id} deleted.`)
63}
64
65const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
66export default cmd

Callers

nothing calls this directly

Calls 3

apiCommandFunction · 0.85
selectFromListFunction · 0.85
installedSchemaInstancesFunction · 0.85

Tested by

no test coverage detected