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

Function builder

src/commands/apps/update.ts:33–60  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

31const describe = 'update the settings of the app'
32
33const builder = (yargs: Argv): Argv<CommandArgs> =>
34 inputAndOutputItemBuilder(lambdaAuthBuilder(apiCommandBuilder(yargs)))
35 .positional('id', { describe: 'app id', type: 'string' })
36 .option(
37 'authorize',
38 { describe: 'authorize Lambda functions to be called by SmartThings', type: 'boolean', default: false },
39 )
40 .example([
41 [
42 '$0 apps:update',
43 'prompt for an app and edit it interactively',
44 ],
45 [
46 '$0 apps:update -i my-app.json',
47 'prompt for an app and update it using the data in "my-app.json"',
48 ],
49 [
50 '$0 apps:update 392bcb11-e251-44f3-b58b-17f93015f3aa -i my-app.json',
51 'update the app with the given id using the data in "my-app.json"',
52 ],
53 [
54 '$0 apps:update 392bcb11-e251-44f3-b58b-17f93015f3aa -i my-app.json --authorize',
55 'update the given app using the data in "my-app.json" and then authorize it\n' +
56 '(See "smartthings apps:authorize" for more information on authorization.)',
57 ],
58 ])
59 .epilog('See apps:oauth:update and apps:oauth:generate for updating oauth-related data.\n\n' +
60 buildEpilog({ command, apiDocs: ['updateApp'] }))
61
62const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
63 const command = await apiCommand(argv)

Callers

nothing calls this directly

Calls 4

lambdaAuthBuilderFunction · 0.85
apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected