@@ -27,12 +25,10 @@

-
## Features
-Yaak is an offline-first API client designed to stay out of your way while giving you everything you need when you need it.
-Built with [Tauri](https://tauri.app), Rust, and React, it’s fast, lightweight, and private. No telemetry, no VC funding, and no cloud lock-in.
-
+Yaak is an offline-first API client designed to stay out of your way while giving you everything you need when you need it.
+Built with [Tauri](https://tauri.app), Rust, and React, it’s fast, lightweight, and private. No telemetry, no VC funding, and no cloud lock-in.
### 🌐 Work with any API
@@ -41,21 +37,23 @@ Built with [Tauri](https://tauri.app), Rust, and React, it’s fast, lightweight
- Filter and inspect responses with JSONPath or XPath.
### 🔐 Stay secure
+
- Use OAuth 2.0, JWT, Basic Auth, or custom plugins for authentication.
-- Secure sensitive values with encrypted secrets.
+- Secure sensitive values with encrypted secrets.
- Store secrets in your OS keychain.
### ☁️ Organize & collaborate
+
- Group requests into workspaces and nested folders.
- Use environment variables to switch between dev, staging, and prod.
- Mirror workspaces to your filesystem for versioning in Git or syncing with Dropbox.
### 🧩 Extend & customize
+
- Insert dynamic values like UUIDs or timestamps with template tags.
- Pick from built-in themes or build your own.
- Create plugins to extend authentication, template tags, or the UI.
-
## Contribution Policy
> [!IMPORTANT]
diff --git a/apps/yaak-client/commands/commands.tsx b/apps/yaak-client/commands/commands.tsx
index 9a75b5fd..e1b09484 100644
--- a/apps/yaak-client/commands/commands.tsx
+++ b/apps/yaak-client/commands/commands.tsx
@@ -1,6 +1,6 @@
-import { createWorkspaceModel, type Folder, modelTypeLabel } from '@yaakapp-internal/models';
-import { applySync, calculateSync } from '@yaakapp-internal/sync';
-import { Button } from '../components/core/Button';
+import { createWorkspaceModel, type Folder, modelTypeLabel } from "@yaakapp-internal/models";
+import { applySync, calculateSync } from "@yaakapp-internal/sync";
+import { Button } from "../components/core/Button";
import {
Banner,
InlineCode,
@@ -11,21 +11,21 @@ import {
TableHeaderCell,
TableRow,
TruncatedWideTableCell,
-} from '@yaakapp-internal/ui';
-import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace';
-import { createFastMutation } from '../hooks/useFastMutation';
-import { showDialog } from '../lib/dialog';
-import { jotaiStore } from '../lib/jotai';
-import { pluralizeCount } from '../lib/pluralize';
-import { showPrompt } from '../lib/prompt';
-import { resolvedModelNameWithFolders } from '../lib/resolvedModelName';
+} from "@yaakapp-internal/ui";
+import { activeWorkspaceIdAtom } from "../hooks/useActiveWorkspace";
+import { createFastMutation } from "../hooks/useFastMutation";
+import { showDialog } from "../lib/dialog";
+import { jotaiStore } from "../lib/jotai";
+import { pluralizeCount } from "../lib/pluralize";
+import { showPrompt } from "../lib/prompt";
+import { resolvedModelNameWithFolders } from "../lib/resolvedModelName";
export const createFolder = createFastMutation<
string | null,
void,
- Partial>
+ Partial>
>({
- mutationKey: ['create_folder'],
+ mutationKey: ["create_folder"],
mutationFn: async (patch) => {
const workspaceId = jotaiStore.get(activeWorkspaceIdAtom);
if (workspaceId == null) {
@@ -34,12 +34,12 @@ export const createFolder = createFastMutation<
if (!patch.name) {
const name = await showPrompt({
- id: 'new-folder',
- label: 'Name',
- defaultValue: 'Folder',
- title: 'New Folder',
- confirmText: 'Create',
- placeholder: 'Name',
+ id: "new-folder",
+ label: "Name",
+ defaultValue: "Folder",
+ title: "New Folder",
+ confirmText: "Create",
+ placeholder: "Name",
});
if (name == null) return null;
@@ -47,7 +47,7 @@ export const createFolder = createFastMutation<
}
patch.sortPriority = patch.sortPriority || -Date.now();
- const id = await createWorkspaceModel({ model: 'folder', workspaceId, ...patch });
+ const id = await createWorkspaceModel({ model: "folder", workspaceId, ...patch });
return id;
},
});
@@ -61,12 +61,12 @@ export const syncWorkspace = createFastMutation<
mutationFn: async ({ workspaceId, syncDir, force }) => {
const ops = (await calculateSync(workspaceId, syncDir)) ?? [];
if (ops.length === 0) {
- console.log('Nothing to sync', workspaceId, syncDir);
+ console.log("Nothing to sync", workspaceId, syncDir);
return;
}
- console.log('Syncing workspace', workspaceId, syncDir, ops);
+ console.log("Syncing workspace", workspaceId, syncDir, ops);
- const dbOps = ops.filter((o) => o.type.startsWith('db'));
+ const dbOps = ops.filter((o) => o.type.startsWith("db"));
if (dbOps.length === 0) {
await applySync(workspaceId, syncDir, ops);
@@ -74,10 +74,10 @@ export const syncWorkspace = createFastMutation<
}
const isDeletingWorkspace = ops.some(
- (o) => o.type === 'dbDelete' && o.model.model === 'workspace',
+ (o) => o.type === "dbDelete" && o.model.model === "workspace",
);
- console.log('Directory changes detected', { dbOps, ops });
+ console.log("Directory changes detected", { dbOps, ops });
if (force) {
await applySync(workspaceId, syncDir, ops);
@@ -85,9 +85,9 @@ export const syncWorkspace = createFastMutation<
}
showDialog({
- id: 'commit-sync',
- title: 'Changes Detected',
- size: 'md',
+ id: "commit-sync",
+ title: "Changes Detected",
+ size: "md",
render: ({ hide }) => (
)}
- {pluralizeCount('file', dbOps.length)} in the directory{' '}
- {dbOps.length === 1 ? 'has' : 'have'} changed. Do you want to update your workspace?
+ {pluralizeCount("file", dbOps.length)} in the directory{" "}
+ {dbOps.length === 1 ? "has" : "have"} changed. Do you want to update your workspace?
@@ -123,20 +123,20 @@ export const syncWorkspace = createFastMutation<
let color: string;
let model: string;
- if (op.type === 'dbCreate') {
- label = 'create';
+ if (op.type === "dbCreate") {
+ label = "create";
name = resolvedModelNameWithFolders(op.fs.model);
- color = 'text-success';
+ color = "text-success";
model = modelTypeLabel(op.fs.model);
- } else if (op.type === 'dbUpdate') {
- label = 'update';
+ } else if (op.type === "dbUpdate") {
+ label = "update";
name = resolvedModelNameWithFolders(op.fs.model);
- color = 'text-info';
+ color = "text-info";
model = modelTypeLabel(op.fs.model);
- } else if (op.type === 'dbDelete') {
- label = 'delete';
+ } else if (op.type === "dbDelete") {
+ label = "delete";
name = resolvedModelNameWithFolders(op.model);
- color = 'text-danger';
+ color = "text-danger";
model = modelTypeLabel(op.model);
} else {
return null;
diff --git a/apps/yaak-client/commands/createEnvironment.tsx b/apps/yaak-client/commands/createEnvironment.tsx
index 1dcc5675..80f68e10 100644
--- a/apps/yaak-client/commands/createEnvironment.tsx
+++ b/apps/yaak-client/commands/createEnvironment.tsx
@@ -1,33 +1,33 @@
-import type { Environment } from '@yaakapp-internal/models';
-import { CreateEnvironmentDialog } from '../components/CreateEnvironmentDialog';
-import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace';
-import { createFastMutation } from '../hooks/useFastMutation';
-import { showDialog } from '../lib/dialog';
-import { jotaiStore } from '../lib/jotai';
-import { setWorkspaceSearchParams } from '../lib/setWorkspaceSearchParams';
+import type { Environment } from "@yaakapp-internal/models";
+import { CreateEnvironmentDialog } from "../components/CreateEnvironmentDialog";
+import { activeWorkspaceIdAtom } from "../hooks/useActiveWorkspace";
+import { createFastMutation } from "../hooks/useFastMutation";
+import { showDialog } from "../lib/dialog";
+import { jotaiStore } from "../lib/jotai";
+import { setWorkspaceSearchParams } from "../lib/setWorkspaceSearchParams";
export const createSubEnvironmentAndActivate = createFastMutation<
string | null,
unknown,
Environment | null
>({
- mutationKey: ['create_environment'],
+ mutationKey: ["create_environment"],
mutationFn: async (baseEnvironment) => {
if (baseEnvironment == null) {
- throw new Error('No base environment passed');
+ throw new Error("No base environment passed");
}
const workspaceId = jotaiStore.get(activeWorkspaceIdAtom);
if (workspaceId == null) {
- throw new Error('Cannot create environment when no active workspace');
+ throw new Error("Cannot create environment when no active workspace");
}
return new Promise((resolve) => {
showDialog({
- id: 'new-environment',
- title: 'New Environment',
- description: 'Create multiple environments with different sets of variables',
- size: 'sm',
+ id: "new-environment",
+ title: "New Environment",
+ description: "Create multiple environments with different sets of variables",
+ size: "sm",
onClose: () => resolve(null),
render: ({ hide }) => (
cmdDeleteWebsocketConnections(request.id),
});
diff --git a/apps/yaak-client/commands/moveToWorkspace.tsx b/apps/yaak-client/commands/moveToWorkspace.tsx
index 63672b4f..3428a580 100644
--- a/apps/yaak-client/commands/moveToWorkspace.tsx
+++ b/apps/yaak-client/commands/moveToWorkspace.tsx
@@ -1,28 +1,26 @@
-import type { GrpcRequest, HttpRequest, WebsocketRequest } from '@yaakapp-internal/models';
+import type { GrpcRequest, HttpRequest, WebsocketRequest } from "@yaakapp-internal/models";
-import { MoveToWorkspaceDialog } from '../components/MoveToWorkspaceDialog';
-import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace';
-import { createFastMutation } from '../hooks/useFastMutation';
-import { pluralizeCount } from '../lib/pluralize';
-import { showDialog } from '../lib/dialog';
-import { jotaiStore } from '../lib/jotai';
+import { MoveToWorkspaceDialog } from "../components/MoveToWorkspaceDialog";
+import { activeWorkspaceIdAtom } from "../hooks/useActiveWorkspace";
+import { createFastMutation } from "../hooks/useFastMutation";
+import { pluralizeCount } from "../lib/pluralize";
+import { showDialog } from "../lib/dialog";
+import { jotaiStore } from "../lib/jotai";
export const moveToWorkspace = createFastMutation({
- mutationKey: ['move_workspace'],
+ mutationKey: ["move_workspace"],
mutationFn: async (requests: (HttpRequest | GrpcRequest | WebsocketRequest)[]) => {
const activeWorkspaceId = jotaiStore.get(activeWorkspaceIdAtom);
if (activeWorkspaceId == null) return;
if (requests.length === 0) return;
const title =
- requests.length === 1
- ? 'Move Request'
- : `Move ${pluralizeCount('Request', requests.length)}`;
+ requests.length === 1 ? "Move Request" : `Move ${pluralizeCount("Request", requests.length)}`;
showDialog({
- id: 'change-workspace',
+ id: "change-workspace",
title,
- size: 'sm',
+ size: "sm",
render: ({ hide }) => (
,
});
diff --git a/apps/yaak-client/commands/openSettings.tsx b/apps/yaak-client/commands/openSettings.tsx
index 099e4bf1..0db60659 100644
--- a/apps/yaak-client/commands/openSettings.tsx
+++ b/apps/yaak-client/commands/openSettings.tsx
@@ -1,29 +1,29 @@
-import type { SettingsTab } from '../components/Settings/Settings';
-import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace';
-import { createFastMutation } from '../hooks/useFastMutation';
-import { jotaiStore } from '../lib/jotai';
-import { router } from '../lib/router';
-import { invokeCmd } from '../lib/tauri';
+import type { SettingsTab } from "../components/Settings/Settings";
+import { activeWorkspaceIdAtom } from "../hooks/useActiveWorkspace";
+import { createFastMutation } from "../hooks/useFastMutation";
+import { jotaiStore } from "../lib/jotai";
+import { router } from "../lib/router";
+import { invokeCmd } from "../lib/tauri";
// Allow tab with optional subtab (e.g., "plugins:installed")
type SettingsTabWithSubtab = SettingsTab | `${SettingsTab}:${string}` | null;
export const openSettings = createFastMutation({
- mutationKey: ['open_settings'],
+ mutationKey: ["open_settings"],
mutationFn: async (tab) => {
const workspaceId = jotaiStore.get(activeWorkspaceIdAtom);
if (workspaceId == null) return;
const location = router.buildLocation({
- to: '/workspaces/$workspaceId/settings',
+ to: "/workspaces/$workspaceId/settings",
params: { workspaceId },
search: { tab: (tab ?? undefined) as SettingsTab | undefined },
});
- await invokeCmd('cmd_new_child_window', {
+ await invokeCmd("cmd_new_child_window", {
url: location.href,
- label: 'settings',
- title: 'Yaak Settings',
+ label: "settings",
+ title: "Yaak Settings",
innerSize: [750, 600],
});
},
diff --git a/apps/yaak-client/commands/openWorkspaceFromSyncDir.tsx b/apps/yaak-client/commands/openWorkspaceFromSyncDir.tsx
index 83426ce9..9c5b6d2f 100644
--- a/apps/yaak-client/commands/openWorkspaceFromSyncDir.tsx
+++ b/apps/yaak-client/commands/openWorkspaceFromSyncDir.tsx
@@ -1,7 +1,7 @@
-import { applySync, calculateSyncFsOnly } from '@yaakapp-internal/sync';
-import { createFastMutation } from '../hooks/useFastMutation';
-import { showSimpleAlert } from '../lib/alert';
-import { router } from '../lib/router';
+import { applySync, calculateSyncFsOnly } from "@yaakapp-internal/sync";
+import { createFastMutation } from "../hooks/useFastMutation";
+import { showSimpleAlert } from "../lib/alert";
+import { router } from "../lib/router";
export const openWorkspaceFromSyncDir = createFastMutation({
mutationKey: [],
@@ -9,18 +9,18 @@ export const openWorkspaceFromSyncDir = createFastMutation({
const ops = await calculateSyncFsOnly(dir);
const workspace = ops
- .map((o) => (o.type === 'dbCreate' && o.fs.model.type === 'workspace' ? o.fs.model : null))
+ .map((o) => (o.type === "dbCreate" && o.fs.model.type === "workspace" ? o.fs.model : null))
.filter((m) => m)[0];
if (workspace == null) {
- showSimpleAlert('Failed to Open', 'No workspace found in directory');
+ showSimpleAlert("Failed to Open", "No workspace found in directory");
return;
}
await applySync(workspace.id, dir, ops);
- router.navigate({
- to: '/workspaces/$workspaceId',
+ await router.navigate({
+ to: "/workspaces/$workspaceId",
params: { workspaceId: workspace.id },
});
},
diff --git a/apps/yaak-client/commands/openWorkspaceSettings.tsx b/apps/yaak-client/commands/openWorkspaceSettings.tsx
index 2ad53fbe..4f68f87c 100644
--- a/apps/yaak-client/commands/openWorkspaceSettings.tsx
+++ b/apps/yaak-client/commands/openWorkspaceSettings.tsx
@@ -1,16 +1,16 @@
-import type { WorkspaceSettingsTab } from '../components/WorkspaceSettingsDialog';
-import { WorkspaceSettingsDialog } from '../components/WorkspaceSettingsDialog';
-import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace';
-import { showDialog } from '../lib/dialog';
-import { jotaiStore } from '../lib/jotai';
+import type { WorkspaceSettingsTab } from "../components/WorkspaceSettingsDialog";
+import { WorkspaceSettingsDialog } from "../components/WorkspaceSettingsDialog";
+import { activeWorkspaceIdAtom } from "../hooks/useActiveWorkspace";
+import { showDialog } from "../lib/dialog";
+import { jotaiStore } from "../lib/jotai";
export function openWorkspaceSettings(tab?: WorkspaceSettingsTab) {
const workspaceId = jotaiStore.get(activeWorkspaceIdAtom);
if (workspaceId == null) return;
showDialog({
- id: 'workspace-settings',
- size: 'md',
- className: 'h-[calc(100vh-5rem)] !max-h-[40rem]',
+ id: "workspace-settings",
+ size: "md",
+ className: "h-[calc(100vh-5rem)] !max-h-[40rem]",
noPadding: true,
render: ({ hide }) => (
diff --git a/apps/yaak-client/commands/switchWorkspace.tsx b/apps/yaak-client/commands/switchWorkspace.tsx
index 461b4922..56356148 100644
--- a/apps/yaak-client/commands/switchWorkspace.tsx
+++ b/apps/yaak-client/commands/switchWorkspace.tsx
@@ -1,9 +1,9 @@
-import { createFastMutation } from '../hooks/useFastMutation';
-import { getRecentCookieJars } from '../hooks/useRecentCookieJars';
-import { getRecentEnvironments } from '../hooks/useRecentEnvironments';
-import { getRecentRequests } from '../hooks/useRecentRequests';
-import { router } from '../lib/router';
-import { invokeCmd } from '../lib/tauri';
+import { createFastMutation } from "../hooks/useFastMutation";
+import { getRecentCookieJars } from "../hooks/useRecentCookieJars";
+import { getRecentEnvironments } from "../hooks/useRecentEnvironments";
+import { getRecentRequests } from "../hooks/useRecentRequests";
+import { router } from "../lib/router";
+import { invokeCmd } from "../lib/tauri";
export const switchWorkspace = createFastMutation<
void,
@@ -13,7 +13,7 @@ export const switchWorkspace = createFastMutation<
inNewWindow: boolean;
}
>({
- mutationKey: ['open_workspace'],
+ mutationKey: ["open_workspace"],
mutationFn: async ({ workspaceId, inNewWindow }) => {
const environmentId = (await getRecentEnvironments(workspaceId))[0] ?? undefined;
const requestId = (await getRecentRequests(workspaceId))[0] ?? undefined;
@@ -26,16 +26,16 @@ export const switchWorkspace = createFastMutation<
if (inNewWindow) {
const location = router.buildLocation({
- to: '/workspaces/$workspaceId',
+ to: "/workspaces/$workspaceId",
params: { workspaceId },
search,
});
- await invokeCmd('cmd_new_main_window', { url: location.href });
+ await invokeCmd("cmd_new_main_window", { url: location.href });
return;
}
await router.navigate({
- to: '/workspaces/$workspaceId',
+ to: "/workspaces/$workspaceId",
params: { workspaceId },
search,
});
diff --git a/apps/yaak-client/components/BinaryFileEditor.tsx b/apps/yaak-client/components/BinaryFileEditor.tsx
index 7069249c..7fc3d458 100644
--- a/apps/yaak-client/components/BinaryFileEditor.tsx
+++ b/apps/yaak-client/components/BinaryFileEditor.tsx
@@ -1,15 +1,15 @@
-import type { HttpRequest } from '@yaakapp-internal/models';
-import { Banner, HStack, InlineCode, VStack } from '@yaakapp-internal/ui';
-import mime from 'mime';
-import { useKeyValue } from '../hooks/useKeyValue';
-import { Button } from './core/Button';
-import { SelectFile } from './SelectFile';
+import type { HttpRequest } from "@yaakapp-internal/models";
+import { Banner, HStack, InlineCode, VStack } from "@yaakapp-internal/ui";
+import mime from "mime";
+import { useKeyValue } from "../hooks/useKeyValue";
+import { Button } from "./core/Button";
+import { SelectFile } from "./SelectFile";
type Props = {
requestId: string;
contentType: string | null;
- body: HttpRequest['body'];
- onChange: (body: HttpRequest['body']) => void;
+ body: HttpRequest["body"];
+ onChange: (body: HttpRequest["body"]) => void;
onChangeContentType: (contentType: string | null) => void;
};
@@ -21,8 +21,8 @@ export function BinaryFileEditor({
requestId,
}: Props) {
const ignoreContentType = useKeyValue({
- namespace: 'global',
- key: ['ignore_content_type', requestId],
+ namespace: "global",
+ key: ["ignore_content_type", requestId],
fallback: false,
});
@@ -31,8 +31,8 @@ export function BinaryFileEditor({
onChange({ filePath: filePath ?? undefined });
};
- const filePath = typeof body.filePath === 'string' ? body.filePath : null;
- const mimeType = mime.getType(filePath ?? '') ?? 'application/octet-stream';
+ const filePath = typeof body.filePath === "string" ? body.filePath : null;
+ const mimeType = mime.getType(filePath ?? "") ?? "application/octet-stream";
return (
diff --git a/apps/yaak-client/components/CargoFeature.tsx b/apps/yaak-client/components/CargoFeature.tsx
index 0186c35b..7a5d1fe5 100644
--- a/apps/yaak-client/components/CargoFeature.tsx
+++ b/apps/yaak-client/components/CargoFeature.tsx
@@ -1,12 +1,12 @@
-import type { ReactNode } from 'react';
-import { appInfo } from '../lib/appInfo';
+import type { ReactNode } from "react";
+import { appInfo } from "../lib/appInfo";
interface Props {
children: ReactNode;
- feature: 'updater' | 'license';
+ feature: "updater" | "license";
}
-const featureMap: Record = {
+const featureMap: Record = {
updater: appInfo.featureUpdater,
license: appInfo.featureLicense,
};
diff --git a/apps/yaak-client/components/CloneGitRepositoryDialog.tsx b/apps/yaak-client/components/CloneGitRepositoryDialog.tsx
index f43e3ff3..3b3e2af2 100644
--- a/apps/yaak-client/components/CloneGitRepositoryDialog.tsx
+++ b/apps/yaak-client/components/CloneGitRepositoryDialog.tsx
@@ -1,15 +1,15 @@
-import { open } from '@tauri-apps/plugin-dialog';
-import { gitClone } from '@yaakapp-internal/git';
-import { Banner, VStack } from '@yaakapp-internal/ui';
-import { useState } from 'react';
-import { openWorkspaceFromSyncDir } from '../commands/openWorkspaceFromSyncDir';
-import { appInfo } from '../lib/appInfo';
-import { showErrorToast } from '../lib/toast';
-import { Button } from './core/Button';
-import { Checkbox } from './core/Checkbox';
-import { IconButton } from './core/IconButton';
-import { PlainInput } from './core/PlainInput';
-import { promptCredentials } from './git/credentials';
+import { open } from "@tauri-apps/plugin-dialog";
+import { gitClone } from "@yaakapp-internal/git";
+import { Banner, VStack } from "@yaakapp-internal/ui";
+import { useState } from "react";
+import { openWorkspaceFromSyncDir } from "../commands/openWorkspaceFromSyncDir";
+import { appInfo } from "../lib/appInfo";
+import { showErrorToast } from "../lib/toast";
+import { Button } from "./core/Button";
+import { Checkbox } from "./core/Checkbox";
+import { IconButton } from "./core/IconButton";
+import { PlainInput } from "./core/PlainInput";
+import { promptCredentials } from "./git/credentials";
interface Props {
hide: () => void;
@@ -17,15 +17,15 @@ interface Props {
// Detect path separator from an existing path (defaults to /)
function getPathSeparator(path: string): string {
- return path.includes('\\') ? '\\' : '/';
+ return path.includes("\\") ? "\\" : "/";
}
export function CloneGitRepositoryDialog({ hide }: Props) {
- const [url, setUrl] = useState('');
+ const [url, setUrl] = useState("");
const [baseDirectory, setBaseDirectory] = useState(appInfo.defaultProjectDir);
const [directoryOverride, setDirectoryOverride] = useState(null);
const [hasSubdirectory, setHasSubdirectory] = useState(false);
- const [subdirectory, setSubdirectory] = useState('');
+ const [subdirectory, setSubdirectory] = useState("");
const [isCloning, setIsCloning] = useState(false);
const [error, setError] = useState(null);
@@ -38,7 +38,7 @@ export function CloneGitRepositoryDialog({ hide }: Props) {
const handleSelectDirectory = async () => {
const dir = await open({
- title: 'Select Directory',
+ title: "Select Directory",
directory: true,
multiple: false,
});
@@ -58,9 +58,9 @@ export function CloneGitRepositoryDialog({ hide }: Props) {
try {
const result = await gitClone(url, directory, promptCredentials);
- if (result.type === 'needs_credentials') {
+ if (result.type === "needs_credentials") {
setError(
- result.error ?? 'Authentication failed. Please check your credentials and try again.',
+ result.error ?? "Authentication failed. Please check your credentials and try again.",
);
return;
}
@@ -72,8 +72,8 @@ export function CloneGitRepositoryDialog({ hide }: Props) {
} catch (err) {
setError(String(err));
showErrorToast({
- id: 'git-clone-error',
- title: 'Clone Failed',
+ id: "git-clone-error",
+ title: "Clone Failed",
message: String(err),
});
} finally {
@@ -136,7 +136,7 @@ export function CloneGitRepositoryDialog({ hide }: Props) {
disabled={!url || !directory || isCloning}
isLoading={isCloning}
>
- {isCloning ? 'Cloning...' : 'Clone Repository'}
+ {isCloning ? "Cloning..." : "Clone Repository"}
);
@@ -156,5 +156,5 @@ function extractRepoName(url: string): string {
if (sshMatch?.[1]) {
return sshMatch[1];
}
- return '';
+ return "";
}
diff --git a/apps/yaak-client/components/ColorIndicator.tsx b/apps/yaak-client/components/ColorIndicator.tsx
index 931fabcf..60cdf14a 100644
--- a/apps/yaak-client/components/ColorIndicator.tsx
+++ b/apps/yaak-client/components/ColorIndicator.tsx
@@ -1,5 +1,5 @@
-import classNames from 'classnames';
-import type { CSSProperties } from 'react';
+import classNames from "classnames";
+import type { CSSProperties } from "react";
interface Props {
color: string | null;
@@ -11,7 +11,7 @@ export function ColorIndicator({ color, onClick, className }: Props) {
const style: CSSProperties = { backgroundColor: color ?? undefined };
const finalClassName = classNames(
className,
- 'inline-block w-[0.75em] h-[0.75em] rounded-full mr-1.5 border border-transparent flex-shrink-0',
+ "inline-block w-[0.75em] h-[0.75em] rounded-full mr-1.5 border border-transparent flex-shrink-0",
);
if (onClick) {
@@ -20,7 +20,7 @@ export function ColorIndicator({ color, onClick, className }: Props) {
type="button"
onClick={onClick}
style={style}
- className={classNames(finalClassName, 'hover:border-text')}
+ className={classNames(finalClassName, "hover:border-text")}
/>
);
}
diff --git a/apps/yaak-client/components/CommandPaletteDialog.tsx b/apps/yaak-client/components/CommandPaletteDialog.tsx
index dced21ce..eec1d3b9 100644
--- a/apps/yaak-client/components/CommandPaletteDialog.tsx
+++ b/apps/yaak-client/components/CommandPaletteDialog.tsx
@@ -1,8 +1,8 @@
-import { workspacesAtom } from '@yaakapp-internal/models';
-import { Heading, Icon, useDebouncedState } from '@yaakapp-internal/ui';
-import classNames from 'classnames';
-import { fuzzyFilter } from 'fuzzbunny';
-import { useAtomValue } from 'jotai';
+import { workspacesAtom } from "@yaakapp-internal/models";
+import { Heading, Icon, useDebouncedState } from "@yaakapp-internal/ui";
+import classNames from "classnames";
+import { fuzzyFilter } from "fuzzbunny";
+import { useAtomValue } from "jotai";
import {
Fragment,
type KeyboardEvent,
@@ -11,45 +11,45 @@ import {
useMemo,
useRef,
useState,
-} from 'react';
-import { createFolder } from '../commands/commands';
-import { createSubEnvironmentAndActivate } from '../commands/createEnvironment';
-import { openSettings } from '../commands/openSettings';
-import { switchWorkspace } from '../commands/switchWorkspace';
-import { useActiveCookieJar } from '../hooks/useActiveCookieJar';
-import { useActiveEnvironment } from '../hooks/useActiveEnvironment';
-import { useActiveRequest } from '../hooks/useActiveRequest';
-import { activeWorkspaceIdAtom } from '../hooks/useActiveWorkspace';
-import { useAllRequests } from '../hooks/useAllRequests';
-import { useCreateWorkspace } from '../hooks/useCreateWorkspace';
-import { useEnvironmentsBreakdown } from '../hooks/useEnvironmentsBreakdown';
-import { useGrpcRequestActions } from '../hooks/useGrpcRequestActions';
-import type { HotkeyAction } from '../hooks/useHotKey';
-import { useHttpRequestActions } from '../hooks/useHttpRequestActions';
-import { useRecentEnvironments } from '../hooks/useRecentEnvironments';
-import { useRecentRequests } from '../hooks/useRecentRequests';
-import { useRecentWorkspaces } from '../hooks/useRecentWorkspaces';
-import { useScrollIntoView } from '../hooks/useScrollIntoView';
-import { useSendAnyHttpRequest } from '../hooks/useSendAnyHttpRequest';
-import { useSidebarHidden } from '../hooks/useSidebarHidden';
-import { appInfo } from '../lib/appInfo';
-import { copyToClipboard } from '../lib/copy';
-import { createRequestAndNavigate } from '../lib/createRequestAndNavigate';
-import { deleteModelWithConfirm } from '../lib/deleteModelWithConfirm';
-import { showDialog } from '../lib/dialog';
-import { editEnvironment } from '../lib/editEnvironment';
-import { renameModelWithPrompt } from '../lib/renameModelWithPrompt';
+} from "react";
+import { createFolder } from "../commands/commands";
+import { createSubEnvironmentAndActivate } from "../commands/createEnvironment";
+import { openSettings } from "../commands/openSettings";
+import { switchWorkspace } from "../commands/switchWorkspace";
+import { useActiveCookieJar } from "../hooks/useActiveCookieJar";
+import { useActiveEnvironment } from "../hooks/useActiveEnvironment";
+import { useActiveRequest } from "../hooks/useActiveRequest";
+import { activeWorkspaceIdAtom } from "../hooks/useActiveWorkspace";
+import { useAllRequests } from "../hooks/useAllRequests";
+import { useCreateWorkspace } from "../hooks/useCreateWorkspace";
+import { useEnvironmentsBreakdown } from "../hooks/useEnvironmentsBreakdown";
+import { useGrpcRequestActions } from "../hooks/useGrpcRequestActions";
+import type { HotkeyAction } from "../hooks/useHotKey";
+import { useHttpRequestActions } from "../hooks/useHttpRequestActions";
+import { useRecentEnvironments } from "../hooks/useRecentEnvironments";
+import { useRecentRequests } from "../hooks/useRecentRequests";
+import { useRecentWorkspaces } from "../hooks/useRecentWorkspaces";
+import { useScrollIntoView } from "../hooks/useScrollIntoView";
+import { useSendAnyHttpRequest } from "../hooks/useSendAnyHttpRequest";
+import { useSidebarHidden } from "../hooks/useSidebarHidden";
+import { appInfo } from "../lib/appInfo";
+import { copyToClipboard } from "../lib/copy";
+import { createRequestAndNavigate } from "../lib/createRequestAndNavigate";
+import { deleteModelWithConfirm } from "../lib/deleteModelWithConfirm";
+import { showDialog } from "../lib/dialog";
+import { editEnvironment } from "../lib/editEnvironment";
+import { renameModelWithPrompt } from "../lib/renameModelWithPrompt";
import {
resolvedModelNameWithFolders,
resolvedModelNameWithFoldersArray,
-} from '../lib/resolvedModelName';
-import { router } from '../lib/router';
-import { setWorkspaceSearchParams } from '../lib/setWorkspaceSearchParams';
-import { CookieDialog } from './CookieDialog';
-import { Button } from './core/Button';
-import { Hotkey } from './core/Hotkey';
-import { HttpMethodTag } from './core/HttpMethodTag';
-import { PlainInput } from './core/PlainInput';
+} from "../lib/resolvedModelName";
+import { router } from "../lib/router";
+import { setWorkspaceSearchParams } from "../lib/setWorkspaceSearchParams";
+import { CookieDialog } from "./CookieDialog";
+import { Button } from "./core/Button";
+import { Hotkey } from "./core/Hotkey";
+import { HttpMethodTag } from "./core/HttpMethodTag";
+import { PlainInput } from "./core/PlainInput";
interface CommandPaletteGroup {
key: string;
@@ -66,7 +66,7 @@ type CommandPaletteItem = {
const MAX_PER_GROUP = 8;
export function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
- const [command, setCommand] = useDebouncedState('', 150);
+ const [command, setCommand] = useDebouncedState("", 150);
const [selectedItemKey, setSelectedItemKey] = useState(null);
const activeEnvironment = useActiveEnvironment();
const httpRequestActions = useHttpRequestActions();
@@ -94,79 +94,79 @@ export function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
const commands: CommandPaletteItem[] = [
{
- key: 'settings.open',
- label: 'Open Settings',
- action: 'settings.show',
+ key: "settings.open",
+ label: "Open Settings",
+ action: "settings.show",
onSelect: () => openSettings.mutate(null),
},
{
- key: 'app.create',
- label: 'Create Workspace',
+ key: "app.create",
+ label: "Create Workspace",
onSelect: createWorkspace,
},
{
- key: 'model.create',
- label: 'Create HTTP Request',
- onSelect: () => createRequestAndNavigate({ model: 'http_request', workspaceId }),
+ key: "model.create",
+ label: "Create HTTP Request",
+ onSelect: () => createRequestAndNavigate({ model: "http_request", workspaceId }),
},
{
- key: 'grpc_request.create',
- label: 'Create GRPC Request',
- onSelect: () => createRequestAndNavigate({ model: 'grpc_request', workspaceId }),
+ key: "grpc_request.create",
+ label: "Create GRPC Request",
+ onSelect: () => createRequestAndNavigate({ model: "grpc_request", workspaceId }),
},
{
- key: 'websocket_request.create',
- label: 'Create Websocket Request',
- onSelect: () => createRequestAndNavigate({ model: 'websocket_request', workspaceId }),
+ key: "websocket_request.create",
+ label: "Create Websocket Request",
+ onSelect: () => createRequestAndNavigate({ model: "websocket_request", workspaceId }),
},
{
- key: 'folder.create',
- label: 'Create Folder',
+ key: "folder.create",
+ label: "Create Folder",
onSelect: () => createFolder.mutate({}),
},
{
- key: 'cookies.show',
- label: 'Show Cookies',
+ key: "cookies.show",
+ label: "Show Cookies",
onSelect: async () => {
showDialog({
- id: 'cookies',
- title: 'Manage Cookies',
- size: 'full',
+ id: "cookies",
+ title: "Manage Cookies",
+ size: "full",
render: () => ,
});
},
},
{
- key: 'environment.edit',
- label: 'Edit Environment',
- action: 'environment_editor.toggle',
+ key: "environment.edit",
+ label: "Edit Environment",
+ action: "environment_editor.toggle",
onSelect: () => editEnvironment(activeEnvironment),
},
{
- key: 'environment.create',
- label: 'Create Environment',
+ key: "environment.create",
+ label: "Create Environment",
onSelect: () => createSubEnvironmentAndActivate.mutate(baseEnvironment),
},
{
- key: 'sidebar.toggle',
- label: 'Toggle Sidebar',
- action: 'sidebar.focus',
+ key: "sidebar.toggle",
+ label: "Toggle Sidebar",
+ action: "sidebar.focus",
onSelect: () => setSidebarHidden((h) => !h),
},
];
- if (activeRequest?.model === 'http_request') {
+ if (activeRequest?.model === "http_request") {
commands.push({
- key: 'request.send',
- action: 'request.send',
- label: 'Send Request',
+ key: "request.send",
+ action: "request.send",
+ label: "Send Request",
onSelect: () => sendRequest(activeRequest.id),
});
if (appInfo.cliVersion != null) {
commands.push({
- key: 'request.copy_cli_send',
+ key: "request.copy_cli_send",
searchText: `copy cli send yaak request send ${activeRequest.id}`,
- label: 'Copy CLI Send Command',
+ label: "Copy CLI Send Command",
onSelect: () => copyToClipboard(`yaak request send ${activeRequest.id}`),
});
}
@@ -179,7 +179,7 @@ export function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
});
}
- if (activeRequest?.model === 'grpc_request') {
+ if (activeRequest?.model === "grpc_request") {
grpcRequestActions.forEach((a, i) => {
commands.push({
key: `grpc_request_action.${i}`,
@@ -191,21 +191,21 @@ export function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
if (activeRequest != null) {
commands.push({
- key: 'http_request.rename',
- label: 'Rename Request',
+ key: "http_request.rename",
+ label: "Rename Request",
onSelect: () => renameModelWithPrompt(activeRequest),
});
commands.push({
- key: 'sidebar.selected.delete',
- label: 'Delete Request',
+ key: "sidebar.selected.delete",
+ label: "Delete Request",
onSelect: () => deleteModelWithConfirm(activeRequest),
});
}
return commands.sort((a, b) =>
- ('searchText' in a ? a.searchText : a.label).localeCompare(
- 'searchText' in b ? b.searchText : b.label,
+ ("searchText" in a ? a.searchText : a.label).localeCompare(
+ "searchText" in b ? b.searchText : b.label,
),
);
}, [
@@ -282,14 +282,14 @@ export function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
const groups = useMemo(() => {
const actionsGroup: CommandPaletteGroup = {
- key: 'actions',
- label: 'Actions',
+ key: "actions",
+ label: "Actions",
items: workspaceCommands,
};
const requestGroup: CommandPaletteGroup = {
- key: 'requests',
- label: 'Switch Request',
+ key: "requests",
+ label: "Switch Request",
items: [],
};
@@ -303,14 +303,14 @@ export function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
{resolvedModelNameWithFoldersArray(r).map((name, i, all) => (
{i !== 0 && }
-
@@ -44,7 +44,7 @@ export function ConfirmLargeResponseRequest({ children, response }: Props) {
color="secondary"
variant="border"
size="xs"
- text={() => getHttpResponseRequestBodyText(response).then((d) => d?.bodyText ?? '')}
+ text={() => getHttpResponseRequestBodyText(response).then((d) => d?.bodyText ?? "")}
/>
)}
diff --git a/apps/yaak-client/components/CookieDialog.tsx b/apps/yaak-client/components/CookieDialog.tsx
index bd50957c..6c8062c5 100644
--- a/apps/yaak-client/components/CookieDialog.tsx
+++ b/apps/yaak-client/components/CookieDialog.tsx
@@ -1,9 +1,9 @@
-import type { Cookie } from '@yaakapp-internal/models';
-import { cookieJarsAtom, patchModel } from '@yaakapp-internal/models';
-import { useAtomValue } from 'jotai';
-import { cookieDomain } from '../lib/model_util';
-import { Banner, InlineCode } from '@yaakapp-internal/ui';
-import { IconButton } from './core/IconButton';
+import type { Cookie } from "@yaakapp-internal/models";
+import { cookieJarsAtom, patchModel } from "@yaakapp-internal/models";
+import { useAtomValue } from "jotai";
+import { cookieDomain } from "../lib/model_util";
+import { Banner, InlineCode } from "@yaakapp-internal/ui";
+import { IconButton } from "./core/IconButton";
interface Props {
cookieJarId: string | null;
diff --git a/apps/yaak-client/components/CookieDropdown.tsx b/apps/yaak-client/components/CookieDropdown.tsx
index b33cd54b..7c64d6c8 100644
--- a/apps/yaak-client/components/CookieDropdown.tsx
+++ b/apps/yaak-client/components/CookieDropdown.tsx
@@ -1,16 +1,16 @@
-import { cookieJarsAtom, patchModel } from '@yaakapp-internal/models';
-import { useAtomValue } from 'jotai';
-import { memo, useMemo } from 'react';
-import { useActiveCookieJar } from '../hooks/useActiveCookieJar';
-import { useCreateCookieJar } from '../hooks/useCreateCookieJar';
-import { deleteModelWithConfirm } from '../lib/deleteModelWithConfirm';
-import { showDialog } from '../lib/dialog';
-import { showPrompt } from '../lib/prompt';
-import { setWorkspaceSearchParams } from '../lib/setWorkspaceSearchParams';
-import { CookieDialog } from './CookieDialog';
-import { Dropdown, type DropdownItem } from './core/Dropdown';
-import { Icon, InlineCode } from '@yaakapp-internal/ui';
-import { IconButton } from './core/IconButton';
+import { cookieJarsAtom, patchModel } from "@yaakapp-internal/models";
+import { useAtomValue } from "jotai";
+import { memo, useMemo } from "react";
+import { useActiveCookieJar } from "../hooks/useActiveCookieJar";
+import { useCreateCookieJar } from "../hooks/useCreateCookieJar";
+import { deleteModelWithConfirm } from "../lib/deleteModelWithConfirm";
+import { showDialog } from "../lib/dialog";
+import { showPrompt } from "../lib/prompt";
+import { setWorkspaceSearchParams } from "../lib/setWorkspaceSearchParams";
+import { CookieDialog } from "./CookieDialog";
+import { Dropdown, type DropdownItem } from "./core/Dropdown";
+import { Icon, InlineCode } from "@yaakapp-internal/ui";
+import { IconButton } from "./core/IconButton";
export const CookieDropdown = memo(function CookieDropdown() {
const activeCookieJar = useActiveCookieJar();
@@ -22,44 +22,44 @@ export const CookieDropdown = memo(function CookieDropdown() {
...(cookieJars ?? []).map((j) => ({
key: j.id,
label: j.name,
- leftSlot: ,
+ leftSlot: ,
onSelect: () => {
setWorkspaceSearchParams({ cookie_jar_id: j.id });
},
})),
...(((cookieJars ?? []).length > 0 && activeCookieJar != null
? [
- { type: 'separator', label: activeCookieJar.name },
+ { type: "separator", label: activeCookieJar.name },
{
- key: 'manage',
- label: 'Manage Cookies',
+ key: "manage",
+ label: "Manage Cookies",
leftSlot: ,
onSelect: () => {
if (activeCookieJar == null) return;
showDialog({
- id: 'cookies',
- title: 'Manage Cookies',
- size: 'full',
+ id: "cookies",
+ title: "Manage Cookies",
+ size: "full",
render: () => ,
});
},
},
{
- key: 'rename',
- label: 'Rename',
+ key: "rename",
+ label: "Rename",
leftSlot: ,
onSelect: async () => {
const name = await showPrompt({
- id: 'rename-cookie-jar',
- title: 'Rename Cookie Jar',
+ id: "rename-cookie-jar",
+ title: "Rename Cookie Jar",
description: (
<>
Enter a new name for {activeCookieJar?.name}
>
),
- label: 'Name',
- confirmText: 'Save',
- placeholder: 'New name',
+ label: "Name",
+ confirmText: "Save",
+ placeholder: "New name",
defaultValue: activeCookieJar?.name,
});
if (name == null) return;
@@ -69,9 +69,9 @@ export const CookieDropdown = memo(function CookieDropdown() {
...(((cookieJars ?? []).length > 1 // Never delete the last one
? [
{
- label: 'Delete',
+ label: "Delete",
leftSlot: ,
- color: 'danger',
+ color: "danger",
onSelect: async () => {
await deleteModelWithConfirm(activeCookieJar);
},
@@ -80,10 +80,10 @@ export const CookieDropdown = memo(function CookieDropdown() {
: []) as DropdownItem[]),
]
: []) as DropdownItem[]),
- { type: 'separator' },
+ { type: "separator" },
{
- key: 'create-cookie-jar',
- label: 'New Cookie Jar',
+ key: "create-cookie-jar",
+ label: "New Cookie Jar",
leftSlot: ,
onSelect: () => createCookieJar.mutate(),
},
diff --git a/apps/yaak-client/components/CopyButton.tsx b/apps/yaak-client/components/CopyButton.tsx
index 4a068b9d..2a0da485 100644
--- a/apps/yaak-client/components/CopyButton.tsx
+++ b/apps/yaak-client/components/CopyButton.tsx
@@ -1,10 +1,10 @@
-import { useTimedBoolean } from '@yaakapp-internal/ui';
-import { copyToClipboard } from '../lib/copy';
-import { showToast } from '../lib/toast';
-import type { ButtonProps } from './core/Button';
-import { Button } from './core/Button';
+import { useTimedBoolean } from "@yaakapp-internal/ui";
+import { copyToClipboard } from "../lib/copy";
+import { showToast } from "../lib/toast";
+import type { ButtonProps } from "./core/Button";
+import { Button } from "./core/Button";
-interface Props extends Omit {
+interface Props extends Omit {
text: string | (() => Promise);
}
@@ -14,12 +14,12 @@ export function CopyButton({ text, ...props }: Props) {
);
}
diff --git a/apps/yaak-client/components/CopyIconButton.tsx b/apps/yaak-client/components/CopyIconButton.tsx
index 84e318c0..a97a032c 100644
--- a/apps/yaak-client/components/CopyIconButton.tsx
+++ b/apps/yaak-client/components/CopyIconButton.tsx
@@ -1,8 +1,8 @@
-import { IconButton, type IconButtonProps, useTimedBoolean } from '@yaakapp-internal/ui';
-import { copyToClipboard } from '../lib/copy';
-import { showToast } from '../lib/toast';
+import { IconButton, type IconButtonProps, useTimedBoolean } from "@yaakapp-internal/ui";
+import { copyToClipboard } from "../lib/copy";
+import { showToast } from "../lib/toast";
-interface Props extends Omit {
+interface Props extends Omit {
text: string | (() => Promise);
}
@@ -11,15 +11,15 @@ export function CopyIconButton({ text, ...props }: Props) {
return (
{
- const content = typeof text === 'function' ? await text() : text;
+ const content = typeof text === "function" ? await text() : text;
if (content == null) {
showToast({
- id: 'failed-to-copy',
- color: 'danger',
- message: 'Failed to copy',
+ id: "failed-to-copy",
+ color: "danger",
+ message: "Failed to copy",
});
} else {
copyToClipboard(content, { disableToast: true });
diff --git a/apps/yaak-client/components/CreateDropdown.tsx b/apps/yaak-client/components/CreateDropdown.tsx
index 7241381d..9fa82376 100644
--- a/apps/yaak-client/components/CreateDropdown.tsx
+++ b/apps/yaak-client/components/CreateDropdown.tsx
@@ -1,8 +1,8 @@
-import { useCreateDropdownItems } from '../hooks/useCreateDropdownItems';
-import type { DropdownProps } from './core/Dropdown';
-import { Dropdown } from './core/Dropdown';
+import { useCreateDropdownItems } from "../hooks/useCreateDropdownItems";
+import type { DropdownProps } from "./core/Dropdown";
+import { Dropdown } from "./core/Dropdown";
-interface Props extends Omit {
+interface Props extends Omit {
hideFolder?: boolean;
}
@@ -10,7 +10,7 @@ export function CreateDropdown({ hideFolder, children, ...props }: Props) {
const getItems = useCreateDropdownItems({
hideFolder,
hideIcons: true,
- folderId: 'active-folder',
+ folderId: "active-folder",
});
return (
diff --git a/apps/yaak-client/components/CreateEnvironmentDialog.tsx b/apps/yaak-client/components/CreateEnvironmentDialog.tsx
index 7a0534b3..1436617a 100644
--- a/apps/yaak-client/components/CreateEnvironmentDialog.tsx
+++ b/apps/yaak-client/components/CreateEnvironmentDialog.tsx
@@ -1,12 +1,12 @@
-import { createWorkspaceModel } from '@yaakapp-internal/models';
-import { useState } from 'react';
-import { useToggle } from '../hooks/useToggle';
-import { ColorIndicator } from './ColorIndicator';
-import { Button } from './core/Button';
-import { Checkbox } from './core/Checkbox';
-import { ColorPickerWithThemeColors } from './core/ColorPicker';
-import { Label } from './core/Label';
-import { PlainInput } from './core/PlainInput';
+import { createWorkspaceModel } from "@yaakapp-internal/models";
+import { useState } from "react";
+import { useToggle } from "../hooks/useToggle";
+import { ColorIndicator } from "./ColorIndicator";
+import { Button } from "./core/Button";
+import { Checkbox } from "./core/Checkbox";
+import { ColorPickerWithThemeColors } from "./core/ColorPicker";
+import { Label } from "./core/Label";
+import { PlainInput } from "./core/PlainInput";
interface Props {
onCreate: (id: string) => void;
@@ -15,7 +15,7 @@ interface Props {
}
export function CreateEnvironmentDialog({ workspaceId, hide, onCreate }: Props) {
- const [name, setName] = useState('');
+ const [name, setName] = useState("");
const [color, setColor] = useState(null);
const [sharable, toggleSharable] = useToggle(false);
return (
@@ -24,13 +24,13 @@ export function CreateEnvironmentDialog({ workspaceId, hide, onCreate }: Props)
onSubmit={async (e) => {
e.preventDefault();
const id = await createWorkspaceModel({
- model: 'environment',
+ model: "environment",
name,
color,
variables: [],
public: sharable,
workspaceId,
- parentModel: 'environment',
+ parentModel: "environment",
});
hide();
onCreate(id);
diff --git a/apps/yaak-client/components/CreateWorkspaceDialog.tsx b/apps/yaak-client/components/CreateWorkspaceDialog.tsx
index f91c007a..339206d5 100644
--- a/apps/yaak-client/components/CreateWorkspaceDialog.tsx
+++ b/apps/yaak-client/components/CreateWorkspaceDialog.tsx
@@ -1,26 +1,26 @@
-import { gitMutations } from '@yaakapp-internal/git';
-import type { WorkspaceMeta } from '@yaakapp-internal/models';
-import { createGlobalModel, updateModel } from '@yaakapp-internal/models';
-import { VStack } from '@yaakapp-internal/ui';
-import { useState } from 'react';
-import { router } from '../lib/router';
-import { setupOrConfigureEncryption } from '../lib/setupOrConfigureEncryption';
-import { invokeCmd } from '../lib/tauri';
-import { showErrorToast } from '../lib/toast';
-import { Button } from './core/Button';
-import { Checkbox } from './core/Checkbox';
-import { Label } from './core/Label';
-import { PlainInput } from './core/PlainInput';
-import { EncryptionHelp } from './EncryptionHelp';
-import { gitCallbacks } from './git/callbacks';
-import { SyncToFilesystemSetting } from './SyncToFilesystemSetting';
+import { gitMutations } from "@yaakapp-internal/git";
+import type { WorkspaceMeta } from "@yaakapp-internal/models";
+import { createGlobalModel, updateModel } from "@yaakapp-internal/models";
+import { VStack } from "@yaakapp-internal/ui";
+import { useState } from "react";
+import { router } from "../lib/router";
+import { setupOrConfigureEncryption } from "../lib/setupOrConfigureEncryption";
+import { invokeCmd } from "../lib/tauri";
+import { showErrorToast } from "../lib/toast";
+import { Button } from "./core/Button";
+import { Checkbox } from "./core/Checkbox";
+import { Label } from "./core/Label";
+import { PlainInput } from "./core/PlainInput";
+import { EncryptionHelp } from "./EncryptionHelp";
+import { gitCallbacks } from "./git/callbacks";
+import { SyncToFilesystemSetting } from "./SyncToFilesystemSetting";
interface Props {
hide: () => void;
}
export function CreateWorkspaceDialog({ hide }: Props) {
- const [name, setName] = useState('');
+ const [name, setName] = useState("");
const [syncConfig, setSyncConfig] = useState<{
filePath: string | null;
initGit?: boolean;
@@ -34,12 +34,12 @@ export function CreateWorkspaceDialog({ hide }: Props) {
className="pb-3"
onSubmit={async (e) => {
e.preventDefault();
- const workspaceId = await createGlobalModel({ model: 'workspace', name });
+ const workspaceId = await createGlobalModel({ model: "workspace", name });
if (workspaceId == null) return;
// Do getWorkspaceMeta instead of naively creating one because it might have
// been created already when the store refreshes the workspace meta after
- const workspaceMeta = await invokeCmd('cmd_get_workspace_meta', {
+ const workspaceMeta = await invokeCmd("cmd_get_workspace_meta", {
workspaceId,
});
await updateModel({
@@ -52,8 +52,8 @@ export function CreateWorkspaceDialog({ hide }: Props) {
.init.mutateAsync()
.catch((err) => {
showErrorToast({
- id: 'git-init-error',
- title: 'Error initializing Git',
+ id: "git-init-error",
+ title: "Error initializing Git",
message: String(err),
});
});
@@ -61,7 +61,7 @@ export function CreateWorkspaceDialog({ hide }: Props) {
// Navigate to workspace
await router.navigate({
- to: '/workspaces/$workspaceId',
+ to: "/workspaces/$workspaceId",
params: { workspaceId },
});
diff --git a/apps/yaak-client/components/Dialogs.tsx b/apps/yaak-client/components/Dialogs.tsx
index bf8b72ce..297cf2f2 100644
--- a/apps/yaak-client/components/Dialogs.tsx
+++ b/apps/yaak-client/components/Dialogs.tsx
@@ -1,14 +1,14 @@
-import { useAtomValue } from 'jotai';
-import type { ComponentType } from 'react';
-import { useCallback } from 'react';
-import { dialogsAtom, hideDialog } from '../lib/dialog';
-import { Dialog, type DialogProps } from './core/Dialog';
-import { ErrorBoundary } from './ErrorBoundary';
+import { useAtomValue } from "jotai";
+import type { ComponentType } from "react";
+import { useCallback } from "react";
+import { dialogsAtom, hideDialog } from "../lib/dialog";
+import { Dialog, type DialogProps } from "./core/Dialog";
+import { ErrorBoundary } from "./ErrorBoundary";
export type DialogInstance = {
id: string;
render: ComponentType<{ hide: () => void }>;
-} & Omit;
+} & Omit;
export function Dialogs() {
const dialogs = useAtomValue(dialogsAtom);
diff --git a/apps/yaak-client/components/DnsOverridesEditor.tsx b/apps/yaak-client/components/DnsOverridesEditor.tsx
index 9faed861..45a4c246 100644
--- a/apps/yaak-client/components/DnsOverridesEditor.tsx
+++ b/apps/yaak-client/components/DnsOverridesEditor.tsx
@@ -1,5 +1,5 @@
-import type { DnsOverride, Workspace } from '@yaakapp-internal/models';
-import { patchModel } from '@yaakapp-internal/models';
+import type { DnsOverride, Workspace } from "@yaakapp-internal/models";
+import { patchModel } from "@yaakapp-internal/models";
import {
HStack,
Table,
@@ -9,12 +9,12 @@ import {
TableHeaderCell,
TableRow,
VStack,
-} from '@yaakapp-internal/ui';
-import { useCallback, useId, useMemo } from 'react';
-import { Button } from './core/Button';
-import { Checkbox } from './core/Checkbox';
-import { IconButton } from './core/IconButton';
-import { PlainInput } from './core/PlainInput';
+} from "@yaakapp-internal/ui";
+import { useCallback, useId, useMemo } from "react";
+import { Button } from "./core/Button";
+import { Checkbox } from "./core/Checkbox";
+import { IconButton } from "./core/IconButton";
+import { PlainInput } from "./core/PlainInput";
interface Props {
workspace: Workspace;
@@ -44,8 +44,8 @@ export function DnsOverridesEditor({ workspace }: Props) {
const handleAdd = useCallback(() => {
const newOverride: DnsOverride = {
- hostname: '',
- ipv4: [''],
+ hostname: "",
+ ipv4: [""],
ipv6: [],
enabled: true,
};
@@ -73,7 +73,7 @@ export function DnsOverridesEditor({ workspace }: Props) {
return (
- Override DNS resolution for specific hostnames. This works like{' '}
+ Override DNS resolution for specific hostnames. This works like{" "}
/etc/hosts but
only for requests made from this workspace.