(argv: ArgumentsCamelCase<CommandArgs>)
| 52 | .epilog(buildEpilog({ command, apiDocs: 'createSchemaAppInvite' })) |
| 53 | |
| 54 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 55 | const command = await apiCommand(argv) |
| 56 | |
| 57 | const createInvitation = async ( |
| 58 | _: unknown, |
| 59 | input: SchemaAppInvitationCreate, |
| 60 | ): Promise<InvitationWithAppDetails> => { |
| 61 | // We don't need the full schema app but using `getSchemaAppEnsuringOrganization` |
| 62 | // ensures there is a valid organization associated with the schema app. |
| 63 | await getSchemaAppEnsuringOrganization(command, input.schemaAppId, argv) |
| 64 | const idWrapper = await command.client.invitesSchema.create(input) |
| 65 | return getSingleInvite(command.client, input.schemaAppId, idWrapper.invitationId) |
| 66 | } |
| 67 | await inputAndOutputItem<SchemaAppInvitationCreate, InvitationWithAppDetails>( |
| 68 | command, |
| 69 | { tableFieldDefinitions }, |
| 70 | createInvitation, |
| 71 | userInputProcessor(() => getInputFromUser(command, argv)), |
| 72 | ) |
| 73 | } |
| 74 | |
| 75 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 76 | export default cmd |
nothing calls this directly
no test coverage detected