| 17 | } |
| 18 | |
| 19 | async function promptForInput() { |
| 20 | const answers = await inquirer.prompt<Answers>([ |
| 21 | { |
| 22 | type: 'list', |
| 23 | name: 'isProduction', |
| 24 | message: 'Is this for production?', |
| 25 | choices: [ |
| 26 | { name: 'Yes', value: true }, |
| 27 | { name: 'No', value: false }, |
| 28 | ], |
| 29 | default: true, |
| 30 | }, |
| 31 | { |
| 32 | type: 'string', |
| 33 | name: 'polarOrganizationId', |
| 34 | message: 'Enter your Polar organization ID:', |
| 35 | }, |
| 36 | { |
| 37 | type: 'string', |
| 38 | name: 'polarApiKey', |
| 39 | message: 'Enter your Polar API key:', |
| 40 | validate: (input: string) => { |
| 41 | if (!input) return 'API key is required'; |
| 42 | return true; |
| 43 | }, |
| 44 | }, |
| 45 | ]); |
| 46 | |
| 47 | return answers; |
| 48 | } |
| 49 | |
| 50 | async function main() { |
| 51 | const input = await promptForInput(); |