A bunch of improvements to chaining

This commit is contained in:
Gregory Schier
2024-08-19 14:10:44 -07:00
parent 3411575ecc
commit bd02206df2
23 changed files with 218 additions and 82 deletions

View File

@@ -1,4 +1,5 @@
import {
FindHttpResponsesResponse,
GetHttpRequestByIdResponse,
HttpRequestAction,
ImportResponse,
@@ -17,6 +18,7 @@ import { readFileSync } from 'node:fs';
import path from 'node:path';
import * as util from 'node:util';
import { parentPort, workerData } from 'node:worker_threads';
import { text } from '../../src-web/components/core/Editor/text/extension';
new Promise<void>(async (resolve, reject) => {
const { pluginDir, pluginRefId } = workerData;
@@ -101,6 +103,13 @@ new Promise<void>(async (resolve, reject) => {
await sendAndWaitForReply({ type: 'show_toast_request', ...args });
},
},
httpResponse: {
async find(args) {
const payload = { type: 'find_http_responses_request', ...args } as const;
const { httpResponses } = await sendAndWaitForReply<FindHttpResponsesResponse>(payload);
return httpResponses;
},
},
httpRequest: {
async getById({ id }) {
const payload = { type: 'get_http_request_by_id_request', id } as const;