(yargs: Argv)
| 21 | const describe = 'authorize calls to your Schema App AWS Lambda function from SmartThings' |
| 22 | |
| 23 | const builder = (yargs: Argv): Argv<CommandArgs> => |
| 24 | lambdaAuthBuilder(smartThingsCommandBuilder(yargs)) |
| 25 | .positional('arn', { describe: 'the ARN of the AWS Lambda function', type: 'string' }) |
| 26 | .example([ |
| 27 | [ |
| 28 | '$0 schema:authorize arn:aws:lambda:us-east-1:1234567890:function:your-test-app', |
| 29 | 'authorize calls to the specified app from SmartThings', |
| 30 | ], |
| 31 | ]) |
| 32 | .epilog(buildEpilog({ |
| 33 | command, |
| 34 | formattedNotes: 'Note that the example above is the same as running the following with the AWS CLI:\n\n' + |
| 35 | '$ aws lambda add-permission --region us-east-1 \\\n' + |
| 36 | ' --function-name arn:aws:lambda:us-east-1:1234567890:function:your-test-app \\\n' + |
| 37 | ' --statement smartthings --principal 148790070172 --action lambda:InvokeFunction\n\n' + |
| 38 | 'This command requires your machine to be configured to run the AWS CLI.', |
| 39 | })) |
| 40 | |
| 41 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 42 | await smartThingsCommand(argv) |
nothing calls this directly
no test coverage detected