Better tauri listeners and stuff

This commit is contained in:
Gregory Schier
2023-03-30 09:05:54 -07:00
parent d2e0717d91
commit bb41f0e4fe
23 changed files with 305 additions and 794 deletions

View File

@@ -2,7 +2,6 @@ export interface BaseModel {
readonly id: string;
readonly createdAt: string;
readonly updatedAt: string;
updatedBy: string;
}
export interface Workspace extends BaseModel {
@@ -26,6 +25,18 @@ export const AUTH_TYPE_NONE = null;
export const AUTH_TYPE_BASIC = 'basic';
export const AUTH_TYPE_BEARER = 'bearer';
export type Model = Workspace | HttpRequest | HttpResponse | KeyValue;
export function modelsEq(a: Model, b: Model) {
if (a.model === 'key_value' && b.model === 'key_value') {
return a.key === b.key && a.namespace === b.namespace;
}
if ('id' in a && 'id' in b) {
return a.id === b.id;
}
return false;
}
export interface HttpRequest extends BaseModel {
readonly workspaceId: string;
readonly model: 'http_request';