diff --git a/package-lock.json b/package-lock.json index 52ac313c..8912ca8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "@tauri-apps/plugin-fs": "^2.0.0-rc.0", "@tauri-apps/plugin-os": "^2.0.0-rc.0", "@tauri-apps/plugin-shell": "^2.0.0-rc.0", - "@yaakapp/api": "^0.1.3", + "@yaakapp/api": "^0.1.4", "buffer": "^6.0.3", "classnames": "^2.3.2", "cm6-graphql": "^0.0.9", @@ -2981,9 +2981,9 @@ "integrity": "sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==" }, "node_modules/@yaakapp/api": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.3.tgz", - "integrity": "sha512-y5zYlyfJkO2bqDRBZFB6DCI+MJzDIjslnApsiW6F0fQHa4QP/gGXEbpjBRa32O4K/CfjziGBpW/yAzYuwBCYDQ==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.4.tgz", + "integrity": "sha512-dI5b2WPjTWXkaYBE/ltfxrJDIjIf/ETjMOzrfWDDcgT2GSBNlYmywZRTsk7j5cEbSQbSrDNgXYGJwG0I89aqSg==", "dependencies": { "@types/node": "^22.0.0" } diff --git a/package.json b/package.json index 26411158..d4396b0e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@tauri-apps/plugin-fs": "^2.0.0-rc.0", "@tauri-apps/plugin-os": "^2.0.0-rc.0", "@tauri-apps/plugin-shell": "^2.0.0-rc.0", - "@yaakapp/api": "^0.1.3", + "@yaakapp/api": "^0.1.4", "buffer": "^6.0.3", "classnames": "^2.3.2", "cm6-graphql": "^0.0.9", diff --git a/plugin-runtime-types/package.json b/plugin-runtime-types/package.json index 6eca5214..b25cd4a9 100644 --- a/plugin-runtime-types/package.json +++ b/plugin-runtime-types/package.json @@ -1,6 +1,6 @@ { "name": "@yaakapp/api", - "version": "0.1.3", + "version": "0.1.4", "main": "lib/index.js", "typings": "./lib/index.d.ts", "files": [ diff --git a/plugin-runtime-types/src/gen/Cookie.ts b/plugin-runtime-types/src/gen/Cookie.ts new file mode 100644 index 00000000..6d2dfc77 --- /dev/null +++ b/plugin-runtime-types/src/gen/Cookie.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { CookieDomain } from "./CookieDomain"; +import type { CookieExpires } from "./CookieExpires"; + +export type Cookie = { raw_cookie: string, domain: CookieDomain, expires: CookieExpires, path: [string, boolean], }; diff --git a/plugin-runtime-types/src/gen/CookieDomain.ts b/plugin-runtime-types/src/gen/CookieDomain.ts new file mode 100644 index 00000000..5ee87594 --- /dev/null +++ b/plugin-runtime-types/src/gen/CookieDomain.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CookieDomain = { "HostOnly": string } | { "Suffix": string } | "NotPresent" | "Empty"; diff --git a/plugin-runtime-types/src/gen/CookieExpires.ts b/plugin-runtime-types/src/gen/CookieExpires.ts new file mode 100644 index 00000000..1e936e38 --- /dev/null +++ b/plugin-runtime-types/src/gen/CookieExpires.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CookieExpires = { "AtUtc": string } | "SessionEnd"; diff --git a/plugin-runtime-types/src/gen/CookieJar.ts b/plugin-runtime-types/src/gen/CookieJar.ts new file mode 100644 index 00000000..aa67f049 --- /dev/null +++ b/plugin-runtime-types/src/gen/CookieJar.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Cookie } from "./Cookie"; + +export type CookieJar = { id: string, model: "cookie_jar", createdAt: string, updatedAt: string, workspaceId: string, name: string, cookies: Array, }; diff --git a/plugin-runtime-types/src/gen/Model.ts b/plugin-runtime-types/src/gen/Model.ts index ed1b1a28..b60d1670 100644 --- a/plugin-runtime-types/src/gen/Model.ts +++ b/plugin-runtime-types/src/gen/Model.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { CookieJar } from "./CookieJar"; import type { Environment } from "./Environment"; import type { Folder } from "./Folder"; import type { GrpcConnection } from "./GrpcConnection"; @@ -7,6 +8,7 @@ import type { GrpcRequest } from "./GrpcRequest"; import type { HttpRequest } from "./HttpRequest"; import type { HttpResponse } from "./HttpResponse"; import type { KeyValue } from "./KeyValue"; +import type { Settings } from "./Settings"; import type { Workspace } from "./Workspace"; -export type Model = Environment | Folder | GrpcConnection | GrpcEvent | GrpcRequest | HttpRequest | HttpResponse | KeyValue | Workspace; +export type Model = Environment | Folder | GrpcConnection | GrpcEvent | GrpcRequest | HttpRequest | HttpResponse | KeyValue | Workspace | CookieJar | Settings; diff --git a/plugin-runtime-types/src/gen/Settings.ts b/plugin-runtime-types/src/gen/Settings.ts new file mode 100644 index 00000000..78548f5f --- /dev/null +++ b/plugin-runtime-types/src/gen/Settings.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Settings = { id: string, model: "settings", createdAt: string, updatedAt: string, theme: string, appearance: string, themeDark: string, themeLight: string, updateChannel: string, interfaceFontSize: number, interfaceScale: number, editorFontSize: number, editorSoftWrap: boolean, openWorkspaceNewWindow: boolean | null, }; diff --git a/plugin-runtime-types/src/index.ts b/plugin-runtime-types/src/index.ts index b6a6fb4f..1ee8377f 100644 --- a/plugin-runtime-types/src/index.ts +++ b/plugin-runtime-types/src/index.ts @@ -3,6 +3,10 @@ export type * from './themes'; export * from './gen/BootRequest'; export * from './gen/BootResponse'; +export * from './gen/Cookie'; +export * from './gen/CookieDomain'; +export * from './gen/CookieExpires'; +export * from './gen/CookieJar'; export * from './gen/EmptyResponse'; export * from './gen/Environment'; export * from './gen/EnvironmentVariable'; @@ -27,4 +31,5 @@ export * from './gen/InternalEvent'; export * from './gen/InternalEventPayload'; export * from './gen/KeyValue'; export * from './gen/Model'; +export * from './gen/Settings'; export * from './gen/Workspace'; diff --git a/src-tauri/yaak_plugin_runtime/src/events.rs b/src-tauri/yaak_plugin_runtime/src/events.rs index a7c5ab0c..b934c6b1 100644 --- a/src-tauri/yaak_plugin_runtime/src/events.rs +++ b/src-tauri/yaak_plugin_runtime/src/events.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use ts_rs::TS; -use yaak_models::models::{Environment, Folder, GrpcConnection, GrpcEvent, GrpcRequest, HttpRequest, HttpResponse, KeyValue, Workspace}; +use yaak_models::models::{CookieJar, Environment, Folder, GrpcConnection, GrpcEvent, GrpcRequest, HttpRequest, HttpResponse, KeyValue, Settings, Workspace}; #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "camelCase")] @@ -131,4 +131,6 @@ pub enum Model { HttpResponse(HttpResponse), KeyValue(KeyValue), Workspace(Workspace), + CookieJar(CookieJar), + Settings(Settings), } diff --git a/src-web/components/GlobalHooks.tsx b/src-web/components/GlobalHooks.tsx index 9b829de9..6b7aa80c 100644 --- a/src-web/components/GlobalHooks.tsx +++ b/src-web/components/GlobalHooks.tsx @@ -1,5 +1,6 @@ import { useQueryClient } from '@tanstack/react-query'; import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'; +import type { Model } from '@yaakapp/api'; import { useEffect } from 'react'; import { useAtiveWorkspaceChangedToast } from '../hooks/useAtiveWorkspaceChangedToast'; import { useClipboardText } from '../hooks/useClipboardText'; @@ -24,7 +25,6 @@ import { settingsQueryKey, useSettings } from '../hooks/useSettings'; import { useSyncThemeToDocument } from '../hooks/useSyncThemeToDocument'; import { workspacesQueryKey } from '../hooks/useWorkspaces'; import { useZoom } from '../hooks/useZoom'; -import type { Model } from '../lib/models'; import { modelsEq } from '../lib/models'; import { catppuccinMacchiato } from '../lib/theme/themes/catppuccin'; import { githubLight } from '../lib/theme/themes/github';