(yargs: Argv)
| 19 | const describe = 'authorize calls to your AWS Lambda function from SmartThings' |
| 20 | |
| 21 | const 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 | |
| 41 | This command requires your machine to be configured to run the AWS CLI.`, |
| 42 | })) |
| 43 | |
| 44 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 45 | await smartThingsCommand(argv) |
nothing calls this directly
no test coverage detected