(argv: ArgumentsCamelCase<CommandArgs>)
| 64 | .epilog(buildEpilog({ command, apiDocs: ['listApps', 'getApp'] })) |
| 65 | |
| 66 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 67 | const command = await apiCommand(argv) |
| 68 | |
| 69 | const listTableFieldDefinitions: TableFieldDefinition<PagedApp | AppResponse>[] = ['displayName', 'appType', 'appId'] |
| 70 | if (argv.verbose) { |
| 71 | listTableFieldDefinitions.push({ label: 'ARN/URL', value: shortARNorURL }) |
| 72 | } |
| 73 | const config: OutputItemOrListConfig<AppResponse, PagedApp | AppResponse> = { |
| 74 | primaryKeyName: 'appId', |
| 75 | sortKeyName: 'displayName', |
| 76 | tableFieldDefinitions, |
| 77 | listTableFieldDefinitions, |
| 78 | } |
| 79 | |
| 80 | const listApps = async (): Promise<PagedApp[] | AppResponse[]> => { |
| 81 | const appListOptions: AppListOptions = {} |
| 82 | if (argv.type) { |
| 83 | appListOptions.appType = AppType[argv.type as keyof typeof AppType] |
| 84 | } |
| 85 | |
| 86 | if (argv.classification) { |
| 87 | appListOptions.classification = argv.classification |
| 88 | .map(classification => AppClassification[classification as keyof typeof AppClassification]) |
| 89 | } |
| 90 | |
| 91 | if (argv.verbose) { |
| 92 | return verboseApps(command.client, appListOptions) |
| 93 | } |
| 94 | return command.client.apps.list(appListOptions) |
| 95 | } |
| 96 | |
| 97 | await outputItemOrList(command, config, argv.idOrIndex, listApps, id => command.client.apps.get(id)) |
| 98 | } |
| 99 | |
| 100 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 101 | export default cmd |
nothing calls this directly
no test coverage detected