MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / handler

Function handler

src/commands/invites/schema/create.ts:54–73  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

52 .epilog(buildEpilog({ command, apiDocs: 'createSchemaAppInvite' }))
53
54const 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
75const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
76export default cmd

Callers

nothing calls this directly

Calls 3

apiCommandFunction · 0.85
userInputProcessorFunction · 0.85
getInputFromUserFunction · 0.50

Tested by

no test coverage detected