From fc841f238b2d118db00adea704e76cb8c9fb5af9 Mon Sep 17 00:00:00 2001 From: haex Date: Thu, 2 Oct 2025 14:31:47 +0200 Subject: [PATCH] generate table structs from ts in rust --- package.json | 3 + pnpm-lock.yaml | 170 +-- src-tauri/database/generate-rust-types.ts | 195 ++++ src-tauri/database/index.ts | 4 +- .../migrations/0000_glamorous_hulk.sql | 139 +++ .../migrations/0000_zippy_scourge.sql | 26 - .../migrations/0001_wealthy_thaddeus_ross.sql | 7 - .../migrations/0002_married_bushwacker.sql | 4 - .../0003_familiar_doctor_faustus.sql | 11 - .../migrations/0004_wooden_lockheed.sql | 1 - .../database/migrations/0005_wooden_nuke.sql | 50 - .../migrations/0006_complete_martin_li.sql | 5 - .../database/migrations/0007_daffy_tusk.sql | 1 - .../migrations/0008_faulty_mercury.sql | 40 - .../migrations/0009_curved_selene.sql | 1 - .../migrations/0010_deep_war_machine.sql | 32 - .../migrations/0011_illegal_thor_girl.sql | 21 - .../migrations/0012_special_gwen_stacy.sql | 15 - .../migrations/meta/0000_snapshot.json | 890 ++++++++++++++-- .../migrations/meta/0001_snapshot.json | 223 ---- .../migrations/meta/0002_snapshot.json | 180 ---- .../migrations/meta/0003_snapshot.json | 251 ----- .../migrations/meta/0004_snapshot.json | 253 ----- .../migrations/meta/0005_snapshot.json | 583 ----------- .../migrations/meta/0006_snapshot.json | 620 ----------- .../migrations/meta/0007_snapshot.json | 627 ----------- .../migrations/meta/0008_snapshot.json | 630 ------------ .../migrations/meta/0009_snapshot.json | 634 ------------ .../migrations/meta/0010_snapshot.json | 825 --------------- .../migrations/meta/0011_snapshot.json | 830 --------------- .../migrations/meta/0012_snapshot.json | 900 ---------------- .../database/migrations/meta/_journal.json | 88 +- src-tauri/database/schemas/crdt.ts | 38 +- src-tauri/database/schemas/haex.ts | 20 +- src-tauri/database/schemas/index.ts | 2 + src-tauri/database/vault.db | Bin 131072 -> 131072 bytes src-tauri/src/build/mod.rs | 3 + src-tauri/src/build/rust_types.rs | 24 + src-tauri/src/build/table_names.rs | 64 ++ src-tauri/src/database/core.rs | 1 + src-tauri/src/database/generated.rs | 210 ++++ src-tauri/src/extension/core_old.rs | 973 ------------------ src-tauri/src/extension/database/mod.rs | 34 +- src-tauri/src/models.rs | 107 -- src-tauri/src/models_final.rs | 34 - src-tauri/src/models_new.rs | 441 -------- .../vault/[vaultId]/extensions/index.vue | 3 - src/stores/vault/index.ts | 2 +- src/stores/vault/settings.ts | 4 +- 49 files changed, 1609 insertions(+), 8610 deletions(-) create mode 100644 src-tauri/database/generate-rust-types.ts create mode 100644 src-tauri/database/migrations/0000_glamorous_hulk.sql delete mode 100644 src-tauri/database/migrations/0000_zippy_scourge.sql delete mode 100644 src-tauri/database/migrations/0001_wealthy_thaddeus_ross.sql delete mode 100644 src-tauri/database/migrations/0002_married_bushwacker.sql delete mode 100644 src-tauri/database/migrations/0003_familiar_doctor_faustus.sql delete mode 100644 src-tauri/database/migrations/0004_wooden_lockheed.sql delete mode 100644 src-tauri/database/migrations/0005_wooden_nuke.sql delete mode 100644 src-tauri/database/migrations/0006_complete_martin_li.sql delete mode 100644 src-tauri/database/migrations/0007_daffy_tusk.sql delete mode 100644 src-tauri/database/migrations/0008_faulty_mercury.sql delete mode 100644 src-tauri/database/migrations/0009_curved_selene.sql delete mode 100644 src-tauri/database/migrations/0010_deep_war_machine.sql delete mode 100644 src-tauri/database/migrations/0011_illegal_thor_girl.sql delete mode 100644 src-tauri/database/migrations/0012_special_gwen_stacy.sql delete mode 100644 src-tauri/database/migrations/meta/0001_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0002_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0003_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0004_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0005_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0006_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0007_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0008_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0009_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0010_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0011_snapshot.json delete mode 100644 src-tauri/database/migrations/meta/0012_snapshot.json create mode 100644 src-tauri/database/schemas/index.ts create mode 100644 src-tauri/src/build/mod.rs create mode 100644 src-tauri/src/build/rust_types.rs create mode 100644 src-tauri/src/build/table_names.rs create mode 100644 src-tauri/src/database/generated.rs delete mode 100644 src-tauri/src/extension/core_old.rs delete mode 100644 src-tauri/src/models.rs delete mode 100644 src-tauri/src/models_final.rs delete mode 100644 src-tauri/src/models_new.rs diff --git a/package.json b/package.json index d9d4a6d..5e94637 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "postinstall": "nuxt prepare", "tauri": "tauri", "tauri:build:debug": "tauri build --debug", + "generate:rust-types": "tsx ./src-tauri/database/generate-rust-types.ts", "drizzle:generate": "drizzle-kit generate", "drizzle:migrate": "drizzle-kit migrate", "eslint:fix": "eslint --fix" @@ -50,11 +51,13 @@ "@iconify/tailwind4": "^1.0.6", "@libsql/client": "^0.15.15", "@tauri-apps/cli": "^2.5.0", + "@types/node": "^24.6.2", "@vitejs/plugin-vue": "6.0.1", "@vue/compiler-sfc": "^3.5.17", "drizzle-kit": "^0.31.2", "globals": "^16.2.0", "prettier": "3.6.2", + "tsx": "^4.20.6", "tw-animate-css": "^1.3.8", "typescript": "^5.8.3", "vite": "7.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63cd07e..e901815 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,16 +13,16 @@ importers: dependencies: '@nuxt/eslint': specifier: 1.9.0 - version: 1.9.0(@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(@vue/compiler-sfc@3.5.21)(eslint@9.35.0(jiti@2.5.1))(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + version: 1.9.0(@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(@vue/compiler-sfc@3.5.21)(eslint@9.35.0(jiti@2.5.1))(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@nuxt/fonts': specifier: 0.11.4 - version: 0.11.4(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(ioredis@5.7.0)(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + version: 0.11.4(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(ioredis@5.7.0)(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@nuxt/icon': specifier: 2.0.0 - version: 2.0.0(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + version: 2.0.0(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) '@nuxt/ui': specifier: 4.0.0 - version: 4.0.0(@babel/parser@7.28.4)(change-case@5.4.4)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(embla-carousel@8.6.0)(ioredis@5.7.0)(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-router@4.5.1(vue@3.5.21(typescript@5.9.2)))(vue@3.5.21(typescript@5.9.2))(zod@3.25.76) + version: 4.0.0(@babel/parser@7.28.4)(change-case@5.4.4)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(embla-carousel@8.6.0)(ioredis@5.7.0)(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-router@4.5.1(vue@3.5.21(typescript@5.9.2)))(vue@3.5.21(typescript@5.9.2))(zod@3.25.76) '@nuxtjs/i18n': specifier: 10.0.6 version: 10.0.6(@vue/compiler-dom@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(magicast@0.3.5)(rollup@4.50.1)(vue@3.5.21(typescript@5.9.2)) @@ -31,7 +31,7 @@ importers: version: 0.11.2(magicast@0.3.5)(pinia@3.0.3(typescript@5.9.2)(vue@3.5.21(typescript@5.9.2))) '@tailwindcss/vite': specifier: ^4.1.10 - version: 4.1.13(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + version: 4.1.13(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@tauri-apps/api': specifier: ^2.5.0 version: 2.8.0 @@ -67,7 +67,7 @@ importers: version: 13.9.0(vue@3.5.21(typescript@5.9.2)) '@vueuse/nuxt': specifier: ^13.4.0 - version: 13.9.0(magicast@0.3.5)(nuxt@4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.5.0)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + version: 13.9.0(magicast@0.3.5)(nuxt@4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.6.2)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) drizzle-orm: specifier: ^0.44.2 version: 0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0) @@ -79,7 +79,7 @@ importers: version: 7.1.0 nuxt: specifier: ^4.0.3 - version: 4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.5.0)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1) + version: 4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.6.2)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1) nuxt-zod-i18n: specifier: ^1.12.0 version: 1.12.1(magicast@0.3.5) @@ -108,9 +108,12 @@ importers: '@tauri-apps/cli': specifier: ^2.5.0 version: 2.8.4 + '@types/node': + specifier: ^24.6.2 + version: 24.6.2 '@vitejs/plugin-vue': specifier: 6.0.1 - version: 6.0.1(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + version: 6.0.1(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) '@vue/compiler-sfc': specifier: ^3.5.17 version: 3.5.21 @@ -123,6 +126,9 @@ importers: prettier: specifier: 3.6.2 version: 3.6.2 + tsx: + specifier: ^4.20.6 + version: 4.20.6 tw-animate-css: specifier: ^1.3.8 version: 1.3.8 @@ -131,7 +137,7 @@ importers: version: 5.9.2 vite: specifier: 7.1.3 - version: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + version: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) vue-tsc: specifier: 3.0.6 version: 3.0.6(typescript@5.9.2) @@ -2067,8 +2073,8 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/node@24.5.0': - resolution: {integrity: sha512-y1dMvuvJspJiPSDZUQ+WMBvF7dpnEqN4x9DDC9ie5Fs/HUZJA3wFp7EhHoVaKX/iI0cRoECV8X2jL8zi0xrHCg==} + '@types/node@24.6.2': + resolution: {integrity: sha512-d2L25Y4j+W3ZlNAeMKcy7yDsK425ibcAOO2t7aPTz6gNMH0z2GThtwENCDc0d/Pw9wgyRqE5Px1wkV7naz8ang==} '@types/parse-path@7.1.0': resolution: {integrity: sha512-EULJ8LApcVEPbrfND0cRQqutIOdiIgJ1Mgrhpy755r14xMohPTEpkV/k28SJvuOs9bHRFW8x+KeDAEPiGQPB9Q==} @@ -4941,6 +4947,11 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tsx@4.20.6: + resolution: {integrity: sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==} + engines: {node: '>=18.0.0'} + hasBin: true + tw-animate-css@1.3.8: resolution: {integrity: sha512-Qrk3PZ7l7wUcGYhwZloqfkWCmaXZAoqjkdbIDvzfGshwGtexa/DAs9koXxIkrpEasyevandomzCBAV1Yyop5rw==} @@ -4972,8 +4983,8 @@ packages: unctx@2.4.1: resolution: {integrity: sha512-AbaYw0Nm4mK4qjhns67C+kgxR2YWiwlDBPzxrN8h8C6VtAdCgditAY5Dezu3IJy4XVqAnbrXt9oQJvsn3fyozg==} - undici-types@7.12.0: - resolution: {integrity: sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==} + undici-types@7.13.0: + resolution: {integrity: sha512-Ov2Rr9Sx+fRgagJ5AX0qvItZG/JKKoBRAVITs1zk7IqZGTJUwgUr7qoYBpWwakpWilTZFM98rG/AFRocu10iIQ==} unenv@2.0.0-rc.20: resolution: {integrity: sha512-8tn4tAl9vD5nWoggAAPz28vf0FY8+pQAayhU94qD+ZkIbVKCBAH/E1MWEEmhb9Whn5EgouYVfBJB20RsTLRDdg==} @@ -6336,11 +6347,11 @@ snapshots: '@nuxt/devalue@2.0.2': {} - '@nuxt/devtools-kit@2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))': + '@nuxt/devtools-kit@2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))': dependencies: '@nuxt/kit': 3.19.1(magicast@0.3.5) execa: 8.0.1 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) transitivePeerDependencies: - magicast @@ -6355,12 +6366,12 @@ snapshots: prompts: 2.4.2 semver: 7.7.2 - '@nuxt/devtools@2.6.3(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': + '@nuxt/devtools@2.6.3(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': dependencies: - '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@nuxt/devtools-wizard': 2.6.3 '@nuxt/kit': 3.19.1(magicast@0.3.5) - '@vue/devtools-core': 7.7.7(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + '@vue/devtools-core': 7.7.7(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) '@vue/devtools-kit': 7.7.7 birpc: 2.5.0 consola: 3.4.2 @@ -6385,9 +6396,9 @@ snapshots: sirv: 3.0.2 structured-clone-es: 1.0.0 tinyglobby: 0.2.14 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) - vite-plugin-inspect: 11.3.3(@nuxt/kit@3.19.1(magicast@0.3.5))(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) - vite-plugin-vue-tracer: 1.0.0(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) + vite-plugin-inspect: 11.3.3(@nuxt/kit@3.19.1(magicast@0.3.5))(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) + vite-plugin-vue-tracer: 1.0.0(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) which: 5.0.0 ws: 8.18.3 transitivePeerDependencies: @@ -6436,10 +6447,10 @@ snapshots: - supports-color - typescript - '@nuxt/eslint@1.9.0(@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(@vue/compiler-sfc@3.5.21)(eslint@9.35.0(jiti@2.5.1))(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))': + '@nuxt/eslint@1.9.0(@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(@vue/compiler-sfc@3.5.21)(eslint@9.35.0(jiti@2.5.1))(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))': dependencies: '@eslint/config-inspector': 1.2.0(eslint@9.35.0(jiti@2.5.1)) - '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@nuxt/eslint-config': 1.9.0(@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(@vue/compiler-sfc@3.5.21)(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) '@nuxt/eslint-plugin': 1.9.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2) '@nuxt/kit': 4.1.1(magicast@0.3.5) @@ -6464,9 +6475,9 @@ snapshots: - utf-8-validate - vite - '@nuxt/fonts@0.11.4(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(ioredis@5.7.0)(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))': + '@nuxt/fonts@0.11.4(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(ioredis@5.7.0)(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))': dependencies: - '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@nuxt/kit': 3.19.1(magicast@0.3.5) consola: 3.4.2 css-tree: 3.1.0 @@ -6510,13 +6521,13 @@ snapshots: - uploadthing - vite - '@nuxt/icon@2.0.0(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': + '@nuxt/icon@2.0.0(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': dependencies: '@iconify/collections': 1.0.592 '@iconify/types': 2.0.0 '@iconify/utils': 3.0.1 '@iconify/vue': 5.0.0(vue@3.5.21(typescript@5.9.2)) - '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + '@nuxt/devtools-kit': 2.6.3(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@nuxt/kit': 4.1.1(magicast@0.3.5) consola: 3.4.2 local-pkg: 1.1.2 @@ -6613,20 +6624,20 @@ snapshots: transitivePeerDependencies: - magicast - '@nuxt/ui@4.0.0(@babel/parser@7.28.4)(change-case@5.4.4)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(embla-carousel@8.6.0)(ioredis@5.7.0)(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-router@4.5.1(vue@3.5.21(typescript@5.9.2)))(vue@3.5.21(typescript@5.9.2))(zod@3.25.76)': + '@nuxt/ui@4.0.0(@babel/parser@7.28.4)(change-case@5.4.4)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(embla-carousel@8.6.0)(ioredis@5.7.0)(magicast@0.3.5)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-router@4.5.1(vue@3.5.21(typescript@5.9.2)))(vue@3.5.21(typescript@5.9.2))(zod@3.25.76)': dependencies: '@ai-sdk/vue': 2.0.51(vue@3.5.21(typescript@5.9.2))(zod@3.25.76) '@iconify/vue': 5.0.0(vue@3.5.21(typescript@5.9.2)) '@internationalized/date': 3.9.0 '@internationalized/number': 3.6.5 - '@nuxt/fonts': 0.11.4(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(ioredis@5.7.0)(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) - '@nuxt/icon': 2.0.0(magicast@0.3.5)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + '@nuxt/fonts': 0.11.4(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(ioredis@5.7.0)(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) + '@nuxt/icon': 2.0.0(magicast@0.3.5)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) '@nuxt/kit': 4.1.1(magicast@0.3.5) '@nuxt/schema': 4.1.1 '@nuxtjs/color-mode': 3.5.2(magicast@0.3.5) '@standard-schema/spec': 1.0.0 '@tailwindcss/postcss': 4.1.13 - '@tailwindcss/vite': 4.1.13(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + '@tailwindcss/vite': 4.1.13(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) '@tanstack/vue-table': 8.21.3(vue@3.5.21(typescript@5.9.2)) '@unhead/vue': 2.0.17(vue@3.5.21(typescript@5.9.2)) '@vueuse/core': 13.9.0(vue@3.5.21(typescript@5.9.2)) @@ -6706,12 +6717,12 @@ snapshots: - vite - vue - '@nuxt/vite-builder@4.1.1(@types/node@24.5.0)(eslint@9.35.0(jiti@2.5.1))(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2))(vue@3.5.21(typescript@5.9.2))(yaml@2.8.1)': + '@nuxt/vite-builder@4.1.1(@types/node@24.6.2)(eslint@9.35.0(jiti@2.5.1))(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2))(vue@3.5.21(typescript@5.9.2))(yaml@2.8.1)': dependencies: '@nuxt/kit': 4.1.1(magicast@0.3.5) '@rollup/plugin-replace': 6.0.2(rollup@4.50.1) - '@vitejs/plugin-vue': 6.0.1(vite@7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) - '@vitejs/plugin-vue-jsx': 5.1.1(vite@7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + '@vitejs/plugin-vue': 6.0.1(vite@7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + '@vitejs/plugin-vue-jsx': 5.1.1(vite@7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) autoprefixer: 10.4.21(postcss@8.5.6) consola: 3.4.2 cssnano: 7.1.1(postcss@8.5.6) @@ -6733,9 +6744,9 @@ snapshots: std-env: 3.9.0 ufo: 1.6.1 unenv: 2.0.0-rc.21 - vite: 7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) - vite-node: 3.2.4(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) - vite-plugin-checker: 0.10.3(eslint@9.35.0(jiti@2.5.1))(optionator@0.9.4)(typescript@5.9.2)(vite@7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2)) + vite: 7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) + vite-node: 3.2.4(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) + vite-plugin-checker: 0.10.3(eslint@9.35.0(jiti@2.5.1))(optionator@0.9.4)(typescript@5.9.2)(vite@7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2)) vue: 3.5.21(typescript@5.9.2) vue-bundle-renderer: 2.1.2 transitivePeerDependencies: @@ -7392,12 +7403,12 @@ snapshots: postcss: 8.5.6 tailwindcss: 4.1.13 - '@tailwindcss/vite@4.1.13(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))': + '@tailwindcss/vite@4.1.13(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))': dependencies: '@tailwindcss/node': 4.1.13 '@tailwindcss/oxide': 4.1.13 tailwindcss: 4.1.13 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) '@tanstack/table-core@8.21.3': {} @@ -7503,9 +7514,9 @@ snapshots: '@types/json-schema@7.0.15': {} - '@types/node@24.5.0': + '@types/node@24.6.2': dependencies: - undici-types: 7.12.0 + undici-types: 7.13.0 '@types/parse-path@7.1.0': dependencies: @@ -7519,7 +7530,7 @@ snapshots: '@types/ws@8.18.1': dependencies: - '@types/node': 24.5.0 + '@types/node': 24.6.2 '@typescript-eslint/eslint-plugin@8.43.0(@typescript-eslint/parser@8.43.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: @@ -7704,28 +7715,28 @@ snapshots: - rollup - supports-color - '@vitejs/plugin-vue-jsx@5.1.1(vite@7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': + '@vitejs/plugin-vue-jsx@5.1.1(vite@7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': dependencies: '@babel/core': 7.28.4 '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.4) '@babel/plugin-transform-typescript': 7.28.0(@babel/core@7.28.4) '@rolldown/pluginutils': 1.0.0-beta.36 '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.28.4) - vite: 7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) vue: 3.5.21(typescript@5.9.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@6.0.1(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': + '@vitejs/plugin-vue@6.0.1(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': dependencies: '@rolldown/pluginutils': 1.0.0-beta.29 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) vue: 3.5.21(typescript@5.9.2) - '@vitejs/plugin-vue@6.0.1(vite@7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': + '@vitejs/plugin-vue@6.0.1(vite@7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': dependencies: '@rolldown/pluginutils': 1.0.0-beta.29 - vite: 7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) vue: 3.5.21(typescript@5.9.2) '@volar/language-core@2.4.23': @@ -7830,14 +7841,14 @@ snapshots: dependencies: '@vue/devtools-kit': 7.7.7 - '@vue/devtools-core@7.7.7(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': + '@vue/devtools-core@7.7.7(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': dependencies: '@vue/devtools-kit': 7.7.7 '@vue/devtools-shared': 7.7.7 mitt: 3.0.1 nanoid: 5.1.5 pathe: 2.0.3 - vite-hot-client: 2.1.0(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + vite-hot-client: 2.1.0(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) vue: 3.5.21(typescript@5.9.2) transitivePeerDependencies: - vite @@ -7940,13 +7951,13 @@ snapshots: '@vueuse/metadata@13.9.0': {} - '@vueuse/nuxt@13.9.0(magicast@0.3.5)(nuxt@4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.5.0)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': + '@vueuse/nuxt@13.9.0(magicast@0.3.5)(nuxt@4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.6.2)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2))': dependencies: '@nuxt/kit': 3.19.1(magicast@0.3.5) '@vueuse/core': 13.9.0(vue@3.5.21(typescript@5.9.2)) '@vueuse/metadata': 13.9.0 local-pkg: 1.1.2 - nuxt: 4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.5.0)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1) + nuxt: 4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.6.2)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1) vue: 3.5.21(typescript@5.9.2) transitivePeerDependencies: - magicast @@ -9646,15 +9657,15 @@ snapshots: transitivePeerDependencies: - magicast - nuxt@4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.5.0)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(typescript@5.9.2)(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1): + nuxt@4.1.1(@libsql/client@0.15.15)(@parcel/watcher@2.5.1)(@types/node@24.6.2)(@vue/compiler-sfc@3.5.21)(db0@0.3.2(@libsql/client@0.15.15)(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0)))(drizzle-orm@0.44.5(@libsql/client@0.15.15)(@opentelemetry/api@1.9.0))(eslint@9.35.0(jiti@2.5.1))(ioredis@5.7.0)(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2))(yaml@2.8.1): dependencies: '@nuxt/cli': 3.28.0(magicast@0.3.5) '@nuxt/devalue': 2.0.2 - '@nuxt/devtools': 2.6.3(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) + '@nuxt/devtools': 2.6.3(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)) '@nuxt/kit': 4.1.1(magicast@0.3.5) '@nuxt/schema': 4.1.1 '@nuxt/telemetry': 2.6.6(magicast@0.3.5) - '@nuxt/vite-builder': 4.1.1(@types/node@24.5.0)(eslint@9.35.0(jiti@2.5.1))(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2))(vue@3.5.21(typescript@5.9.2))(yaml@2.8.1) + '@nuxt/vite-builder': 4.1.1(@types/node@24.6.2)(eslint@9.35.0(jiti@2.5.1))(lightningcss@1.30.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.50.1)(terser@5.44.0)(tsx@4.20.6)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2))(vue@3.5.21(typescript@5.9.2))(yaml@2.8.1) '@unhead/vue': 2.0.14(vue@3.5.21(typescript@5.9.2)) '@vue/shared': 3.5.21 c12: 3.2.0(magicast@0.3.5) @@ -9713,7 +9724,7 @@ snapshots: vue-router: 4.5.1(vue@3.5.21(typescript@5.9.2)) optionalDependencies: '@parcel/watcher': 2.5.1 - '@types/node': 24.5.0 + '@types/node': 24.6.2 transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -10623,6 +10634,13 @@ snapshots: tslib@2.8.1: {} + tsx@4.20.6: + dependencies: + esbuild: 0.25.9 + get-tsconfig: 4.10.1 + optionalDependencies: + fsevents: 2.3.3 + tw-animate-css@1.3.8: {} type-check@0.4.0: @@ -10648,7 +10666,7 @@ snapshots: magic-string: 0.30.19 unplugin: 2.3.10 - undici-types@7.12.0: {} + undici-types@7.13.0: {} unenv@2.0.0-rc.20: dependencies: @@ -10908,23 +10926,23 @@ snapshots: transitivePeerDependencies: - '@vue/composition-api' - vite-dev-rpc@1.1.0(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)): + vite-dev-rpc@1.1.0(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)): dependencies: birpc: 2.5.0 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) - vite-hot-client: 2.1.0(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) + vite-hot-client: 2.1.0(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) - vite-hot-client@2.1.0(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)): + vite-hot-client@2.1.0(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)): dependencies: - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) - vite-node@3.2.4(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1): + vite-node@3.2.4(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1): dependencies: cac: 6.7.14 debug: 4.4.1 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) transitivePeerDependencies: - '@types/node' - jiti @@ -10939,7 +10957,7 @@ snapshots: - tsx - yaml - vite-plugin-checker@0.10.3(eslint@9.35.0(jiti@2.5.1))(optionator@0.9.4)(typescript@5.9.2)(vite@7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2)): + vite-plugin-checker@0.10.3(eslint@9.35.0(jiti@2.5.1))(optionator@0.9.4)(typescript@5.9.2)(vite@7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue-tsc@3.0.6(typescript@5.9.2)): dependencies: '@babel/code-frame': 7.27.1 chokidar: 4.0.3 @@ -10949,7 +10967,7 @@ snapshots: strip-ansi: 7.1.2 tiny-invariant: 1.3.3 tinyglobby: 0.2.14 - vite: 7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) vscode-uri: 3.1.0 optionalDependencies: eslint: 9.35.0(jiti@2.5.1) @@ -10957,7 +10975,7 @@ snapshots: typescript: 5.9.2 vue-tsc: 3.0.6(typescript@5.9.2) - vite-plugin-inspect@11.3.3(@nuxt/kit@3.19.1(magicast@0.3.5))(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)): + vite-plugin-inspect@11.3.3(@nuxt/kit@3.19.1(magicast@0.3.5))(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)): dependencies: ansis: 4.1.0 debug: 4.4.1 @@ -10967,24 +10985,24 @@ snapshots: perfect-debounce: 2.0.0 sirv: 3.0.2 unplugin-utils: 0.3.0 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) - vite-dev-rpc: 1.1.0(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1)) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) + vite-dev-rpc: 1.1.0(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1)) optionalDependencies: '@nuxt/kit': 3.19.1(magicast@0.3.5) transitivePeerDependencies: - supports-color - vite-plugin-vue-tracer@1.0.0(vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)): + vite-plugin-vue-tracer@1.0.0(vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1))(vue@3.5.21(typescript@5.9.2)): dependencies: estree-walker: 3.0.3 exsolve: 1.0.7 magic-string: 0.30.19 pathe: 2.0.3 source-map-js: 1.2.1 - vite: 7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1) + vite: 7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1) vue: 3.5.21(typescript@5.9.2) - vite@7.1.3(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1): + vite@7.1.3(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1): dependencies: esbuild: 0.25.9 fdir: 6.5.0(picomatch@4.0.3) @@ -10993,14 +11011,15 @@ snapshots: rollup: 4.50.1 tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 24.5.0 + '@types/node': 24.6.2 fsevents: 2.3.3 jiti: 2.5.1 lightningcss: 1.30.1 terser: 5.44.0 + tsx: 4.20.6 yaml: 2.8.1 - vite@7.1.5(@types/node@24.5.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(yaml@2.8.1): + vite@7.1.5(@types/node@24.6.2)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.1): dependencies: esbuild: 0.25.9 fdir: 6.5.0(picomatch@4.0.3) @@ -11009,11 +11028,12 @@ snapshots: rollup: 4.50.1 tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 24.5.0 + '@types/node': 24.6.2 fsevents: 2.3.3 jiti: 2.5.1 lightningcss: 1.30.1 terser: 5.44.0 + tsx: 4.20.6 yaml: 2.8.1 vscode-uri@3.1.0: {} diff --git a/src-tauri/database/generate-rust-types.ts b/src-tauri/database/generate-rust-types.ts new file mode 100644 index 0000000..d278806 --- /dev/null +++ b/src-tauri/database/generate-rust-types.ts @@ -0,0 +1,195 @@ +import { writeFileSync, mkdirSync } from 'node:fs' +import { join, dirname } from 'node:path' +import { fileURLToPath } from 'node:url' +import tablesNames from './tableNames.json' +import { schema } from './index' +import { getTableColumns } from 'drizzle-orm' +import type { AnySQLiteColumn, SQLiteTable } from 'drizzle-orm/sqlite-core' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = dirname(__filename) + +interface Column { + name: string + rustType: string + isOptional: boolean +} + +function drizzleToRustType(colDef: AnySQLiteColumn): { + rustType: string + isOptional: boolean +} { + let baseType = 'String' + let isOptional = !colDef.notNull + + if (colDef.columnType === 'SQLiteText') { + // Das 'mode' Property ist ebenfalls direkt auf dem Objekt verfügbar + if ('mode' in colDef && colDef.mode === 'json') { + baseType = 'serde_json::Value' + } else { + baseType = 'String' + } + } else if (colDef.columnType === 'SQLiteInteger') { + if ('mode' in colDef && colDef.mode === 'boolean') { + baseType = 'bool' + } else if ('mode' in colDef && colDef.mode === 'timestamp') { + baseType = 'i64' + } else { + baseType = 'i64' + } + } + // ... weitere SQLite-Typen hier ... + else if (colDef.columnType === 'SQLiteReal') { + baseType = 'f64' + } else if (colDef.columnType === 'SQLiteBlob') { + baseType = 'Vec' + } + + // Drizzle verwendet 'primary' für den Primärschlüssel-Status + if (colDef.primary) { + isOptional = false + } + + return { rustType: baseType, isOptional } +} + +function extractColumns(table: SQLiteTable): Column[] { + const columns: Column[] = [] + + // getTableColumns gibt ein Record zurück + const tableColumns = getTableColumns(table) + + // Object.values gibt uns ein Array vom Typ AnySQLiteColumn[] + for (const colDef of Object.values(tableColumns)) { + // Die relevanten Infos stehen im 'config' Property der Spalte. + // TypeScript kennt den Typ von 'config' bereits! + const { rustType, isOptional } = drizzleToRustType(colDef) + + columns.push({ + name: colDef.name, + rustType: isOptional ? `Option<${rustType}>` : rustType, + isOptional, + }) + } + return columns +} + +function toSnakeCase(str: string): string { + return str.replace(/[A-Z]/g, (letter, index) => + index === 0 ? letter.toLowerCase() : `_${letter.toLowerCase()}`, + ) +} + +function toPascalCase(str: string): string { + return str + .split('_') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) + .join('') +} + +const RUST_KEYWORDS = new Set([ + 'type', + 'struct', + 'enum', + 'pub', + 'use', + 'as', + 'crate', + 'super', + 'self', + 'let', + 'mut', +]) + +function generateStruct(name: string, columns: Column[]): string { + let structName = toPascalCase(name) + + if (RUST_KEYWORDS.has(structName.toLowerCase())) { + structName = `r#${structName}` + } + + // --- Teil 1: Struct-Definition --- + let code = `#[derive(Debug, Clone, Serialize, Deserialize)]\n` + code += `#[serde(rename_all = "camelCase")]\n` + code += `pub struct ${structName} {\n` + + for (const col of columns) { + let fieldName = toSnakeCase(col.name) + + // Prüfen, ob der Name ein Keyword ist + if (RUST_KEYWORDS.has(fieldName)) { + fieldName = `r#${fieldName}` + } + + if (col.isOptional) { + code += ` #[serde(skip_serializing_if = "Option::is_none")]\n` + } + // Wichtig: #[serde(rename = "...")] hinzufügen, falls der Feldname geändert wurde! + if (fieldName.startsWith('r#')) { + const originalName = fieldName.substring(2) + code += ` #[serde(rename = "${originalName}")]\n` + } + code += ` pub ${fieldName}: ${col.rustType},\n` + } + + code += `}\n\n` + + // --- Teil 2: Impl-Block --- + code += `impl ${structName} {\n` + code += ` pub fn from_row(row: &rusqlite::Row) -> rusqlite::Result {\n` + code += ` Ok(Self {\n` + + columns.forEach((col, idx) => { + let fieldName = toSnakeCase(col.name) + if (RUST_KEYWORDS.has(fieldName)) { + fieldName = `r#${fieldName}` + } + code += ` ${fieldName}: row.get(${idx})?,\n` + }) + + code += ` })\n` + code += ` }\n` + code += `}\n\n` + + return code +} + +function main() { + let output = `// Auto-generated from Drizzle schema +// DO NOT EDIT MANUALLY +// Run 'pnpm generate:rust-types' to regenerate + +use serde::{Deserialize, Serialize}; + +` + + const schemas = [ + { name: tablesNames.haex.settings, table: schema.haexSettings }, + { name: tablesNames.haex.extensions, table: schema.haexExtensions }, + { + name: tablesNames.haex.extension_permissions, + table: schema.haexExtensionPermissions, + }, + { name: tablesNames.haex.crdt.logs, table: schema.haexCrdtLogs }, + { name: tablesNames.haex.crdt.snapshots, table: schema.haexCrdtSnapshots }, + { name: tablesNames.haex.crdt.configs, table: schema.haexCrdtConfigs }, + ] + + for (const { name, table } of schemas) { + console.log(`\n=== Processing table: ${name} ===`) + const columns = extractColumns(table) + console.log(`Found ${columns.length} columns`) + + if (columns.length > 0) { + output += generateStruct(name, columns) + } + } + + const outputPath = join(__dirname, '../src/database/generated.rs') + mkdirSync(dirname(outputPath), { recursive: true }) + writeFileSync(outputPath, output, 'utf-8') + + console.log('\n✅ Rust types generated:', outputPath) +} + +main() diff --git a/src-tauri/database/index.ts b/src-tauri/database/index.ts index 26550f6..a7a6417 100644 --- a/src-tauri/database/index.ts +++ b/src-tauri/database/index.ts @@ -1,6 +1,6 @@ import { drizzle } from 'drizzle-orm/sqlite-proxy' // Adapter für Query Building ohne direkte Verbindung -import * as schema from './schemas/haex' // Importiere alles aus deiner Schema-Datei - +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. diff --git a/src-tauri/database/migrations/0000_glamorous_hulk.sql b/src-tauri/database/migrations/0000_glamorous_hulk.sql new file mode 100644 index 0000000..4f3824b --- /dev/null +++ b/src-tauri/database/migrations/0000_glamorous_hulk.sql @@ -0,0 +1,139 @@ +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_extension_permissions` ( + `id` text PRIMARY KEY NOT NULL, + `extension_id` text, + `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_tombstone` integer, + `haex_timestamp` text, + FOREIGN KEY (`extension_id`) REFERENCES `haex_extensions`(`id`) ON UPDATE no action ON DELETE no action +); +--> 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, + `author` text, + `description` text, + `entry` text, + `homepage` text, + `enabled` integer, + `icon` text, + `name` text, + `public_key` text, + `signature` text, + `url` text, + `version` text, + `haex_tombstone` integer, + `haex_timestamp` text +); +--> statement-breakpoint +CREATE TABLE `haex_settings` ( + `id` text PRIMARY KEY NOT NULL, + `key` text, + `type` text, + `value` text, + `haex_tombstone` integer, + `haex_timestamp` text +); +--> 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_tombstone` integer +); +--> statement-breakpoint +CREATE TABLE `haex_passwords_group_items` ( + `group_id` text, + `item_id` text, + `haex_tombstone` integer, + PRIMARY KEY(`item_id`, `group_id`), + FOREIGN KEY (`group_id`) REFERENCES `haex_passwords_groups`(`id`) ON UPDATE no action ON DELETE no action, + FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_item_details`(`id`) ON UPDATE no action ON DELETE no action +); +--> statement-breakpoint +CREATE TABLE `haex_passwords_groups` ( + `id` text PRIMARY KEY NOT NULL, + `name` text, + `description` text, + `icon` text, + `order` integer, + `color` text, + `parent_id` text, + `created_at` text DEFAULT (CURRENT_TIMESTAMP), + `updated_at` integer, + `haex_tombstone` integer, + FOREIGN KEY (`parent_id`) REFERENCES `haex_passwords_groups`(`id`) ON UPDATE no action ON DELETE no action +); +--> statement-breakpoint +CREATE TABLE `haex_passwords_item_details` ( + `id` text PRIMARY KEY NOT NULL, + `title` text, + `username` text, + `password` text, + `note` text, + `icon` text, + `tags` text, + `url` text, + `created_at` text DEFAULT (CURRENT_TIMESTAMP), + `updated_at` integer, + `haex_tombstone` integer +); +--> statement-breakpoint +CREATE TABLE `haex_passwords_item_history` ( + `id` text PRIMARY KEY NOT NULL, + `item_id` text, + `changed_property` text, + `old_value` text, + `new_value` text, + `created_at` text DEFAULT (CURRENT_TIMESTAMP), + `haex_tombstone` integer, + FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_item_details`(`id`) ON UPDATE no action ON DELETE no action +); +--> statement-breakpoint +CREATE TABLE `haex_passwords_item_key_values` ( + `id` text PRIMARY KEY NOT NULL, + `item_id` text, + `key` text, + `value` text, + `updated_at` integer, + `haex_tombstone` integer, + FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_item_details`(`id`) ON UPDATE no action ON DELETE no action +); diff --git a/src-tauri/database/migrations/0000_zippy_scourge.sql b/src-tauri/database/migrations/0000_zippy_scourge.sql deleted file mode 100644 index 95bd5ce..0000000 --- a/src-tauri/database/migrations/0000_zippy_scourge.sql +++ /dev/null @@ -1,26 +0,0 @@ -CREATE TABLE `haex_extensions` ( - `id` text PRIMARY KEY NOT NULL, - `author` text, - `enabled` integer, - `name` text, - `url` text, - `version` text -); ---> statement-breakpoint -CREATE TABLE `haex_extensions_permissions` ( - `id` text PRIMARY KEY NOT NULL, - `extension_id` text, - `resource` text, - `operation` text, - `path` text, - FOREIGN KEY (`extension_id`) REFERENCES `haex_extensions`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -CREATE UNIQUE INDEX `haex_extensions_permissions_extension_id_resource_operation_path_unique` ON `haex_extensions_permissions` (`extension_id`,`resource`,`operation`,`path`);--> statement-breakpoint -CREATE TABLE `haex_settings` ( - `id` text PRIMARY KEY NOT NULL, - `key` text, - `value_text` text, - `value_json` text, - `value_number` numeric -); diff --git a/src-tauri/database/migrations/0001_wealthy_thaddeus_ross.sql b/src-tauri/database/migrations/0001_wealthy_thaddeus_ross.sql deleted file mode 100644 index 8d52b2b..0000000 --- a/src-tauri/database/migrations/0001_wealthy_thaddeus_ross.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE `testTable` ( - `id` text PRIMARY KEY NOT NULL, - `author` text, - `test` text -); ---> statement-breakpoint -ALTER TABLE `haex_extensions` ADD `icon` text; \ No newline at end of file diff --git a/src-tauri/database/migrations/0002_married_bushwacker.sql b/src-tauri/database/migrations/0002_married_bushwacker.sql deleted file mode 100644 index 4fa851e..0000000 --- a/src-tauri/database/migrations/0002_married_bushwacker.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `haex_settings` RENAME COLUMN "value_text" TO "value";--> statement-breakpoint -DROP TABLE `testTable`;--> statement-breakpoint -ALTER TABLE `haex_settings` DROP COLUMN `value_json`;--> statement-breakpoint -ALTER TABLE `haex_settings` DROP COLUMN `value_number`; \ No newline at end of file diff --git a/src-tauri/database/migrations/0003_familiar_doctor_faustus.sql b/src-tauri/database/migrations/0003_familiar_doctor_faustus.sql deleted file mode 100644 index dabd059..0000000 --- a/src-tauri/database/migrations/0003_familiar_doctor_faustus.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE TABLE `haex_notofications` ( - `id` text PRIMARY KEY NOT NULL, - `title` text, - `text` text, - `type` text NOT NULL, - `read` integer, - `date` text, - `image` text, - `alt` text, - `icon` text -); diff --git a/src-tauri/database/migrations/0004_wooden_lockheed.sql b/src-tauri/database/migrations/0004_wooden_lockheed.sql deleted file mode 100644 index 6f5131b..0000000 --- a/src-tauri/database/migrations/0004_wooden_lockheed.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `haex_notofications` RENAME TO `haex_notifications`; \ No newline at end of file diff --git a/src-tauri/database/migrations/0005_wooden_nuke.sql b/src-tauri/database/migrations/0005_wooden_nuke.sql deleted file mode 100644 index 30805d2..0000000 --- a/src-tauri/database/migrations/0005_wooden_nuke.sql +++ /dev/null @@ -1,50 +0,0 @@ -CREATE TABLE `haex_passwords_group_items` ( - `group_id` text, - `item_id` text, - PRIMARY KEY(`item_id`, `group_id`), - FOREIGN KEY (`group_id`) REFERENCES `haex_passwords_groups`(`id`) ON UPDATE no action ON DELETE no action, - FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_items`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -CREATE TABLE `haex_passwords_groups` ( - `id` text PRIMARY KEY NOT NULL, - `name` text, - `icon` text, - `order` integer, - `color` text, - `parent_id` text, - FOREIGN KEY (`parent_id`) REFERENCES `haex_passwords_groups`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -CREATE TABLE `haex_passwords_item_history` ( - `id` text PRIMARY KEY NOT NULL, - `item_id` text, - `changed_property` text, - `old_value` text, - `new_value` text, - `created_at` text DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_items`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -CREATE TABLE `haex_passwords_items` ( - `id` text PRIMARY KEY NOT NULL, - `title` text, - `username` text, - `password` text, - `note` text, - `icon` text, - `tags` text, - `url` text, - `created_at` text DEFAULT (CURRENT_TIMESTAMP), - `updated_at` integer -); ---> statement-breakpoint -CREATE TABLE `haex_passwords_items_key_values` ( - `id` text PRIMARY KEY NOT NULL, - `item_id` text, - `key` text, - `value` text, - FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_items`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -ALTER TABLE `haex_notifications` ADD `source` text; \ No newline at end of file diff --git a/src-tauri/database/migrations/0006_complete_martin_li.sql b/src-tauri/database/migrations/0006_complete_martin_li.sql deleted file mode 100644 index 1be4a32..0000000 --- a/src-tauri/database/migrations/0006_complete_martin_li.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `haex_extensions_permissions` ADD `created_at` text DEFAULT (CURRENT_TIMESTAMP);--> statement-breakpoint -ALTER TABLE `haex_extensions_permissions` ADD `updated_at` integer;--> statement-breakpoint -ALTER TABLE `haex_passwords_groups` ADD `created_at` text DEFAULT (CURRENT_TIMESTAMP);--> statement-breakpoint -ALTER TABLE `haex_passwords_groups` ADD `updated_at` integer;--> statement-breakpoint -ALTER TABLE `haex_passwords_items_key_values` ADD `updated_at` integer; \ No newline at end of file diff --git a/src-tauri/database/migrations/0007_daffy_tusk.sql b/src-tauri/database/migrations/0007_daffy_tusk.sql deleted file mode 100644 index 032e08d..0000000 --- a/src-tauri/database/migrations/0007_daffy_tusk.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `haex_passwords_groups` ADD `description` text; \ No newline at end of file diff --git a/src-tauri/database/migrations/0008_faulty_mercury.sql b/src-tauri/database/migrations/0008_faulty_mercury.sql deleted file mode 100644 index 730bb1e..0000000 --- a/src-tauri/database/migrations/0008_faulty_mercury.sql +++ /dev/null @@ -1,40 +0,0 @@ -ALTER TABLE `haex_passwords_items` RENAME TO `haex_passwords_item_details`;--> statement-breakpoint -ALTER TABLE `haex_passwords_items_key_values` RENAME TO `haex_passwords_item_key_values`;--> statement-breakpoint -PRAGMA foreign_keys=OFF;--> statement-breakpoint -CREATE TABLE `__new_haex_passwords_item_key_values` ( - `id` text PRIMARY KEY NOT NULL, - `item_id` text, - `key` text, - `value` text, - `updated_at` integer, - FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_item_details`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -INSERT INTO `__new_haex_passwords_item_key_values`("id", "item_id", "key", "value", "updated_at") SELECT "id", "item_id", "key", "value", "updated_at" FROM `haex_passwords_item_key_values`;--> statement-breakpoint -DROP TABLE `haex_passwords_item_key_values`;--> statement-breakpoint -ALTER TABLE `__new_haex_passwords_item_key_values` RENAME TO `haex_passwords_item_key_values`;--> statement-breakpoint -PRAGMA foreign_keys=ON;--> statement-breakpoint -CREATE TABLE `__new_haex_passwords_group_items` ( - `group_id` text, - `item_id` text, - PRIMARY KEY(`item_id`, `group_id`), - FOREIGN KEY (`group_id`) REFERENCES `haex_passwords_groups`(`id`) ON UPDATE no action ON DELETE no action, - FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_item_details`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -INSERT INTO `__new_haex_passwords_group_items`("group_id", "item_id") SELECT "group_id", "item_id" FROM `haex_passwords_group_items`;--> statement-breakpoint -DROP TABLE `haex_passwords_group_items`;--> statement-breakpoint -ALTER TABLE `__new_haex_passwords_group_items` RENAME TO `haex_passwords_group_items`;--> statement-breakpoint -CREATE TABLE `__new_haex_passwords_item_history` ( - `id` text PRIMARY KEY NOT NULL, - `item_id` text, - `changed_property` text, - `old_value` text, - `new_value` text, - `created_at` text DEFAULT (CURRENT_TIMESTAMP), - FOREIGN KEY (`item_id`) REFERENCES `haex_passwords_item_details`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -INSERT INTO `__new_haex_passwords_item_history`("id", "item_id", "changed_property", "old_value", "new_value", "created_at") SELECT "id", "item_id", "changed_property", "old_value", "new_value", "created_at" FROM `haex_passwords_item_history`;--> statement-breakpoint -DROP TABLE `haex_passwords_item_history`;--> statement-breakpoint -ALTER TABLE `__new_haex_passwords_item_history` RENAME TO `haex_passwords_item_history`; \ No newline at end of file diff --git a/src-tauri/database/migrations/0009_curved_selene.sql b/src-tauri/database/migrations/0009_curved_selene.sql deleted file mode 100644 index cc5931e..0000000 --- a/src-tauri/database/migrations/0009_curved_selene.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `haex_settings` ADD `type` text; \ No newline at end of file diff --git a/src-tauri/database/migrations/0010_deep_war_machine.sql b/src-tauri/database/migrations/0010_deep_war_machine.sql deleted file mode 100644 index fe74bbe..0000000 --- a/src-tauri/database/migrations/0010_deep_war_machine.sql +++ /dev/null @@ -1,32 +0,0 @@ -CREATE TABLE `haex_crdt_logs` ( - `hlc_timestamp` text PRIMARY KEY NOT NULL, - `table_name` text, - `row_pks` text, - `op_type` text, - `column_name` text, - `new_value` text, - `old_value` text -); ---> statement-breakpoint -CREATE TABLE `haex_crdt_settings` ( - `type` text PRIMARY KEY NOT NULL, - `value` text -); ---> 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 -ALTER TABLE `haex_extensions` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_extensions_permissions` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_notifications` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_passwords_group_items` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_passwords_groups` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_passwords_item_details` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_passwords_item_history` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_passwords_item_key_values` ADD `haex_tombstone` integer;--> statement-breakpoint -ALTER TABLE `haex_settings` ADD `haex_tombstone` integer; \ No newline at end of file diff --git a/src-tauri/database/migrations/0011_illegal_thor_girl.sql b/src-tauri/database/migrations/0011_illegal_thor_girl.sql deleted file mode 100644 index e10f34e..0000000 --- a/src-tauri/database/migrations/0011_illegal_thor_girl.sql +++ /dev/null @@ -1,21 +0,0 @@ -ALTER TABLE `haex_crdt_settings` RENAME TO `haex_crdt_configs`;--> statement-breakpoint -ALTER TABLE `haex_extensions_permissions` RENAME TO `haex_extension_permissions`;--> statement-breakpoint -ALTER TABLE `haex_crdt_configs` RENAME COLUMN "type" TO "key";--> statement-breakpoint -PRAGMA foreign_keys=OFF;--> statement-breakpoint -CREATE TABLE `__new_haex_extension_permissions` ( - `id` text PRIMARY KEY NOT NULL, - `extension_id` text, - `resource` text, - `operation` text, - `path` text, - `created_at` text DEFAULT (CURRENT_TIMESTAMP), - `updated_at` integer, - `haex_tombstone` integer, - FOREIGN KEY (`extension_id`) REFERENCES `haex_extensions`(`id`) ON UPDATE no action ON DELETE no action -); ---> statement-breakpoint -INSERT INTO `__new_haex_extension_permissions`("id", "extension_id", "resource", "operation", "path", "created_at", "updated_at", "haex_tombstone") SELECT "id", "extension_id", "resource", "operation", "path", "created_at", "updated_at", "haex_tombstone" FROM `haex_extension_permissions`;--> statement-breakpoint -DROP TABLE `haex_extension_permissions`;--> statement-breakpoint -ALTER TABLE `__new_haex_extension_permissions` RENAME TO `haex_extension_permissions`;--> statement-breakpoint -PRAGMA foreign_keys=ON;--> statement-breakpoint -CREATE UNIQUE INDEX `haex_extension_permissions_extension_id_resource_operation_path_unique` ON `haex_extension_permissions` (`extension_id`,`resource`,`operation`,`path`); \ No newline at end of file diff --git a/src-tauri/database/migrations/0012_special_gwen_stacy.sql b/src-tauri/database/migrations/0012_special_gwen_stacy.sql deleted file mode 100644 index 5a78073..0000000 --- a/src-tauri/database/migrations/0012_special_gwen_stacy.sql +++ /dev/null @@ -1,15 +0,0 @@ -ALTER TABLE `haex_extension_permissions` RENAME COLUMN "resource" TO "resource_type";--> statement-breakpoint -ALTER TABLE `haex_extension_permissions` RENAME COLUMN "operation" TO "action";--> statement-breakpoint -ALTER TABLE `haex_extension_permissions` RENAME COLUMN "path" TO "target";--> statement-breakpoint -DROP INDEX `haex_extension_permissions_extension_id_resource_operation_path_unique`;--> statement-breakpoint -ALTER TABLE `haex_extension_permissions` ADD `constraints` text;--> statement-breakpoint -ALTER TABLE `haex_extension_permissions` ADD `status` text DEFAULT 'denied' NOT NULL;--> statement-breakpoint -ALTER TABLE `haex_extension_permissions` ADD `haex_timestamp` text;--> 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 -ALTER TABLE `haex_extensions` ADD `description` text;--> statement-breakpoint -ALTER TABLE `haex_extensions` ADD `entry` text;--> statement-breakpoint -ALTER TABLE `haex_extensions` ADD `homepage` text;--> statement-breakpoint -ALTER TABLE `haex_extensions` ADD `public_key` text;--> statement-breakpoint -ALTER TABLE `haex_extensions` ADD `signature` text;--> statement-breakpoint -ALTER TABLE `haex_extensions` ADD `haex_timestamp` text;--> statement-breakpoint -ALTER TABLE `haex_settings` ADD `haex_timestamp` text; \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0000_snapshot.json b/src-tauri/database/migrations/meta/0000_snapshot.json index 1a2ad3f..51e3311 100644 --- a/src-tauri/database/migrations/meta/0000_snapshot.json +++ b/src-tauri/database/migrations/meta/0000_snapshot.json @@ -1,9 +1,274 @@ { "version": "6", "dialect": "sqlite", - "id": "fc5a7c9d-4846-4120-a762-cc2ea00504b9", + "id": "3bbe52b8-5933-4b21-8b24-de3927a2f9b0", "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_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": false, + "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_tombstone": { + "name": "haex_tombstone", + "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": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, "haex_extensions": { "name": "haex_extensions", "columns": { @@ -21,6 +286,27 @@ "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 + }, + "homepage": { + "name": "homepage", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, "enabled": { "name": "enabled", "type": "integer", @@ -28,6 +314,13 @@ "notNull": false, "autoincrement": false }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, "name": { "name": "name", "type": "text", @@ -35,6 +328,20 @@ "notNull": false, "autoincrement": false }, + "public_key": { + "name": "public_key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "signature": { + "name": "signature", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, "url": { "name": "url", "type": "text", @@ -48,6 +355,20 @@ "primaryKey": false, "notNull": false, "autoincrement": false + }, + "haex_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "haex_timestamp": { + "name": "haex_timestamp", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false } }, "indexes": {}, @@ -56,76 +377,6 @@ "uniqueConstraints": {}, "checkConstraints": {} }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, "haex_settings": { "name": "haex_settings", "columns": { @@ -143,23 +394,30 @@ "notNull": false, "autoincrement": false }, - "value_text": { - "name": "value_text", + "type": { + "name": "type", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, - "value_json": { - "name": "value_json", + "value": { + "name": "value", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, - "value_number": { - "name": "value_number", - "type": "numeric", + "haex_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "haex_timestamp": { + "name": "haex_timestamp", + "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false @@ -170,6 +428,482 @@ "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_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "haex_passwords_group_items": { + "name": "haex_passwords_group_items", + "columns": { + "group_id": { + "name": "group_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "item_id": { + "name": "item_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "haex_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { + "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", + "tableFrom": "haex_passwords_group_items", + "tableTo": "haex_passwords_groups", + "columnsFrom": [ + "group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk": { + "name": "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk", + "tableFrom": "haex_passwords_group_items", + "tableTo": "haex_passwords_item_details", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "haex_passwords_group_items_item_id_group_id_pk": { + "columns": [ + "item_id", + "group_id" + ], + "name": "haex_passwords_group_items_item_id_group_id_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "haex_passwords_groups": { + "name": "haex_passwords_groups", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "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_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { + "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", + "tableFrom": "haex_passwords_groups", + "tableTo": "haex_passwords_groups", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "haex_passwords_item_details": { + "name": "haex_passwords_item_details", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "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_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "haex_passwords_item_history": { + "name": "haex_passwords_item_history", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "item_id": { + "name": "item_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "changed_property": { + "name": "changed_property", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "old_value": { + "name": "old_value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "new_value": { + "name": "new_value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "(CURRENT_TIMESTAMP)" + }, + "haex_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk": { + "name": "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk", + "tableFrom": "haex_passwords_item_history", + "tableTo": "haex_passwords_item_details", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "haex_passwords_item_key_values": { + "name": "haex_passwords_item_key_values", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "item_id": { + "name": "item_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "haex_tombstone": { + "name": "haex_tombstone", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk": { + "name": "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk", + "tableFrom": "haex_passwords_item_key_values", + "tableTo": "haex_passwords_item_details", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} } }, "views": {}, diff --git a/src-tauri/database/migrations/meta/0001_snapshot.json b/src-tauri/database/migrations/meta/0001_snapshot.json deleted file mode 100644 index 120b98e..0000000 --- a/src-tauri/database/migrations/meta/0001_snapshot.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "6fb5396b-9f87-4fb5-87a2-22d4eecaa11e", - "prevId": "fc5a7c9d-4846-4120-a762-cc2ea00504b9", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - }, - "value_text": { - "name": "value_text", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value_json": { - "name": "value_json", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value_number": { - "name": "value_number", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "testTable": { - "name": "testTable", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "test": { - "name": "test", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0002_snapshot.json b/src-tauri/database/migrations/meta/0002_snapshot.json deleted file mode 100644 index e8dc4a8..0000000 --- a/src-tauri/database/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "ea3507ca-77bc-4f3c-a605-8426614f5803", - "prevId": "6fb5396b-9f87-4fb5-87a2-22d4eecaa11e", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": { - "\"haex_settings\".\"value_text\"": "\"haex_settings\".\"value\"" - } - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0003_snapshot.json b/src-tauri/database/migrations/meta/0003_snapshot.json deleted file mode 100644 index bdd353e..0000000 --- a/src-tauri/database/migrations/meta/0003_snapshot.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "5f413421-18a5-4c1b-9c5b-99f574b10126", - "prevId": "ea3507ca-77bc-4f3c-a605-8426614f5803", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_notofications": { - "name": "haex_notofications", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "text": { - "name": "text", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "read": { - "name": "read", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "date": { - "name": "date", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "alt": { - "name": "alt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "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 - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0004_snapshot.json b/src-tauri/database/migrations/meta/0004_snapshot.json deleted file mode 100644 index fbeb0fc..0000000 --- a/src-tauri/database/migrations/meta/0004_snapshot.json +++ /dev/null @@ -1,253 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "7aaac460-00b5-4387-bef9-b189297cefb3", - "prevId": "5f413421-18a5-4c1b-9c5b-99f574b10126", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - }, - "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 - } - }, - "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 - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": { - "\"haex_notofications\"": "\"haex_notifications\"" - }, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0005_snapshot.json b/src-tauri/database/migrations/meta/0005_snapshot.json deleted file mode 100644 index 9b105ba..0000000 --- a/src-tauri/database/migrations/meta/0005_snapshot.json +++ /dev/null @@ -1,583 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "fd079acd-3b5f-4fb7-97e2-d6641620f393", - "prevId": "7aaac460-00b5-4387-bef9-b189297cefb3", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_items": { - "name": "haex_passwords_items", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_items_key_values": { - "name": "haex_passwords_items_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_items_key_values_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_items_key_values_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_items_key_values", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0006_snapshot.json b/src-tauri/database/migrations/meta/0006_snapshot.json deleted file mode 100644 index 91eff78..0000000 --- a/src-tauri/database/migrations/meta/0006_snapshot.json +++ /dev/null @@ -1,620 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "76878f8b-9a30-4fd2-9a7b-d1a85874b1ab", - "prevId": "fd079acd-3b5f-4fb7-97e2-d6641620f393", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_items": { - "name": "haex_passwords_items", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_items_key_values": { - "name": "haex_passwords_items_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_items_key_values_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_items_key_values_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_items_key_values", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0007_snapshot.json b/src-tauri/database/migrations/meta/0007_snapshot.json deleted file mode 100644 index 6bd7da0..0000000 --- a/src-tauri/database/migrations/meta/0007_snapshot.json +++ /dev/null @@ -1,627 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "47f309cf-dabd-4f19-b87a-ed73d0e97781", - "prevId": "76878f8b-9a30-4fd2-9a7b-d1a85874b1ab", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_items": { - "name": "haex_passwords_items", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_items_key_values": { - "name": "haex_passwords_items_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_items_key_values_item_id_haex_passwords_items_id_fk": { - "name": "haex_passwords_items_key_values_item_id_haex_passwords_items_id_fk", - "tableFrom": "haex_passwords_items_key_values", - "tableTo": "haex_passwords_items", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0008_snapshot.json b/src-tauri/database/migrations/meta/0008_snapshot.json deleted file mode 100644 index 8b93fbd..0000000 --- a/src-tauri/database/migrations/meta/0008_snapshot.json +++ /dev/null @@ -1,630 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "c4edecb8-6aef-49e2-8498-0c4b74653c75", - "prevId": "47f309cf-dabd-4f19-b87a-ed73d0e97781", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_details": { - "name": "haex_passwords_item_details", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_key_values": { - "name": "haex_passwords_item_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_key_values", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": { - "\"haex_passwords_items\"": "\"haex_passwords_item_details\"", - "\"haex_passwords_items_key_values\"": "\"haex_passwords_item_key_values\"" - }, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0009_snapshot.json b/src-tauri/database/migrations/meta/0009_snapshot.json deleted file mode 100644 index 18de799..0000000 --- a/src-tauri/database/migrations/meta/0009_snapshot.json +++ /dev/null @@ -1,634 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "c3a688c3-9537-4aa8-be95-a8f55546caf1", - "prevId": "c4edecb8-6aef-49e2-8498-0c4b74653c75", - "tables": { - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_details": { - "name": "haex_passwords_item_details", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_key_values": { - "name": "haex_passwords_item_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_key_values", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0010_snapshot.json b/src-tauri/database/migrations/meta/0010_snapshot.json deleted file mode 100644 index ebe5e11..0000000 --- a/src-tauri/database/migrations/meta/0010_snapshot.json +++ /dev/null @@ -1,825 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "288d577f-f9c8-44e8-964e-da1fa062aff9", - "prevId": "c3a688c3-9537-4aa8-be95-a8f55546caf1", - "tables": { - "haex_crdt_logs": { - "name": "haex_crdt_logs", - "columns": { - "hlc_timestamp": { - "name": "hlc_timestamp", - "type": "text", - "primaryKey": true, - "notNull": true, - "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": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_crdt_settings": { - "name": "haex_crdt_settings", - "columns": { - "type": { - "name": "type", - "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_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_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions_permissions": { - "name": "haex_extensions_permissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "extension_id": { - "name": "extension_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extensions_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "isUnique": true - } - }, - "foreignKeys": { - "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { - "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", - "tableFrom": "haex_extensions_permissions", - "tableTo": "haex_extensions", - "columnsFrom": [ - "extension_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_details": { - "name": "haex_passwords_item_details", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_key_values": { - "name": "haex_passwords_item_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_key_values", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0011_snapshot.json b/src-tauri/database/migrations/meta/0011_snapshot.json deleted file mode 100644 index e2be297..0000000 --- a/src-tauri/database/migrations/meta/0011_snapshot.json +++ /dev/null @@ -1,830 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "c8c0825d-c435-4a42-986a-a4f70e7f9e8b", - "prevId": "288d577f-f9c8-44e8-964e-da1fa062aff9", - "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": { - "hlc_timestamp": { - "name": "hlc_timestamp", - "type": "text", - "primaryKey": true, - "notNull": true, - "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": {}, - "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_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": false, - "autoincrement": false - }, - "resource": { - "name": "resource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "operation": { - "name": "operation", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "haex_extension_permissions_extension_id_resource_operation_path_unique": { - "name": "haex_extension_permissions_extension_id_resource_operation_path_unique", - "columns": [ - "extension_id", - "resource", - "operation", - "path" - ], - "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": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_details": { - "name": "haex_passwords_item_details", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_key_values": { - "name": "haex_passwords_item_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_key_values", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": { - "\"haex_crdt_settings\"": "\"haex_crdt_configs\"", - "\"haex_extensions_permissions\"": "\"haex_extension_permissions\"" - }, - "columns": { - "\"haex_crdt_configs\".\"type\"": "\"haex_crdt_configs\".\"key\"" - } - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0012_snapshot.json b/src-tauri/database/migrations/meta/0012_snapshot.json deleted file mode 100644 index c580a7a..0000000 --- a/src-tauri/database/migrations/meta/0012_snapshot.json +++ /dev/null @@ -1,900 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "e4f45178-afcf-46e9-9a07-79b7bca88d88", - "prevId": "c8c0825d-c435-4a42-986a-a4f70e7f9e8b", - "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": { - "hlc_timestamp": { - "name": "hlc_timestamp", - "type": "text", - "primaryKey": true, - "notNull": true, - "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": {}, - "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_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": false, - "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_tombstone": { - "name": "haex_tombstone", - "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": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_extensions": { - "name": "haex_extensions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "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 - }, - "homepage": { - "name": "homepage", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "public_key": { - "name": "public_key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "signature": { - "name": "signature", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_timestamp": { - "name": "haex_timestamp", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_group_items": { - "name": "haex_passwords_group_items", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_group_items_group_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_group_items_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_group_items", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "haex_passwords_group_items_item_id_group_id_pk": { - "columns": [ - "item_id", - "group_id" - ], - "name": "haex_passwords_group_items_item_id_group_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_groups": { - "name": "haex_passwords_groups", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk": { - "name": "haex_passwords_groups_parent_id_haex_passwords_groups_id_fk", - "tableFrom": "haex_passwords_groups", - "tableTo": "haex_passwords_groups", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_details": { - "name": "haex_passwords_item_details", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "note": { - "name": "note", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "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_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_history": { - "name": "haex_passwords_item_history", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changed_property": { - "name": "changed_property", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_value": { - "name": "old_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "new_value": { - "name": "new_value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(CURRENT_TIMESTAMP)" - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_history_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_history", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "haex_passwords_item_key_values": { - "name": "haex_passwords_item_key_values", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "haex_tombstone": { - "name": "haex_tombstone", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk": { - "name": "haex_passwords_item_key_values_item_id_haex_passwords_item_details_id_fk", - "tableFrom": "haex_passwords_item_key_values", - "tableTo": "haex_passwords_item_details", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": { - "\"haex_extension_permissions\".\"resource\"": "\"haex_extension_permissions\".\"resource_type\"", - "\"haex_extension_permissions\".\"operation\"": "\"haex_extension_permissions\".\"action\"", - "\"haex_extension_permissions\".\"path\"": "\"haex_extension_permissions\".\"target\"" - } - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/_journal.json b/src-tauri/database/migrations/meta/_journal.json index 116cd06..492d9fe 100644 --- a/src-tauri/database/migrations/meta/_journal.json +++ b/src-tauri/database/migrations/meta/_journal.json @@ -5,92 +5,8 @@ { "idx": 0, "version": "6", - "when": 1742903332283, - "tag": "0000_zippy_scourge", - "breakpoints": true - }, - { - "idx": 1, - "version": "6", - "when": 1746281577722, - "tag": "0001_wealthy_thaddeus_ross", - "breakpoints": true - }, - { - "idx": 2, - "version": "6", - "when": 1747583956679, - "tag": "0002_married_bushwacker", - "breakpoints": true - }, - { - "idx": 3, - "version": "6", - "when": 1748873820060, - "tag": "0003_familiar_doctor_faustus", - "breakpoints": true - }, - { - "idx": 4, - "version": "6", - "when": 1748982377354, - "tag": "0004_wooden_lockheed", - "breakpoints": true - }, - { - "idx": 5, - "version": "6", - "when": 1749073296353, - "tag": "0005_wooden_nuke", - "breakpoints": true - }, - { - "idx": 6, - "version": "6", - "when": 1749128243104, - "tag": "0006_complete_martin_li", - "breakpoints": true - }, - { - "idx": 7, - "version": "6", - "when": 1749244165094, - "tag": "0007_daffy_tusk", - "breakpoints": true - }, - { - "idx": 8, - "version": "6", - "when": 1749727958231, - "tag": "0008_faulty_mercury", - "breakpoints": true - }, - { - "idx": 9, - "version": "6", - "when": 1750158916787, - "tag": "0009_curved_selene", - "breakpoints": true - }, - { - "idx": 10, - "version": "6", - "when": 1756377828646, - "tag": "0010_deep_war_machine", - "breakpoints": true - }, - { - "idx": 11, - "version": "6", - "when": 1757968140525, - "tag": "0011_illegal_thor_girl", - "breakpoints": true - }, - { - "idx": 12, - "version": "6", - "when": 1759362109283, - "tag": "0012_special_gwen_stacy", + "when": 1759402321133, + "tag": "0000_glamorous_hulk", "breakpoints": true } ] diff --git a/src-tauri/database/schemas/crdt.ts b/src-tauri/database/schemas/crdt.ts index 30e195d..68efa6d 100644 --- a/src-tauri/database/schemas/crdt.ts +++ b/src-tauri/database/schemas/crdt.ts @@ -1,20 +1,32 @@ -import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core' +import { integer, sqliteTable, text, index } from 'drizzle-orm/sqlite-core' import tableNames from '../tableNames.json' -export const haexCrdtLogs = sqliteTable(tableNames.haex.crdt.logs, { - hlc_timestamp: text().primaryKey(), - table_name: text(), - row_pks: text({ mode: 'json' }), - op_type: text({ enum: ['INSERT', 'UPDATE', 'DELETE'] }), - column_name: text(), - new_value: text({ mode: 'json' }), - old_value: text({ mode: 'json' }), -}) +export const haexCrdtLogs = sqliteTable( + tableNames.haex.crdt.logs, + { + id: text() + .primaryKey() + .$defaultFn(() => crypto.randomUUID()), + haexTimestamp: text('haex_timestamp'), + tableName: text('table_name'), + rowPks: text('row_pks', { mode: 'json' }), + opType: text('op_type', { enum: ['INSERT', 'UPDATE', 'DELETE'] }), + columnName: text('column_name'), + newValue: text('new_value', { mode: 'json' }), + oldValue: text('old_value', { mode: 'json' }), + }, + (table) => [ + index('idx_haex_timestamp').on(table.haexTimestamp), + index('idx_table_row').on(table.tableName, table.rowPks), + ], +) export type InsertHaexCrdtLogs = typeof haexCrdtLogs.$inferInsert export type SelectHaexCrdtLogs = typeof haexCrdtLogs.$inferSelect export const haexCrdtSnapshots = sqliteTable(tableNames.haex.crdt.snapshots, { - snapshot_id: text().primaryKey(), + snapshot_id: text() + .primaryKey() + .$defaultFn(() => crypto.randomUUID()), created: text(), epoch_hlc: text(), location_url: text(), @@ -22,6 +34,8 @@ export const haexCrdtSnapshots = sqliteTable(tableNames.haex.crdt.snapshots, { }) export const haexCrdtConfigs = sqliteTable(tableNames.haex.crdt.configs, { - key: text().primaryKey(), + key: text() + .primaryKey() + .$defaultFn(() => crypto.randomUUID()), value: text(), }) diff --git a/src-tauri/database/schemas/haex.ts b/src-tauri/database/schemas/haex.ts index 2dd11aa..b209be8 100644 --- a/src-tauri/database/schemas/haex.ts +++ b/src-tauri/database/schemas/haex.ts @@ -9,18 +9,22 @@ import { import tableNames from '../tableNames.json' export const haexSettings = sqliteTable(tableNames.haex.settings, { - id: text().primaryKey(), + id: text() + .primaryKey() + .$defaultFn(() => crypto.randomUUID()), key: text(), type: text(), value: text(), - haex_tombstone: integer({ mode: 'boolean' }), - haex_timestamp: text(), + haexTombstone: integer('haex_tombstone', { mode: 'boolean' }), + haexTimestamp: text('haex_timestamp'), }) export type InsertHaexSettings = typeof haexSettings.$inferInsert export type SelectHaexSettings = typeof haexSettings.$inferSelect export const haexExtensions = sqliteTable(tableNames.haex.extensions, { - id: text().primaryKey(), + id: text() + .primaryKey() + .$defaultFn(() => crypto.randomUUID()), author: text(), description: text(), entry: text(), @@ -32,8 +36,8 @@ export const haexExtensions = sqliteTable(tableNames.haex.extensions, { signature: text(), url: text(), version: text(), - haex_tombstone: integer({ mode: 'boolean' }), - haex_timestamp: text(), + haexTombstone: integer('haex_tombstone', { mode: 'boolean' }), + haexTimestamp: text('haex_timestamp'), }) export type InsertHaexExtensions = typeof haexExtensions.$inferInsert export type SelectHaexExtensions = typeof haexExtensions.$inferSelect @@ -41,7 +45,9 @@ export type SelectHaexExtensions = typeof haexExtensions.$inferSelect export const haexExtensionPermissions = sqliteTable( tableNames.haex.extension_permissions, { - id: text().primaryKey(), + id: text() + .primaryKey() + .$defaultFn(() => crypto.randomUUID()), extensionId: text('extension_id').references( (): AnySQLiteColumn => haexExtensions.id, ), diff --git a/src-tauri/database/schemas/index.ts b/src-tauri/database/schemas/index.ts new file mode 100644 index 0000000..6835710 --- /dev/null +++ b/src-tauri/database/schemas/index.ts @@ -0,0 +1,2 @@ +export * from './crdt' +export * from './haex' diff --git a/src-tauri/database/vault.db b/src-tauri/database/vault.db index 1200657c02b19e6964aef39db98929def9d7bf24..5247ff49c7c5254de83812d773557528add6ad1f 100644 GIT binary patch delta 3360 zcmeHJZEO=|9PhvF-L-dZ@4AiM-nw=YGR~FJQr2}L;OdyLV3;TblxTZvuid$|9qkp0 zFt&DpF>07Th9}0C50ei&Lj4Qao7zGXd(-i)opFHe zEn6G?JM)9(Bz=l15?83l%|8(*O$W{I!9G(vc)^SO+?&P$9)COxo0*2GRdo~}4#N=% z&lX@4nl^FxsSzMhgzm(@Wuf_tsr>*zKC_JElVSYXunG{NN%W(&g{d#K)=<3P4^v6} z^C$>Vi{{8$YdWLI2{|Szh=mTPII2WFid0a%v^5$R6$x>sI&_&ZGjd8yN(*cFSPGUA zxlBGAL#K^R=s4j(=ZrkQo(0}Q3w^aDztfMtGrQ0!rj4m9ZsaJwy&X!MkkjS{C-U32 zHbs^FW4GZnS9`_LdwQ`+sI_>K-ZoWjn7 zY90{>2dtJ2{wfIqx?r;4^D*GOaVZze%43S0N#D&%N-Np@cYh9NQqq{38v4@F8j@p+ zEz@FZQHW#tp;0*&8Icxk&dJHNsN}Qgl4AwF6LB$OSutuG%>>S6X4m zmkz-maNti5z!SJ}0vhp06R@40I>hKrewos;>j7IOGb=tjq2^f+kM~8Y%O}RFb5z7^ zQd-nWHLaYI73H*&yOTNIJq|0;1hocrl6CmeacIFE<6y7@Mrp?dofUUSQ3pTv| z5VUai;w~%22Le#qsfa_P5}wOJt^NhH9_DNw2y9p2b+Vr(`DX(f27V_8%O{vU7Ih2+ zD7xizTq?-%LPUp%WHbAQMX3;pW#dX@G?UC(`=0I(Z}0aEY~9$u%M-1#jCuyQdZN|# zQP0Zg0+ik{Z&XE$jE&@?LY`75UUlh`(-XIS>RXjchpK@re|B7L{&(J&SP8`(LGgkB zQ*C-&+A=QZp#jKBkyv!j(pI-*pMLUi{a(nC>qwFx6!hvH%|oM^Dw<6AvI3o8u0Rl+ z+SY`eR9m`IJwobW;yD@IwTsRYEriV^zhkwIb4CHT+MHb(_z!cepm!H^`b?T*EQfl$n!=o;z?#)slQu{)NKf@^(#Unmg@4Xq9MyTy1S z9`FbJp)P;CTMVobdxC31T>*Ie#A{cs(K`4o1AD9NjQ+}&Z>=_aW+pu|y`Ik}8DE+4 zU3Y6QA28FN%2Q^hZ?IkLyunTt4J^f;c5Jv0w!CrwY{|}>pZm|)lASkR`A68Yt}@dV zwq)nwdvuWrKIF@Xd|Ab>5Bc&z_|m5`nMLDFJ9W*#85M(L#u2l>YZq<3%uRZW^@gRF zx=seEsd>dr*uF_di#?+|v7J#&_qA GXa4}8Ncz}?cRIs*v`gw>|8Esooh@yv+q@c5;vs5IZ`KW0)3=C&(7{92Y$tO zDTzw!`0S`^RaD|lym3g<5-Nd23$*?tNJXMTLR65b6cqsyk46*%5~Zk!AlmYn-Sy+_ zh8Ce>c}F*|-+bSE-#6dyJAOQN{CMmOZ4IeVD3qmNjDB_W+j+7}97}~ZJ@9Ch_5k+| zZ9}WLcQWD7)9GhYkEht=wmK)3H|Oi_FKOO_3jl<;Xx}z+1ZbHxZAr{PykO zL`wx51J)sI9W7c%E7nlCG(1!;j##6ErLzBf`BbWAj&Xl<0kk{u_}+YfwnF!JCF1?V zbOEkVn8l$HTsbt?%eot8z$TD&w>p4#ADaOgr!R4DqFR?=d4#}3x4Y{c$mf#V@7U3^ zZ%1}t&#j->k;TpMh64oVzGj9$TyViTdP996;qTAXZY(1AOH-hc zs~uapv(b5uTkZ6-(S=Rn^4!W)xvBb*6)Z2yVB(<#ncSzQKvP}0(HFyg?L64vUCXnP zM1FsRd-XKfmt0Z(T)l7Y$+7ueQFqfcVBJHfKpSZAcIJYCXHS8zEb36#%Q>6C$CLHc z*|zek3MP39(BhIaV5QT*G`UYqgM>2z829`cAiLMjfF94JgV8j@AMBY|opXoI0>&wZ zS0^(Q$rQ`?^nep$?oZ)wO22huy zd@?a!7i0O(PB6aR`D0`ah&!q1?Oi$F6gl4q^VN1X#*epc2i1e6A=5g#%!8dL*>z~a zNsFFu7LN>-4j*~HD2O@N*>#}o?aeIR>)ak|qZ6fAC*R*yKXqjNOQOABX!ti@H271%2?h_Zliez+rSD58DZUohW^QY)K5b@$~pL@@fpeZth z2Q7Dv3-~EEo$-9RwBXs!*STE|%YC_%#y`I@P1|&e4{@`c&9!7MXT~x@`nTyb=|bwC zspnE=il1$$|7&urkdB7N(@{%-3KUJ1hzLVNkfC5$Sk`4kbQ$VICs0(8Dwry?R1GPr zgiR=!*cN4EW6@N=%*D<=Qb_q=vMvaki8Woeu>^@tOuPk~6m ziY7rM%BDy#mQ9J+GE{U5NWhst-*)BZLc#|lSdulxw238SMYqwIV%U-<$cQShP=%-r zrU{WCA%qnwBc$_|L^O<49jdlSfcwzQw`U7+9}Pi-Mb*- zG}dG~El3)jL|BqktXc>WLgmvm!L&69+?|at{I05@bNAiZCto3d@|mZF%z-FC~hrwWXZ1~r}PXbTvtl4RS&R&`>k zvQ7j;Cc1^GGJ-`dtlJbC3bufdu9~KbY=vH}E&_MU>knQnM13%9YNoA7mLZF9OcW$T zKqfM6q#`;93B)F%Ca3NKsilc+KwBV|DruOyq$V0F0QJ#&f&MZG4Fj2o7N&;Nbwjii6->Y0asB&+Ivq9X z+>0UZUG8t(TU_HC-0!*HaKGYy&b`XL%>97-9`_=B7%p&IBH<87drit~l3tVWnz+}* zyoU7}#%rQp6Y-j`*VN6v+a1YX+*VKjPwrvkfS$?HkC|I2#5_ay5<((j+# z6ZL!P`QF7n!F0p&f#&&vt!eh5P&#}d%-zLt;RBg4do8go^?K}jQiy$x>4KziFsiOV8?X{Nnb&VXhw=M5yPy8^l}nVe6u zA4nGt)bb#A%mMj;I)p;eUo58%ZM8JP&mGk}gJdvy-}@$m`lZRBE9;^Qpd}E!(aQE) zLzU5E^X#nu(D0x&vPhS*{Ub+=ffDif&cd2<>EIBq92uSGRM~z%lT}KCR=I))M}md< zYH20Q_x6Ix-SZd1d4#8fYgtO}{6P>9x>rw8Ib2eT@fkDm&C+RL2OIt!U|OJaOmKqjhN7s*6h zEt#Nsv~p}@K~eweTK|K-`G75j>jUl*PVH~>Qa^OwtYh7mUC^FxO2iWnhMw{0OSR#@ zKXDbCe-91H+#0&HoCfvQN}jJ)SI_ex>qb1NmTm;xf1-OX3_NoAek|{XVbEA(vW$CX z2Hc;huAXD{(hy=p-lK_C@~rPN$fcD8uMuM zsVIs3GIBQjo$%2Vn~7$AMjz45pm{>hvHb4c;KY4?0ah#yS)VOBC)u{>{IAyTHA}p^ zKUh;k8Yem_hDWCF_A%)0R_DjDR&MFOoHrf>g|j8z+?^Y>f-S)o9F)wG4l^7*NuGB-hn+yidD(F5AC>;a`NF;Q(>Pm7+G z9$NG`kF!ei(jsN9!0|nSp{2}i+4sy(JQz6BBjEq+Ooy7Y{nX0k$|x=kRm$^O#W^3} z0J2U#QH`!!ywfWQRG+0m`LOTjdp}ULX5Vr8OJ)F@-E&88^``aCBzu@vpx4>ii*Oqy H5%mAx@&_He diff --git a/src-tauri/src/build/mod.rs b/src-tauri/src/build/mod.rs new file mode 100644 index 0000000..9faabd4 --- /dev/null +++ b/src-tauri/src/build/mod.rs @@ -0,0 +1,3 @@ +// src-tauri/src/build/mod.rs +pub mod rust_types; +pub mod table_names; diff --git a/src-tauri/src/build/rust_types.rs b/src-tauri/src/build/rust_types.rs new file mode 100644 index 0000000..ff59b47 --- /dev/null +++ b/src-tauri/src/build/rust_types.rs @@ -0,0 +1,24 @@ +// src-tauri/src/build/rust_types.rs +use std::fs; +use std::path::Path; + +pub fn generate_rust_types() { + // Prüfe ob die generierte Datei vom TypeScript-Script existiert + let generated_path = Path::new("src/database/generated.rs"); + + if !generated_path.exists() { + eprintln!("⚠️ Warning: src/database/generated.rs not found!"); + eprintln!(" Run 'pnpm generate:rust-types' first."); + + // Erstelle eine leere Datei als Fallback + fs::write( + generated_path, + "// Run 'pnpm generate:rust-types' to generate this file\n", + ) + .ok(); + } + + println!("cargo:rerun-if-changed=src/database/generated.rs"); + println!("cargo:rerun-if-changed=src/database/schemas/crdt.ts"); + println!("cargo:rerun-if-changed=src/database/schemas/haex.ts"); +} diff --git a/src-tauri/src/build/table_names.rs b/src-tauri/src/build/table_names.rs new file mode 100644 index 0000000..b92090a --- /dev/null +++ b/src-tauri/src/build/table_names.rs @@ -0,0 +1,64 @@ +// build/table_names.rs +use serde::Deserialize; +use std::fs::File; +use std::io::{BufReader, Write}; +use std::path::Path; + +#[derive(Debug, Deserialize)] +pub struct Schema { + pub haex: Haex, +} + +#[derive(Debug, Deserialize)] +pub struct Haex { + pub settings: String, + pub extensions: String, + pub extension_permissions: String, + pub crdt: Crdt, +} + +#[derive(Debug, Deserialize)] +pub struct Crdt { + pub logs: String, + pub snapshots: String, + pub configs: String, +} + +pub fn generate_table_names(out_dir: &str) { + let schema_path = Path::new("database/tableNames.json"); + let dest_path = Path::new(out_dir).join("tableNames.rs"); + + let file = File::open(&schema_path).expect("Konnte tableNames.json nicht öffnen"); + let reader = BufReader::new(file); + let schema: Schema = + serde_json::from_reader(reader).expect("Konnte tableNames.json nicht parsen"); + let haex = schema.haex; + + let code = format!( + r#" + // Auto-generated - DO NOT EDIT + + // Core Tables + pub const TABLE_SETTINGS: &str = "{settings}"; + pub const TABLE_EXTENSIONS: &str = "{extensions}"; + pub const TABLE_EXTENSION_PERMISSIONS: &str = "{extension_permissions}"; + + // CRDT Tables + pub const TABLE_CRDT_LOGS: &str = "{crdt_logs}"; + pub const TABLE_CRDT_SNAPSHOTS: &str = "{crdt_snapshots}"; + pub const TABLE_CRDT_CONFIGS: &str = "{crdt_configs}"; + "#, + settings = haex.settings, + extensions = haex.extensions, + extension_permissions = haex.extension_permissions, + crdt_logs = haex.crdt.logs, + crdt_snapshots = haex.crdt.snapshots, + crdt_configs = haex.crdt.configs + ); + + let mut f = File::create(&dest_path).expect("Konnte Zieldatei nicht erstellen"); + f.write_all(code.as_bytes()) + .expect("Konnte nicht in Zieldatei schreiben"); + + println!("cargo:rerun-if-changed=database/tableNames.json"); +} diff --git a/src-tauri/src/database/core.rs b/src-tauri/src/database/core.rs index e744caa..8a92ba8 100644 --- a/src-tauri/src/database/core.rs +++ b/src-tauri/src/database/core.rs @@ -15,6 +15,7 @@ use sqlparser::parser::Parser; use std::collections::HashMap; /// Öffnet und initialisiert eine Datenbank mit Verschlüsselung +/// pub fn open_and_init_db(path: &str, key: &str, create: bool) -> Result { let flags = if create { OpenFlags::SQLITE_OPEN_READ_WRITE | OpenFlags::SQLITE_OPEN_CREATE diff --git a/src-tauri/src/database/generated.rs b/src-tauri/src/database/generated.rs new file mode 100644 index 0000000..d9bb9f3 --- /dev/null +++ b/src-tauri/src/database/generated.rs @@ -0,0 +1,210 @@ +// Auto-generated from Drizzle schema +// DO NOT EDIT MANUALLY +// Run 'pnpm generate:rust-types' to regenerate + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HaexSettings { + pub id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub key: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(rename = "type")] + pub r#type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub haex_tombstone: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub haex_timestamp: Option, +} + +impl HaexSettings { + pub fn from_row(row: &rusqlite::Row) -> rusqlite::Result { + Ok(Self { + id: row.get(0)?, + key: row.get(1)?, + r#type: row.get(2)?, + value: row.get(3)?, + haex_tombstone: row.get(4)?, + haex_timestamp: row.get(5)?, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HaexExtensions { + pub id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub author: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub entry: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub homepage: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub signature: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub haex_tombstone: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub haex_timestamp: Option, +} + +impl HaexExtensions { + pub fn from_row(row: &rusqlite::Row) -> rusqlite::Result { + Ok(Self { + id: row.get(0)?, + author: row.get(1)?, + description: row.get(2)?, + entry: row.get(3)?, + homepage: row.get(4)?, + enabled: row.get(5)?, + icon: row.get(6)?, + name: row.get(7)?, + public_key: row.get(8)?, + signature: row.get(9)?, + url: row.get(10)?, + version: row.get(11)?, + haex_tombstone: row.get(12)?, + haex_timestamp: row.get(13)?, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HaexExtensionPermissions { + pub id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub extension_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub resource_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub action: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub target: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub constraints: Option, + pub status: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub haex_tombstone: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub haex_timestamp: Option, +} + +impl HaexExtensionPermissions { + pub fn from_row(row: &rusqlite::Row) -> rusqlite::Result { + Ok(Self { + id: row.get(0)?, + extension_id: row.get(1)?, + resource_type: row.get(2)?, + action: row.get(3)?, + target: row.get(4)?, + constraints: row.get(5)?, + status: row.get(6)?, + created_at: row.get(7)?, + updated_at: row.get(8)?, + haex_tombstone: row.get(9)?, + haex_timestamp: row.get(10)?, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HaexCrdtLogs { + pub id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub haex_timestamp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub table_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub row_pks: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub op_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub column_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub new_value: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub old_value: Option, +} + +impl HaexCrdtLogs { + pub fn from_row(row: &rusqlite::Row) -> rusqlite::Result { + Ok(Self { + id: row.get(0)?, + haex_timestamp: row.get(1)?, + table_name: row.get(2)?, + row_pks: row.get(3)?, + op_type: row.get(4)?, + column_name: row.get(5)?, + new_value: row.get(6)?, + old_value: row.get(7)?, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HaexCrdtSnapshots { + pub snapshot_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub epoch_hlc: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub location_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub file_size_bytes: Option, +} + +impl HaexCrdtSnapshots { + pub fn from_row(row: &rusqlite::Row) -> rusqlite::Result { + Ok(Self { + snapshot_id: row.get(0)?, + created: row.get(1)?, + epoch_hlc: row.get(2)?, + location_url: row.get(3)?, + file_size_bytes: row.get(4)?, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HaexCrdtConfigs { + pub key: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +impl HaexCrdtConfigs { + pub fn from_row(row: &rusqlite::Row) -> rusqlite::Result { + Ok(Self { + key: row.get(0)?, + value: row.get(1)?, + }) + } +} + diff --git a/src-tauri/src/extension/core_old.rs b/src-tauri/src/extension/core_old.rs deleted file mode 100644 index 9414e09..0000000 --- a/src-tauri/src/extension/core_old.rs +++ /dev/null @@ -1,973 +0,0 @@ -/// src-tauri/src/extension/core.rs -use crate::extension::crypto::ExtensionCrypto; -use crate::extension::error::ExtensionError; -use crate::extension::permissions::manager::PermissionManager; -use crate::extension::permissions::types::{ - Action, DbConstraints, ExtensionPermission, FsConstraints, HttpConstraints, - PermissionConstraints, PermissionStatus, ResourceType, ShellConstraints, -}; -use crate::AppState; -use mime; -use serde::{Deserialize, Serialize}; -use sha2::Digest; -use sha2::Sha256; -use std::collections::HashMap; -use std::fmt; -use std::fs; -use std::fs::File; -use std::path::PathBuf; -use std::sync::Mutex; -use std::time::{Duration, SystemTime}; -use tauri::State; -use tauri::{ - http::{Request, Response}, - AppHandle, Manager, Runtime, UriSchemeContext, -}; -use zip::ZipArchive; - -#[derive(Serialize, Deserialize)] -pub struct ExtensionPreview { - pub manifest: ExtensionManifest, - pub is_valid_signature: bool, - pub key_hash: String, - pub editable_permissions: EditablePermissions, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct EditablePermissions { - pub permissions: Vec, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct EditablePermission { - pub resource_type: String, - pub action: String, - pub target: String, - pub constraints: Option, - pub status: String, -} - -impl EditablePermissions { - /// Konvertiert EditablePermissions zu internen ExtensionPermissions - pub fn to_internal_permissions(&self, extension_id: &str) -> Vec { - self.permissions - .iter() - .map(|p| ExtensionPermission { - id: uuid::Uuid::new_v4().to_string(), - extension_id: extension_id.to_string(), - resource_type: match p.resource_type.as_str() { - "fs" => ResourceType::Fs, - "http" => ResourceType::Http, - "db" => ResourceType::Db, - "shell" => ResourceType::Shell, - _ => ResourceType::Fs, // Fallback - }, - action: match p.action.as_str() { - "read" => Action::Read, - "write" => Action::Write, - _ => Action::Read, // Fallback - }, - target: p.target.clone(), - constraints: p - .constraints - .as_ref() - .and_then(|c| Self::parse_constraints(&p.resource_type, c)), - status: match p.status.as_str() { - "granted" => PermissionStatus::Granted, - "denied" => PermissionStatus::Denied, - "ask" => PermissionStatus::Ask, - _ => PermissionStatus::Denied, // Fallback - }, - haex_timestamp: None, - haex_tombstone: None, - }) - .collect() - } - - fn parse_constraints( - resource_type: &str, - json_value: &serde_json::Value, - ) -> Option { - match resource_type { - "db" => serde_json::from_value::(json_value.clone()) - .ok() - .map(PermissionConstraints::Database), - "fs" => serde_json::from_value::(json_value.clone()) - .ok() - .map(PermissionConstraints::Filesystem), - "http" => serde_json::from_value::(json_value.clone()) - .ok() - .map(PermissionConstraints::Http), - "shell" => serde_json::from_value::(json_value.clone()) - .ok() - .map(PermissionConstraints::Shell), - _ => None, - } - } - - /// Filtert nur granted Permissions - pub fn filter_granted(&self) -> Vec { - self.permissions - .iter() - .filter(|p| p.status == "granted") - .cloned() - .collect() - } -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct ExtensionManifest { - pub id: String, - pub name: String, - pub version: String, - pub author: Option, - pub entry: String, - pub icon: Option, - pub public_key: String, - pub signature: String, - pub permissions: ExtensionManifestPermissions, - pub homepage: Option, - pub description: Option, -} - -impl ExtensionManifest { - /// Berechnet den Key Hash für diese Extension - pub fn calculate_key_hash(&self) -> Result { - ExtensionCrypto::calculate_key_hash(&self.public_key) - .map_err(|e| ExtensionError::InvalidPublicKey { reason: e }) - } - - /// Generiert die vollständige Extension ID mit Key Hash Prefix - pub fn full_extension_id(&self) -> Result { - let key_hash = self.calculate_key_hash()?; - Ok(format!("{}-{}", key_hash, self.id)) - } - pub fn to_editable_permissions(&self) -> EditablePermissions { - let mut database = Vec::new(); - let mut filesystem = Vec::new(); - let mut http = Vec::new(); - - if let Some(db) = &self.permissions.database { - for resource in &db.read { - database.push(EditableDatabasePermission { - operation: "read".to_string(), - resource: resource.clone(), - status: PermissionStatus::Granted, - }); - } - for resource in &db.write { - database.push(EditableDatabasePermission { - operation: "write".to_string(), - resource: resource.clone(), - status: PermissionStatus::Granted, - }); - } - } - - if let Some(fs) = &self.permissions.filesystem { - for path in &fs.read { - filesystem.push(EditableFilesystemPermission { - operation: "read".to_string(), - path: path.clone(), - status: PermissionStatus::Granted, - }); - } - for path in &fs.write { - filesystem.push(EditableFilesystemPermission { - operation: "write".to_string(), - path: path.clone(), - status: PermissionStatus::Granted, - }); - } - } - - if let Some(http_list) = &self.permissions.http { - for domain in http_list { - http.push(EditableHttpPermission { - domain: domain.clone(), - status: PermissionStatus::Granted, - }); - } - } - - EditablePermissions { - database, - filesystem, - http, - } - } -} - -impl ExtensionManifest { - /// Konvertiert Manifest zu EditablePermissions (neue Version) - pub fn to_editable_permissions(&self) -> EditablePermissions { - let mut permissions = Vec::new(); - - // Database Permissions - if let Some(db) = &self.permissions.database { - for resource in &db.read { - permissions.push(EditablePermission { - resource_type: "db".to_string(), - action: "read".to_string(), - target: resource.clone(), - constraints: None, - status: "granted".to_string(), - }); - } - for resource in &db.write { - permissions.push(EditablePermission { - resource_type: "db".to_string(), - action: "write".to_string(), - target: resource.clone(), - constraints: None, - status: "granted".to_string(), - }); - } - } - - // Filesystem Permissions - if let Some(fs) = &self.permissions.filesystem { - for path in &fs.read { - permissions.push(EditablePermission { - resource_type: "fs".to_string(), - action: "read".to_string(), - target: path.clone(), - constraints: None, - status: "granted".to_string(), - }); - } - for path in &fs.write { - permissions.push(EditablePermission { - resource_type: "fs".to_string(), - action: "write".to_string(), - target: path.clone(), - constraints: None, - status: "granted".to_string(), - }); - } - } - - // HTTP Permissions - if let Some(http_list) = &self.permissions.http { - for domain in http_list { - permissions.push(EditablePermission { - resource_type: "http".to_string(), - action: "read".to_string(), // HTTP ist meist read - target: domain.clone(), - constraints: None, - status: "granted".to_string(), - }); - } - } - - // Shell Permissions - if let Some(shell_list) = &self.permissions.shell { - for command in shell_list { - permissions.push(EditablePermission { - resource_type: "shell".to_string(), - action: "read".to_string(), // Shell hat keine action mehr im Schema - target: command.clone(), - constraints: None, - status: "granted".to_string(), - }); - } - } - - EditablePermissions { permissions } - } -} -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct ExtensionInfoResponse { - pub key_hash: String, - pub name: String, - pub full_id: String, - pub version: String, - pub display_name: Option, - pub namespace: Option, - pub allowed_origin: String, -} - -impl ExtensionInfoResponse { - pub fn from_extension(extension: &Extension) -> Result { - // Bestimme die allowed_origin basierend auf Tauri-Konfiguration - let allowed_origin = get_tauri_origin(); - let key_hash = extension - .manifest - .calculate_key_hash() - .map_err(|e| ExtensionError::InvalidPublicKey { reason: e })?; - let full_id = extension - .manifest - .full_extension_id() - .map_err(|e| ExtensionError::InvalidPublicKey { reason: e })?; - - Ok(Self { - key_hash, - name: extension.manifest.name.clone(), - full_id, - version: extension.manifest.version.clone(), - display_name: Some(extension.manifest.name.clone()), - namespace: extension.manifest.author.clone(), - allowed_origin, - }) - } -} - -fn get_tauri_origin() -> String { - #[cfg(target_os = "windows")] - { - "https://tauri.localhost".to_string() - } - - #[cfg(target_os = "macos")] - { - "tauri://localhost".to_string() - } - - #[cfg(target_os = "linux")] - { - "tauri://localhost".to_string() - } - - #[cfg(target_os = "android")] - { - "tauri://localhost".to_string() - } - - #[cfg(target_os = "ios")] - { - "tauri://localhost".to_string() - } -} - -/// Extension source type (production vs development) -#[derive(Debug, Clone)] -pub enum ExtensionSource { - Production { - path: PathBuf, - version: String, - }, - Development { - dev_server_url: String, - manifest_path: PathBuf, - auto_reload: bool, - }, -} - -/// Complete extension data structure -#[derive(Debug, Clone)] -pub struct Extension { - pub id: String, - pub name: String, - pub source: ExtensionSource, - pub manifest: ExtensionManifest, - pub enabled: bool, - pub last_accessed: SystemTime, -} - -/// Cached permission data for performance -#[derive(Debug, Clone)] -pub struct CachedPermission { - pub permissions: Vec, - pub cached_at: SystemTime, - pub ttl: Duration, -} - -/// Enhanced extension manager -#[derive(Default)] -pub struct ExtensionManager { - pub production_extensions: Mutex>, - pub dev_extensions: Mutex>, - pub permission_cache: Mutex>, -} - -impl ExtensionManager { - pub fn new() -> Self { - Self::default() - } - - pub fn get_base_extension_dir(&self, app_handle: AppHandle) -> Result { - let path = app_handle - .path() - .app_local_data_dir() // Korrekt für Ressourcen - // Wenn du stattdessen App Local Data willst: .app_local_data_dir() - .map_err(|e| ExtensionError::Filesystem { - source: std::io::Error::new(std::io::ErrorKind::NotFound, e.to_string()), - })? - .join("extensions"); - Ok(path) - } - - pub fn get_extension_dir( - &self, - app_handle: AppHandle, - extension_id: &str, - extension_version: &str, - ) -> Result { - let specific_extension_dir = self - .get_base_extension_dir(app_handle)? - .join(extension_id) - .join(extension_version); - - Ok(specific_extension_dir) - } - - pub fn add_production_extension(&self, extension: Extension) -> Result<(), ExtensionError> { - if extension.id.is_empty() { - return Err(ExtensionError::ValidationError { - reason: "Extension ID cannot be empty".to_string(), - }); - } - - // Validate filesystem permissions - /* if let Some(fs_perms) = &extension.manifest.permissions.filesystem { - fs_perms.validate()?; - } - */ - match &extension.source { - ExtensionSource::Production { .. } => { - let mut extensions = self.production_extensions.lock().unwrap(); - extensions.insert(extension.id.clone(), extension); - Ok(()) - } - _ => Err(ExtensionError::ValidationError { - reason: "Expected Production source".to_string(), - }), - } - } - - pub fn add_dev_extension(&self, extension: Extension) -> Result<(), ExtensionError> { - if extension.id.is_empty() { - return Err(ExtensionError::ValidationError { - reason: "Extension ID cannot be empty".to_string(), - }); - } - - // Validate filesystem permissions - /* if let Some(fs_perms) = &extension.manifest.permissions.filesystem { - fs_perms.validate()?; - } */ - - match &extension.source { - ExtensionSource::Development { .. } => { - let mut extensions = self.dev_extensions.lock().unwrap(); - extensions.insert(extension.id.clone(), extension); - Ok(()) - } - _ => Err(ExtensionError::ValidationError { - reason: "Expected Development source".to_string(), - }), - } - } - - pub fn get_extension(&self, extension_id: &str) -> Option { - // Dev extensions take priority - let dev_extensions = self.dev_extensions.lock().unwrap(); - if let Some(extension) = dev_extensions.get(extension_id) { - return Some(extension.clone()); - } - - // Then check production - let prod_extensions = self.production_extensions.lock().unwrap(); - prod_extensions.get(extension_id).cloned() - } - - pub fn remove_extension(&self, extension_id: &str) -> Result<(), ExtensionError> { - { - let mut dev_extensions = self.dev_extensions.lock().unwrap(); - if dev_extensions.remove(extension_id).is_some() { - return Ok(()); - } - } - - { - let mut prod_extensions = self.production_extensions.lock().unwrap(); - if prod_extensions.remove(extension_id).is_some() { - return Ok(()); - } - } - - Err(ExtensionError::NotFound { - id: extension_id.to_string(), - }) - } - - pub async fn remove_extension_internal( - &self, - app_handle: AppHandle, - extension_id: String, - extension_version: String, - state: &State<'_, AppState>, - ) -> Result<(), ExtensionError> { - // Permissions löschen (verwendet jetzt die neue Methode) - PermissionManager::delete_permissions(state, &extension_id).await?; - - // Extension aus Manager entfernen - self.remove_extension(&extension_id)?; - - let extension_dir = - self.get_extension_dir(app_handle, &extension_id, &extension_version)?; - - // Dateien löschen - if extension_dir.exists() { - std::fs::remove_dir_all(&extension_dir) - .map_err(|e| ExtensionError::Filesystem { source: e })?; - } - - Ok(()) - } - - pub async fn preview_extension_internal( - &self, - source_path: String, - ) -> Result { - let source = PathBuf::from(&source_path); - - // ZIP in temp entpacken - let temp = std::env::temp_dir().join(format!("haexhub_preview_{}", uuid::Uuid::new_v4())); - std::fs::create_dir_all(&temp).map_err(|e| ExtensionError::Filesystem { source: e })?; - - let file = File::open(&source).map_err(|e| ExtensionError::Filesystem { source: e })?; - let mut archive = - ZipArchive::new(file).map_err(|e| ExtensionError::InstallationFailed { - reason: format!("Invalid ZIP: {}", e), - })?; - - archive - .extract(&temp) - .map_err(|e| ExtensionError::InstallationFailed { - reason: format!("Cannot extract ZIP: {}", e), - })?; - - // Manifest laden - let manifest_path = temp.join("manifest.json"); - let manifest_content = - std::fs::read_to_string(&manifest_path).map_err(|e| ExtensionError::ManifestError { - reason: format!("Cannot read manifest: {}", e), - })?; - - let manifest: ExtensionManifest = serde_json::from_str(&manifest_content)?; - - // Signatur verifizieren - let content_hash = ExtensionCrypto::hash_directory(&temp) - .map_err(|e| ExtensionError::SignatureVerificationFailed { reason: e })?; - - let is_valid_signature = ExtensionCrypto::verify_signature( - &manifest.public_key, - &content_hash, - &manifest.signature, - ) - .is_ok(); - - let key_hash = manifest.calculate_key_hash()?; - - // Editable permissions erstellen - let editable_permissions = manifest.to_editable_permissions(); - - // Cleanup - std::fs::remove_dir_all(&temp).ok(); - - Ok(ExtensionPreview { - manifest, - is_valid_signature, - key_hash, - editable_permissions, - }) - } - - pub async fn install_extension_with_permissions_internal( - &self, - app_handle: AppHandle, - source_path: String, - custom_permissions: EditablePermissions, - state: &State<'_, AppState>, - ) -> Result { - let source = PathBuf::from(&source_path); - - // 1. ZIP entpacken - let temp = std::env::temp_dir().join(format!("haexhub_ext_{}", uuid::Uuid::new_v4())); - std::fs::create_dir_all(&temp).map_err(|e| ExtensionError::Filesystem { source: e })?; - - let file = File::open(&source).map_err(|e| ExtensionError::Filesystem { source: e })?; - let mut archive = - ZipArchive::new(file).map_err(|e| ExtensionError::InstallationFailed { - reason: format!("Invalid ZIP: {}", e), - })?; - - archive - .extract(&temp) - .map_err(|e| ExtensionError::InstallationFailed { - reason: format!("Cannot extract ZIP: {}", e), - })?; - - // 2. Manifest laden - let manifest_path = temp.join("manifest.json"); - let manifest_content = - std::fs::read_to_string(&manifest_path).map_err(|e| ExtensionError::ManifestError { - reason: format!("Cannot read manifest: {}", e), - })?; - - let manifest: ExtensionManifest = serde_json::from_str(&manifest_content)?; - - // 3. Signatur verifizieren - let content_hash = ExtensionCrypto::hash_directory(&temp) - .map_err(|e| ExtensionError::SignatureVerificationFailed { reason: e })?; - - ExtensionCrypto::verify_signature(&manifest.public_key, &content_hash, &manifest.signature) - .map_err(|e| ExtensionError::SignatureVerificationFailed { reason: e })?; - - // 4. Key Hash berechnen - let key_hash = manifest.calculate_key_hash()?; - let full_extension_id = format!("{}-{}", key_hash, manifest.id); - - // 5. Zielverzeichnis - let extensions_dir = app_handle - .path() - .app_data_dir() - .map_err(|e| ExtensionError::Filesystem { - source: std::io::Error::new(std::io::ErrorKind::NotFound, e.to_string()), - })? - .join("extensions") - .join(&full_extension_id) - .join(&manifest.version); - - std::fs::create_dir_all(&extensions_dir) - .map_err(|e| ExtensionError::Filesystem { source: e })?; - - // 6. Dateien kopieren - copy_directory( - temp.to_string_lossy().to_string(), - extensions_dir.to_string_lossy().to_string(), - )?; - - // 7. Temp aufräumen - std::fs::remove_dir_all(&temp).ok(); - - // 8. Custom Permissions konvertieren und speichern - let permissions = custom_permissions.to_internal_permissions(&full_extension_id); - let granted_permissions = permissions.filter_granted(); - PermissionManager::save_permissions(&state.db, &granted_permissions).await?; - - // 9. Extension registrieren - let extension = Extension { - id: full_extension_id.clone(), - name: manifest.name.clone(), - source: ExtensionSource::Production { - path: extensions_dir.clone(), - version: manifest.version.clone(), - }, - manifest: manifest.clone(), - enabled: true, - last_accessed: SystemTime::now(), - }; - - state - .extension_manager - .add_production_extension(extension)?; - - Ok(full_extension_id) - } -} - -// For backward compatibility -#[derive(Default)] -pub struct ExtensionState { - pub extensions: Mutex>, -} - -impl ExtensionState { - pub fn add_extension(&self, path: String, manifest: ExtensionManifest) { - let mut extensions = self.extensions.lock().unwrap(); - extensions.insert(path, manifest); - } - - pub fn get_extension(&self, addon_id: &str) -> Option { - let extensions = self.extensions.lock().unwrap(); - extensions.values().find(|p| p.name == addon_id).cloned() - } -} - -#[derive(Deserialize, Debug)] -struct ExtensionInfo { - id: String, - version: String, -} - -#[derive(Debug)] -enum DataProcessingError { - HexDecoding(hex::FromHexError), - Utf8Conversion(std::string::FromUtf8Error), - JsonParsing(serde_json::Error), -} - -// Implementierung von Display für benutzerfreundliche Fehlermeldungen -impl fmt::Display for DataProcessingError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - DataProcessingError::HexDecoding(e) => write!(f, "Hex-Dekodierungsfehler: {}", e), - DataProcessingError::Utf8Conversion(e) => { - write!(f, "UTF-8-Konvertierungsfehler: {}", e) - } - DataProcessingError::JsonParsing(e) => write!(f, "JSON-Parsing-Fehler: {}", e), - } - } -} - -// Implementierung von std::error::Error (optional, aber gute Praxis für bibliotheksähnlichen Code) -impl std::error::Error for DataProcessingError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - DataProcessingError::HexDecoding(e) => Some(e), - DataProcessingError::Utf8Conversion(e) => Some(e), - DataProcessingError::JsonParsing(e) => Some(e), - } - } -} - -// Implementierung von From-Traits für einfache Verwendung des '?'-Operators -impl From for DataProcessingError { - fn from(err: hex::FromHexError) -> Self { - DataProcessingError::HexDecoding(err) - } -} - -impl From for DataProcessingError { - fn from(err: std::string::FromUtf8Error) -> Self { - DataProcessingError::Utf8Conversion(err) - } -} - -impl From for DataProcessingError { - fn from(err: serde_json::Error) -> Self { - DataProcessingError::JsonParsing(err) - } -} - -pub fn copy_directory(source: String, destination: String) -> Result<(), ExtensionError> { - println!( - "Kopiere Verzeichnis von '{}' nach '{}'", - source, destination - ); - - let source_path = PathBuf::from(&source); - let destination_path = PathBuf::from(&destination); - - if !source_path.exists() || !source_path.is_dir() { - return Err(ExtensionError::Filesystem { - source: std::io::Error::new( - std::io::ErrorKind::NotFound, - format!("Source directory '{}' not found", source), - ), - }); - } - - // Optionen für fs_extra::dir::copy - let mut options = fs_extra::dir::CopyOptions::new(); - options.overwrite = true; // Überschreibe Zieldateien, falls sie existieren - options.copy_inside = true; // Kopiere den *Inhalt* des Quellordners in den Zielordner - // options.content_only = true; // Alternative: nur Inhalt kopieren, Zielordner muss existieren - options.buffer_size = 64000; // Standard-Puffergröße, kann angepasst werden - - // Führe die Kopieroperation aus - fs_extra::dir::copy(&source_path, &destination_path, &options).map_err(|e| { - ExtensionError::Filesystem { - source: std::io::Error::new(std::io::ErrorKind::Other, e.to_string()), - } - })?; - Ok(()) -} - -pub fn resolve_secure_extension_asset_path( - app_handle: AppHandle, - state: State, - extension_id: &str, - extension_version: &str, - requested_asset_path: &str, -) -> Result { - // 1. Validiere die Extension ID - if extension_id.is_empty() - || !extension_id - .chars() - .all(|c| c.is_ascii_alphanumeric() || c == '-') - { - return Err(ExtensionError::ValidationError { - reason: format!("Invalid extension ID: {}", extension_id), - }); - } - - if extension_version.is_empty() - || !extension_version - .chars() - .all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '.') - { - return Err(ExtensionError::ValidationError { - reason: format!("Invalid extension version: {}", extension_version), - }); - } - - // 3. Verzeichnis für die spezifische Erweiterung - let specific_extension_dir = - state - .extension_manager - .get_extension_dir(app_handle, extension_id, extension_version)?; - - // 4. Bereinige den angeforderten Asset-Pfad - let clean_relative_path = requested_asset_path - .replace('\\', "/") - .trim_start_matches('/') - .split('/') - .filter(|&part| !part.is_empty() && part != "." && part != "..") - .collect::(); - - if clean_relative_path.as_os_str().is_empty() && requested_asset_path != "/" { - return Err(ExtensionError::ValidationError { - reason: "Empty or invalid asset path".to_string(), - }); - } - - // 5. Setze den finalen Pfad zusammen - let final_path = specific_extension_dir.join(clean_relative_path); - - // 6. SICHERHEITSCHECK - match final_path.canonicalize() { - Ok(canonical_path) => { - let canonical_base = specific_extension_dir - .canonicalize() - .map_err(|e| ExtensionError::Filesystem { source: e })?; - if canonical_path.starts_with(&canonical_base) { - Ok(canonical_path) - } else { - eprintln!( /* ... Sicherheitswarnung ... */ ); - Err(ExtensionError::SecurityViolation { - reason: format!("Path traversal attempt: {}", requested_asset_path), - }) - } - } - Err(_) => { - // Fehler bei canonicalize (z.B. Pfad existiert nicht) - if final_path.starts_with(&specific_extension_dir) { - Ok(final_path) // Nicht-kanonisierten Pfad zurückgeben - } else { - eprintln!( /* ... Sicherheitswarnung ... */ ); - Err(ExtensionError::SecurityViolation { - reason: format!("Invalid asset path: {}", requested_asset_path), - }) - } - } - } -} - -pub fn extension_protocol_handler( - state: State, - app_handle: AppHandle, - request: &Request>, -) -> Result>, Box> { - let uri_ref = request.uri(); - println!("Protokoll Handler für: {}", uri_ref); - - let host = uri_ref - .host() - .ok_or("Kein Host (Extension ID) in URI gefunden")? - .to_string(); - - let path_str = uri_ref.path(); - let segments_iter = path_str.split('/').filter(|s| !s.is_empty()); - let resource_segments: Vec<&str> = segments_iter.collect(); - let raw_asset_path = resource_segments.join("/"); - let asset_to_load = if raw_asset_path.is_empty() { - "index.html" - } else { - &raw_asset_path - }; - - match process_hex_encoded_json(&host) { - Ok(info) => { - println!("Daten erfolgreich verarbeitet:"); - println!(" ID: {}", info.id); - println!(" Version: {}", info.version); - let absolute_secure_path = resolve_secure_extension_asset_path( - app_handle, - state, - &info.id, - &info.version, - &asset_to_load, - )?; - - println!("absolute_secure_path: {}", absolute_secure_path.display()); - - if absolute_secure_path.exists() && absolute_secure_path.is_file() { - match fs::read(&absolute_secure_path) { - Ok(content) => { - let mime_type = mime_guess::from_path(&absolute_secure_path) - .first_or(mime::APPLICATION_OCTET_STREAM) - .to_string(); - let content_length = content.len(); - println!( - "Liefere {} ({}, {} bytes) ", // Content-Length zum Log hinzugefügt - absolute_secure_path.display(), - mime_type, - content_length - ); - Response::builder() - .status(200) - .header("Content-Type", mime_type) - .header("Content-Length", content_length.to_string()) // <-- HIER HINZUGEFÜGT - // Optional, aber gut für Streaming-Fähigkeit: - .header("Accept-Ranges", "bytes") - .body(content) - .map_err(|e| e.into()) - } - Err(e) => { - eprintln!( - "Fehler beim Lesen der Datei {}: {}", - absolute_secure_path.display(), - e - ); - let status_code = if e.kind() == std::io::ErrorKind::NotFound { - 404 - } else if e.kind() == std::io::ErrorKind::PermissionDenied { - 403 - } else { - 500 - }; - - Response::builder() - .status(status_code) - .body(Vec::new()) // Leerer Body für Fehler - .map_err(|e| e.into()) // Wandle http::Error in Box um - } - } - } else { - // Datei nicht gefunden oder es ist keine Datei - eprintln!( - "Asset nicht gefunden oder ist kein File: {}", - absolute_secure_path.display() - ); - Response::builder() - .status(404) // HTTP 404 Not Found - .body(Vec::new()) - .map_err(|e| e.into()) - } - } - Err(e) => { - eprintln!("Fehler bei der Datenverarbeitung: {}", e); - - Response::builder() - .status(500) - .body(Vec::new()) // Leerer Body für Fehler - .map_err(|e| e.into()) - } - } -} - -fn process_hex_encoded_json(hex_input: &str) -> Result { - // Schritt 1: Hex-String zu Bytes dekodieren - let bytes = hex::decode(hex_input)?; // Konvertiert hex::FromHexError automatisch - - // Schritt 2: Bytes zu UTF-8-String konvertieren - let json_string = String::from_utf8(bytes)?; // Konvertiert FromUtf8Error automatisch - - // Schritt 3: JSON-String zu Struktur parsen - let extension_info: ExtensionInfo = serde_json::from_str(&json_string)?; // Konvertiert serde_json::Error automatisch - - Ok(extension_info) -} diff --git a/src-tauri/src/extension/database/mod.rs b/src-tauri/src/extension/database/mod.rs index 6ca6fa8..d58dca0 100644 --- a/src-tauri/src/extension/database/mod.rs +++ b/src-tauri/src/extension/database/mod.rs @@ -1,7 +1,6 @@ // src-tauri/src/extension/database/mod.rs pub mod executor; -use crate::crdt::hlc::HlcService; use crate::crdt::transformer::CrdtTransformer; use crate::crdt::trigger; use crate::database::core::{parse_sql_statements, with_connection, ValueConverter}; @@ -22,15 +21,11 @@ use tauri::State; /// Führt Statements mit korrekter Parameter-Bindung aus pub struct StatementExecutor<'a> { transaction: &'a Transaction<'a>, - hlc_service: &'a HlcService, } impl<'a> StatementExecutor<'a> { - fn new(transaction: &'a Transaction<'a>, hlc_service: &'a HlcService) -> Self { - Self { - transaction, - hlc_service, - } + fn new(transaction: &'a Transaction<'a>) -> Self { + Self { transaction } } /// Führt ein einzelnes Statement mit Parametern aus @@ -114,7 +109,6 @@ pub async fn extension_sql_execute( params: Vec, extension_id: String, state: State<'_, AppState>, - hlc_service: State<'_, HlcService>, ) -> Result, ExtensionError> { // Permission check SqlPermissionValidator::validate_sql(&state, &extension_id, sql).await?; @@ -130,15 +124,17 @@ pub async fn extension_sql_execute( let tx = conn.transaction().map_err(DatabaseError::from)?; let transformer = CrdtTransformer::new(); - let executor = StatementExecutor::new(&tx, &hlc_service); + let executor = StatementExecutor::new(&tx); // Generate HLC timestamp - let hlc_timestamp = - hlc_service - .new_timestamp_and_persist(&tx) - .map_err(|e| DatabaseError::HlcError { - reason: e.to_string(), - })?; + let hlc_timestamp = state + .hlc + .lock() + .unwrap() + .new_timestamp_and_persist(&tx) + .map_err(|e| DatabaseError::HlcError { + reason: e.to_string(), + })?; // Transform statements let mut modified_schema_tables = HashSet::new(); @@ -302,13 +298,13 @@ fn count_sql_placeholders(sql: &str) -> usize { } /// Kürzt SQL für Fehlermeldungen -fn truncate_sql(sql: &str, max_length: usize) -> String { +/* fn truncate_sql(sql: &str, max_length: usize) -> String { if sql.len() <= max_length { sql.to_string() } else { format!("{}...", &sql[..max_length]) } -} +} */ #[cfg(test)] mod tests { @@ -327,12 +323,12 @@ mod tests { assert_eq!(count_sql_placeholders("SELECT * FROM users"), 0); } - #[test] + /* #[test] fn test_truncate_sql() { let sql = "SELECT * FROM very_long_table_name"; assert_eq!(truncate_sql(sql, 10), "SELECT * F..."); assert_eq!(truncate_sql(sql, 50), sql); - } + } */ #[test] fn test_validate_params() { diff --git a/src-tauri/src/models.rs b/src-tauri/src/models.rs deleted file mode 100644 index 17aa3cf..0000000 --- a/src-tauri/src/models.rs +++ /dev/null @@ -1,107 +0,0 @@ -// src-tauri/src/models.rs -use serde::{Deserialize, Serialize}; -use std::collections::HashMap; -use std::path::{Path, PathBuf}; -use std::sync::{Arc, Mutex}; -use std::time::{Duration, SystemTime}; -use thiserror::Error; - -/* #[derive(Serialize, Deserialize, Clone, Debug)] -pub struct ExtensionManifest { - pub id: String, - pub name: String, - pub version: String, - pub author: Option, - pub entry: String, - pub icon: Option, - pub permissions: ExtensionPermissions, - pub homepage: Option, - pub description: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct ExtensionPermissions { - pub database: Option, - pub http: Option>, - pub filesystem: Option, -} - -/// Enum to represent the source of an extension -#[derive(Debug, Clone)] -pub enum ExtensionSource { - /// Production extension installed in app data - Production { path: PathBuf, version: String }, - /// Development mode extension with live reloading - Development { - dev_server_url: String, - manifest_path: PathBuf, - auto_reload: bool, - }, -} */ - -/* -#[derive(Default)] -pub struct ExtensionState { - pub extensions: Mutex>, -} - -impl ExtensionState { - pub fn add_extension(&self, path: String, manifest: ExtensionManifest) { - let mut extensions = self.extensions.lock().unwrap(); - extensions.insert(path, manifest); - } - - pub fn get_extension(&self, addon_id: &str) -> Option { - let extensions = self.extensions.lock().unwrap(); - extensions.values().find(|p| p.name == addon_id).cloned() - } -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct DbExtensionPermission { - pub id: String, - pub extension_id: String, - pub resource: String, - pub operation: String, - pub path: String, -} - -/// Comprehensive error type for all extension-related operations -#[derive(Error, Debug)] -pub enum ExtensionError { - /// Security violation detected - #[error("Security violation: {reason}")] - SecurityViolation { reason: String }, - - /// Extension not found - #[error("Extension not found: {id}")] - NotFound { id: String }, - - /// Permission denied - #[error("Permission denied: {extension_id} cannot {operation} on {resource}")] - PermissionDenied { - extension_id: String, - operation: String, - resource: String, - }, - - /// IO error during extension operations - #[error("IO error: {source}")] - Io { - #[from] - source: std::io::Error, - }, - - /// Error during extension manifest parsing - #[error("Manifest error: {reason}")] - ManifestError { reason: String }, - - /// Input validation error - #[error("Validation error: {reason}")] - ValidationError { reason: String }, - - /// Development server error - #[error("Dev server error: {reason}")] - DevServerError { reason: String }, -} - */ diff --git a/src-tauri/src/models_final.rs b/src-tauri/src/models_final.rs deleted file mode 100644 index 1ff24ca..0000000 --- a/src-tauri/src/models_final.rs +++ /dev/null @@ -1,34 +0,0 @@ -// models.rs - - - - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_validate_path_pattern() { - // Valid patterns - assert!(validate_path_pattern("$PICTURE/**").is_ok()); - assert!(validate_path_pattern("$DOCUMENT/myfiles/*").is_ok()); - assert!(validate_path_pattern("$APPDATA/extensions/my-ext/**").is_ok()); - - // Invalid patterns - assert!(validate_path_pattern("").is_err()); - assert!(validate_path_pattern("$INVALID/test").is_err()); - assert!(validate_path_pattern("$PICTURE/../secret").is_err()); - assert!(validate_path_pattern("relative/path").is_err()); - } - - #[test] - fn test_filesystem_permissions() { - let mut perms = FilesystemPermissions::new(); - perms.add_read("$PICTURE/**"); - perms.add_write("$APPDATA/my-ext/**"); - - assert!(perms.validate().is_ok()); - assert_eq!(perms.read.as_ref().unwrap().len(), 1); - assert_eq!(perms.write.as_ref().unwrap().len(), 1); - } -} \ No newline at end of file diff --git a/src-tauri/src/models_new.rs b/src-tauri/src/models_new.rs deleted file mode 100644 index 0012cd7..0000000 --- a/src-tauri/src/models_new.rs +++ /dev/null @@ -1,441 +0,0 @@ -// models.rs -use serde::{Deserialize, Serialize}; -use std::collections::HashMap; -use std::path::{Path, PathBuf}; -use std::sync::{Mutex, Arc}; -use std::time::{Duration, SystemTime}; -use thiserror::Error; - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct ExtensionManifest { - pub id: String, - pub name: String, - pub version: String, - pub author: Option, - pub entry: String, - pub icon: Option, - pub permissions: ExtensionPermissions, - pub homepage: Option, - pub description: Option, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct ExtensionPermissions { - pub database: Option, - pub http: Option>, - pub filesystem: Option, - pub shell: Option>, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct DatabasePermissions { - pub read: Option>, - pub write: Option>, - pub create: Option>, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct FilesystemPermissions { - /// Read access to files and directories - pub read: Option>, - /// Write access to files and directories (includes create/delete) - pub write: Option>, -} - -/// Cross-platform filesystem path specification -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct FilesystemPath { - /// The type of path (determines base directory) - pub path_type: FilesystemPathType, - /// Relative path from the base directory - pub relative_path: String, - /// Whether subdirectories are included (recursive) - pub recursive: bool, -} - -/// Platform-agnostic path types that map to appropriate directories on each OS -#[derive(Serialize, Deserialize, Clone, Debug)] -pub enum FilesystemPathType { - /// App's data directory ($APPDATA on Windows, ~/.local/share on Linux, etc.) - AppData, - /// App's cache directory - AppCache, - /// App's configuration directory - AppConfig, - /// User's documents directory - Documents, - /// User's pictures directory - Pictures, - /// User's downloads directory - Downloads, - /// Temporary directory - Temp, - /// Extension's own private directory (always allowed) - ExtensionData, - /// Shared data between extensions (requires special permission) - SharedData, -} - -impl FilesystemPath { - /// Creates a new filesystem path specification - pub fn new(path_type: FilesystemPathType, relative_path: &str, recursive: bool) -> Self { - Self { - path_type, - relative_path: relative_path.to_string(), - recursive, - } - } - - /// Resolves the path to an actual system path - /// This would be implemented in your Tauri backend - pub fn resolve_system_path(&self, app_handle: &tauri::AppHandle) -> Result { - let base_dir = match self.path_type { - FilesystemPathType::AppData => app_handle.path().app_data_dir(), - FilesystemPathType::AppCache => app_handle.path().app_cache_dir(), - FilesystemPathType::AppConfig => app_handle.path().app_config_dir(), - FilesystemPathType::Documents => app_handle.path().document_dir(), - FilesystemPathType::Pictures => app_handle.path().picture_dir(), - FilesystemPathType::Downloads => app_handle.path().download_dir(), - FilesystemPathType::Temp => app_handle.path().temp_dir(), - FilesystemPathType::ExtensionData => { - app_handle.path().app_data_dir().map(|p| p.join("extensions")) - }, - FilesystemPathType::SharedData => { - app_handle.path().app_data_dir().map(|p| p.join("shared")) - }, - }.map_err(|e| ExtensionError::ValidationError { - reason: format!("Failed to resolve base directory: {}", e), - })?; - - let final_path = base_dir.join(&self.relative_path); - - // Security check - ensure the resolved path is still within the base directory - if let (Ok(canonical_final), Ok(canonical_base)) = (final_path.canonicalize(), base_dir.canonicalize()) { - if !canonical_final.starts_with(&canonical_base) { - return Err(ExtensionError::SecurityViolation { - reason: format!("Path traversal detected: {} escapes base directory", self.relative_path), - }); - } - } - - Ok(final_path) - } -} - -/// Enum to represent the source of an extension -#[derive(Debug, Clone)] -pub enum ExtensionSource { - /// Production extension installed in app data - Production { - path: PathBuf, - version: String, - }, - /// Development mode extension with live reloading - Development { - dev_server_url: String, - manifest_path: PathBuf, - auto_reload: bool, - }, -} - -/// Complete extension data including source and runtime status -#[derive(Debug, Clone)] -pub struct Extension { - /// Unique extension ID - pub id: String, - /// Extension display name - pub name: String, - /// Source information (production or dev) - pub source: ExtensionSource, - /// Complete manifest data - pub manifest: ExtensionManifest, - /// Enabled status - pub enabled: bool, - /// Last access timestamp - pub last_accessed: SystemTime, -} - -/// Cached permission data to avoid frequent database lookups -#[derive(Debug, Clone)] -pub struct CachedPermission { - /// The permissions that were fetched - pub permissions: Vec, - /// When this cache entry was created - pub cached_at: SystemTime, - /// How long this cache entry is valid - pub ttl: Duration, -} - -/// Enhanced extension manager with production/dev support and caching -#[derive(Default)] -pub struct ExtensionManager { - /// Production extensions loaded from app data directory - pub production_extensions: Mutex>, - /// Development mode extensions for live-reloading during development - pub dev_extensions: Mutex>, - /// Cache for extension permissions to improve performance - pub permission_cache: Mutex>, -} - -impl ExtensionManager { - /// Creates a new extension manager - pub fn new() -> Self { - Self { - production_extensions: Mutex::new(HashMap::new()), - dev_extensions: Mutex::new(HashMap::new()), - permission_cache: Mutex::new(HashMap::new()), - } - } - - /// Adds a production extension to the manager - pub fn add_production_extension(&self, extension: Extension) -> Result<(), ExtensionError> { - if extension.id.is_empty() { - return Err(ExtensionError::ValidationError { - reason: "Extension ID cannot be empty".to_string(), - }); - } - - match &extension.source { - ExtensionSource::Production { .. } => { - let mut extensions = self.production_extensions.lock().unwrap(); - extensions.insert(extension.id.clone(), extension); - Ok(()) - }, - _ => Err(ExtensionError::ValidationError { - reason: "Expected Production source for production extension".to_string(), - }) - } - } - - /// Adds a development mode extension to the manager - pub fn add_dev_extension(&self, extension: Extension) -> Result<(), ExtensionError> { - if extension.id.is_empty() { - return Err(ExtensionError::ValidationError { - reason: "Extension ID cannot be empty".to_string(), - }); - } - - match &extension.source { - ExtensionSource::Development { .. } => { - let mut extensions = self.dev_extensions.lock().unwrap(); - extensions.insert(extension.id.clone(), extension); - Ok(()) - }, - _ => Err(ExtensionError::ValidationError { - reason: "Expected Development source for dev extension".to_string(), - }) - } - } - - /// Gets an extension by its ID - pub fn get_extension(&self, extension_id: &str) -> Option { - // First check development extensions (they take priority) - let dev_extensions = self.dev_extensions.lock().unwrap(); - if let Some(extension) = dev_extensions.get(extension_id) { - return Some(extension.clone()); - } - - // Then check production extensions - let prod_extensions = self.production_extensions.lock().unwrap(); - prod_extensions.get(extension_id).cloned() - } - - /// Removes an extension from the manager - pub fn remove_extension(&self, extension_id: &str) -> Result<(), ExtensionError> { - // Check dev extensions first - { - let mut dev_extensions = self.dev_extensions.lock().unwrap(); - if dev_extensions.remove(extension_id).is_some() { - return Ok(()); - } - } - - // Then check production extensions - { - let mut prod_extensions = self.production_extensions.lock().unwrap(); - if prod_extensions.remove(extension_id).is_some() { - return Ok(()); - } - } - - Err(ExtensionError::NotFound { - id: extension_id.to_string(), - }) - } - - /// Gets cached permissions or indicates they need to be loaded - pub fn get_cached_permissions( - &self, - extension_id: &str, - resource: &str, - operation: &str, - ) -> Option> { - let cache = self.permission_cache.lock().unwrap(); - let cache_key = format!("{}-{}-{}", extension_id, resource, operation); - - if let Some(cached) = cache.get(&cache_key) { - let now = SystemTime::now(); - if now.duration_since(cached.cached_at).unwrap_or(Duration::from_secs(0)) < cached.ttl { - return Some(cached.permissions.clone()); - } - } - - None - } - - /// Updates the permission cache - pub fn update_permission_cache( - &self, - extension_id: &str, - resource: &str, - operation: &str, - permissions: Vec, - ) { - let mut cache = self.permission_cache.lock().unwrap(); - let cache_key = format!("{}-{}-{}", extension_id, resource, operation); - - cache.insert(cache_key, CachedPermission { - permissions, - cached_at: SystemTime::now(), - ttl: Duration::from_secs(60), // Cache for 60 seconds - }); - } - - /// Validates a manifest for security concerns - pub fn validate_manifest_security(&self, manifest: &ExtensionManifest) -> Result<(), ExtensionError> { - // Check for suspicious permission combinations - let has_filesystem = manifest.permissions.filesystem.is_some(); - let has_database = manifest.permissions.database.is_some(); - let has_shell = manifest.permissions.shell.is_some(); - - if has_filesystem && has_database && has_shell { - // This is a powerful combination, warn or check user confirmation elsewhere - } - - // Validate ID format - if !manifest.id.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_') { - return Err(ExtensionError::ValidationError { - reason: "Invalid extension ID format. Must contain only alphanumeric characters, dash or underscore.".to_string() - }); - } - - Ok(()) - } - - /// Lists all enabled extensions (both dev and production) - pub fn list_enabled_extensions(&self) -> Vec { - let mut extensions = Vec::new(); - - // Add enabled dev extensions first (higher priority) - { - let dev_extensions = self.dev_extensions.lock().unwrap(); - extensions.extend( - dev_extensions - .values() - .filter(|ext| ext.enabled) - .cloned() - ); - } - - // Add enabled production extensions (avoiding duplicates) - { - let prod_extensions = self.production_extensions.lock().unwrap(); - let dev_ids: std::collections::HashSet = extensions.iter().map(|e| e.id.clone()).collect(); - - extensions.extend( - prod_extensions - .values() - .filter(|ext| ext.enabled && !dev_ids.contains(&ext.id)) - .cloned() - ); - } - - extensions - } -} - -// For backward compatibility - will be deprecated -#[derive(Default)] -pub struct ExtensionState { - pub extensions: Mutex>, -} - -impl ExtensionState { - pub fn add_extension(&self, path: String, manifest: ExtensionManifest) { - let mut extensions = self.extensions.lock().unwrap(); - extensions.insert(path, manifest); - } - - pub fn get_extension(&self, addon_id: &str) -> Option { - let extensions = self.extensions.lock().unwrap(); - extensions.values().find(|p| p.name == addon_id).cloned() - } -} - -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct DbExtensionPermission { - pub id: String, - pub extension_id: String, - pub resource: String, - pub operation: String, - pub path: String, -} - -/// Comprehensive error type for all extension-related operations -#[derive(Error, Debug)] -pub enum ExtensionError { - /// Security violation detected - #[error("Security violation: {reason}")] - SecurityViolation { - reason: String - }, - - /// Extension not found - #[error("Extension not found: {id}")] - NotFound { - id: String - }, - - /// Permission denied - #[error("Permission denied: {extension_id} cannot {operation} on {resource}")] - PermissionDenied { - extension_id: String, - operation: String, - resource: String - }, - - /// IO error during extension operations - #[error("IO error: {source}")] - Io { - #[from] - source: std::io::Error - }, - - /// Error during extension manifest parsing - #[error("Manifest error: {reason}")] - ManifestError { - reason: String - }, - - /// Input validation error - #[error("Validation error: {reason}")] - ValidationError { - reason: String - }, - - /// Development server error - #[error("Dev server error: {reason}")] - DevServerError { - reason: String - }, -} - -// For Tauri Command Serialization -impl serde::Serialize for ExtensionError { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - serializer.serialize_str(&self.to_string()) - } -} \ No newline at end of file diff --git a/src/pages/vault/[vaultId]/extensions/index.vue b/src/pages/vault/[vaultId]/extensions/index.vue index 6735bfc..8f6792b 100644 --- a/src/pages/vault/[vaultId]/extensions/index.vue +++ b/src/pages/vault/[vaultId]/extensions/index.vue @@ -66,9 +66,6 @@