mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-19 01:45:23 +02:00
18 lines
601 B
TypeScript
18 lines
601 B
TypeScript
import type { HttpRequest } from "@yaakapp-internal/models";
|
|
import type { EphemeralHttpResponse } from "@yaakapp-internal/rpc-schema";
|
|
import { getActiveCookieJar } from "../hooks/useActiveCookieJar";
|
|
import { rpc } from "./rpc";
|
|
|
|
export async function sendEphemeralRequest(
|
|
request: HttpRequest,
|
|
environmentId: string | null,
|
|
): Promise<EphemeralHttpResponse> {
|
|
// Remove some things that we don't want to associate
|
|
const newRequest = { ...request };
|
|
return rpc("cmd_send_ephemeral_request", {
|
|
request: newRequest,
|
|
environmentId,
|
|
cookieJarId: getActiveCookieJar()?.id,
|
|
});
|
|
}
|