(argv: ArgumentsCamelCase<CommandArgs>)
| 53 | .epilog(buildEpilog({ command, apiDocs: ['getAppsByUserToken', 'getAppsByEndpointAppId'] })) |
| 54 | |
| 55 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 56 | const command = await apiOrganizationCommand(argv) |
| 57 | |
| 58 | const config: OutputItemOrListConfig<SchemaApp> = { |
| 59 | tableFieldDefinitions: [ |
| 60 | 'appName', 'partnerName', 'endpointAppId', 'organizationId', 'schemaType', 'hostingType', |
| 61 | // stClientId is missing from the docs |
| 62 | ('stClientId' as keyof SchemaApp), 'oAuthAuthorizationUrl', 'oAuthTokenUrl', 'oAuthClientId', |
| 63 | 'oAuthClientSecret', 'icon', 'icon2x', 'icon3x', |
| 64 | { prop: 'lambdaArn', skipEmpty: true }, |
| 65 | { prop: 'lambdaArnAP', skipEmpty: true }, |
| 66 | { prop: 'lambdaArnCN', skipEmpty: true }, |
| 67 | { prop: 'lambdaArnEU', skipEmpty: true }, |
| 68 | { prop: 'webhookUrl', skipEmpty: true }, |
| 69 | { prop: 'userEmail', skipEmpty: true }, |
| 70 | ], |
| 71 | primaryKeyName: 'endpointAppId', |
| 72 | sortKeyName: 'appName', |
| 73 | listTableFieldDefinitions: ['appName', 'endpointAppId', 'organizationId', 'hostingType'], |
| 74 | } |
| 75 | if (argv.verbose) { |
| 76 | config.listTableFieldDefinitions.push({ |
| 77 | label: 'ARN/URL', |
| 78 | value: app => app.hostingType === 'lambda' ? app.lambdaArn : app.webhookUrl, |
| 79 | }) |
| 80 | } |
| 81 | |
| 82 | await outputItemOrList( |
| 83 | command, |
| 84 | config, |
| 85 | argv.idOrIndex, |
| 86 | () => command.client.schema.list({ includeAllOrganizations: argv.allOrganizations }), |
| 87 | async id => (await getSchemaAppEnsuringOrganization(command, id, argv)).schemaApp, |
| 88 | ) |
| 89 | } |
| 90 | |
| 91 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 92 | export default cmd |
nothing calls this directly
no test coverage detected