mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-18 23:10:51 +01:00
Compare commits
9 Commits
v0.1.1
...
4e1e4ae601
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e1e4ae601 | |||
| 6a7f58a513 | |||
| 3ed8d6bc05 | |||
| 81a72da26c | |||
| 4fa3515e32 | |||
| c5c30fd4c4 | |||
| 8c7a02a019 | |||
| 465fe19542 | |||
| d2d0f8996b |
@ -1,7 +1,7 @@
|
|||||||
import { defineConfig } from 'drizzle-kit'
|
import { defineConfig } from 'drizzle-kit'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
schema: './src-tauri/database/schemas/**.ts',
|
schema: './src/database/schemas/**.ts',
|
||||||
out: './src-tauri/database/migrations',
|
out: './src-tauri/database/migrations',
|
||||||
dialect: 'sqlite',
|
dialect: 'sqlite',
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
//import tailwindcss from '@tailwindcss/vite'
|
|
||||||
|
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
|
|
||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
@ -31,7 +29,6 @@ export default defineNuxtConfig({
|
|||||||
'@vueuse/nuxt',
|
'@vueuse/nuxt',
|
||||||
'@nuxt/icon',
|
'@nuxt/icon',
|
||||||
'@nuxt/eslint',
|
'@nuxt/eslint',
|
||||||
//"@nuxt/image",
|
|
||||||
'@nuxt/fonts',
|
'@nuxt/fonts',
|
||||||
'@nuxt/ui',
|
'@nuxt/ui',
|
||||||
],
|
],
|
||||||
@ -125,7 +122,6 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
vite: {
|
vite: {
|
||||||
//plugins: [tailwindcss()],
|
|
||||||
// Better support for Tauri CLI output
|
// Better support for Tauri CLI output
|
||||||
clearScreen: false,
|
clearScreen: false,
|
||||||
// Enable environment variables
|
// Enable environment variables
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "haex-hub",
|
"name": "haex-hub",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.1",
|
"version": "0.1.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxt build",
|
"build": "nuxt build",
|
||||||
@ -28,11 +28,9 @@
|
|||||||
"@tauri-apps/api": "^2.9.0",
|
"@tauri-apps/api": "^2.9.0",
|
||||||
"@tauri-apps/plugin-dialog": "^2.4.2",
|
"@tauri-apps/plugin-dialog": "^2.4.2",
|
||||||
"@tauri-apps/plugin-fs": "^2.4.4",
|
"@tauri-apps/plugin-fs": "^2.4.4",
|
||||||
"@tauri-apps/plugin-http": "2.5.2",
|
|
||||||
"@tauri-apps/plugin-notification": "2.3.1",
|
"@tauri-apps/plugin-notification": "2.3.1",
|
||||||
"@tauri-apps/plugin-opener": "^2.5.2",
|
"@tauri-apps/plugin-opener": "^2.5.2",
|
||||||
"@tauri-apps/plugin-os": "^2.3.2",
|
"@tauri-apps/plugin-os": "^2.3.2",
|
||||||
"@tauri-apps/plugin-sql": "2.3.0",
|
|
||||||
"@tauri-apps/plugin-store": "^2.4.1",
|
"@tauri-apps/plugin-store": "^2.4.1",
|
||||||
"@vueuse/components": "^13.9.0",
|
"@vueuse/components": "^13.9.0",
|
||||||
"@vueuse/core": "^13.9.0",
|
"@vueuse/core": "^13.9.0",
|
||||||
@ -40,7 +38,6 @@
|
|||||||
"@vueuse/nuxt": "^13.9.0",
|
"@vueuse/nuxt": "^13.9.0",
|
||||||
"drizzle-orm": "^0.44.7",
|
"drizzle-orm": "^0.44.7",
|
||||||
"eslint": "^9.38.0",
|
"eslint": "^9.38.0",
|
||||||
"fuse.js": "^7.1.0",
|
|
||||||
"nuxt-zod-i18n": "^1.12.1",
|
"nuxt-zod-i18n": "^1.12.1",
|
||||||
"swiper": "^12.0.3",
|
"swiper": "^12.0.3",
|
||||||
"tailwindcss": "^4.1.16",
|
"tailwindcss": "^4.1.16",
|
||||||
@ -65,7 +62,7 @@
|
|||||||
"tsx": "^4.20.6",
|
"tsx": "^4.20.6",
|
||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vite": "7.1.3",
|
"vite": "^7.1.3",
|
||||||
"vue-tsc": "3.0.6"
|
"vue-tsc": "3.0.6"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
|
|||||||
658
pnpm-lock.yaml
generated
658
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
1166
src-tauri/Cargo.lock
generated
1166
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "haex-hub"
|
name = "haex-hub"
|
||||||
version = "0.1.0"
|
version = "0.1.4"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@ -21,8 +21,6 @@ serde = { version = "1.0.228", features = ["derive"] }
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1.47.1", features = ["macros", "rt-multi-thread"] }
|
tokio = { version = "1.47.1", features = ["macros", "rt-multi-thread"] }
|
||||||
#libsqlite3-sys = { version = "0.31", features = ["bundled-sqlcipher"] }
|
|
||||||
#sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "sqlite"] }
|
|
||||||
base64 = "0.22"
|
base64 = "0.22"
|
||||||
ed25519-dalek = "2.1"
|
ed25519-dalek = "2.1"
|
||||||
fs_extra = "1.3.0"
|
fs_extra = "1.3.0"
|
||||||
@ -49,10 +47,11 @@ uhlc = "0.8.2"
|
|||||||
url = "2.5.7"
|
url = "2.5.7"
|
||||||
uuid = { version = "1.18.1", features = ["v4"] }
|
uuid = { version = "1.18.1", features = ["v4"] }
|
||||||
zip = "6.0.0"
|
zip = "6.0.0"
|
||||||
|
rusqlite = { version = "0.37.0", features = [
|
||||||
|
"load_extension",
|
||||||
|
"bundled-sqlcipher-vendored-openssl",
|
||||||
|
"functions",
|
||||||
|
] }
|
||||||
|
|
||||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||||
trash = "5.2.0"
|
trash = "5.2.5"
|
||||||
rusqlite = { version = "0.37.0", features = ["load_extension", "bundled-sqlcipher-vendored-openssl", "functions"] }
|
|
||||||
|
|
||||||
[target.'cfg(target_os = "android")'.dependencies]
|
|
||||||
rusqlite = { version = "0.37.0", features = ["load_extension", "bundled-sqlcipher-vendored-openssl", "functions"] }
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@
|
|||||||
"notification:allow-create-channel",
|
"notification:allow-create-channel",
|
||||||
"notification:allow-list-channels",
|
"notification:allow-list-channels",
|
||||||
"notification:allow-notify",
|
"notification:allow-notify",
|
||||||
|
"notification:allow-is-permission-granted",
|
||||||
"notification:default",
|
"notification:default",
|
||||||
"opener:allow-open-url",
|
"opener:allow-open-url",
|
||||||
"opener:default",
|
"opener:default",
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { writeFileSync, mkdirSync } from 'node:fs'
|
import { writeFileSync, mkdirSync } from 'node:fs'
|
||||||
import { join, dirname } from 'node:path'
|
import { join, dirname } from 'node:path'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import tablesNames from './tableNames.json'
|
import tablesNames from '../../src/database/tableNames.json'
|
||||||
import { schema } from './index'
|
import { schema } from '../../src/database/index'
|
||||||
import { getTableColumns } from 'drizzle-orm'
|
import { getTableColumns } from 'drizzle-orm'
|
||||||
import type { AnySQLiteColumn, SQLiteTable } from 'drizzle-orm/sqlite-core'
|
import type { AnySQLiteColumn, SQLiteTable } from 'drizzle-orm/sqlite-core'
|
||||||
|
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
import { drizzle } from 'drizzle-orm/sqlite-proxy' // Adapter für Query Building ohne direkte Verbindung
|
|
||||||
import * as schema from './schemas' // Importiere alles aus deiner Schema-Datei
|
|
||||||
export * as schema from './schemas'
|
|
||||||
// sqlite-proxy benötigt eine (dummy) Ausführungsfunktion als Argument.
|
|
||||||
// Diese wird in unserem Tauri-Workflow nie aufgerufen, da wir nur .toSQL() verwenden.
|
|
||||||
// Sie muss aber vorhanden sein, um drizzle() aufrufen zu können.
|
|
||||||
const dummyExecutor = async (
|
|
||||||
sql: string,
|
|
||||||
params: unknown[],
|
|
||||||
method: 'all' | 'run' | 'get' | 'values',
|
|
||||||
) => {
|
|
||||||
console.warn(
|
|
||||||
`Frontend Drizzle Executor wurde aufgerufen (Methode: ${method}). Das sollte im Tauri-Invoke-Workflow nicht passieren!`,
|
|
||||||
)
|
|
||||||
// Wir geben leere Ergebnisse zurück, um die Typen zufriedenzustellen, falls es doch aufgerufen wird.
|
|
||||||
return { rows: [] } // Für 'run' (z.B. bei INSERT/UPDATE)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Erstelle die Drizzle-Instanz für den SQLite-Dialekt
|
|
||||||
// Übergib den dummyExecutor und das importierte Schema
|
|
||||||
export const db = drizzle(dummyExecutor, { schema })
|
|
||||||
@ -1,104 +0,0 @@
|
|||||||
CREATE TABLE `haex_crdt_configs` (
|
|
||||||
`key` text PRIMARY KEY NOT NULL,
|
|
||||||
`value` text
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_crdt_logs` (
|
|
||||||
`id` text PRIMARY KEY NOT NULL,
|
|
||||||
`haex_timestamp` text,
|
|
||||||
`table_name` text,
|
|
||||||
`row_pks` text,
|
|
||||||
`op_type` text,
|
|
||||||
`column_name` text,
|
|
||||||
`new_value` text,
|
|
||||||
`old_value` text
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE INDEX `idx_haex_timestamp` ON `haex_crdt_logs` (`haex_timestamp`);--> statement-breakpoint
|
|
||||||
CREATE INDEX `idx_table_row` ON `haex_crdt_logs` (`table_name`,`row_pks`);--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_crdt_snapshots` (
|
|
||||||
`snapshot_id` text PRIMARY KEY NOT NULL,
|
|
||||||
`created` text,
|
|
||||||
`epoch_hlc` text,
|
|
||||||
`location_url` text,
|
|
||||||
`file_size_bytes` integer
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_desktop_items` (
|
|
||||||
`id` text PRIMARY KEY NOT NULL,
|
|
||||||
`workspace_id` text NOT NULL,
|
|
||||||
`item_type` text NOT NULL,
|
|
||||||
`extension_id` text,
|
|
||||||
`system_window_id` text,
|
|
||||||
`position_x` integer DEFAULT 0 NOT NULL,
|
|
||||||
`position_y` integer DEFAULT 0 NOT NULL,
|
|
||||||
`haex_timestamp` text,
|
|
||||||
FOREIGN KEY (`workspace_id`) REFERENCES `haex_workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
||||||
FOREIGN KEY (`extension_id`) REFERENCES `haex_extensions`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
||||||
CONSTRAINT "item_reference" CHECK(("haex_desktop_items"."item_type" = 'extension' AND "haex_desktop_items"."extension_id" IS NOT NULL AND "haex_desktop_items"."system_window_id" IS NULL) OR ("haex_desktop_items"."item_type" = 'system' AND "haex_desktop_items"."system_window_id" IS NOT NULL AND "haex_desktop_items"."extension_id" IS NULL) OR ("haex_desktop_items"."item_type" = 'file' AND "haex_desktop_items"."system_window_id" IS NOT NULL AND "haex_desktop_items"."extension_id" IS NULL) OR ("haex_desktop_items"."item_type" = 'folder' AND "haex_desktop_items"."system_window_id" IS NOT NULL AND "haex_desktop_items"."extension_id" IS NULL))
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_extension_permissions` (
|
|
||||||
`id` text PRIMARY KEY NOT NULL,
|
|
||||||
`extension_id` text NOT NULL,
|
|
||||||
`resource_type` text,
|
|
||||||
`action` text,
|
|
||||||
`target` text,
|
|
||||||
`constraints` text,
|
|
||||||
`status` text DEFAULT 'denied' NOT NULL,
|
|
||||||
`created_at` text DEFAULT (CURRENT_TIMESTAMP),
|
|
||||||
`updated_at` integer,
|
|
||||||
`haex_timestamp` text,
|
|
||||||
FOREIGN KEY (`extension_id`) REFERENCES `haex_extensions`(`id`) ON UPDATE no action ON DELETE cascade
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE UNIQUE INDEX `haex_extension_permissions_extension_id_resource_type_action_target_unique` ON `haex_extension_permissions` (`extension_id`,`resource_type`,`action`,`target`);--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_extensions` (
|
|
||||||
`id` text PRIMARY KEY NOT NULL,
|
|
||||||
`public_key` text NOT NULL,
|
|
||||||
`name` text NOT NULL,
|
|
||||||
`version` text NOT NULL,
|
|
||||||
`author` text,
|
|
||||||
`description` text,
|
|
||||||
`entry` text DEFAULT 'index.html',
|
|
||||||
`homepage` text,
|
|
||||||
`enabled` integer DEFAULT true,
|
|
||||||
`icon` text,
|
|
||||||
`signature` text NOT NULL,
|
|
||||||
`single_instance` integer DEFAULT false,
|
|
||||||
`haex_timestamp` text
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE UNIQUE INDEX `haex_extensions_public_key_name_unique` ON `haex_extensions` (`public_key`,`name`);--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_notifications` (
|
|
||||||
`id` text PRIMARY KEY NOT NULL,
|
|
||||||
`alt` text,
|
|
||||||
`date` text,
|
|
||||||
`icon` text,
|
|
||||||
`image` text,
|
|
||||||
`read` integer,
|
|
||||||
`source` text,
|
|
||||||
`text` text,
|
|
||||||
`title` text,
|
|
||||||
`type` text NOT NULL,
|
|
||||||
`haex_timestamp` text
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_settings` (
|
|
||||||
`id` text PRIMARY KEY NOT NULL,
|
|
||||||
`key` text,
|
|
||||||
`type` text,
|
|
||||||
`value` text,
|
|
||||||
`haex_timestamp` text
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE UNIQUE INDEX `haex_settings_key_type_value_unique` ON `haex_settings` (`key`,`type`,`value`);--> statement-breakpoint
|
|
||||||
CREATE TABLE `haex_workspaces` (
|
|
||||||
`id` text PRIMARY KEY NOT NULL,
|
|
||||||
`device_id` text NOT NULL,
|
|
||||||
`name` text NOT NULL,
|
|
||||||
`position` integer DEFAULT 0 NOT NULL,
|
|
||||||
`haex_timestamp` text
|
|
||||||
);
|
|
||||||
--> statement-breakpoint
|
|
||||||
CREATE UNIQUE INDEX `haex_workspaces_position_unique` ON `haex_workspaces` (`position`);
|
|
||||||
@ -1,685 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "6",
|
|
||||||
"dialect": "sqlite",
|
|
||||||
"id": "8dc25226-70f9-4d2e-89d4-f3a6b2bdf58d",
|
|
||||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
||||||
"tables": {
|
|
||||||
"haex_crdt_configs": {
|
|
||||||
"name": "haex_crdt_configs",
|
|
||||||
"columns": {
|
|
||||||
"key": {
|
|
||||||
"name": "key",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"name": "value",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"haex_crdt_logs": {
|
|
||||||
"name": "haex_crdt_logs",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"haex_timestamp": {
|
|
||||||
"name": "haex_timestamp",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"table_name": {
|
|
||||||
"name": "table_name",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"row_pks": {
|
|
||||||
"name": "row_pks",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"op_type": {
|
|
||||||
"name": "op_type",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"column_name": {
|
|
||||||
"name": "column_name",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"new_value": {
|
|
||||||
"name": "new_value",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"old_value": {
|
|
||||||
"name": "old_value",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {
|
|
||||||
"idx_haex_timestamp": {
|
|
||||||
"name": "idx_haex_timestamp",
|
|
||||||
"columns": [
|
|
||||||
"haex_timestamp"
|
|
||||||
],
|
|
||||||
"isUnique": false
|
|
||||||
},
|
|
||||||
"idx_table_row": {
|
|
||||||
"name": "idx_table_row",
|
|
||||||
"columns": [
|
|
||||||
"table_name",
|
|
||||||
"row_pks"
|
|
||||||
],
|
|
||||||
"isUnique": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"haex_crdt_snapshots": {
|
|
||||||
"name": "haex_crdt_snapshots",
|
|
||||||
"columns": {
|
|
||||||
"snapshot_id": {
|
|
||||||
"name": "snapshot_id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"created": {
|
|
||||||
"name": "created",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"epoch_hlc": {
|
|
||||||
"name": "epoch_hlc",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"location_url": {
|
|
||||||
"name": "location_url",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"file_size_bytes": {
|
|
||||||
"name": "file_size_bytes",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"haex_desktop_items": {
|
|
||||||
"name": "haex_desktop_items",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"workspace_id": {
|
|
||||||
"name": "workspace_id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"item_type": {
|
|
||||||
"name": "item_type",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"extension_id": {
|
|
||||||
"name": "extension_id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"system_window_id": {
|
|
||||||
"name": "system_window_id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"position_x": {
|
|
||||||
"name": "position_x",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"position_y": {
|
|
||||||
"name": "position_y",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"haex_timestamp": {
|
|
||||||
"name": "haex_timestamp",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {},
|
|
||||||
"foreignKeys": {
|
|
||||||
"haex_desktop_items_workspace_id_haex_workspaces_id_fk": {
|
|
||||||
"name": "haex_desktop_items_workspace_id_haex_workspaces_id_fk",
|
|
||||||
"tableFrom": "haex_desktop_items",
|
|
||||||
"tableTo": "haex_workspaces",
|
|
||||||
"columnsFrom": [
|
|
||||||
"workspace_id"
|
|
||||||
],
|
|
||||||
"columnsTo": [
|
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onDelete": "cascade",
|
|
||||||
"onUpdate": "no action"
|
|
||||||
},
|
|
||||||
"haex_desktop_items_extension_id_haex_extensions_id_fk": {
|
|
||||||
"name": "haex_desktop_items_extension_id_haex_extensions_id_fk",
|
|
||||||
"tableFrom": "haex_desktop_items",
|
|
||||||
"tableTo": "haex_extensions",
|
|
||||||
"columnsFrom": [
|
|
||||||
"extension_id"
|
|
||||||
],
|
|
||||||
"columnsTo": [
|
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onDelete": "cascade",
|
|
||||||
"onUpdate": "no action"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {
|
|
||||||
"item_reference": {
|
|
||||||
"name": "item_reference",
|
|
||||||
"value": "(\"haex_desktop_items\".\"item_type\" = 'extension' AND \"haex_desktop_items\".\"extension_id\" IS NOT NULL AND \"haex_desktop_items\".\"system_window_id\" IS NULL) OR (\"haex_desktop_items\".\"item_type\" = 'system' AND \"haex_desktop_items\".\"system_window_id\" IS NOT NULL AND \"haex_desktop_items\".\"extension_id\" IS NULL) OR (\"haex_desktop_items\".\"item_type\" = 'file' AND \"haex_desktop_items\".\"system_window_id\" IS NOT NULL AND \"haex_desktop_items\".\"extension_id\" IS NULL) OR (\"haex_desktop_items\".\"item_type\" = 'folder' AND \"haex_desktop_items\".\"system_window_id\" IS NOT NULL AND \"haex_desktop_items\".\"extension_id\" IS NULL)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"haex_extension_permissions": {
|
|
||||||
"name": "haex_extension_permissions",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"extension_id": {
|
|
||||||
"name": "extension_id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"resource_type": {
|
|
||||||
"name": "resource_type",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"action": {
|
|
||||||
"name": "action",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"target": {
|
|
||||||
"name": "target",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"constraints": {
|
|
||||||
"name": "constraints",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"name": "status",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": "'denied'"
|
|
||||||
},
|
|
||||||
"created_at": {
|
|
||||||
"name": "created_at",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": "(CURRENT_TIMESTAMP)"
|
|
||||||
},
|
|
||||||
"updated_at": {
|
|
||||||
"name": "updated_at",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"haex_timestamp": {
|
|
||||||
"name": "haex_timestamp",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {
|
|
||||||
"haex_extension_permissions_extension_id_resource_type_action_target_unique": {
|
|
||||||
"name": "haex_extension_permissions_extension_id_resource_type_action_target_unique",
|
|
||||||
"columns": [
|
|
||||||
"extension_id",
|
|
||||||
"resource_type",
|
|
||||||
"action",
|
|
||||||
"target"
|
|
||||||
],
|
|
||||||
"isUnique": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"foreignKeys": {
|
|
||||||
"haex_extension_permissions_extension_id_haex_extensions_id_fk": {
|
|
||||||
"name": "haex_extension_permissions_extension_id_haex_extensions_id_fk",
|
|
||||||
"tableFrom": "haex_extension_permissions",
|
|
||||||
"tableTo": "haex_extensions",
|
|
||||||
"columnsFrom": [
|
|
||||||
"extension_id"
|
|
||||||
],
|
|
||||||
"columnsTo": [
|
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onDelete": "cascade",
|
|
||||||
"onUpdate": "no action"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"haex_extensions": {
|
|
||||||
"name": "haex_extensions",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"public_key": {
|
|
||||||
"name": "public_key",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"name": "name",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"version": {
|
|
||||||
"name": "version",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"author": {
|
|
||||||
"name": "author",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"name": "description",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"entry": {
|
|
||||||
"name": "entry",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": "'index.html'"
|
|
||||||
},
|
|
||||||
"homepage": {
|
|
||||||
"name": "homepage",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"enabled": {
|
|
||||||
"name": "enabled",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"name": "icon",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"signature": {
|
|
||||||
"name": "signature",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"single_instance": {
|
|
||||||
"name": "single_instance",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"haex_timestamp": {
|
|
||||||
"name": "haex_timestamp",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {
|
|
||||||
"haex_extensions_public_key_name_unique": {
|
|
||||||
"name": "haex_extensions_public_key_name_unique",
|
|
||||||
"columns": [
|
|
||||||
"public_key",
|
|
||||||
"name"
|
|
||||||
],
|
|
||||||
"isUnique": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"haex_notifications": {
|
|
||||||
"name": "haex_notifications",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"alt": {
|
|
||||||
"name": "alt",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"date": {
|
|
||||||
"name": "date",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"name": "icon",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"image": {
|
|
||||||
"name": "image",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"read": {
|
|
||||||
"name": "read",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"source": {
|
|
||||||
"name": "source",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"text": {
|
|
||||||
"name": "text",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"name": "title",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"name": "type",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"haex_timestamp": {
|
|
||||||
"name": "haex_timestamp",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"haex_settings": {
|
|
||||||
"name": "haex_settings",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"key": {
|
|
||||||
"name": "key",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"name": "type",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"name": "value",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"haex_timestamp": {
|
|
||||||
"name": "haex_timestamp",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {
|
|
||||||
"haex_settings_key_type_value_unique": {
|
|
||||||
"name": "haex_settings_key_type_value_unique",
|
|
||||||
"columns": [
|
|
||||||
"key",
|
|
||||||
"type",
|
|
||||||
"value"
|
|
||||||
],
|
|
||||||
"isUnique": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
},
|
|
||||||
"haex_workspaces": {
|
|
||||||
"name": "haex_workspaces",
|
|
||||||
"columns": {
|
|
||||||
"id": {
|
|
||||||
"name": "id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": true,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"device_id": {
|
|
||||||
"name": "device_id",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"name": "name",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false
|
|
||||||
},
|
|
||||||
"position": {
|
|
||||||
"name": "position",
|
|
||||||
"type": "integer",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": true,
|
|
||||||
"autoincrement": false,
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"haex_timestamp": {
|
|
||||||
"name": "haex_timestamp",
|
|
||||||
"type": "text",
|
|
||||||
"primaryKey": false,
|
|
||||||
"notNull": false,
|
|
||||||
"autoincrement": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"indexes": {
|
|
||||||
"haex_workspaces_position_unique": {
|
|
||||||
"name": "haex_workspaces_position_unique",
|
|
||||||
"columns": [
|
|
||||||
"position"
|
|
||||||
],
|
|
||||||
"isUnique": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"foreignKeys": {},
|
|
||||||
"compositePrimaryKeys": {},
|
|
||||||
"uniqueConstraints": {},
|
|
||||||
"checkConstraints": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"views": {},
|
|
||||||
"enums": {},
|
|
||||||
"_meta": {
|
|
||||||
"schemas": {},
|
|
||||||
"tables": {},
|
|
||||||
"columns": {}
|
|
||||||
},
|
|
||||||
"internal": {
|
|
||||||
"indexes": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "7",
|
|
||||||
"dialect": "sqlite",
|
|
||||||
"entries": [
|
|
||||||
{
|
|
||||||
"idx": 0,
|
|
||||||
"version": "6",
|
|
||||||
"when": 1761821821609,
|
|
||||||
"tag": "0000_dashing_night_nurse",
|
|
||||||
"breakpoints": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
export const crdtColumnNames = {
|
|
||||||
haexTimestamp: 'haex_timestamp',
|
|
||||||
}
|
|
||||||
export * from './crdt'
|
|
||||||
export * from './haex'
|
|
||||||
@ -1 +1 @@
|
|||||||
{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["core:default","core:webview:allow-create-webview-window","core:webview:allow-create-webview","core:webview:allow-webview-show","core:webview:default","core:window:allow-create","core:window:allow-get-all-windows","core:window:allow-show","core:window:default","dialog:default","fs:allow-appconfig-read-recursive","fs:allow-appconfig-write-recursive","fs:allow-appdata-read-recursive","fs:allow-appdata-write-recursive","fs:allow-read-file","fs:allow-read-dir","fs:allow-resource-read-recursive","fs:allow-resource-write-recursive","fs:allow-download-read-recursive","fs:allow-download-write-recursive","fs:default",{"identifier":"fs:scope","allow":[{"path":"**"}]},"http:allow-fetch-send","http:allow-fetch","http:default","notification:allow-create-channel","notification:allow-list-channels","notification:allow-notify","notification:default","opener:allow-open-url","opener:default","os:allow-hostname","os:default","store:default"]}}
|
{"default":{"identifier":"default","description":"Capability for the main window","local":true,"windows":["main"],"permissions":["core:default","core:webview:allow-create-webview-window","core:webview:allow-create-webview","core:webview:allow-webview-show","core:webview:default","core:window:allow-create","core:window:allow-get-all-windows","core:window:allow-show","core:window:default","dialog:default","fs:allow-appconfig-read-recursive","fs:allow-appconfig-write-recursive","fs:allow-appdata-read-recursive","fs:allow-appdata-write-recursive","fs:allow-read-file","fs:allow-read-dir","fs:allow-resource-read-recursive","fs:allow-resource-write-recursive","fs:allow-download-read-recursive","fs:allow-download-write-recursive","fs:default",{"identifier":"fs:scope","allow":[{"path":"**"}]},"http:allow-fetch-send","http:allow-fetch","http:default","notification:allow-create-channel","notification:allow-list-channels","notification:allow-notify","notification:allow-is-permission-granted","notification:default","opener:allow-open-url","opener:default","os:allow-hostname","os:default","store:default"]}}
|
||||||
@ -21,7 +21,7 @@ struct TableDefinition {
|
|||||||
pub fn generate_table_names() {
|
pub fn generate_table_names() {
|
||||||
let out_dir = env::var("OUT_DIR").expect("OUT_DIR ist nicht gesetzt.");
|
let out_dir = env::var("OUT_DIR").expect("OUT_DIR ist nicht gesetzt.");
|
||||||
println!("Generiere Tabellennamen nach {}", out_dir);
|
println!("Generiere Tabellennamen nach {}", out_dir);
|
||||||
let schema_path = Path::new("database/tableNames.json");
|
let schema_path = Path::new("../src/database/tableNames.json");
|
||||||
let dest_path = Path::new(&out_dir).join("tableNames.rs");
|
let dest_path = Path::new(&out_dir).join("tableNames.rs");
|
||||||
|
|
||||||
let file = File::open(&schema_path).expect("Konnte tableNames.json nicht öffnen");
|
let file = File::open(&schema_path).expect("Konnte tableNames.json nicht öffnen");
|
||||||
@ -66,7 +66,7 @@ pub fn generate_table_names() {
|
|||||||
f.write_all(code.as_bytes())
|
f.write_all(code.as_bytes())
|
||||||
.expect("Konnte nicht in Zieldatei schreiben");
|
.expect("Konnte nicht in Zieldatei schreiben");
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=database/tableNames.json");
|
println!("cargo:rerun-if-changed=../src/database/tableNames.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Konvertiert einen String zu SCREAMING_SNAKE_CASE
|
/// Konvertiert einen String zu SCREAMING_SNAKE_CASE
|
||||||
|
|||||||
@ -11,8 +11,6 @@ const INSERT_TRIGGER_TPL: &str = "z_crdt_{TABLE_NAME}_insert";
|
|||||||
const UPDATE_TRIGGER_TPL: &str = "z_crdt_{TABLE_NAME}_update";
|
const UPDATE_TRIGGER_TPL: &str = "z_crdt_{TABLE_NAME}_update";
|
||||||
const DELETE_TRIGGER_TPL: &str = "z_crdt_{TABLE_NAME}_delete";
|
const DELETE_TRIGGER_TPL: &str = "z_crdt_{TABLE_NAME}_delete";
|
||||||
|
|
||||||
//const SYNC_ACTIVE_KEY: &str = "sync_active";
|
|
||||||
|
|
||||||
pub const HLC_TIMESTAMP_COLUMN: &str = "haex_timestamp";
|
pub const HLC_TIMESTAMP_COLUMN: &str = "haex_timestamp";
|
||||||
|
|
||||||
/// Name der custom UUID-Generierungs-Funktion (registriert in database::core::open_and_init_db)
|
/// Name der custom UUID-Generierungs-Funktion (registriert in database::core::open_and_init_db)
|
||||||
|
|||||||
@ -135,7 +135,6 @@ pub fn get_vaults_directory(app_handle: &AppHandle) -> Result<String, DatabaseEr
|
|||||||
Ok(vaults_dir.to_string_lossy().to_string())
|
Ok(vaults_dir.to_string_lossy().to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
//#[serde(tag = "type", content = "details")]
|
|
||||||
#[derive(Debug, Serialize, Deserialize, TS)]
|
#[derive(Debug, Serialize, Deserialize, TS)]
|
||||||
#[ts(export)]
|
#[ts(export)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
@ -450,9 +449,6 @@ pub fn open_encrypted_database(
|
|||||||
state: State<'_, AppState>,
|
state: State<'_, AppState>,
|
||||||
) -> Result<String, DatabaseError> {
|
) -> Result<String, DatabaseError> {
|
||||||
println!("Opening encrypted database vault_path: {}", vault_path);
|
println!("Opening encrypted database vault_path: {}", vault_path);
|
||||||
|
|
||||||
// Vault-Pfad aus dem Namen ableiten
|
|
||||||
//let vault_path = get_vault_path(&app_handle, &vault_name)?;
|
|
||||||
println!("Resolved vault path: {}", vault_path);
|
println!("Resolved vault path: {}", vault_path);
|
||||||
|
|
||||||
if !Path::new(&vault_path).exists() {
|
if !Path::new(&vault_path).exists() {
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "haex-hub",
|
"productName": "haex-hub",
|
||||||
"version": "0.1.0",
|
"version": "0.1.4",
|
||||||
"identifier": "space.haex.hub",
|
"identifier": "space.haex.hub",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "pnpm dev",
|
"beforeDevCommand": "pnpm dev",
|
||||||
"devUrl": "http://localhost:3003",
|
"devUrl": "http://localhost:3003",
|
||||||
"beforeBuildCommand": "pnpm generate",
|
"beforeBuildCommand": "pnpm generate",
|
||||||
"frontendDist": "../dist"
|
"frontendDist": "../.output/public"
|
||||||
},
|
},
|
||||||
|
|
||||||
"app": {
|
"app": {
|
||||||
@ -15,46 +15,12 @@
|
|||||||
{
|
{
|
||||||
"title": "haex-hub",
|
"title": "haex-hub",
|
||||||
"width": 800,
|
"width": 800,
|
||||||
"height": 600
|
"height": 600,
|
||||||
|
"devtools": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"security": {
|
"security": {
|
||||||
"csp": {
|
"csp": null,
|
||||||
"default-src": ["'self'", "http://tauri.localhost", "haex-extension:"],
|
|
||||||
"script-src": [
|
|
||||||
"'self'",
|
|
||||||
"http://tauri.localhost",
|
|
||||||
"haex-extension:",
|
|
||||||
"'wasm-unsafe-eval'"
|
|
||||||
],
|
|
||||||
"style-src": [
|
|
||||||
"'self'",
|
|
||||||
"http://tauri.localhost",
|
|
||||||
"haex-extension:",
|
|
||||||
"'unsafe-inline'"
|
|
||||||
],
|
|
||||||
"connect-src": [
|
|
||||||
"'self'",
|
|
||||||
"http://tauri.localhost",
|
|
||||||
"haex-extension:",
|
|
||||||
"ipc:",
|
|
||||||
"http://ipc.localhost",
|
|
||||||
"ws://localhost:*"
|
|
||||||
],
|
|
||||||
"img-src": [
|
|
||||||
"'self'",
|
|
||||||
"http://tauri.localhost",
|
|
||||||
"haex-extension:",
|
|
||||||
"data:",
|
|
||||||
"blob:"
|
|
||||||
],
|
|
||||||
"font-src": ["'self'", "http://tauri.localhost", "haex-extension:"],
|
|
||||||
"object-src": ["'none'"],
|
|
||||||
"media-src": ["'self'", "http://tauri.localhost", "haex-extension:"],
|
|
||||||
"frame-src": ["haex-extension:"],
|
|
||||||
"frame-ancestors": ["'none'"],
|
|
||||||
"base-uri": ["'self'"]
|
|
||||||
},
|
|
||||||
"assetProtocol": {
|
"assetProtocol": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"scope": ["$APPDATA", "$RESOURCE"]
|
"scope": ["$APPDATA", "$RESOURCE"]
|
||||||
@ -63,7 +29,7 @@
|
|||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"targets": "all",
|
"targets": ["deb"],
|
||||||
"icon": [
|
"icon": [
|
||||||
"icons/32x32.png",
|
"icons/32x32.png",
|
||||||
"icons/128x128.png",
|
"icons/128x128.png",
|
||||||
|
|||||||
1
src/database/index.ts
Normal file
1
src/database/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * as schema from './schemas'
|
||||||
@ -1,12 +1,12 @@
|
|||||||
import { integer, sqliteTable, text, index } from 'drizzle-orm/sqlite-core'
|
import { integer, sqliteTable, text, index } from 'drizzle-orm/sqlite-core'
|
||||||
import tableNames from '../tableNames.json'
|
import tableNames from '~/database/tableNames.json'
|
||||||
|
|
||||||
export const haexCrdtLogs = sqliteTable(
|
export const haexCrdtLogs = sqliteTable(
|
||||||
tableNames.haex.crdt.logs.name,
|
tableNames.haex.crdt.logs.name,
|
||||||
{
|
{
|
||||||
id: text()
|
id: text()
|
||||||
.primaryKey()
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
.primaryKey(),
|
||||||
haexTimestamp: text(tableNames.haex.crdt.logs.columns.haexTimestamp),
|
haexTimestamp: text(tableNames.haex.crdt.logs.columns.haexTimestamp),
|
||||||
tableName: text(tableNames.haex.crdt.logs.columns.tableName),
|
tableName: text(tableNames.haex.crdt.logs.columns.tableName),
|
||||||
rowPks: text(tableNames.haex.crdt.logs.columns.rowPks, { mode: 'json' }),
|
rowPks: text(tableNames.haex.crdt.logs.columns.rowPks, { mode: 'json' }),
|
||||||
@ -33,8 +33,8 @@ export const haexCrdtSnapshots = sqliteTable(
|
|||||||
tableNames.haex.crdt.snapshots.name,
|
tableNames.haex.crdt.snapshots.name,
|
||||||
{
|
{
|
||||||
snapshotId: text(tableNames.haex.crdt.snapshots.columns.snapshotId)
|
snapshotId: text(tableNames.haex.crdt.snapshots.columns.snapshotId)
|
||||||
.primaryKey()
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
.primaryKey(),
|
||||||
created: text(),
|
created: text(),
|
||||||
epochHlc: text(tableNames.haex.crdt.snapshots.columns.epochHlc),
|
epochHlc: text(tableNames.haex.crdt.snapshots.columns.epochHlc),
|
||||||
locationUrl: text(tableNames.haex.crdt.snapshots.columns.locationUrl),
|
locationUrl: text(tableNames.haex.crdt.snapshots.columns.locationUrl),
|
||||||
@ -45,8 +45,6 @@ export const haexCrdtSnapshots = sqliteTable(
|
|||||||
)
|
)
|
||||||
|
|
||||||
export const haexCrdtConfigs = sqliteTable(tableNames.haex.crdt.configs.name, {
|
export const haexCrdtConfigs = sqliteTable(tableNames.haex.crdt.configs.name, {
|
||||||
key: text()
|
key: text().primaryKey(),
|
||||||
.primaryKey()
|
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
|
||||||
value: text(),
|
value: text(),
|
||||||
})
|
})
|
||||||
@ -8,8 +8,11 @@ import {
|
|||||||
type AnySQLiteColumn,
|
type AnySQLiteColumn,
|
||||||
type SQLiteColumnBuilderBase,
|
type SQLiteColumnBuilderBase,
|
||||||
} from 'drizzle-orm/sqlite-core'
|
} from 'drizzle-orm/sqlite-core'
|
||||||
import tableNames from '../tableNames.json'
|
import tableNames from '~/database/tableNames.json'
|
||||||
import { crdtColumnNames } from '.'
|
|
||||||
|
const crdtColumnNames = {
|
||||||
|
haexTimestamp: 'haex_timestamp',
|
||||||
|
}
|
||||||
|
|
||||||
// Helper function to add common CRDT columns ( haexTimestamp)
|
// Helper function to add common CRDT columns ( haexTimestamp)
|
||||||
export const withCrdtColumns = <
|
export const withCrdtColumns = <
|
||||||
@ -25,8 +28,8 @@ export const haexSettings = sqliteTable(
|
|||||||
tableNames.haex.settings.name,
|
tableNames.haex.settings.name,
|
||||||
withCrdtColumns({
|
withCrdtColumns({
|
||||||
id: text()
|
id: text()
|
||||||
.primaryKey()
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
.primaryKey(),
|
||||||
key: text(),
|
key: text(),
|
||||||
type: text(),
|
type: text(),
|
||||||
value: text(),
|
value: text(),
|
||||||
@ -40,8 +43,8 @@ export const haexExtensions = sqliteTable(
|
|||||||
tableNames.haex.extensions.name,
|
tableNames.haex.extensions.name,
|
||||||
withCrdtColumns({
|
withCrdtColumns({
|
||||||
id: text()
|
id: text()
|
||||||
.primaryKey()
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
.primaryKey(),
|
||||||
public_key: text().notNull(),
|
public_key: text().notNull(),
|
||||||
name: text().notNull(),
|
name: text().notNull(),
|
||||||
version: text().notNull(),
|
version: text().notNull(),
|
||||||
@ -66,8 +69,8 @@ export const haexExtensionPermissions = sqliteTable(
|
|||||||
tableNames.haex.extension_permissions.name,
|
tableNames.haex.extension_permissions.name,
|
||||||
withCrdtColumns({
|
withCrdtColumns({
|
||||||
id: text()
|
id: text()
|
||||||
.primaryKey()
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
.primaryKey(),
|
||||||
extensionId: text(tableNames.haex.extension_permissions.columns.extensionId)
|
extensionId: text(tableNames.haex.extension_permissions.columns.extensionId)
|
||||||
.notNull()
|
.notNull()
|
||||||
.references((): AnySQLiteColumn => haexExtensions.id, {
|
.references((): AnySQLiteColumn => haexExtensions.id, {
|
||||||
@ -104,7 +107,9 @@ export type SelecthaexExtensionPermissions =
|
|||||||
export const haexNotifications = sqliteTable(
|
export const haexNotifications = sqliteTable(
|
||||||
tableNames.haex.notifications.name,
|
tableNames.haex.notifications.name,
|
||||||
withCrdtColumns({
|
withCrdtColumns({
|
||||||
id: text().primaryKey(),
|
id: text()
|
||||||
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
|
.primaryKey(),
|
||||||
alt: text(),
|
alt: text(),
|
||||||
date: text(),
|
date: text(),
|
||||||
icon: text(),
|
icon: text(),
|
||||||
@ -125,8 +130,8 @@ export const haexWorkspaces = sqliteTable(
|
|||||||
tableNames.haex.workspaces.name,
|
tableNames.haex.workspaces.name,
|
||||||
withCrdtColumns({
|
withCrdtColumns({
|
||||||
id: text(tableNames.haex.workspaces.columns.id)
|
id: text(tableNames.haex.workspaces.columns.id)
|
||||||
.primaryKey()
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
.primaryKey(),
|
||||||
deviceId: text(tableNames.haex.workspaces.columns.deviceId).notNull(),
|
deviceId: text(tableNames.haex.workspaces.columns.deviceId).notNull(),
|
||||||
name: text(tableNames.haex.workspaces.columns.name).notNull(),
|
name: text(tableNames.haex.workspaces.columns.name).notNull(),
|
||||||
position: integer(tableNames.haex.workspaces.columns.position)
|
position: integer(tableNames.haex.workspaces.columns.position)
|
||||||
@ -142,8 +147,8 @@ export const haexDesktopItems = sqliteTable(
|
|||||||
tableNames.haex.desktop_items.name,
|
tableNames.haex.desktop_items.name,
|
||||||
withCrdtColumns({
|
withCrdtColumns({
|
||||||
id: text(tableNames.haex.desktop_items.columns.id)
|
id: text(tableNames.haex.desktop_items.columns.id)
|
||||||
.primaryKey()
|
.$defaultFn(() => crypto.randomUUID())
|
||||||
.$defaultFn(() => crypto.randomUUID()),
|
.primaryKey(),
|
||||||
workspaceId: text(tableNames.haex.desktop_items.columns.workspaceId)
|
workspaceId: text(tableNames.haex.desktop_items.columns.workspaceId)
|
||||||
.notNull()
|
.notNull()
|
||||||
.references(() => haexWorkspaces.id, { onDelete: 'cascade' }),
|
.references(() => haexWorkspaces.id, { onDelete: 'cascade' }),
|
||||||
2
src/database/schemas/index.ts
Normal file
2
src/database/schemas/index.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './crdt'
|
||||||
|
export * from './haex'
|
||||||
25
src/plugins/init-logger.ts
Normal file
25
src/plugins/init-logger.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
export default defineNuxtPlugin({
|
||||||
|
name: 'init-logger',
|
||||||
|
enforce: 'pre',
|
||||||
|
parallel: false,
|
||||||
|
setup() {
|
||||||
|
// Add global error handler for better debugging
|
||||||
|
window.addEventListener('error', (event) => {
|
||||||
|
console.error('[HaexHub] Global error caught:', {
|
||||||
|
message: event.message,
|
||||||
|
filename: event.filename,
|
||||||
|
lineno: event.lineno,
|
||||||
|
colno: event.colno,
|
||||||
|
error: event.error,
|
||||||
|
stack: event.error?.stack,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
window.addEventListener('unhandledrejection', (event) => {
|
||||||
|
console.error('[HaexHub] Unhandled rejection:', {
|
||||||
|
reason: event.reason,
|
||||||
|
promise: event.promise,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
@ -1,9 +1,9 @@
|
|||||||
import { eq } from 'drizzle-orm'
|
import { eq } from 'drizzle-orm'
|
||||||
import { haexDesktopItems } from '~~/src-tauri/database/schemas'
|
import { haexDesktopItems } from '~/database/schemas'
|
||||||
import type {
|
import type {
|
||||||
InsertHaexDesktopItems,
|
InsertHaexDesktopItems,
|
||||||
SelectHaexDesktopItems,
|
SelectHaexDesktopItems,
|
||||||
} from '~~/src-tauri/database/schemas'
|
} from '~/database/schemas'
|
||||||
import de from './de.json'
|
import de from './de.json'
|
||||||
import en from './en.json'
|
import en from './en.json'
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { asc, eq } from 'drizzle-orm'
|
|||||||
import {
|
import {
|
||||||
haexWorkspaces,
|
haexWorkspaces,
|
||||||
type SelectHaexWorkspaces,
|
type SelectHaexWorkspaces,
|
||||||
} from '~~/src-tauri/database/schemas'
|
} from '~/database/schemas'
|
||||||
import type { Swiper } from 'swiper/types'
|
import type { Swiper } from 'swiper/types'
|
||||||
|
|
||||||
export type IWorkspace = SelectHaexWorkspaces
|
export type IWorkspace = SelectHaexWorkspaces
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { breakpointsTailwind } from '@vueuse/core'
|
import { breakpointsTailwind } from '@vueuse/core'
|
||||||
import { broadcastContextToAllExtensions } from '~/composables/extensionMessageHandler'
|
import { broadcastContextToAllExtensions } from '~/composables/extensionMessageHandler'
|
||||||
|
|
||||||
import de from './de.json'
|
import de from './de.json'
|
||||||
import en from './en.json'
|
import en from './en.json'
|
||||||
|
|
||||||
@ -13,7 +14,6 @@ export const useUiStore = defineStore('uiStore', () => {
|
|||||||
const { locale } = useI18n({
|
const { locale } = useI18n({
|
||||||
useScope: 'global',
|
useScope: 'global',
|
||||||
})
|
})
|
||||||
const { platform } = useDeviceStore()
|
|
||||||
|
|
||||||
$i18n.setLocaleMessage('de', {
|
$i18n.setLocaleMessage('de', {
|
||||||
ui: de,
|
ui: de,
|
||||||
@ -62,11 +62,13 @@ export const useUiStore = defineStore('uiStore', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Broadcast theme and locale changes to extensions
|
// Broadcast theme and locale changes to extensions
|
||||||
watch([currentThemeName, locale], () => {
|
watch([currentThemeName, locale], async () => {
|
||||||
|
const deviceStore = useDeviceStore()
|
||||||
|
const platformValue = await deviceStore.platform
|
||||||
broadcastContextToAllExtensions({
|
broadcastContextToAllExtensions({
|
||||||
theme: currentThemeName.value,
|
theme: currentThemeName.value,
|
||||||
locale: locale.value,
|
locale: locale.value,
|
||||||
platform,
|
platform: platformValue,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { drizzle } from 'drizzle-orm/sqlite-proxy'
|
import { drizzle } from 'drizzle-orm/sqlite-proxy'
|
||||||
import { invoke } from '@tauri-apps/api/core'
|
import { invoke } from '@tauri-apps/api/core'
|
||||||
import { schema } from '@/../src-tauri/database/index'
|
import { schema } from '~/database'
|
||||||
import type {
|
import type {
|
||||||
AsyncRemoteCallback,
|
AsyncRemoteCallback,
|
||||||
SqliteRemoteDatabase,
|
SqliteRemoteDatabase,
|
||||||
@ -21,11 +21,12 @@ export const useVaultStore = defineStore('vaultStore', () => {
|
|||||||
public: { haexVault },
|
public: { haexVault },
|
||||||
} = useRuntimeConfig()
|
} = useRuntimeConfig()
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
const currentVaultId = computed<string | undefined>({
|
const currentVaultId = computed<string | undefined>({
|
||||||
get: () =>
|
get: () =>
|
||||||
getSingleRouteParam(useRouter().currentRoute.value.params.vaultId),
|
getSingleRouteParam(router.currentRoute.value.params.vaultId),
|
||||||
set: (newVaultId) => {
|
set: (newVaultId) => {
|
||||||
useRouter().currentRoute.value.params.vaultId = newVaultId ?? ''
|
router.currentRoute.value.params.vaultId = newVaultId ?? ''
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { and, eq, or, type SQLWrapper } from 'drizzle-orm'
|
|||||||
import {
|
import {
|
||||||
haexNotifications,
|
haexNotifications,
|
||||||
type InsertHaexNotifications,
|
type InsertHaexNotifications,
|
||||||
} from '~~/src-tauri/database/schemas/haex'
|
} from '~/database/schemas/haex'
|
||||||
import {
|
import {
|
||||||
isPermissionGranted,
|
isPermissionGranted,
|
||||||
requestPermission,
|
requestPermission,
|
||||||
@ -31,7 +31,12 @@ export const useNotificationStore = defineStore('notificationStore', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const checkNotificationAsync = async () => {
|
const checkNotificationAsync = async () => {
|
||||||
isNotificationAllowed.value = await isPermissionGranted()
|
try {
|
||||||
|
isNotificationAllowed.value = await isPermissionGranted()
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Notification permission check failed:', error)
|
||||||
|
isNotificationAllowed.value = false
|
||||||
|
}
|
||||||
return isNotificationAllowed.value
|
return isNotificationAllowed.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { and, eq } from 'drizzle-orm'
|
import { and, eq } from 'drizzle-orm'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import * as schema from '@/../src-tauri/database/schemas/haex'
|
import * as schema from '~/database/schemas/haex'
|
||||||
import type { Locale } from 'vue-i18n'
|
import type { Locale } from 'vue-i18n'
|
||||||
|
|
||||||
export enum VaultSettingsTypeEnum {
|
export enum VaultSettingsTypeEnum {
|
||||||
|
|||||||
Reference in New Issue
Block a user