mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 23:44:12 +01:00
Add prompt() plugin API (#121)
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
InternalEvent,
|
||||
InternalEventPayload,
|
||||
SendHttpRequestResponse,
|
||||
ShowPromptResponse,
|
||||
TemplateFunction,
|
||||
} from '@yaakapp/api';
|
||||
import { HttpRequestActionPlugin } from '@yaakapp/api/lib/plugins/HttpRequestActionPlugin';
|
||||
@@ -138,6 +139,15 @@ async function initialize() {
|
||||
await sendAndWaitForReply(event.windowContext, { type: 'show_toast_request', ...args });
|
||||
},
|
||||
},
|
||||
prompt: {
|
||||
async show(args) {
|
||||
const reply: ShowPromptResponse = await sendAndWaitForReply(event.windowContext, {
|
||||
type: 'show_prompt_request',
|
||||
...args,
|
||||
});
|
||||
return reply.value;
|
||||
},
|
||||
},
|
||||
httpResponse: {
|
||||
async find(args) {
|
||||
const payload = { type: 'find_http_responses_request', ...args } as const;
|
||||
|
||||
Reference in New Issue
Block a user