-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c10e28
commit 4f2ec40
Showing
7 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ParsedArgumentsObject } from '@caporal/core'; | ||
|
||
export function getInputQueryArgumentDefinition(): [string, string] { | ||
return ['<inputQuery>', 'Input query params eg. contentID=contendId123&mediaType=episode']; | ||
} | ||
|
||
export function getInputQuery(args: ParsedArgumentsObject): string { | ||
return args.inputQuery as string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { CreateCommandParameters, Command } from '@caporal/core'; | ||
import { envVariables } from '../../env/args'; | ||
import input from '../../requests/input'; | ||
import { getInputQuery, getInputQueryArgumentDefinition } from '../arguments/inputQuery'; | ||
import { getRokuIP, getRokuIPOptionDefinition } from '../options/rokuIP'; | ||
|
||
export default function ({ createCommand }: CreateCommandParameters): Command { | ||
return createCommand('Sends custom events to the current application.') | ||
.argument(...getInputQueryArgumentDefinition()) | ||
.option(...getRokuIPOptionDefinition()) | ||
.action(async ({ args, options }) => input({ | ||
query: getInputQuery(args) || '', | ||
rokuIP: getRokuIP(options) || envVariables.ROKU_IP || '', | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters