mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-21 14:47:46 -04:00
* Refactor extension format and load plugins from directory * Added some UI around plugins * Refactor PromptModal usage
34 lines
1001 B
JavaScript
34 lines
1001 B
JavaScript
module.exports = `
|
|
module.exports.templateTags = [{
|
|
name: 'hello',
|
|
displayName: 'Say Hello',
|
|
description: 'says hello to someone',
|
|
args: [{
|
|
displayName: 'Mood',
|
|
type: 'enum',
|
|
options: [
|
|
{displayName: 'Calm', value: 'calm'},
|
|
{displayName: 'Talkative', value: 'talkative'},
|
|
{displayName: 'Ecstatic', value: 'ecstatic'},
|
|
]
|
|
}, {
|
|
displayName: 'Name',
|
|
description: 'who to say "hi" to',
|
|
type: 'string',
|
|
defaultValue: 'Karen'
|
|
}],
|
|
async run (context, mood, name) {
|
|
switch (mood) {
|
|
case 'calm':
|
|
return \`Hi \${name}.\`;
|
|
case 'talkative':
|
|
return \`Oh, hello \${name}, it's so nice to see you! How have you been?\`;
|
|
case 'ecstatic':
|
|
return \`OH MY GOD, HI \${name.toUpperCase()}!\`;
|
|
default:
|
|
return \`Hello \${name.toUpperCase()}.\`;
|
|
}
|
|
}
|
|
}];
|
|
`.trim();
|