(yargs: Argv)
| 35 | const describe = 'create an app' |
| 36 | |
| 37 | const builder = (yargs: Argv): Argv<CommandArgs> => |
| 38 | inputAndOutputItemBuilder(lambdaAuthBuilder(apiCommandBuilder(yargs))) |
| 39 | .option( |
| 40 | 'authorize', |
| 41 | { |
| 42 | describe: 'authorize Lambda functions to be called by SmartThings', |
| 43 | type: 'boolean', |
| 44 | default: false, |
| 45 | }, |
| 46 | ) |
| 47 | .example([ |
| 48 | [ '$0 apps:create', 'create an OAuth-In app from prompted input'], |
| 49 | ['$0 apps:create -i my-app.yaml', 'create an app defined in "my-app.yaml'], |
| 50 | [ |
| 51 | '$0 apps:create -i my-app.json --authorize', |
| 52 | 'create an app defined in "my-app.json" and then authorize it\n' + |
| 53 | '(See "smartthings apps:authorize" for more information on authorization.)', |
| 54 | ], |
| 55 | ]) |
| 56 | .epilog(buildEpilog({ command, apiDocs: ['createApp'] })) |
| 57 | |
| 58 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 59 | const command = await apiCommand(argv) |
nothing calls this directly
no test coverage detected