(argv: ArgumentsCamelCase<CommandArgs>)
| 51 | .epilog(buildEpilog({ command, apiDocs: [docNames] })) |
| 52 | |
| 53 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 54 | const command = await apiCommand(argv) |
| 55 | |
| 56 | const appId = await chooseApp(command, argv.id) |
| 57 | |
| 58 | const getInputFromUser = async (): Promise<AppOAuthRequest> => { |
| 59 | const startingRequest: AppOAuthRequest = await command.client.apps.getOauth(appId) |
| 60 | if (!startingRequest.scope) { |
| 61 | startingRequest.scope = [] |
| 62 | } |
| 63 | const inputDef = objectDef('OAuth Settings', { |
| 64 | clientName: stringDef('Client Name'), |
| 65 | scope: oauthAppScopeDef, |
| 66 | redirectUris: redirectUrisDef, |
| 67 | }, { helpText: itemInputHelpText(docNames) }) |
| 68 | |
| 69 | return updateFromUserInput(command, inputDef, startingRequest, { dryRun: !!argv.dryRun }) |
| 70 | } |
| 71 | |
| 72 | await inputAndOutputItem(command, { tableFieldDefinitions: oauthTableFieldDefinitions }, |
| 73 | (_, data: AppOAuthRequest) => command.client.apps.updateOauth(appId, data), |
| 74 | inputProcessor(() => true, getInputFromUser)) |
| 75 | } |
| 76 | |
| 77 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 78 | export default cmd |
nothing calls this directly
no test coverage detected