mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-25 19:01:38 +01:00
Run oxfmt across repo, add format script and docs
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
environmentsAtom,
|
||||
type Folder,
|
||||
@@ -8,13 +8,13 @@ import {
|
||||
pluginsAtom,
|
||||
type WebsocketRequest,
|
||||
type Workspace,
|
||||
} from '@yaakapp-internal/models';
|
||||
import type { GetTemplateFunctionConfigResponse, JsonPrimitive } from '@yaakapp-internal/plugins';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { md5 } from 'js-md5';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { activeEnvironmentIdAtom } from './useActiveEnvironment';
|
||||
import { activeWorkspaceIdAtom } from './useActiveWorkspace';
|
||||
} from "@yaakapp-internal/models";
|
||||
import type { GetTemplateFunctionConfigResponse, JsonPrimitive } from "@yaakapp-internal/plugins";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { md5 } from "js-md5";
|
||||
import { invokeCmd } from "../lib/tauri";
|
||||
import { activeEnvironmentIdAtom } from "./useActiveEnvironment";
|
||||
import { activeWorkspaceIdAtom } from "./useActiveWorkspace";
|
||||
|
||||
export function useTemplateFunctionConfig(
|
||||
functionName: string | null,
|
||||
@@ -26,20 +26,20 @@ export function useTemplateFunctionConfig(
|
||||
const environmentId = useAtomValue(activeEnvironmentIdAtom);
|
||||
const responses = useAtomValue(httpResponsesAtom);
|
||||
const environments = useAtomValue(environmentsAtom);
|
||||
const environmentsKey = environments.map((e) => e.id + e.updatedAt).join(':');
|
||||
const environmentsKey = environments.map((e) => e.id + e.updatedAt).join(":");
|
||||
|
||||
// Some auth handlers like OAuth 2.0 show the current token after a successful request. To
|
||||
// handle that, we'll force the auth to re-fetch after each new response closes
|
||||
const responseKey = md5(
|
||||
responses
|
||||
.filter((r) => r.state === 'closed')
|
||||
.filter((r) => r.state === "closed")
|
||||
.map((r) => r.id)
|
||||
.join(':'),
|
||||
.join(":"),
|
||||
);
|
||||
|
||||
return useQuery({
|
||||
queryKey: [
|
||||
'template_function_config',
|
||||
"template_function_config",
|
||||
model,
|
||||
functionName,
|
||||
values,
|
||||
@@ -64,7 +64,7 @@ export async function getTemplateFunctionConfig(
|
||||
environmentId: string | undefined,
|
||||
) {
|
||||
const config = await invokeCmd<GetTemplateFunctionConfigResponse>(
|
||||
'cmd_template_function_config',
|
||||
"cmd_template_function_config",
|
||||
{
|
||||
functionName,
|
||||
values,
|
||||
|
||||
Reference in New Issue
Block a user