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

Function builder

src/commands/apps/authorize.ts:21–42  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

19const describe = 'authorize calls to your AWS Lambda function from SmartThings'
20
21const builder = (yargs: Argv): Argv<CommandArgs> =>
22 lambdaAuthBuilder(smartThingsCommandBuilder(yargs))
23 .positional(
24 'arn',
25 { describe: 'the ARN of the AWS Lambda function', type: 'string', demandOption: true },
26 )
27 .example([
28 [
29 '$0 apps:authorize \\\n> arn:aws:lambda:us-east-1:1234567890:function:your-app',
30 'authorize an app',
31 ],
32 ])
33 .epilog(buildEpilog({
34 command,
35 formattedNotes: `The example above is the same as running the following with the AWS CLI:
36
37$ aws lambda add-permission --region us-east-1 --function-name \\
38> arn:aws:lambda:us-east-1:1234567890:function:your-app \\
39> --statement smartthings --principal 906037444270 --action lambda:InvokeFunction
40
41This command requires your machine to be configured to run the AWS CLI.`,
42 }))
43
44const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
45 await smartThingsCommand(argv)

Callers

nothing calls this directly

Calls 3

lambdaAuthBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected