(yargs: Argv<T>)
| 40 | } |
| 41 | |
| 42 | export const apiCommandBuilder = <T extends object>(yargs: Argv<T>): Argv<T & APICommandFlags> => |
| 43 | smartThingsCommandBuilder(yargs) |
| 44 | .option('environment', { |
| 45 | desc: 'the environment to use', |
| 46 | type: 'string', |
| 47 | choices: Object.keys(urlProvidersByEnvironment), |
| 48 | }) |
| 49 | .option('token', { |
| 50 | alias: 't', |
| 51 | desc: 'the auth token to use', |
| 52 | type: 'string', |
| 53 | default: process.env.SMARTTHINGS_TOKEN, |
| 54 | hidden: true, |
| 55 | }) |
| 56 | .option('language', { |
| 57 | desc: 'ISO language code or "NONE" to not specify a language. Defaults to the OS locale', |
| 58 | type: 'string', |
| 59 | }) |
| 60 | |
| 61 | export type APICommand<T extends APICommandFlags = APICommandFlags> = SmartThingsCommand<T> & { |
| 62 | environment: string |
no test coverage detected