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

Function builder

src/commands/edge/channels/invites.ts:29–53  ·  view source on GitHub ↗
(yargs: Argv)

Source from the content-addressed store, hash-verified

27const describe = 'list invitations or retrieve a single invitation by id or index'
28
29const builder = (yargs: Argv): Argv<CommandArgs> =>
30 outputItemOrListBuilder(apiCommandBuilder(yargs))
31 .positional('id-or-index', { describe: 'the invitation id or number in list', type: 'string' })
32 .option('channel', {
33 alias: 'C',
34 describe: 'channel id',
35 type: 'string',
36 })
37 .example([
38 ['$0 edge:channels:invites', 'list all invites on all channels you own'],
39 [
40 '$0 edge:channels:invites 2',
41 'display details for the second invite in the list retrieved by running' +
42 ' "smartthings edge:channels:invites"',
43 ],
44 [
45 '$0 edge:channels:invites 5dfd6626-ab1d-42da-bb76-90def3153998',
46 'display details for an invite by id',
47 ],
48 [
49 '$0 edge:channels:invites --channel 92ece7fc-46d0-4a6c-932c-f7c4a1b8d754',
50 'list invites for the specified channel',
51 ],
52 ])
53 .epilog(buildEpilog({ command }))
54
55const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
56 const command = edgeCommand(await apiCommand(argv))

Callers

nothing calls this directly

Calls 2

apiCommandBuilderFunction · 0.85
buildEpilogFunction · 0.85

Tested by

no test coverage detected