This commit is contained in:
Gregory Schier
2025-01-26 13:13:45 -08:00
committed by GitHub
parent 82b1ad35ff
commit f678593903
99 changed files with 3492 additions and 1583 deletions

View File

@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { SyncModel } from "./models.js";
import type { SyncState } from "./models.js";
import type { SyncModel } from "./gen_models.js";
import type { SyncState } from "./gen_models.js";
export type FsCandidate = { "type": "FsCandidate", model: SyncModel, relPath: string, checksum: string, };

View File

@@ -1,7 +1,7 @@
import { Channel, invoke } from '@tauri-apps/api/core';
import { emit } from '@tauri-apps/api/event';
import { SyncOp } from './bindings/sync';
import { WatchEvent, WatchResult } from './bindings/watch';
import { SyncOp } from './bindings/gen_sync';
import { WatchEvent, WatchResult } from './bindings/gen_watch';
export async function calculateSync(workspaceId: string, syncDir: string) {
return invoke<SyncOp[]>('plugin:yaak-sync|calculate', {

View File

@@ -51,7 +51,7 @@ pub async fn apply<R: Runtime>(
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export, export_to = "watch.ts")]
#[ts(export, export_to = "gen_watch.ts")]
pub(crate) struct WatchResult {
unlisten_event: String,
}

View File

@@ -10,7 +10,7 @@ use yaak_models::models::{AnyModel, Environment, Folder, GrpcRequest, HttpReques
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[serde(rename_all = "snake_case", tag = "type")]
#[ts(export, export_to = "models.ts")]
#[ts(export, export_to = "gen_models.ts")]
pub enum SyncModel {
Workspace(Workspace),
Environment(Environment),

View File

@@ -21,7 +21,7 @@ use yaak_models::queries::{
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[serde(rename_all = "camelCase", tag = "type")]
#[ts(export, export_to = "sync.ts")]
#[ts(export, export_to = "gen_sync.ts")]
pub(crate) enum SyncOp {
FsCreate {
model: SyncModel,
@@ -98,7 +98,7 @@ impl DbCandidate {
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[serde(rename_all = "camelCase", tag = "type")]
#[ts(export, export_to = "sync.ts")]
#[ts(export, export_to = "gen_sync.ts")]
pub(crate) struct FsCandidate {
pub(crate) model: SyncModel,
pub(crate) rel_path: PathBuf,

View File

@@ -10,7 +10,7 @@ use ts_rs::TS;
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export, export_to = "watch.ts")]
#[ts(export, export_to = "gen_watch.ts")]
pub(crate) struct WatchEvent {
paths: Vec<PathBuf>,
kind: String,