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

Function builder

src/commands/schema/authorize.ts:23–39  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

21const describe = 'authorize calls to your Schema App AWS Lambda function from SmartThings'
22
23const 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
41const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
42 await smartThingsCommand(argv)

Callers

nothing calls this directly

Calls 3

lambdaAuthBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected