[WIP] Encryption for secure values (#183)

This commit is contained in:
Gregory Schier
2025-04-15 07:18:26 -07:00
committed by GitHub
parent e114a85c39
commit 2e55a1bd6d
208 changed files with 4063 additions and 28698 deletions
+1
View File
@@ -1,6 +1,7 @@
import { AnyModel } from '../bindings/gen_models';
export * from '../bindings/gen_models';
export * from '../bindings/gen_util';
export * from './store';
export * from './atoms';
+7 -1
View File
@@ -102,7 +102,7 @@ export function patchModelById<M extends AnyModel['model'], T extends ExtractMod
}
const newModel = typeof patch === 'function' ? patch(prev) : { ...prev, ...patch };
return invoke<string>('plugin:yaak-models|upsert', { model: newModel });
return updateModel(newModel);
}
export async function patchModel<M extends AnyModel['model'], T extends ExtractModel<AnyModel, M>>(
@@ -112,6 +112,12 @@ export async function patchModel<M extends AnyModel['model'], T extends ExtractM
return patchModelById<M, T>(base.model, base.id, patch);
}
export async function updateModel<M extends AnyModel['model'], T extends ExtractModel<AnyModel, M>>(
model: T,
): Promise<string> {
return invoke<string>('plugin:yaak-models|upsert', { model });
}
export async function deleteModelById<
M extends AnyModel['model'],
T extends ExtractModel<AnyModel, M>,