(argv: ArgumentsCamelCase<CommandArgs>)
| 61 | .epilog(buildEpilog({ command, apiDocs: ['getIsaByLocationId', 'getDevicesByIsaId'] })) |
| 62 | |
| 63 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 64 | const command = await apiCommand(argv) |
| 65 | |
| 66 | const config: OutputItemOrListConfig<InstalledSchemaApp & WithNamedLocation> = { |
| 67 | primaryKeyName: 'isaId', |
| 68 | sortKeyName: 'appName', |
| 69 | listTableFieldDefinitions, |
| 70 | tableFieldDefinitions, |
| 71 | } |
| 72 | |
| 73 | if (argv.verbose) { |
| 74 | config.listTableFieldDefinitions = listTableFieldDefinitions.toSpliced(3, 0, 'locationId', 'location') |
| 75 | config.tableFieldDefinitions = tableFieldDefinitions.toSpliced(5, 0, 'location') |
| 76 | } |
| 77 | const verboseInstalledApp: (app: Promise<InstalledSchemaApp>) => Promise<InstalledSchemaApp & WithNamedLocation> = |
| 78 | async app => argv.verbose ? withLocation(command.client, await app) : app |
| 79 | |
| 80 | await outputItemOrList( |
| 81 | command, |
| 82 | config, |
| 83 | argv.idOrIndex, |
| 84 | () => installedSchemaInstances(command.client, argv.location, { verbose: argv.verbose }), |
| 85 | id => verboseInstalledApp(command.client.schema.getInstalledApp(id)), |
| 86 | ) |
| 87 | } |
| 88 | |
| 89 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 90 | export default cmd |
nothing calls this directly
no test coverage detected