snapshot of https://github.com/mountain-loop/yaak.git (main, 2026-09-23; blobs > 131072B omitted)
This commit is contained in:
43
crates/yaak-ws/index.ts
Normal file
43
crates/yaak-ws/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { platform } from "@yaakapp-internal/platform";
|
||||
import { WebsocketConnection } from "@yaakapp-internal/models";
|
||||
|
||||
export function deleteWebsocketConnections(requestId: string) {
|
||||
return platform.rpc("cmd_ws_delete_connections", {
|
||||
requestId,
|
||||
});
|
||||
}
|
||||
|
||||
export function connectWebsocket({
|
||||
requestId,
|
||||
environmentId,
|
||||
cookieJarId,
|
||||
}: {
|
||||
requestId: string;
|
||||
environmentId: string | null;
|
||||
cookieJarId: string | null;
|
||||
}) {
|
||||
return platform.rpc("cmd_ws_connect", {
|
||||
requestId,
|
||||
environmentId,
|
||||
cookieJarId,
|
||||
}) as Promise<WebsocketConnection>;
|
||||
}
|
||||
|
||||
export function closeWebsocket({ connectionId }: { connectionId: string }) {
|
||||
return platform.rpc("cmd_ws_close", {
|
||||
connectionId,
|
||||
});
|
||||
}
|
||||
|
||||
export function sendWebsocket({
|
||||
connectionId,
|
||||
environmentId,
|
||||
}: {
|
||||
connectionId: string;
|
||||
environmentId: string | null;
|
||||
}) {
|
||||
return platform.rpc("cmd_ws_send", {
|
||||
connectionId,
|
||||
environmentId,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user