diff --git a/Cargo.lock b/Cargo.lock index a3cbab7f22..7b5167a9ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17063,28 +17063,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "tauri-plugin-db" -version = "0.1.0" -dependencies = [ - "db-core", - "db-user", - "dirs 6.0.0", - "owhisper-interface", - "schemars 0.8.22", - "serde", - "serde_json", - "specta", - "specta-typescript", - "tauri", - "tauri-plugin", - "tauri-specta", - "thiserror 2.0.17", - "tokio", - "tracing", - "uuid", -] - [[package]] name = "tauri-plugin-db2" version = "0.1.0" @@ -17541,7 +17519,6 @@ dependencies = [ "tauri", "tauri-plugin", "tauri-plugin-analytics", - "tauri-plugin-db", "tauri-plugin-dialog", "tauri-plugin-listener", "tauri-plugin-windows", diff --git a/Cargo.toml b/Cargo.toml index 2d3e048e47..2e0809420c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -124,7 +124,6 @@ tauri-plugin-analytics = { path = "plugins/analytics" } tauri-plugin-apple-calendar = { path = "plugins/apple-calendar" } tauri-plugin-auth = { path = "plugins/auth" } tauri-plugin-cli2 = { path = "plugins/cli2" } -tauri-plugin-db = { path = "plugins/db" } tauri-plugin-db2 = { path = "plugins/db2" } tauri-plugin-deeplink2 = { path = "plugins/deeplink2" } tauri-plugin-detect = { path = "plugins/detect" } diff --git a/crates/db-user/src/init.rs b/crates/db-user/src/init.rs deleted file mode 100644 index 93090c4391..0000000000 --- a/crates/db-user/src/init.rs +++ /dev/null @@ -1,42 +0,0 @@ -use super::{ - UserDatabase, - seed::{SeedData, SeedParams}, -}; - -const ONBOARDING_JSON: &str = include_str!("../../../plugins/db/seed/onboarding.json"); -const DEV_JSON: &str = include_str!("../../../plugins/db/seed/dev.json"); - -pub async fn onboarding(db: &UserDatabase, user_id: impl Into) -> Result<(), crate::Error> { - let user_id = user_id.into(); - - SeedData::from_json( - ONBOARDING_JSON, - SeedParams { - user_id, - now: chrono::Utc::now(), - }, - ) - .unwrap() - .push(db) - .await?; - - Ok(()) -} - -#[cfg(debug_assertions)] -pub async fn seed(db: &UserDatabase, user_id: impl Into) -> Result<(), crate::Error> { - let user_id = user_id.into(); - - SeedData::from_json( - DEV_JSON, - SeedParams { - user_id: user_id.clone(), - now: chrono::Utc::now(), - }, - ) - .unwrap() - .push(db) - .await?; - - Ok(()) -} diff --git a/crates/db-user/src/lib.rs b/crates/db-user/src/lib.rs index 8ed6fc2c4c..ffd8220f34 100644 --- a/crates/db-user/src/lib.rs +++ b/crates/db-user/src/lib.rs @@ -78,9 +78,6 @@ pub use templates_ops::*; #[allow(unused)] pub use templates_types::*; -pub mod init; -pub mod seed; - pub use hypr_db_core::{Database, Error}; #[macro_export] diff --git a/crates/db-user/src/seed.rs b/crates/db-user/src/seed.rs deleted file mode 100644 index e18ef4f6df..0000000000 --- a/crates/db-user/src/seed.rs +++ /dev/null @@ -1,152 +0,0 @@ -use super::{ - Calendar, Config, Event, Human, Organization, Session, Tag, UserDatabase, user_common_derives, -}; - -const ONBOARDING_RAW_HTML: &str = include_str!("../assets/onboarding-raw.html"); -const THANK_YOU_MD: &str = include_str!("../assets/thank-you.md"); - -user_common_derives! { - pub struct SeedData { - pub organizations: Vec, - pub humans: Vec, - pub calendars: Vec, - pub events: Vec, - pub sessions: Vec, - pub tags: Vec, - pub config: Option, - } -} - -user_common_derives! { - pub struct SeedParams { - pub user_id: String, - pub now: chrono::DateTime, - } -} - -impl SeedData { - pub fn from_json(json: &str, params: SeedParams) -> Result { - let mut seed: Self = serde_json::from_str(json)?; - - seed.override_session_words(); - seed.override_session_raw_note(); - seed.override_user_id(¶ms); - seed.override_timestamp(¶ms); - - Ok(seed) - } - - fn override_session_words(&mut self) { - self.sessions.iter_mut().for_each(|session| { - if session.id == "550e8400-e29b-41d4-a716-446655442001" { - session.words = serde_json::from_str(hypr_data::english_3::WORDS_JSON).unwrap(); - } - - if session.id == "08fc2a61-e54b-4310-92b7-efa45b7344c5" { - session.words = serde_json::from_str(hypr_data::english_8::WORDS_JSON).unwrap(); - } - - if session.id == "a1ee4374-7e80-4c5c-b7db-5247e9662126" { - session.words = serde_json::from_str(hypr_data::english_9::WORDS_JSON).unwrap(); - } - }); - } - - fn override_session_raw_note(&mut self) { - self.sessions.iter_mut().for_each(|session| { - if session.id == UserDatabase::onboarding_session_id() { - session.raw_memo_html = ONBOARDING_RAW_HTML.to_string(); - } - - if session.id == UserDatabase::thank_you_session_id() { - session.raw_memo_html = hypr_buffer::opinionated_md_to_html(THANK_YOU_MD).unwrap(); - } - }); - } - - fn override_user_id(&mut self, params: &SeedParams) { - self.humans.iter_mut().for_each(|human| { - if human.id == "{{ CURRENT_USER_ID }}" { - human.id = params.user_id.clone(); - } - }); - - self.sessions.iter_mut().for_each(|session| { - if session.user_id == "{{ CURRENT_USER_ID }}" { - session.user_id = params.user_id.clone(); - } - }); - - self.events.iter_mut().for_each(|event| { - if event.user_id == "{{ CURRENT_USER_ID }}" { - event.user_id = params.user_id.clone(); - } - }); - - self.calendars.iter_mut().for_each(|calendar| { - if calendar.user_id == "{{ CURRENT_USER_ID }}" { - calendar.user_id = params.user_id.clone(); - } - }); - } - - fn override_timestamp(&mut self, params: &SeedParams) { - let epoch_base = chrono::DateTime::parse_from_rfc3339("1970-01-01T00:00:00Z") - .unwrap() - .with_timezone(&chrono::Utc); - - self.sessions.iter_mut().for_each(|session| { - let offset = session.created_at - epoch_base; - session.created_at = params.now + offset; - - let offset = session.visited_at - epoch_base; - session.visited_at = params.now + offset; - }); - - self.events.iter_mut().for_each(|event| { - let offset = event.start_date - epoch_base; - event.start_date = params.now + offset; - - let offset = event.end_date - epoch_base; - event.end_date = params.now + offset; - }); - } - - pub async fn push(self, db: &UserDatabase) -> Result<(), crate::Error> { - for org in self.organizations { - db.upsert_organization(org).await?; - } - for human in self.humans { - db.upsert_human(human).await?; - } - for calendar in self.calendars { - db.upsert_calendar(calendar).await?; - } - for event in self.events { - db.upsert_event(event).await?; - } - for session in self.sessions { - db.upsert_session(session).await?; - } - for tag in self.tags { - db.upsert_tag(tag).await?; - } - if let Some(config) = self.config { - db.set_config(config).await?; - } - - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_init_thank_you() { - let html = hypr_buffer::opinionated_md_to_html(THANK_YOU_MD).unwrap(); - - assert!(html.contains("We appreciate your patience")); - } -} diff --git a/plugins/db/.gitignore b/plugins/db/.gitignore deleted file mode 100644 index 50d8e32e89..0000000000 --- a/plugins/db/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -/.vs -.DS_Store -.Thumbs.db -*.sublime* -.idea/ -debug.log -package-lock.json -.vscode/settings.json -yarn.lock - -/.tauri -/target -Cargo.lock -node_modules/ - -dist-js -dist diff --git a/plugins/db/Cargo.toml b/plugins/db/Cargo.toml deleted file mode 100644 index 55759eec4f..0000000000 --- a/plugins/db/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "tauri-plugin-db" -version = "0.1.0" -authors = ["You"] -edition = "2024" -exclude = ["/js", "/node_modules"] -links = "tauri-plugin-db" -description = "" - -[build-dependencies] -tauri-plugin = { workspace = true, features = ["build"] } -hypr-db-user = { workspace = true } -schemars = { workspace = true, features = ["chrono"] } -serde_json = { workspace = true } - -[dev-dependencies] -specta-typescript = { workspace = true } - -[dependencies] -hypr-db-core = { workspace = true } -hypr-db-user = { workspace = true } -owhisper-interface = { workspace = true } - -specta = { workspace = true } -tauri = { workspace = true, features = ["test"] } -tauri-specta = { workspace = true, features = ["derive", "typescript"] } - -dirs = { workspace = true } -serde = { workspace = true } -thiserror = { workspace = true } -uuid = { workspace = true } - -tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -tracing = { workspace = true } diff --git a/plugins/db/build.rs b/plugins/db/build.rs deleted file mode 100644 index 1f0c105c15..0000000000 --- a/plugins/db/build.rs +++ /dev/null @@ -1,72 +0,0 @@ -const COMMANDS: &[&str] = &[ - // calendar - "get_calendar", - "list_calendars", - "upsert_calendar", - "toggle_calendar_selected", - // session - "onboarding_session_id", - "thank_you_session_id", - "visit_session", - "upsert_session", - "list_sessions", - "delete_session", - "get_session", - "set_session_event", - "session_add_participant", - "session_remove_participant", - "session_list_participants", - "session_list_deleted_participant_ids", - "session_get_event", - "get_words_onboarding", - "get_words", - // template - "list_templates", - "upsert_template", - "delete_template", - // event - "get_event", - "list_events", - // config - "get_config", - "set_config", - // user - "get_human", - "upsert_human", - "list_humans", - "delete_human", - "upsert_organization", - "delete_organization", - "get_organization", - "get_organization_by_user_id", - "list_organizations", - "list_organization_members", - // chat - "list_chat_groups", - "list_chat_messages", - "create_chat_group", - "upsert_chat_message", - "delete_chat_messages", - "create_conversation", - "list_conversations", - "create_message_v2", - "list_messages_v2", - "update_message_v2_parts", - // tag - "upsert_tag", - "delete_tag", - "list_all_tags", - "list_session_tags", - "assign_tag_to_session", - "unassign_tag_from_session", -]; - -fn main() { - tauri_plugin::Builder::new(COMMANDS).build(); - - std::fs::write( - "./seed/schema.json", - serde_json::to_string_pretty(&schemars::schema_for!(hypr_db_user::seed::SeedData)).unwrap(), - ) - .unwrap(); -} diff --git a/plugins/db/js/bindings.gen.ts b/plugins/db/js/bindings.gen.ts deleted file mode 100644 index 98e462d5c7..0000000000 --- a/plugins/db/js/bindings.gen.ts +++ /dev/null @@ -1,821 +0,0 @@ -// @ts-nocheck -/** tauri-specta globals **/ -import { Channel as TAURI_CHANNEL, invoke as TAURI_INVOKE } from "@tauri-apps/api/core"; -import * as TAURI_API_EVENT from "@tauri-apps/api/event"; -import { type WebviewWindow as __WebviewWindow__ } from "@tauri-apps/api/webviewWindow"; - -// This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually. - -/** user-defined commands **/ - -export const commands = { - async getEvent(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_event", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listEvents(filter: ListEventFilter | null): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_events", { filter }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getCalendar(calendarId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_calendar", { calendarId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listCalendars(userId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_calendars", { userId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async upsertCalendar(calendar: Calendar): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|upsert_calendar", { calendar }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async toggleCalendarSelected(trackingId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|toggle_calendar_selected", { - trackingId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async upsertSession(session: Session): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|upsert_session", { session }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async visitSession(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|visit_session", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listTemplates(): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_templates"), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async upsertTemplate(template: Template): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|upsert_template", { template }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async deleteTemplate(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|delete_template", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async onboardingSessionId(): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|onboarding_session_id"), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async thankYouSessionId(): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|thank_you_session_id"), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listSessions(filter: ListSessionFilter | null): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_sessions", { filter }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async deleteSession(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|delete_session", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getSession(filter: GetSessionFilter): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_session", { filter }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async setSessionEvent(sessionId: string, eventId: string | null): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|set_session_event", { - sessionId, - eventId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async sessionAddParticipant(sessionId: string, humanId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|session_add_participant", { - sessionId, - humanId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async sessionListDeletedParticipantIds(sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|session_list_deleted_participant_ids", { sessionId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async sessionRemoveParticipant( - sessionId: string, - humanId: string, - ): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|session_remove_participant", { - sessionId, - humanId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async sessionListParticipants(sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|session_list_participants", { - sessionId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async sessionGetEvent(sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|session_get_event", { sessionId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getWords(sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_words", { sessionId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getWordsOnboarding(): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_words_onboarding"), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getConfig(): Promise> { - try { - return { status: "ok", data: await TAURI_INVOKE("plugin:db|get_config") }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async setConfig(config: Config): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|set_config", { config }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getHuman(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_human", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async upsertHuman(human: Human): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|upsert_human", { human }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listHumans(filter: ListHumanFilter | null): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_humans", { filter }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async deleteHuman(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|delete_human", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getOrganization(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_organization", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async deleteOrganization(id: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|delete_organization", { id }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async getOrganizationByUserId(userId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|get_organization_by_user_id", { - userId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async upsertOrganization(organization: Organization): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|upsert_organization", { - organization, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listOrganizations( - filter: ListOrganizationFilter | null, - ): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_organizations", { filter }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listOrganizationMembers(organizationId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_organization_members", { - organizationId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listChatGroups(sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_chat_groups", { sessionId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listChatMessages(groupId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_chat_messages", { groupId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async createChatGroup(group: ChatGroup): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|create_chat_group", { group }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async upsertChatMessage(message: ChatMessage): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|upsert_chat_message", { message }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async deleteChatMessages(groupId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|delete_chat_messages", { groupId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listAllTags(): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_all_tags"), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listSessionTags(sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_session_tags", { sessionId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async assignTagToSession(tagId: string, sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|assign_tag_to_session", { - tagId, - sessionId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async unassignTagFromSession(tagId: string, sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|unassign_tag_from_session", { - tagId, - sessionId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async upsertTag(tag: Tag): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|upsert_tag", { tag }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async deleteTag(tagId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|delete_tag", { tagId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async createConversation( - conversation: ChatConversation, - ): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|create_conversation", { - conversation, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listConversations(sessionId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_conversations", { sessionId }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async createMessageV2(message: ChatMessageV2): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|create_message_v2", { message }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async listMessagesV2(conversationId: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|list_messages_v2", { - conversationId, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, - async updateMessageV2Parts(id: string, parts: string): Promise> { - try { - return { - status: "ok", - data: await TAURI_INVOKE("plugin:db|update_message_v2_parts", { - id, - parts, - }), - }; - } catch (e) { - if (e instanceof Error) throw e; - else return { status: "error", error: e as any }; - } - }, -}; - -/** user-defined events **/ - -/** user-defined constants **/ - -/** user-defined types **/ - -export type Calendar = { - id: string; - tracking_id: string; - user_id: string; - platform: Platform; - name: string; - selected: boolean; - source: string | null; -}; -export type ChatConversation = { - id: string; - session_id: string; - user_id: string; - name: string | null; - created_at: string; - updated_at: string; -}; -export type ChatGroup = { - id: string; - user_id: string; - name: string | null; - created_at: string; - session_id: string; -}; -export type ChatMessage = { - id: string; - group_id: string; - created_at: string; - role: ChatMessageRole; - content: string; - type: ChatMessageType; - tool_details: string | null; -}; -export type ChatMessageRole = "User" | "Assistant"; -export type ChatMessageType = "text-delta" | "tool-start" | "tool-result" | "tool-error"; -export type ChatMessageV2 = { - id: string; - conversation_id: string; - role: ChatMessageV2Role; - parts: string; - metadata: string | null; - created_at: string; - updated_at: string; -}; -export type ChatMessageV2Role = "system" | "user" | "assistant"; -export type Config = { - id: string; - user_id: string; - general: ConfigGeneral; - notification: ConfigNotification; - ai: ConfigAI; -}; -export type ConfigAI = { - api_base: string | null; - api_key: string | null; - ai_specificity: number | null; - redemption_time_ms: number | null; -}; -export type ConfigGeneral = { - autostart: boolean; - display_language: string; - spoken_languages?: string[]; - jargons?: string[]; - telemetry_consent: boolean; - save_recordings: boolean | null; - selected_template_id: string | null; - summary_language?: string; -}; -export type ConfigNotification = { - before: boolean; - auto: boolean; - ignoredPlatforms: string[] | null; -}; -export type Event = { - id: string; - user_id: string; - tracking_id: string; - calendar_id: string | null; - name: string; - note: string; - start_date: string; - end_date: string; - google_event_url: string | null; - participants: string | null; - is_recurring: boolean; -}; -export type GetSessionFilter = { id: string } | { calendarEventId: string } | { tagId: string }; -export type Human = { - id: string; - organization_id: string | null; - is_user: boolean; - full_name: string | null; - email: string | null; - job_title: string | null; - linkedin_username: string | null; -}; -export type ListEventFilter = { user_id: string; limit: number | null } & ( - | { type: "simple" } - | { type: "search"; query: string } - | { type: "dateRange"; start: string; end: string } - | { type: "not-assigned-past" } -); -export type ListHumanFilter = { search: [number, string] }; -export type ListOrganizationFilter = { search: [number, string] }; -export type ListSessionFilter = { user_id: string; limit: number | null } & ( - | { type: "search"; query: string } - | { type: "recentlyVisited" } - | { type: "dateRange"; start: string; end: string } - | { type: "tagFilter"; tag_ids: string[] } -); -export type Organization = { - id: string; - name: string; - description: string | null; -}; -export type Platform = "Apple" | "Google" | "Outlook"; -export type Session = { - id: string; - created_at: string; - visited_at: string; - user_id: string; - calendar_event_id: string | null; - title: string; - raw_memo_html: string; - enhanced_memo_html: string | null; - words: Word2[]; - record_start: string | null; - record_end: string | null; - pre_meeting_memo_html: string | null; -}; -export type SpeakerIdentity = - | { type: "unassigned"; value: { index: number } } - | { type: "assigned"; value: { id: string; label: string } }; -export type Tag = { id: string; name: string }; -export type Template = { - id: string; - user_id: string; - title: string; - description: string; - sections: TemplateSection[]; - tags: string[]; - context_option: string | null; -}; -export type TemplateSection = { title: string; description: string }; -export type Word2 = { - text: string; - speaker: SpeakerIdentity | null; - confidence: number | null; - start_ms: number | null; - end_ms: number | null; -}; - -type __EventObj__ = { - listen: (cb: TAURI_API_EVENT.EventCallback) => ReturnType>; - once: (cb: TAURI_API_EVENT.EventCallback) => ReturnType>; - emit: null extends T - ? (payload?: T) => ReturnType - : (payload: T) => ReturnType; -}; - -export type Result = { status: "ok"; data: T } | { status: "error"; error: E }; - -function __makeEvents__>(mappings: Record) { - return new Proxy( - {} as unknown as { - [K in keyof T]: __EventObj__ & { - (handle: __WebviewWindow__): __EventObj__; - }; - }, - { - get: (_, event) => { - const name = mappings[event as keyof T]; - - return new Proxy((() => {}) as any, { - apply: (_, __, [window]: [__WebviewWindow__]) => ({ - listen: (arg: any) => window.listen(name, arg), - once: (arg: any) => window.once(name, arg), - emit: (arg: any) => window.emit(name, arg), - }), - get: (_, command: keyof __EventObj__) => { - switch (command) { - case "listen": - return (arg: any) => TAURI_API_EVENT.listen(name, arg); - case "once": - return (arg: any) => TAURI_API_EVENT.once(name, arg); - case "emit": - return (arg: any) => TAURI_API_EVENT.emit(name, arg); - } - }, - }); - }, - }, - ); -} diff --git a/plugins/db/js/index.ts b/plugins/db/js/index.ts deleted file mode 100644 index a96e122f03..0000000000 --- a/plugins/db/js/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./bindings.gen"; diff --git a/plugins/db/package.json b/plugins/db/package.json deleted file mode 100644 index 9cf2de396d..0000000000 --- a/plugins/db/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "@hypr/plugin-db", - "private": true, - "main": "./js/index.ts", - "scripts": { - "codegen": "cargo test -p tauri-plugin-db" - }, - "dependencies": { - "@tauri-apps/api": "^2.9.1" - } -} diff --git a/plugins/db/permissions/autogenerated/commands/assign_tag_to_session.toml b/plugins/db/permissions/autogenerated/commands/assign_tag_to_session.toml deleted file mode 100644 index 53008cbebf..0000000000 --- a/plugins/db/permissions/autogenerated/commands/assign_tag_to_session.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-assign-tag-to-session" -description = "Enables the assign_tag_to_session command without any pre-configured scope." -commands.allow = ["assign_tag_to_session"] - -[[permission]] -identifier = "deny-assign-tag-to-session" -description = "Denies the assign_tag_to_session command without any pre-configured scope." -commands.deny = ["assign_tag_to_session"] diff --git a/plugins/db/permissions/autogenerated/commands/create_chat_group.toml b/plugins/db/permissions/autogenerated/commands/create_chat_group.toml deleted file mode 100644 index 98a2be84ba..0000000000 --- a/plugins/db/permissions/autogenerated/commands/create_chat_group.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-create-chat-group" -description = "Enables the create_chat_group command without any pre-configured scope." -commands.allow = ["create_chat_group"] - -[[permission]] -identifier = "deny-create-chat-group" -description = "Denies the create_chat_group command without any pre-configured scope." -commands.deny = ["create_chat_group"] diff --git a/plugins/db/permissions/autogenerated/commands/create_conversation.toml b/plugins/db/permissions/autogenerated/commands/create_conversation.toml deleted file mode 100644 index 72050e8b01..0000000000 --- a/plugins/db/permissions/autogenerated/commands/create_conversation.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-create-conversation" -description = "Enables the create_conversation command without any pre-configured scope." -commands.allow = ["create_conversation"] - -[[permission]] -identifier = "deny-create-conversation" -description = "Denies the create_conversation command without any pre-configured scope." -commands.deny = ["create_conversation"] diff --git a/plugins/db/permissions/autogenerated/commands/create_message_v2.toml b/plugins/db/permissions/autogenerated/commands/create_message_v2.toml deleted file mode 100644 index 984569b693..0000000000 --- a/plugins/db/permissions/autogenerated/commands/create_message_v2.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-create-message-v2" -description = "Enables the create_message_v2 command without any pre-configured scope." -commands.allow = ["create_message_v2"] - -[[permission]] -identifier = "deny-create-message-v2" -description = "Denies the create_message_v2 command without any pre-configured scope." -commands.deny = ["create_message_v2"] diff --git a/plugins/db/permissions/autogenerated/commands/delete_chat_messages.toml b/plugins/db/permissions/autogenerated/commands/delete_chat_messages.toml deleted file mode 100644 index a15de0b520..0000000000 --- a/plugins/db/permissions/autogenerated/commands/delete_chat_messages.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-delete-chat-messages" -description = "Enables the delete_chat_messages command without any pre-configured scope." -commands.allow = ["delete_chat_messages"] - -[[permission]] -identifier = "deny-delete-chat-messages" -description = "Denies the delete_chat_messages command without any pre-configured scope." -commands.deny = ["delete_chat_messages"] diff --git a/plugins/db/permissions/autogenerated/commands/delete_human.toml b/plugins/db/permissions/autogenerated/commands/delete_human.toml deleted file mode 100644 index 9841adf812..0000000000 --- a/plugins/db/permissions/autogenerated/commands/delete_human.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-delete-human" -description = "Enables the delete_human command without any pre-configured scope." -commands.allow = ["delete_human"] - -[[permission]] -identifier = "deny-delete-human" -description = "Denies the delete_human command without any pre-configured scope." -commands.deny = ["delete_human"] diff --git a/plugins/db/permissions/autogenerated/commands/delete_organization.toml b/plugins/db/permissions/autogenerated/commands/delete_organization.toml deleted file mode 100644 index 7391c3a2f5..0000000000 --- a/plugins/db/permissions/autogenerated/commands/delete_organization.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-delete-organization" -description = "Enables the delete_organization command without any pre-configured scope." -commands.allow = ["delete_organization"] - -[[permission]] -identifier = "deny-delete-organization" -description = "Denies the delete_organization command without any pre-configured scope." -commands.deny = ["delete_organization"] diff --git a/plugins/db/permissions/autogenerated/commands/delete_session.toml b/plugins/db/permissions/autogenerated/commands/delete_session.toml deleted file mode 100644 index 04ef7aea07..0000000000 --- a/plugins/db/permissions/autogenerated/commands/delete_session.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-delete-session" -description = "Enables the delete_session command without any pre-configured scope." -commands.allow = ["delete_session"] - -[[permission]] -identifier = "deny-delete-session" -description = "Denies the delete_session command without any pre-configured scope." -commands.deny = ["delete_session"] diff --git a/plugins/db/permissions/autogenerated/commands/delete_tag.toml b/plugins/db/permissions/autogenerated/commands/delete_tag.toml deleted file mode 100644 index 3118e26362..0000000000 --- a/plugins/db/permissions/autogenerated/commands/delete_tag.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-delete-tag" -description = "Enables the delete_tag command without any pre-configured scope." -commands.allow = ["delete_tag"] - -[[permission]] -identifier = "deny-delete-tag" -description = "Denies the delete_tag command without any pre-configured scope." -commands.deny = ["delete_tag"] diff --git a/plugins/db/permissions/autogenerated/commands/delete_template.toml b/plugins/db/permissions/autogenerated/commands/delete_template.toml deleted file mode 100644 index 6aaab59f8a..0000000000 --- a/plugins/db/permissions/autogenerated/commands/delete_template.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-delete-template" -description = "Enables the delete_template command without any pre-configured scope." -commands.allow = ["delete_template"] - -[[permission]] -identifier = "deny-delete-template" -description = "Denies the delete_template command without any pre-configured scope." -commands.deny = ["delete_template"] diff --git a/plugins/db/permissions/autogenerated/commands/get_calendar.toml b/plugins/db/permissions/autogenerated/commands/get_calendar.toml deleted file mode 100644 index db4503f444..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_calendar.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-calendar" -description = "Enables the get_calendar command without any pre-configured scope." -commands.allow = ["get_calendar"] - -[[permission]] -identifier = "deny-get-calendar" -description = "Denies the get_calendar command without any pre-configured scope." -commands.deny = ["get_calendar"] diff --git a/plugins/db/permissions/autogenerated/commands/get_config.toml b/plugins/db/permissions/autogenerated/commands/get_config.toml deleted file mode 100644 index 2acc1db083..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_config.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-config" -description = "Enables the get_config command without any pre-configured scope." -commands.allow = ["get_config"] - -[[permission]] -identifier = "deny-get-config" -description = "Denies the get_config command without any pre-configured scope." -commands.deny = ["get_config"] diff --git a/plugins/db/permissions/autogenerated/commands/get_event.toml b/plugins/db/permissions/autogenerated/commands/get_event.toml deleted file mode 100644 index e920d99e67..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_event.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-event" -description = "Enables the get_event command without any pre-configured scope." -commands.allow = ["get_event"] - -[[permission]] -identifier = "deny-get-event" -description = "Denies the get_event command without any pre-configured scope." -commands.deny = ["get_event"] diff --git a/plugins/db/permissions/autogenerated/commands/get_human.toml b/plugins/db/permissions/autogenerated/commands/get_human.toml deleted file mode 100644 index 0062f7fe5b..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_human.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-human" -description = "Enables the get_human command without any pre-configured scope." -commands.allow = ["get_human"] - -[[permission]] -identifier = "deny-get-human" -description = "Denies the get_human command without any pre-configured scope." -commands.deny = ["get_human"] diff --git a/plugins/db/permissions/autogenerated/commands/get_organization.toml b/plugins/db/permissions/autogenerated/commands/get_organization.toml deleted file mode 100644 index 65dc1eea9b..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_organization.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-organization" -description = "Enables the get_organization command without any pre-configured scope." -commands.allow = ["get_organization"] - -[[permission]] -identifier = "deny-get-organization" -description = "Denies the get_organization command without any pre-configured scope." -commands.deny = ["get_organization"] diff --git a/plugins/db/permissions/autogenerated/commands/get_organization_by_user_id.toml b/plugins/db/permissions/autogenerated/commands/get_organization_by_user_id.toml deleted file mode 100644 index 1cd2e422a1..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_organization_by_user_id.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-organization-by-user-id" -description = "Enables the get_organization_by_user_id command without any pre-configured scope." -commands.allow = ["get_organization_by_user_id"] - -[[permission]] -identifier = "deny-get-organization-by-user-id" -description = "Denies the get_organization_by_user_id command without any pre-configured scope." -commands.deny = ["get_organization_by_user_id"] diff --git a/plugins/db/permissions/autogenerated/commands/get_session.toml b/plugins/db/permissions/autogenerated/commands/get_session.toml deleted file mode 100644 index 1dc2505393..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_session.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-session" -description = "Enables the get_session command without any pre-configured scope." -commands.allow = ["get_session"] - -[[permission]] -identifier = "deny-get-session" -description = "Denies the get_session command without any pre-configured scope." -commands.deny = ["get_session"] diff --git a/plugins/db/permissions/autogenerated/commands/get_words.toml b/plugins/db/permissions/autogenerated/commands/get_words.toml deleted file mode 100644 index 64eb272c63..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_words.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-words" -description = "Enables the get_words command without any pre-configured scope." -commands.allow = ["get_words"] - -[[permission]] -identifier = "deny-get-words" -description = "Denies the get_words command without any pre-configured scope." -commands.deny = ["get_words"] diff --git a/plugins/db/permissions/autogenerated/commands/get_words_onboarding.toml b/plugins/db/permissions/autogenerated/commands/get_words_onboarding.toml deleted file mode 100644 index 14344fe9c5..0000000000 --- a/plugins/db/permissions/autogenerated/commands/get_words_onboarding.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-get-words-onboarding" -description = "Enables the get_words_onboarding command without any pre-configured scope." -commands.allow = ["get_words_onboarding"] - -[[permission]] -identifier = "deny-get-words-onboarding" -description = "Denies the get_words_onboarding command without any pre-configured scope." -commands.deny = ["get_words_onboarding"] diff --git a/plugins/db/permissions/autogenerated/commands/list_all_tags.toml b/plugins/db/permissions/autogenerated/commands/list_all_tags.toml deleted file mode 100644 index 81c88aa3ab..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_all_tags.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-all-tags" -description = "Enables the list_all_tags command without any pre-configured scope." -commands.allow = ["list_all_tags"] - -[[permission]] -identifier = "deny-list-all-tags" -description = "Denies the list_all_tags command without any pre-configured scope." -commands.deny = ["list_all_tags"] diff --git a/plugins/db/permissions/autogenerated/commands/list_calendars.toml b/plugins/db/permissions/autogenerated/commands/list_calendars.toml deleted file mode 100644 index 1e19ab1acd..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_calendars.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-calendars" -description = "Enables the list_calendars command without any pre-configured scope." -commands.allow = ["list_calendars"] - -[[permission]] -identifier = "deny-list-calendars" -description = "Denies the list_calendars command without any pre-configured scope." -commands.deny = ["list_calendars"] diff --git a/plugins/db/permissions/autogenerated/commands/list_chat_groups.toml b/plugins/db/permissions/autogenerated/commands/list_chat_groups.toml deleted file mode 100644 index f7c6d380aa..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_chat_groups.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-chat-groups" -description = "Enables the list_chat_groups command without any pre-configured scope." -commands.allow = ["list_chat_groups"] - -[[permission]] -identifier = "deny-list-chat-groups" -description = "Denies the list_chat_groups command without any pre-configured scope." -commands.deny = ["list_chat_groups"] diff --git a/plugins/db/permissions/autogenerated/commands/list_chat_messages.toml b/plugins/db/permissions/autogenerated/commands/list_chat_messages.toml deleted file mode 100644 index 6cc355f9dc..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_chat_messages.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-chat-messages" -description = "Enables the list_chat_messages command without any pre-configured scope." -commands.allow = ["list_chat_messages"] - -[[permission]] -identifier = "deny-list-chat-messages" -description = "Denies the list_chat_messages command without any pre-configured scope." -commands.deny = ["list_chat_messages"] diff --git a/plugins/db/permissions/autogenerated/commands/list_conversations.toml b/plugins/db/permissions/autogenerated/commands/list_conversations.toml deleted file mode 100644 index b81f80dde3..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_conversations.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-conversations" -description = "Enables the list_conversations command without any pre-configured scope." -commands.allow = ["list_conversations"] - -[[permission]] -identifier = "deny-list-conversations" -description = "Denies the list_conversations command without any pre-configured scope." -commands.deny = ["list_conversations"] diff --git a/plugins/db/permissions/autogenerated/commands/list_events.toml b/plugins/db/permissions/autogenerated/commands/list_events.toml deleted file mode 100644 index 6a7f9b0c7e..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_events.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-events" -description = "Enables the list_events command without any pre-configured scope." -commands.allow = ["list_events"] - -[[permission]] -identifier = "deny-list-events" -description = "Denies the list_events command without any pre-configured scope." -commands.deny = ["list_events"] diff --git a/plugins/db/permissions/autogenerated/commands/list_humans.toml b/plugins/db/permissions/autogenerated/commands/list_humans.toml deleted file mode 100644 index 86034adf00..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_humans.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-humans" -description = "Enables the list_humans command without any pre-configured scope." -commands.allow = ["list_humans"] - -[[permission]] -identifier = "deny-list-humans" -description = "Denies the list_humans command without any pre-configured scope." -commands.deny = ["list_humans"] diff --git a/plugins/db/permissions/autogenerated/commands/list_messages_v2.toml b/plugins/db/permissions/autogenerated/commands/list_messages_v2.toml deleted file mode 100644 index 4e6ee3cbbb..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_messages_v2.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-messages-v2" -description = "Enables the list_messages_v2 command without any pre-configured scope." -commands.allow = ["list_messages_v2"] - -[[permission]] -identifier = "deny-list-messages-v2" -description = "Denies the list_messages_v2 command without any pre-configured scope." -commands.deny = ["list_messages_v2"] diff --git a/plugins/db/permissions/autogenerated/commands/list_organization_members.toml b/plugins/db/permissions/autogenerated/commands/list_organization_members.toml deleted file mode 100644 index 4efad81109..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_organization_members.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-organization-members" -description = "Enables the list_organization_members command without any pre-configured scope." -commands.allow = ["list_organization_members"] - -[[permission]] -identifier = "deny-list-organization-members" -description = "Denies the list_organization_members command without any pre-configured scope." -commands.deny = ["list_organization_members"] diff --git a/plugins/db/permissions/autogenerated/commands/list_organizations.toml b/plugins/db/permissions/autogenerated/commands/list_organizations.toml deleted file mode 100644 index 330844e2e3..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_organizations.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-organizations" -description = "Enables the list_organizations command without any pre-configured scope." -commands.allow = ["list_organizations"] - -[[permission]] -identifier = "deny-list-organizations" -description = "Denies the list_organizations command without any pre-configured scope." -commands.deny = ["list_organizations"] diff --git a/plugins/db/permissions/autogenerated/commands/list_session_tags.toml b/plugins/db/permissions/autogenerated/commands/list_session_tags.toml deleted file mode 100644 index 999fbd2e21..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_session_tags.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-session-tags" -description = "Enables the list_session_tags command without any pre-configured scope." -commands.allow = ["list_session_tags"] - -[[permission]] -identifier = "deny-list-session-tags" -description = "Denies the list_session_tags command without any pre-configured scope." -commands.deny = ["list_session_tags"] diff --git a/plugins/db/permissions/autogenerated/commands/list_sessions.toml b/plugins/db/permissions/autogenerated/commands/list_sessions.toml deleted file mode 100644 index 0ecf41175f..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_sessions.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-sessions" -description = "Enables the list_sessions command without any pre-configured scope." -commands.allow = ["list_sessions"] - -[[permission]] -identifier = "deny-list-sessions" -description = "Denies the list_sessions command without any pre-configured scope." -commands.deny = ["list_sessions"] diff --git a/plugins/db/permissions/autogenerated/commands/list_templates.toml b/plugins/db/permissions/autogenerated/commands/list_templates.toml deleted file mode 100644 index f2a807049c..0000000000 --- a/plugins/db/permissions/autogenerated/commands/list_templates.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-list-templates" -description = "Enables the list_templates command without any pre-configured scope." -commands.allow = ["list_templates"] - -[[permission]] -identifier = "deny-list-templates" -description = "Denies the list_templates command without any pre-configured scope." -commands.deny = ["list_templates"] diff --git a/plugins/db/permissions/autogenerated/commands/onboarding_session_id.toml b/plugins/db/permissions/autogenerated/commands/onboarding_session_id.toml deleted file mode 100644 index 7e4c769ee3..0000000000 --- a/plugins/db/permissions/autogenerated/commands/onboarding_session_id.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-onboarding-session-id" -description = "Enables the onboarding_session_id command without any pre-configured scope." -commands.allow = ["onboarding_session_id"] - -[[permission]] -identifier = "deny-onboarding-session-id" -description = "Denies the onboarding_session_id command without any pre-configured scope." -commands.deny = ["onboarding_session_id"] diff --git a/plugins/db/permissions/autogenerated/commands/session_add_participant.toml b/plugins/db/permissions/autogenerated/commands/session_add_participant.toml deleted file mode 100644 index d7915a69ff..0000000000 --- a/plugins/db/permissions/autogenerated/commands/session_add_participant.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-session-add-participant" -description = "Enables the session_add_participant command without any pre-configured scope." -commands.allow = ["session_add_participant"] - -[[permission]] -identifier = "deny-session-add-participant" -description = "Denies the session_add_participant command without any pre-configured scope." -commands.deny = ["session_add_participant"] diff --git a/plugins/db/permissions/autogenerated/commands/session_get_event.toml b/plugins/db/permissions/autogenerated/commands/session_get_event.toml deleted file mode 100644 index 0c11d7593e..0000000000 --- a/plugins/db/permissions/autogenerated/commands/session_get_event.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-session-get-event" -description = "Enables the session_get_event command without any pre-configured scope." -commands.allow = ["session_get_event"] - -[[permission]] -identifier = "deny-session-get-event" -description = "Denies the session_get_event command without any pre-configured scope." -commands.deny = ["session_get_event"] diff --git a/plugins/db/permissions/autogenerated/commands/session_list_deleted_participant_ids.toml b/plugins/db/permissions/autogenerated/commands/session_list_deleted_participant_ids.toml deleted file mode 100644 index 3842342ee9..0000000000 --- a/plugins/db/permissions/autogenerated/commands/session_list_deleted_participant_ids.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-session-list-deleted-participant-ids" -description = "Enables the session_list_deleted_participant_ids command without any pre-configured scope." -commands.allow = ["session_list_deleted_participant_ids"] - -[[permission]] -identifier = "deny-session-list-deleted-participant-ids" -description = "Denies the session_list_deleted_participant_ids command without any pre-configured scope." -commands.deny = ["session_list_deleted_participant_ids"] diff --git a/plugins/db/permissions/autogenerated/commands/session_list_participants.toml b/plugins/db/permissions/autogenerated/commands/session_list_participants.toml deleted file mode 100644 index 802e5894c1..0000000000 --- a/plugins/db/permissions/autogenerated/commands/session_list_participants.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-session-list-participants" -description = "Enables the session_list_participants command without any pre-configured scope." -commands.allow = ["session_list_participants"] - -[[permission]] -identifier = "deny-session-list-participants" -description = "Denies the session_list_participants command without any pre-configured scope." -commands.deny = ["session_list_participants"] diff --git a/plugins/db/permissions/autogenerated/commands/session_remove_participant.toml b/plugins/db/permissions/autogenerated/commands/session_remove_participant.toml deleted file mode 100644 index dec2484314..0000000000 --- a/plugins/db/permissions/autogenerated/commands/session_remove_participant.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-session-remove-participant" -description = "Enables the session_remove_participant command without any pre-configured scope." -commands.allow = ["session_remove_participant"] - -[[permission]] -identifier = "deny-session-remove-participant" -description = "Denies the session_remove_participant command without any pre-configured scope." -commands.deny = ["session_remove_participant"] diff --git a/plugins/db/permissions/autogenerated/commands/set_config.toml b/plugins/db/permissions/autogenerated/commands/set_config.toml deleted file mode 100644 index 4fa408286f..0000000000 --- a/plugins/db/permissions/autogenerated/commands/set_config.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-set-config" -description = "Enables the set_config command without any pre-configured scope." -commands.allow = ["set_config"] - -[[permission]] -identifier = "deny-set-config" -description = "Denies the set_config command without any pre-configured scope." -commands.deny = ["set_config"] diff --git a/plugins/db/permissions/autogenerated/commands/set_session_event.toml b/plugins/db/permissions/autogenerated/commands/set_session_event.toml deleted file mode 100644 index c92cfcb56b..0000000000 --- a/plugins/db/permissions/autogenerated/commands/set_session_event.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-set-session-event" -description = "Enables the set_session_event command without any pre-configured scope." -commands.allow = ["set_session_event"] - -[[permission]] -identifier = "deny-set-session-event" -description = "Denies the set_session_event command without any pre-configured scope." -commands.deny = ["set_session_event"] diff --git a/plugins/db/permissions/autogenerated/commands/thank_you_session_id.toml b/plugins/db/permissions/autogenerated/commands/thank_you_session_id.toml deleted file mode 100644 index 7621d3e03b..0000000000 --- a/plugins/db/permissions/autogenerated/commands/thank_you_session_id.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-thank-you-session-id" -description = "Enables the thank_you_session_id command without any pre-configured scope." -commands.allow = ["thank_you_session_id"] - -[[permission]] -identifier = "deny-thank-you-session-id" -description = "Denies the thank_you_session_id command without any pre-configured scope." -commands.deny = ["thank_you_session_id"] diff --git a/plugins/db/permissions/autogenerated/commands/toggle_calendar_selected.toml b/plugins/db/permissions/autogenerated/commands/toggle_calendar_selected.toml deleted file mode 100644 index 7251a30973..0000000000 --- a/plugins/db/permissions/autogenerated/commands/toggle_calendar_selected.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-toggle-calendar-selected" -description = "Enables the toggle_calendar_selected command without any pre-configured scope." -commands.allow = ["toggle_calendar_selected"] - -[[permission]] -identifier = "deny-toggle-calendar-selected" -description = "Denies the toggle_calendar_selected command without any pre-configured scope." -commands.deny = ["toggle_calendar_selected"] diff --git a/plugins/db/permissions/autogenerated/commands/unassign_tag_from_session.toml b/plugins/db/permissions/autogenerated/commands/unassign_tag_from_session.toml deleted file mode 100644 index e2cf9efe82..0000000000 --- a/plugins/db/permissions/autogenerated/commands/unassign_tag_from_session.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-unassign-tag-from-session" -description = "Enables the unassign_tag_from_session command without any pre-configured scope." -commands.allow = ["unassign_tag_from_session"] - -[[permission]] -identifier = "deny-unassign-tag-from-session" -description = "Denies the unassign_tag_from_session command without any pre-configured scope." -commands.deny = ["unassign_tag_from_session"] diff --git a/plugins/db/permissions/autogenerated/commands/update_message_v2_parts.toml b/plugins/db/permissions/autogenerated/commands/update_message_v2_parts.toml deleted file mode 100644 index 4515d85b9d..0000000000 --- a/plugins/db/permissions/autogenerated/commands/update_message_v2_parts.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-update-message-v2-parts" -description = "Enables the update_message_v2_parts command without any pre-configured scope." -commands.allow = ["update_message_v2_parts"] - -[[permission]] -identifier = "deny-update-message-v2-parts" -description = "Denies the update_message_v2_parts command without any pre-configured scope." -commands.deny = ["update_message_v2_parts"] diff --git a/plugins/db/permissions/autogenerated/commands/upsert_calendar.toml b/plugins/db/permissions/autogenerated/commands/upsert_calendar.toml deleted file mode 100644 index 68524600ff..0000000000 --- a/plugins/db/permissions/autogenerated/commands/upsert_calendar.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-upsert-calendar" -description = "Enables the upsert_calendar command without any pre-configured scope." -commands.allow = ["upsert_calendar"] - -[[permission]] -identifier = "deny-upsert-calendar" -description = "Denies the upsert_calendar command without any pre-configured scope." -commands.deny = ["upsert_calendar"] diff --git a/plugins/db/permissions/autogenerated/commands/upsert_chat_message.toml b/plugins/db/permissions/autogenerated/commands/upsert_chat_message.toml deleted file mode 100644 index cabcaee006..0000000000 --- a/plugins/db/permissions/autogenerated/commands/upsert_chat_message.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-upsert-chat-message" -description = "Enables the upsert_chat_message command without any pre-configured scope." -commands.allow = ["upsert_chat_message"] - -[[permission]] -identifier = "deny-upsert-chat-message" -description = "Denies the upsert_chat_message command without any pre-configured scope." -commands.deny = ["upsert_chat_message"] diff --git a/plugins/db/permissions/autogenerated/commands/upsert_human.toml b/plugins/db/permissions/autogenerated/commands/upsert_human.toml deleted file mode 100644 index 7cc4326fa3..0000000000 --- a/plugins/db/permissions/autogenerated/commands/upsert_human.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-upsert-human" -description = "Enables the upsert_human command without any pre-configured scope." -commands.allow = ["upsert_human"] - -[[permission]] -identifier = "deny-upsert-human" -description = "Denies the upsert_human command without any pre-configured scope." -commands.deny = ["upsert_human"] diff --git a/plugins/db/permissions/autogenerated/commands/upsert_organization.toml b/plugins/db/permissions/autogenerated/commands/upsert_organization.toml deleted file mode 100644 index a6ca2b418f..0000000000 --- a/plugins/db/permissions/autogenerated/commands/upsert_organization.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-upsert-organization" -description = "Enables the upsert_organization command without any pre-configured scope." -commands.allow = ["upsert_organization"] - -[[permission]] -identifier = "deny-upsert-organization" -description = "Denies the upsert_organization command without any pre-configured scope." -commands.deny = ["upsert_organization"] diff --git a/plugins/db/permissions/autogenerated/commands/upsert_session.toml b/plugins/db/permissions/autogenerated/commands/upsert_session.toml deleted file mode 100644 index c892d7b0aa..0000000000 --- a/plugins/db/permissions/autogenerated/commands/upsert_session.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-upsert-session" -description = "Enables the upsert_session command without any pre-configured scope." -commands.allow = ["upsert_session"] - -[[permission]] -identifier = "deny-upsert-session" -description = "Denies the upsert_session command without any pre-configured scope." -commands.deny = ["upsert_session"] diff --git a/plugins/db/permissions/autogenerated/commands/upsert_tag.toml b/plugins/db/permissions/autogenerated/commands/upsert_tag.toml deleted file mode 100644 index 850dc19bbb..0000000000 --- a/plugins/db/permissions/autogenerated/commands/upsert_tag.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-upsert-tag" -description = "Enables the upsert_tag command without any pre-configured scope." -commands.allow = ["upsert_tag"] - -[[permission]] -identifier = "deny-upsert-tag" -description = "Denies the upsert_tag command without any pre-configured scope." -commands.deny = ["upsert_tag"] diff --git a/plugins/db/permissions/autogenerated/commands/upsert_template.toml b/plugins/db/permissions/autogenerated/commands/upsert_template.toml deleted file mode 100644 index 6b072118b5..0000000000 --- a/plugins/db/permissions/autogenerated/commands/upsert_template.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-upsert-template" -description = "Enables the upsert_template command without any pre-configured scope." -commands.allow = ["upsert_template"] - -[[permission]] -identifier = "deny-upsert-template" -description = "Denies the upsert_template command without any pre-configured scope." -commands.deny = ["upsert_template"] diff --git a/plugins/db/permissions/autogenerated/commands/visit_session.toml b/plugins/db/permissions/autogenerated/commands/visit_session.toml deleted file mode 100644 index c51fe47393..0000000000 --- a/plugins/db/permissions/autogenerated/commands/visit_session.toml +++ /dev/null @@ -1,13 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -"$schema" = "../../schemas/schema.json" - -[[permission]] -identifier = "allow-visit-session" -description = "Enables the visit_session command without any pre-configured scope." -commands.allow = ["visit_session"] - -[[permission]] -identifier = "deny-visit-session" -description = "Denies the visit_session command without any pre-configured scope." -commands.deny = ["visit_session"] diff --git a/plugins/db/permissions/autogenerated/reference.md b/plugins/db/permissions/autogenerated/reference.md deleted file mode 100644 index ba9c91077b..0000000000 --- a/plugins/db/permissions/autogenerated/reference.md +++ /dev/null @@ -1,1420 +0,0 @@ -## Default Permission - -Default permissions for the plugin - -#### This default permission set includes the following: - -- `allow-onboarding-session-id` -- `allow-thank-you-session-id` -- `allow-upsert-session` -- `allow-list-sessions` -- `allow-get-session` -- `allow-visit-session` -- `allow-delete-session` -- `allow-set-session-event` -- `allow-session-add-participant` -- `allow-session-remove-participant` -- `allow-session-list-participants` -- `allow-session-get-event` -- `allow-get-words` -- `allow-get-words-onboarding` -- `allow-get-calendar` -- `allow-list-calendars` -- `allow-upsert-calendar` -- `allow-toggle-calendar-selected` -- `allow-list-templates` -- `allow-upsert-template` -- `allow-delete-template` -- `allow-get-event` -- `allow-list-events` -- `allow-get-config` -- `allow-set-config` -- `allow-get-human` -- `allow-delete-human` -- `allow-upsert-human` -- `allow-list-humans` -- `allow-get-organization` -- `allow-get-organization-by-user-id` -- `allow-list-organizations` -- `allow-list-organization-members` -- `allow-upsert-organization` -- `allow-delete-organization` -- `allow-list-chat-groups` -- `allow-list-chat-messages` -- `allow-create-chat-group` -- `allow-upsert-chat-message` -- `allow-delete-chat-messages` -- `allow-list-conversations` -- `allow-create-message-v2` -- `allow-create-conversation` -- `allow-list-messages-v2` -- `allow-update-message-v2-parts` -- `allow-upsert-tag` -- `allow-delete-tag` -- `allow-list-all-tags` -- `allow-list-session-tags` -- `allow-assign-tag-to-session` -- `allow-unassign-tag-from-session` -- `allow-session-list-deleted-participant-ids` - -## Permission Table - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IdentifierDescription
- -`db:allow-assign-tag-to-session` - - - -Enables the assign_tag_to_session command without any pre-configured scope. - -
- -`db:deny-assign-tag-to-session` - - - -Denies the assign_tag_to_session command without any pre-configured scope. - -
- -`db:allow-create-chat-group` - - - -Enables the create_chat_group command without any pre-configured scope. - -
- -`db:deny-create-chat-group` - - - -Denies the create_chat_group command without any pre-configured scope. - -
- -`db:allow-create-conversation` - - - -Enables the create_conversation command without any pre-configured scope. - -
- -`db:deny-create-conversation` - - - -Denies the create_conversation command without any pre-configured scope. - -
- -`db:allow-create-message-v2` - - - -Enables the create_message_v2 command without any pre-configured scope. - -
- -`db:deny-create-message-v2` - - - -Denies the create_message_v2 command without any pre-configured scope. - -
- -`db:allow-delete-chat-messages` - - - -Enables the delete_chat_messages command without any pre-configured scope. - -
- -`db:deny-delete-chat-messages` - - - -Denies the delete_chat_messages command without any pre-configured scope. - -
- -`db:allow-delete-human` - - - -Enables the delete_human command without any pre-configured scope. - -
- -`db:deny-delete-human` - - - -Denies the delete_human command without any pre-configured scope. - -
- -`db:allow-delete-organization` - - - -Enables the delete_organization command without any pre-configured scope. - -
- -`db:deny-delete-organization` - - - -Denies the delete_organization command without any pre-configured scope. - -
- -`db:allow-delete-session` - - - -Enables the delete_session command without any pre-configured scope. - -
- -`db:deny-delete-session` - - - -Denies the delete_session command without any pre-configured scope. - -
- -`db:allow-delete-tag` - - - -Enables the delete_tag command without any pre-configured scope. - -
- -`db:deny-delete-tag` - - - -Denies the delete_tag command without any pre-configured scope. - -
- -`db:allow-delete-template` - - - -Enables the delete_template command without any pre-configured scope. - -
- -`db:deny-delete-template` - - - -Denies the delete_template command without any pre-configured scope. - -
- -`db:allow-get-calendar` - - - -Enables the get_calendar command without any pre-configured scope. - -
- -`db:deny-get-calendar` - - - -Denies the get_calendar command without any pre-configured scope. - -
- -`db:allow-get-config` - - - -Enables the get_config command without any pre-configured scope. - -
- -`db:deny-get-config` - - - -Denies the get_config command without any pre-configured scope. - -
- -`db:allow-get-event` - - - -Enables the get_event command without any pre-configured scope. - -
- -`db:deny-get-event` - - - -Denies the get_event command without any pre-configured scope. - -
- -`db:allow-get-human` - - - -Enables the get_human command without any pre-configured scope. - -
- -`db:deny-get-human` - - - -Denies the get_human command without any pre-configured scope. - -
- -`db:allow-get-organization` - - - -Enables the get_organization command without any pre-configured scope. - -
- -`db:deny-get-organization` - - - -Denies the get_organization command without any pre-configured scope. - -
- -`db:allow-get-organization-by-user-id` - - - -Enables the get_organization_by_user_id command without any pre-configured scope. - -
- -`db:deny-get-organization-by-user-id` - - - -Denies the get_organization_by_user_id command without any pre-configured scope. - -
- -`db:allow-get-session` - - - -Enables the get_session command without any pre-configured scope. - -
- -`db:deny-get-session` - - - -Denies the get_session command without any pre-configured scope. - -
- -`db:allow-get-words` - - - -Enables the get_words command without any pre-configured scope. - -
- -`db:deny-get-words` - - - -Denies the get_words command without any pre-configured scope. - -
- -`db:allow-get-words-onboarding` - - - -Enables the get_words_onboarding command without any pre-configured scope. - -
- -`db:deny-get-words-onboarding` - - - -Denies the get_words_onboarding command without any pre-configured scope. - -
- -`db:allow-list-all-tags` - - - -Enables the list_all_tags command without any pre-configured scope. - -
- -`db:deny-list-all-tags` - - - -Denies the list_all_tags command without any pre-configured scope. - -
- -`db:allow-list-calendars` - - - -Enables the list_calendars command without any pre-configured scope. - -
- -`db:deny-list-calendars` - - - -Denies the list_calendars command without any pre-configured scope. - -
- -`db:allow-list-chat-groups` - - - -Enables the list_chat_groups command without any pre-configured scope. - -
- -`db:deny-list-chat-groups` - - - -Denies the list_chat_groups command without any pre-configured scope. - -
- -`db:allow-list-chat-messages` - - - -Enables the list_chat_messages command without any pre-configured scope. - -
- -`db:deny-list-chat-messages` - - - -Denies the list_chat_messages command without any pre-configured scope. - -
- -`db:allow-list-conversations` - - - -Enables the list_conversations command without any pre-configured scope. - -
- -`db:deny-list-conversations` - - - -Denies the list_conversations command without any pre-configured scope. - -
- -`db:allow-list-events` - - - -Enables the list_events command without any pre-configured scope. - -
- -`db:deny-list-events` - - - -Denies the list_events command without any pre-configured scope. - -
- -`db:allow-list-humans` - - - -Enables the list_humans command without any pre-configured scope. - -
- -`db:deny-list-humans` - - - -Denies the list_humans command without any pre-configured scope. - -
- -`db:allow-list-messages-v2` - - - -Enables the list_messages_v2 command without any pre-configured scope. - -
- -`db:deny-list-messages-v2` - - - -Denies the list_messages_v2 command without any pre-configured scope. - -
- -`db:allow-list-organization-members` - - - -Enables the list_organization_members command without any pre-configured scope. - -
- -`db:deny-list-organization-members` - - - -Denies the list_organization_members command without any pre-configured scope. - -
- -`db:allow-list-organizations` - - - -Enables the list_organizations command without any pre-configured scope. - -
- -`db:deny-list-organizations` - - - -Denies the list_organizations command without any pre-configured scope. - -
- -`db:allow-list-session-tags` - - - -Enables the list_session_tags command without any pre-configured scope. - -
- -`db:deny-list-session-tags` - - - -Denies the list_session_tags command without any pre-configured scope. - -
- -`db:allow-list-sessions` - - - -Enables the list_sessions command without any pre-configured scope. - -
- -`db:deny-list-sessions` - - - -Denies the list_sessions command without any pre-configured scope. - -
- -`db:allow-list-templates` - - - -Enables the list_templates command without any pre-configured scope. - -
- -`db:deny-list-templates` - - - -Denies the list_templates command without any pre-configured scope. - -
- -`db:allow-onboarding-session-id` - - - -Enables the onboarding_session_id command without any pre-configured scope. - -
- -`db:deny-onboarding-session-id` - - - -Denies the onboarding_session_id command without any pre-configured scope. - -
- -`db:allow-session-add-participant` - - - -Enables the session_add_participant command without any pre-configured scope. - -
- -`db:deny-session-add-participant` - - - -Denies the session_add_participant command without any pre-configured scope. - -
- -`db:allow-session-get-event` - - - -Enables the session_get_event command without any pre-configured scope. - -
- -`db:deny-session-get-event` - - - -Denies the session_get_event command without any pre-configured scope. - -
- -`db:allow-session-list-deleted-participant-ids` - - - -Enables the session_list_deleted_participant_ids command without any pre-configured scope. - -
- -`db:deny-session-list-deleted-participant-ids` - - - -Denies the session_list_deleted_participant_ids command without any pre-configured scope. - -
- -`db:allow-session-list-participants` - - - -Enables the session_list_participants command without any pre-configured scope. - -
- -`db:deny-session-list-participants` - - - -Denies the session_list_participants command without any pre-configured scope. - -
- -`db:allow-session-remove-participant` - - - -Enables the session_remove_participant command without any pre-configured scope. - -
- -`db:deny-session-remove-participant` - - - -Denies the session_remove_participant command without any pre-configured scope. - -
- -`db:allow-set-config` - - - -Enables the set_config command without any pre-configured scope. - -
- -`db:deny-set-config` - - - -Denies the set_config command without any pre-configured scope. - -
- -`db:allow-set-session-event` - - - -Enables the set_session_event command without any pre-configured scope. - -
- -`db:deny-set-session-event` - - - -Denies the set_session_event command without any pre-configured scope. - -
- -`db:allow-thank-you-session-id` - - - -Enables the thank_you_session_id command without any pre-configured scope. - -
- -`db:deny-thank-you-session-id` - - - -Denies the thank_you_session_id command without any pre-configured scope. - -
- -`db:allow-toggle-calendar-selected` - - - -Enables the toggle_calendar_selected command without any pre-configured scope. - -
- -`db:deny-toggle-calendar-selected` - - - -Denies the toggle_calendar_selected command without any pre-configured scope. - -
- -`db:allow-unassign-tag-from-session` - - - -Enables the unassign_tag_from_session command without any pre-configured scope. - -
- -`db:deny-unassign-tag-from-session` - - - -Denies the unassign_tag_from_session command without any pre-configured scope. - -
- -`db:allow-update-message-v2-parts` - - - -Enables the update_message_v2_parts command without any pre-configured scope. - -
- -`db:deny-update-message-v2-parts` - - - -Denies the update_message_v2_parts command without any pre-configured scope. - -
- -`db:allow-upsert-calendar` - - - -Enables the upsert_calendar command without any pre-configured scope. - -
- -`db:deny-upsert-calendar` - - - -Denies the upsert_calendar command without any pre-configured scope. - -
- -`db:allow-upsert-chat-message` - - - -Enables the upsert_chat_message command without any pre-configured scope. - -
- -`db:deny-upsert-chat-message` - - - -Denies the upsert_chat_message command without any pre-configured scope. - -
- -`db:allow-upsert-human` - - - -Enables the upsert_human command without any pre-configured scope. - -
- -`db:deny-upsert-human` - - - -Denies the upsert_human command without any pre-configured scope. - -
- -`db:allow-upsert-organization` - - - -Enables the upsert_organization command without any pre-configured scope. - -
- -`db:deny-upsert-organization` - - - -Denies the upsert_organization command without any pre-configured scope. - -
- -`db:allow-upsert-session` - - - -Enables the upsert_session command without any pre-configured scope. - -
- -`db:deny-upsert-session` - - - -Denies the upsert_session command without any pre-configured scope. - -
- -`db:allow-upsert-tag` - - - -Enables the upsert_tag command without any pre-configured scope. - -
- -`db:deny-upsert-tag` - - - -Denies the upsert_tag command without any pre-configured scope. - -
- -`db:allow-upsert-template` - - - -Enables the upsert_template command without any pre-configured scope. - -
- -`db:deny-upsert-template` - - - -Denies the upsert_template command without any pre-configured scope. - -
- -`db:allow-visit-session` - - - -Enables the visit_session command without any pre-configured scope. - -
- -`db:deny-visit-session` - - - -Denies the visit_session command without any pre-configured scope. - -
diff --git a/plugins/db/permissions/default.toml b/plugins/db/permissions/default.toml deleted file mode 100644 index 8f90a89631..0000000000 --- a/plugins/db/permissions/default.toml +++ /dev/null @@ -1,64 +0,0 @@ -[default] -description = "Default permissions for the plugin" -permissions = [ - # session - "allow-onboarding-session-id", - "allow-thank-you-session-id", - "allow-upsert-session", - "allow-list-sessions", - "allow-get-session", - "allow-visit-session", - "allow-delete-session", - "allow-set-session-event", - "allow-session-add-participant", - "allow-session-remove-participant", - "allow-session-list-participants", - "allow-session-get-event", - "allow-get-words", - "allow-get-words-onboarding", - # calendar - "allow-get-calendar", - "allow-list-calendars", - "allow-upsert-calendar", - "allow-toggle-calendar-selected", - # template - "allow-list-templates", - "allow-upsert-template", - "allow-delete-template", - # event - "allow-get-event", - "allow-list-events", - # config - "allow-get-config", - "allow-set-config", - # user - "allow-get-human", - "allow-delete-human", - "allow-upsert-human", - "allow-list-humans", - "allow-get-organization", - "allow-get-organization-by-user-id", - "allow-list-organizations", - "allow-list-organization-members", - "allow-upsert-organization", - "allow-delete-organization", - # chat - "allow-list-chat-groups", - "allow-list-chat-messages", - "allow-create-chat-group", - "allow-upsert-chat-message", - "allow-delete-chat-messages", - "allow-list-conversations", - "allow-create-message-v2", - "allow-create-conversation", - "allow-list-messages-v2", - "allow-update-message-v2-parts", - # tag - "allow-upsert-tag", - "allow-delete-tag", - "allow-list-all-tags", - "allow-list-session-tags", - "allow-assign-tag-to-session", - "allow-unassign-tag-from-session", - "allow-session-list-deleted-participant-ids", -] diff --git a/plugins/db/permissions/schemas/schema.json b/plugins/db/permissions/schemas/schema.json deleted file mode 100644 index ddf2dad5e1..0000000000 --- a/plugins/db/permissions/schemas/schema.json +++ /dev/null @@ -1,930 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "PermissionFile", - "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.", - "type": "object", - "properties": { - "default": { - "description": "The default permission set for the plugin", - "anyOf": [ - { - "$ref": "#/definitions/DefaultPermission" - }, - { - "type": "null" - } - ] - }, - "set": { - "description": "A list of permissions sets defined", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionSet" - } - }, - "permission": { - "description": "A list of inlined permissions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Permission" - } - } - }, - "definitions": { - "DefaultPermission": { - "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.", - "type": "object", - "required": [ - "permissions" - ], - "properties": { - "version": { - "description": "The version of the permission.", - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 1.0 - }, - "description": { - "description": "Human-readable description of what the permission does. Tauri convention is to use `

` headings in markdown content for Tauri documentation generation purposes.", - "type": [ - "string", - "null" - ] - }, - "permissions": { - "description": "All permissions this set contains.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "PermissionSet": { - "description": "A set of direct permissions grouped together under a new name.", - "type": "object", - "required": [ - "description", - "identifier", - "permissions" - ], - "properties": { - "identifier": { - "description": "A unique identifier for the permission.", - "type": "string" - }, - "description": { - "description": "Human-readable description of what the permission does.", - "type": "string" - }, - "permissions": { - "description": "All permissions this set contains.", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionKind" - } - } - } - }, - "Permission": { - "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.", - "type": "object", - "required": [ - "identifier" - ], - "properties": { - "version": { - "description": "The version of the permission.", - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 1.0 - }, - "identifier": { - "description": "A unique identifier for the permission.", - "type": "string" - }, - "description": { - "description": "Human-readable description of what the permission does. Tauri internal convention is to use `

` headings in markdown content for Tauri documentation generation purposes.", - "type": [ - "string", - "null" - ] - }, - "commands": { - "description": "Allowed or denied commands when using this permission.", - "default": { - "allow": [], - "deny": [] - }, - "allOf": [ - { - "$ref": "#/definitions/Commands" - } - ] - }, - "scope": { - "description": "Allowed or denied scoped when using this permission.", - "allOf": [ - { - "$ref": "#/definitions/Scopes" - } - ] - }, - "platforms": { - "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Target" - } - } - } - }, - "Commands": { - "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.", - "type": "object", - "properties": { - "allow": { - "description": "Allowed command.", - "default": [], - "type": "array", - "items": { - "type": "string" - } - }, - "deny": { - "description": "Denied command, which takes priority.", - "default": [], - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "Scopes": { - "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```", - "type": "object", - "properties": { - "allow": { - "description": "Data that defines what is allowed by the scope.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - }, - "deny": { - "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - } - } - }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, - "Target": { - "description": "Platform target.", - "oneOf": [ - { - "description": "MacOS.", - "type": "string", - "enum": [ - "macOS" - ] - }, - { - "description": "Windows.", - "type": "string", - "enum": [ - "windows" - ] - }, - { - "description": "Linux.", - "type": "string", - "enum": [ - "linux" - ] - }, - { - "description": "Android.", - "type": "string", - "enum": [ - "android" - ] - }, - { - "description": "iOS.", - "type": "string", - "enum": [ - "iOS" - ] - } - ] - }, - "PermissionKind": { - "type": "string", - "oneOf": [ - { - "description": "Enables the assign_tag_to_session command without any pre-configured scope.", - "type": "string", - "const": "allow-assign-tag-to-session", - "markdownDescription": "Enables the assign_tag_to_session command without any pre-configured scope." - }, - { - "description": "Denies the assign_tag_to_session command without any pre-configured scope.", - "type": "string", - "const": "deny-assign-tag-to-session", - "markdownDescription": "Denies the assign_tag_to_session command without any pre-configured scope." - }, - { - "description": "Enables the create_chat_group command without any pre-configured scope.", - "type": "string", - "const": "allow-create-chat-group", - "markdownDescription": "Enables the create_chat_group command without any pre-configured scope." - }, - { - "description": "Denies the create_chat_group command without any pre-configured scope.", - "type": "string", - "const": "deny-create-chat-group", - "markdownDescription": "Denies the create_chat_group command without any pre-configured scope." - }, - { - "description": "Enables the create_conversation command without any pre-configured scope.", - "type": "string", - "const": "allow-create-conversation", - "markdownDescription": "Enables the create_conversation command without any pre-configured scope." - }, - { - "description": "Denies the create_conversation command without any pre-configured scope.", - "type": "string", - "const": "deny-create-conversation", - "markdownDescription": "Denies the create_conversation command without any pre-configured scope." - }, - { - "description": "Enables the create_message_v2 command without any pre-configured scope.", - "type": "string", - "const": "allow-create-message-v2", - "markdownDescription": "Enables the create_message_v2 command without any pre-configured scope." - }, - { - "description": "Denies the create_message_v2 command without any pre-configured scope.", - "type": "string", - "const": "deny-create-message-v2", - "markdownDescription": "Denies the create_message_v2 command without any pre-configured scope." - }, - { - "description": "Enables the delete_chat_messages command without any pre-configured scope.", - "type": "string", - "const": "allow-delete-chat-messages", - "markdownDescription": "Enables the delete_chat_messages command without any pre-configured scope." - }, - { - "description": "Denies the delete_chat_messages command without any pre-configured scope.", - "type": "string", - "const": "deny-delete-chat-messages", - "markdownDescription": "Denies the delete_chat_messages command without any pre-configured scope." - }, - { - "description": "Enables the delete_human command without any pre-configured scope.", - "type": "string", - "const": "allow-delete-human", - "markdownDescription": "Enables the delete_human command without any pre-configured scope." - }, - { - "description": "Denies the delete_human command without any pre-configured scope.", - "type": "string", - "const": "deny-delete-human", - "markdownDescription": "Denies the delete_human command without any pre-configured scope." - }, - { - "description": "Enables the delete_organization command without any pre-configured scope.", - "type": "string", - "const": "allow-delete-organization", - "markdownDescription": "Enables the delete_organization command without any pre-configured scope." - }, - { - "description": "Denies the delete_organization command without any pre-configured scope.", - "type": "string", - "const": "deny-delete-organization", - "markdownDescription": "Denies the delete_organization command without any pre-configured scope." - }, - { - "description": "Enables the delete_session command without any pre-configured scope.", - "type": "string", - "const": "allow-delete-session", - "markdownDescription": "Enables the delete_session command without any pre-configured scope." - }, - { - "description": "Denies the delete_session command without any pre-configured scope.", - "type": "string", - "const": "deny-delete-session", - "markdownDescription": "Denies the delete_session command without any pre-configured scope." - }, - { - "description": "Enables the delete_tag command without any pre-configured scope.", - "type": "string", - "const": "allow-delete-tag", - "markdownDescription": "Enables the delete_tag command without any pre-configured scope." - }, - { - "description": "Denies the delete_tag command without any pre-configured scope.", - "type": "string", - "const": "deny-delete-tag", - "markdownDescription": "Denies the delete_tag command without any pre-configured scope." - }, - { - "description": "Enables the delete_template command without any pre-configured scope.", - "type": "string", - "const": "allow-delete-template", - "markdownDescription": "Enables the delete_template command without any pre-configured scope." - }, - { - "description": "Denies the delete_template command without any pre-configured scope.", - "type": "string", - "const": "deny-delete-template", - "markdownDescription": "Denies the delete_template command without any pre-configured scope." - }, - { - "description": "Enables the get_calendar command without any pre-configured scope.", - "type": "string", - "const": "allow-get-calendar", - "markdownDescription": "Enables the get_calendar command without any pre-configured scope." - }, - { - "description": "Denies the get_calendar command without any pre-configured scope.", - "type": "string", - "const": "deny-get-calendar", - "markdownDescription": "Denies the get_calendar command without any pre-configured scope." - }, - { - "description": "Enables the get_config command without any pre-configured scope.", - "type": "string", - "const": "allow-get-config", - "markdownDescription": "Enables the get_config command without any pre-configured scope." - }, - { - "description": "Denies the get_config command without any pre-configured scope.", - "type": "string", - "const": "deny-get-config", - "markdownDescription": "Denies the get_config command without any pre-configured scope." - }, - { - "description": "Enables the get_event command without any pre-configured scope.", - "type": "string", - "const": "allow-get-event", - "markdownDescription": "Enables the get_event command without any pre-configured scope." - }, - { - "description": "Denies the get_event command without any pre-configured scope.", - "type": "string", - "const": "deny-get-event", - "markdownDescription": "Denies the get_event command without any pre-configured scope." - }, - { - "description": "Enables the get_human command without any pre-configured scope.", - "type": "string", - "const": "allow-get-human", - "markdownDescription": "Enables the get_human command without any pre-configured scope." - }, - { - "description": "Denies the get_human command without any pre-configured scope.", - "type": "string", - "const": "deny-get-human", - "markdownDescription": "Denies the get_human command without any pre-configured scope." - }, - { - "description": "Enables the get_organization command without any pre-configured scope.", - "type": "string", - "const": "allow-get-organization", - "markdownDescription": "Enables the get_organization command without any pre-configured scope." - }, - { - "description": "Denies the get_organization command without any pre-configured scope.", - "type": "string", - "const": "deny-get-organization", - "markdownDescription": "Denies the get_organization command without any pre-configured scope." - }, - { - "description": "Enables the get_organization_by_user_id command without any pre-configured scope.", - "type": "string", - "const": "allow-get-organization-by-user-id", - "markdownDescription": "Enables the get_organization_by_user_id command without any pre-configured scope." - }, - { - "description": "Denies the get_organization_by_user_id command without any pre-configured scope.", - "type": "string", - "const": "deny-get-organization-by-user-id", - "markdownDescription": "Denies the get_organization_by_user_id command without any pre-configured scope." - }, - { - "description": "Enables the get_session command without any pre-configured scope.", - "type": "string", - "const": "allow-get-session", - "markdownDescription": "Enables the get_session command without any pre-configured scope." - }, - { - "description": "Denies the get_session command without any pre-configured scope.", - "type": "string", - "const": "deny-get-session", - "markdownDescription": "Denies the get_session command without any pre-configured scope." - }, - { - "description": "Enables the get_words command without any pre-configured scope.", - "type": "string", - "const": "allow-get-words", - "markdownDescription": "Enables the get_words command without any pre-configured scope." - }, - { - "description": "Denies the get_words command without any pre-configured scope.", - "type": "string", - "const": "deny-get-words", - "markdownDescription": "Denies the get_words command without any pre-configured scope." - }, - { - "description": "Enables the get_words_onboarding command without any pre-configured scope.", - "type": "string", - "const": "allow-get-words-onboarding", - "markdownDescription": "Enables the get_words_onboarding command without any pre-configured scope." - }, - { - "description": "Denies the get_words_onboarding command without any pre-configured scope.", - "type": "string", - "const": "deny-get-words-onboarding", - "markdownDescription": "Denies the get_words_onboarding command without any pre-configured scope." - }, - { - "description": "Enables the list_all_tags command without any pre-configured scope.", - "type": "string", - "const": "allow-list-all-tags", - "markdownDescription": "Enables the list_all_tags command without any pre-configured scope." - }, - { - "description": "Denies the list_all_tags command without any pre-configured scope.", - "type": "string", - "const": "deny-list-all-tags", - "markdownDescription": "Denies the list_all_tags command without any pre-configured scope." - }, - { - "description": "Enables the list_calendars command without any pre-configured scope.", - "type": "string", - "const": "allow-list-calendars", - "markdownDescription": "Enables the list_calendars command without any pre-configured scope." - }, - { - "description": "Denies the list_calendars command without any pre-configured scope.", - "type": "string", - "const": "deny-list-calendars", - "markdownDescription": "Denies the list_calendars command without any pre-configured scope." - }, - { - "description": "Enables the list_chat_groups command without any pre-configured scope.", - "type": "string", - "const": "allow-list-chat-groups", - "markdownDescription": "Enables the list_chat_groups command without any pre-configured scope." - }, - { - "description": "Denies the list_chat_groups command without any pre-configured scope.", - "type": "string", - "const": "deny-list-chat-groups", - "markdownDescription": "Denies the list_chat_groups command without any pre-configured scope." - }, - { - "description": "Enables the list_chat_messages command without any pre-configured scope.", - "type": "string", - "const": "allow-list-chat-messages", - "markdownDescription": "Enables the list_chat_messages command without any pre-configured scope." - }, - { - "description": "Denies the list_chat_messages command without any pre-configured scope.", - "type": "string", - "const": "deny-list-chat-messages", - "markdownDescription": "Denies the list_chat_messages command without any pre-configured scope." - }, - { - "description": "Enables the list_conversations command without any pre-configured scope.", - "type": "string", - "const": "allow-list-conversations", - "markdownDescription": "Enables the list_conversations command without any pre-configured scope." - }, - { - "description": "Denies the list_conversations command without any pre-configured scope.", - "type": "string", - "const": "deny-list-conversations", - "markdownDescription": "Denies the list_conversations command without any pre-configured scope." - }, - { - "description": "Enables the list_events command without any pre-configured scope.", - "type": "string", - "const": "allow-list-events", - "markdownDescription": "Enables the list_events command without any pre-configured scope." - }, - { - "description": "Denies the list_events command without any pre-configured scope.", - "type": "string", - "const": "deny-list-events", - "markdownDescription": "Denies the list_events command without any pre-configured scope." - }, - { - "description": "Enables the list_humans command without any pre-configured scope.", - "type": "string", - "const": "allow-list-humans", - "markdownDescription": "Enables the list_humans command without any pre-configured scope." - }, - { - "description": "Denies the list_humans command without any pre-configured scope.", - "type": "string", - "const": "deny-list-humans", - "markdownDescription": "Denies the list_humans command without any pre-configured scope." - }, - { - "description": "Enables the list_messages_v2 command without any pre-configured scope.", - "type": "string", - "const": "allow-list-messages-v2", - "markdownDescription": "Enables the list_messages_v2 command without any pre-configured scope." - }, - { - "description": "Denies the list_messages_v2 command without any pre-configured scope.", - "type": "string", - "const": "deny-list-messages-v2", - "markdownDescription": "Denies the list_messages_v2 command without any pre-configured scope." - }, - { - "description": "Enables the list_organization_members command without any pre-configured scope.", - "type": "string", - "const": "allow-list-organization-members", - "markdownDescription": "Enables the list_organization_members command without any pre-configured scope." - }, - { - "description": "Denies the list_organization_members command without any pre-configured scope.", - "type": "string", - "const": "deny-list-organization-members", - "markdownDescription": "Denies the list_organization_members command without any pre-configured scope." - }, - { - "description": "Enables the list_organizations command without any pre-configured scope.", - "type": "string", - "const": "allow-list-organizations", - "markdownDescription": "Enables the list_organizations command without any pre-configured scope." - }, - { - "description": "Denies the list_organizations command without any pre-configured scope.", - "type": "string", - "const": "deny-list-organizations", - "markdownDescription": "Denies the list_organizations command without any pre-configured scope." - }, - { - "description": "Enables the list_session_tags command without any pre-configured scope.", - "type": "string", - "const": "allow-list-session-tags", - "markdownDescription": "Enables the list_session_tags command without any pre-configured scope." - }, - { - "description": "Denies the list_session_tags command without any pre-configured scope.", - "type": "string", - "const": "deny-list-session-tags", - "markdownDescription": "Denies the list_session_tags command without any pre-configured scope." - }, - { - "description": "Enables the list_sessions command without any pre-configured scope.", - "type": "string", - "const": "allow-list-sessions", - "markdownDescription": "Enables the list_sessions command without any pre-configured scope." - }, - { - "description": "Denies the list_sessions command without any pre-configured scope.", - "type": "string", - "const": "deny-list-sessions", - "markdownDescription": "Denies the list_sessions command without any pre-configured scope." - }, - { - "description": "Enables the list_templates command without any pre-configured scope.", - "type": "string", - "const": "allow-list-templates", - "markdownDescription": "Enables the list_templates command without any pre-configured scope." - }, - { - "description": "Denies the list_templates command without any pre-configured scope.", - "type": "string", - "const": "deny-list-templates", - "markdownDescription": "Denies the list_templates command without any pre-configured scope." - }, - { - "description": "Enables the onboarding_session_id command without any pre-configured scope.", - "type": "string", - "const": "allow-onboarding-session-id", - "markdownDescription": "Enables the onboarding_session_id command without any pre-configured scope." - }, - { - "description": "Denies the onboarding_session_id command without any pre-configured scope.", - "type": "string", - "const": "deny-onboarding-session-id", - "markdownDescription": "Denies the onboarding_session_id command without any pre-configured scope." - }, - { - "description": "Enables the session_add_participant command without any pre-configured scope.", - "type": "string", - "const": "allow-session-add-participant", - "markdownDescription": "Enables the session_add_participant command without any pre-configured scope." - }, - { - "description": "Denies the session_add_participant command without any pre-configured scope.", - "type": "string", - "const": "deny-session-add-participant", - "markdownDescription": "Denies the session_add_participant command without any pre-configured scope." - }, - { - "description": "Enables the session_get_event command without any pre-configured scope.", - "type": "string", - "const": "allow-session-get-event", - "markdownDescription": "Enables the session_get_event command without any pre-configured scope." - }, - { - "description": "Denies the session_get_event command without any pre-configured scope.", - "type": "string", - "const": "deny-session-get-event", - "markdownDescription": "Denies the session_get_event command without any pre-configured scope." - }, - { - "description": "Enables the session_list_deleted_participant_ids command without any pre-configured scope.", - "type": "string", - "const": "allow-session-list-deleted-participant-ids", - "markdownDescription": "Enables the session_list_deleted_participant_ids command without any pre-configured scope." - }, - { - "description": "Denies the session_list_deleted_participant_ids command without any pre-configured scope.", - "type": "string", - "const": "deny-session-list-deleted-participant-ids", - "markdownDescription": "Denies the session_list_deleted_participant_ids command without any pre-configured scope." - }, - { - "description": "Enables the session_list_participants command without any pre-configured scope.", - "type": "string", - "const": "allow-session-list-participants", - "markdownDescription": "Enables the session_list_participants command without any pre-configured scope." - }, - { - "description": "Denies the session_list_participants command without any pre-configured scope.", - "type": "string", - "const": "deny-session-list-participants", - "markdownDescription": "Denies the session_list_participants command without any pre-configured scope." - }, - { - "description": "Enables the session_remove_participant command without any pre-configured scope.", - "type": "string", - "const": "allow-session-remove-participant", - "markdownDescription": "Enables the session_remove_participant command without any pre-configured scope." - }, - { - "description": "Denies the session_remove_participant command without any pre-configured scope.", - "type": "string", - "const": "deny-session-remove-participant", - "markdownDescription": "Denies the session_remove_participant command without any pre-configured scope." - }, - { - "description": "Enables the set_config command without any pre-configured scope.", - "type": "string", - "const": "allow-set-config", - "markdownDescription": "Enables the set_config command without any pre-configured scope." - }, - { - "description": "Denies the set_config command without any pre-configured scope.", - "type": "string", - "const": "deny-set-config", - "markdownDescription": "Denies the set_config command without any pre-configured scope." - }, - { - "description": "Enables the set_session_event command without any pre-configured scope.", - "type": "string", - "const": "allow-set-session-event", - "markdownDescription": "Enables the set_session_event command without any pre-configured scope." - }, - { - "description": "Denies the set_session_event command without any pre-configured scope.", - "type": "string", - "const": "deny-set-session-event", - "markdownDescription": "Denies the set_session_event command without any pre-configured scope." - }, - { - "description": "Enables the thank_you_session_id command without any pre-configured scope.", - "type": "string", - "const": "allow-thank-you-session-id", - "markdownDescription": "Enables the thank_you_session_id command without any pre-configured scope." - }, - { - "description": "Denies the thank_you_session_id command without any pre-configured scope.", - "type": "string", - "const": "deny-thank-you-session-id", - "markdownDescription": "Denies the thank_you_session_id command without any pre-configured scope." - }, - { - "description": "Enables the toggle_calendar_selected command without any pre-configured scope.", - "type": "string", - "const": "allow-toggle-calendar-selected", - "markdownDescription": "Enables the toggle_calendar_selected command without any pre-configured scope." - }, - { - "description": "Denies the toggle_calendar_selected command without any pre-configured scope.", - "type": "string", - "const": "deny-toggle-calendar-selected", - "markdownDescription": "Denies the toggle_calendar_selected command without any pre-configured scope." - }, - { - "description": "Enables the unassign_tag_from_session command without any pre-configured scope.", - "type": "string", - "const": "allow-unassign-tag-from-session", - "markdownDescription": "Enables the unassign_tag_from_session command without any pre-configured scope." - }, - { - "description": "Denies the unassign_tag_from_session command without any pre-configured scope.", - "type": "string", - "const": "deny-unassign-tag-from-session", - "markdownDescription": "Denies the unassign_tag_from_session command without any pre-configured scope." - }, - { - "description": "Enables the update_message_v2_parts command without any pre-configured scope.", - "type": "string", - "const": "allow-update-message-v2-parts", - "markdownDescription": "Enables the update_message_v2_parts command without any pre-configured scope." - }, - { - "description": "Denies the update_message_v2_parts command without any pre-configured scope.", - "type": "string", - "const": "deny-update-message-v2-parts", - "markdownDescription": "Denies the update_message_v2_parts command without any pre-configured scope." - }, - { - "description": "Enables the upsert_calendar command without any pre-configured scope.", - "type": "string", - "const": "allow-upsert-calendar", - "markdownDescription": "Enables the upsert_calendar command without any pre-configured scope." - }, - { - "description": "Denies the upsert_calendar command without any pre-configured scope.", - "type": "string", - "const": "deny-upsert-calendar", - "markdownDescription": "Denies the upsert_calendar command without any pre-configured scope." - }, - { - "description": "Enables the upsert_chat_message command without any pre-configured scope.", - "type": "string", - "const": "allow-upsert-chat-message", - "markdownDescription": "Enables the upsert_chat_message command without any pre-configured scope." - }, - { - "description": "Denies the upsert_chat_message command without any pre-configured scope.", - "type": "string", - "const": "deny-upsert-chat-message", - "markdownDescription": "Denies the upsert_chat_message command without any pre-configured scope." - }, - { - "description": "Enables the upsert_human command without any pre-configured scope.", - "type": "string", - "const": "allow-upsert-human", - "markdownDescription": "Enables the upsert_human command without any pre-configured scope." - }, - { - "description": "Denies the upsert_human command without any pre-configured scope.", - "type": "string", - "const": "deny-upsert-human", - "markdownDescription": "Denies the upsert_human command without any pre-configured scope." - }, - { - "description": "Enables the upsert_organization command without any pre-configured scope.", - "type": "string", - "const": "allow-upsert-organization", - "markdownDescription": "Enables the upsert_organization command without any pre-configured scope." - }, - { - "description": "Denies the upsert_organization command without any pre-configured scope.", - "type": "string", - "const": "deny-upsert-organization", - "markdownDescription": "Denies the upsert_organization command without any pre-configured scope." - }, - { - "description": "Enables the upsert_session command without any pre-configured scope.", - "type": "string", - "const": "allow-upsert-session", - "markdownDescription": "Enables the upsert_session command without any pre-configured scope." - }, - { - "description": "Denies the upsert_session command without any pre-configured scope.", - "type": "string", - "const": "deny-upsert-session", - "markdownDescription": "Denies the upsert_session command without any pre-configured scope." - }, - { - "description": "Enables the upsert_tag command without any pre-configured scope.", - "type": "string", - "const": "allow-upsert-tag", - "markdownDescription": "Enables the upsert_tag command without any pre-configured scope." - }, - { - "description": "Denies the upsert_tag command without any pre-configured scope.", - "type": "string", - "const": "deny-upsert-tag", - "markdownDescription": "Denies the upsert_tag command without any pre-configured scope." - }, - { - "description": "Enables the upsert_template command without any pre-configured scope.", - "type": "string", - "const": "allow-upsert-template", - "markdownDescription": "Enables the upsert_template command without any pre-configured scope." - }, - { - "description": "Denies the upsert_template command without any pre-configured scope.", - "type": "string", - "const": "deny-upsert-template", - "markdownDescription": "Denies the upsert_template command without any pre-configured scope." - }, - { - "description": "Enables the visit_session command without any pre-configured scope.", - "type": "string", - "const": "allow-visit-session", - "markdownDescription": "Enables the visit_session command without any pre-configured scope." - }, - { - "description": "Denies the visit_session command without any pre-configured scope.", - "type": "string", - "const": "deny-visit-session", - "markdownDescription": "Denies the visit_session command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin\n#### This default permission set includes:\n\n- `allow-onboarding-session-id`\n- `allow-thank-you-session-id`\n- `allow-upsert-session`\n- `allow-list-sessions`\n- `allow-get-session`\n- `allow-visit-session`\n- `allow-delete-session`\n- `allow-set-session-event`\n- `allow-session-add-participant`\n- `allow-session-remove-participant`\n- `allow-session-list-participants`\n- `allow-session-get-event`\n- `allow-get-words`\n- `allow-get-words-onboarding`\n- `allow-get-calendar`\n- `allow-list-calendars`\n- `allow-upsert-calendar`\n- `allow-toggle-calendar-selected`\n- `allow-list-templates`\n- `allow-upsert-template`\n- `allow-delete-template`\n- `allow-get-event`\n- `allow-list-events`\n- `allow-get-config`\n- `allow-set-config`\n- `allow-get-human`\n- `allow-delete-human`\n- `allow-upsert-human`\n- `allow-list-humans`\n- `allow-get-organization`\n- `allow-get-organization-by-user-id`\n- `allow-list-organizations`\n- `allow-list-organization-members`\n- `allow-upsert-organization`\n- `allow-delete-organization`\n- `allow-list-chat-groups`\n- `allow-list-chat-messages`\n- `allow-create-chat-group`\n- `allow-upsert-chat-message`\n- `allow-delete-chat-messages`\n- `allow-list-conversations`\n- `allow-create-message-v2`\n- `allow-create-conversation`\n- `allow-list-messages-v2`\n- `allow-update-message-v2-parts`\n- `allow-upsert-tag`\n- `allow-delete-tag`\n- `allow-list-all-tags`\n- `allow-list-session-tags`\n- `allow-assign-tag-to-session`\n- `allow-unassign-tag-from-session`\n- `allow-session-list-deleted-participant-ids`", - "type": "string", - "const": "default", - "markdownDescription": "Default permissions for the plugin\n#### This default permission set includes:\n\n- `allow-onboarding-session-id`\n- `allow-thank-you-session-id`\n- `allow-upsert-session`\n- `allow-list-sessions`\n- `allow-get-session`\n- `allow-visit-session`\n- `allow-delete-session`\n- `allow-set-session-event`\n- `allow-session-add-participant`\n- `allow-session-remove-participant`\n- `allow-session-list-participants`\n- `allow-session-get-event`\n- `allow-get-words`\n- `allow-get-words-onboarding`\n- `allow-get-calendar`\n- `allow-list-calendars`\n- `allow-upsert-calendar`\n- `allow-toggle-calendar-selected`\n- `allow-list-templates`\n- `allow-upsert-template`\n- `allow-delete-template`\n- `allow-get-event`\n- `allow-list-events`\n- `allow-get-config`\n- `allow-set-config`\n- `allow-get-human`\n- `allow-delete-human`\n- `allow-upsert-human`\n- `allow-list-humans`\n- `allow-get-organization`\n- `allow-get-organization-by-user-id`\n- `allow-list-organizations`\n- `allow-list-organization-members`\n- `allow-upsert-organization`\n- `allow-delete-organization`\n- `allow-list-chat-groups`\n- `allow-list-chat-messages`\n- `allow-create-chat-group`\n- `allow-upsert-chat-message`\n- `allow-delete-chat-messages`\n- `allow-list-conversations`\n- `allow-create-message-v2`\n- `allow-create-conversation`\n- `allow-list-messages-v2`\n- `allow-update-message-v2-parts`\n- `allow-upsert-tag`\n- `allow-delete-tag`\n- `allow-list-all-tags`\n- `allow-list-session-tags`\n- `allow-assign-tag-to-session`\n- `allow-unassign-tag-from-session`\n- `allow-session-list-deleted-participant-ids`" - } - ] - } - } -} \ No newline at end of file diff --git a/plugins/db/seed/dev.json b/plugins/db/seed/dev.json deleted file mode 100644 index eed091cac7..0000000000 --- a/plugins/db/seed/dev.json +++ /dev/null @@ -1,521 +0,0 @@ -{ - "$schema": "./schema.json", - "organizations": [ - { - "id": "550e8400-e29b-41d4-a716-446655441000", - "name": "Some Company", - "description": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655441001", - "name": "Boring Company", - "description": "Boring Company is a tunnel construction company" - } - ], - "humans": [ - { - "id": "{{ CURRENT_USER_ID }}", - "organization_id": "550e8400-e29b-41d4-a716-446655441000", - "is_user": true, - "full_name": null, - "email": null, - "job_title": null, - "linkedin_username": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655441002", - "organization_id": "550e8400-e29b-41d4-a716-446655441001", - "job_title": "CEO", - "full_name": "Elon Musk", - "email": "elon@boringcompany.com", - "is_user": false, - "linkedin_username": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655441003", - "full_name": "Alex Karp", - "email": "alex@hyprnote.com", - "is_user": false, - "organization_id": null, - "job_title": null, - "linkedin_username": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655441004", - "full_name": "Jenny Park", - "email": "jenny@hyprnote.com", - "is_user": false, - "organization_id": null, - "job_title": null, - "linkedin_username": null - } - ], - "calendars": [ - { - "id": "550e8400-e29b-41d4-a716-446655441100", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "calendar_1", - "name": "Work", - "platform": "Apple", - "selected": true, - "source": null - } - ], - "events": [ - { - "id": "550e8400-e29b-41d4-a716-446655441200", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441201", - "name": "Daily Standup", - "note": "What:\n30 Min Meeting between Alice Smith and Bob Johnson\nInvitee Time Zone:\nAsia/Seoul\nWho:\nAlice Smith - Organizer\nalice.smith@example.com\nBob Johnson\nbob.johnson@example.com\nWhere:\nhttps://app.cal.com/video/d713v9w1d2krBptPtwUAnJ\nNeed to reschedule or cancel? https://cal.com/booking/d713v9w1d2krBptPtwUAnJ?changes=true", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1970-01-01T00:15:00Z", - "end_date": "1970-01-01T00:45:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441202", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441203", - "name": "Team Review Meeting", - "note": "Weekly team review and planning", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-31T00:00:00Z", - "end_date": "1969-12-31T01:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441204", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441205", - "name": "Client Presentation", - "note": "Presenting Q3 results to client", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-29T00:00:00Z", - "end_date": "1969-12-29T02:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441206", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441207", - "name": "Product Roadmap Discussion", - "note": "Planning next quarter's product roadmap", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-28T00:00:00Z", - "end_date": "1969-12-28T01:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441208", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441209", - "name": "Sprint Planning", - "note": "Planning the next 2-week sprint", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-25T00:00:00Z", - "end_date": "1969-12-25T02:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441210", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441211", - "name": "All Hands Meeting", - "note": "Monthly all hands company meeting", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-17T00:00:00Z", - "end_date": "1969-12-17T01:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441212", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441213", - "name": "Design Review - Mobile App", - "note": "Design review session for the new mobile app interface.\n\nJoin Zoom Meeting\nhttps://zoom.us/j/123456789?pwd=abc123\nMeeting ID: 123 456 789\nPasscode: design123\n\nAttendees:\n- Sarah Johnson (Design Lead)\n- Mike Chen (Product Manager)\n- Alex Rivera (Developer)", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1970-01-01T16:00:00Z", - "end_date": "1970-01-01T17:00:00Z", - "google_event_url": "https://zoom.us/j/123456789?pwd=abc123", - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441214", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441215", - "name": "Quick Sync - Project Alpha", - "note": "Brief sync on Project Alpha progress and blockers", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1970-01-01T18:00:00Z", - "end_date": "1970-01-01T18:15:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441216", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441217", - "name": "Sprint Retrospective", - "note": "Sprint 23 Retrospective Meeting\n\nAgenda:\n- What went well?\n- What could be improved?\n- Action items for next sprint\n\nMicrosoft Teams Meeting\nhttps://teams.microsoft.com/l/meetup-join/meeting123", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1970-01-01T20:00:00Z", - "end_date": "1970-01-01T21:00:00Z", - "google_event_url": "https://teams.microsoft.com/l/meetup-join/meeting123", - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441218", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441219", - "name": "Client Demo - Acme Corp", - "note": "Product demonstration for Acme Corp\n\nDemo Flow:\n1. Dashboard overview\n2. New features showcase\n3. Q&A session\n4. Next steps discussion\n\nGoogle Meet\nhttps://meet.google.com/abc-defg-hij\nPhone: +1 555-0123", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-26T00:00:00Z", - "end_date": "1969-12-26T01:30:00Z", - "google_event_url": "https://meet.google.com/abc-defg-hij", - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441220", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441221", - "name": "UX Workshop - User Journey Mapping", - "note": "Interactive workshop on mapping user journeys and identifying pain points in our product", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-26T00:00:00Z", - "end_date": "1969-12-26T03:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441222", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441223", - "name": "Technical Interview - Senior Developer", - "note": "Technical interview for Senior Software Developer position\n\nCandidate: Jordan Martinez\nRole: Senior Full-Stack Developer\n\nInterview Plan:\n- System design discussion (30 min)\n- Coding challenge (45 min)\n- Behavioral questions (15 min)\n\nZoom Meeting\nhttps://zoom.us/j/987654321?pwd=interview123", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-22T00:00:00Z", - "end_date": "1969-12-22T01:30:00Z", - "google_event_url": "https://zoom.us/j/987654321?pwd=interview123", - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441224", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441225", - "name": "Board Meeting - Q3 Review", - "note": "Quarterly board meeting to review Q3 performance and discuss Q4 strategy", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-20T00:00:00Z", - "end_date": "1969-12-20T02:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441226", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441227", - "name": "Security Training - OWASP Best Practices", - "note": "Company-wide security training session\n\nTopics:\n- OWASP Top 10 vulnerabilities\n- Secure coding practices\n- Incident response procedures\n- Security tools overview\n\nWebEx Meeting\nhttps://company.webex.com/meet/security.training\nMeeting Number: 2468013579", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-18T00:00:00Z", - "end_date": "1969-12-18T02:00:00Z", - "google_event_url": "https://company.webex.com/meet/security.training", - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441228", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441229", - "name": "Tech Conference 2024", - "note": "Annual technology conference - attending sessions on AI, cloud architecture, and emerging technologies", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-10T00:00:00Z", - "end_date": "1969-12-12T00:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441230", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441231", - "name": "Follow-up Discussion", - "note": "Follow-up on yesterday's decisions", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-31T00:00:00Z", - "end_date": "1969-12-31T00:30:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441232", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441233", - "name": "Project Kickoff", - "note": "Initial meeting for Project Phoenix", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-25T00:00:00Z", - "end_date": "1969-12-25T01:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441234", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441235", - "name": "Q3 Strategy Meeting", - "note": "Quarterly planning session", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-22T00:00:00Z", - "end_date": "1969-12-22T02:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - }, - { - "id": "550e8400-e29b-41d4-a716-446655441236", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655441237", - "name": "Random Thoughts", - "note": "Random thoughts session", - "calendar_id": "550e8400-e29b-41d4-a716-446655441100", - "start_date": "1969-12-18T00:00:00Z", - "end_date": "1969-12-18T01:00:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - } - ], - "sessions": [ - { - "id": "a1ee4374-7e80-4c5c-b7db-5247e9662126", - "title": "Recurring Product Meeting 2", - "created_at": "1970-01-03T00:00:01Z", - "visited_at": "1970-01-03T00:00:01Z", - "calendar_event_id": null, - "raw_memo_html": "
  • test
  • ", - "enhanced_memo_html": "
  • test
  • ", - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "08fc2a61-e54b-4310-92b7-efa45b7344c5", - "title": "Recurring Product Meeting 1", - "created_at": "1970-01-02T00:00:01Z", - "visited_at": "1970-01-02T00:00:01Z", - "calendar_event_id": null, - "raw_memo_html": "
  • test
  • ", - "enhanced_memo_html": "
  • test
  • ", - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442000", - "title": "Daily Standup Prep", - "created_at": "1970-01-01T00:00:01Z", - "visited_at": "1970-01-01T00:00:01Z", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655441200", - "raw_memo_html": "

    Agenda

    \n
      \n
    • Sprint progress update
    • \n
    • Blockers discussion
    • \n
    \n

    Notes

    \n
      \n
    • Remember to mention API delay
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442001", - "title": "Team Review Planning", - "created_at": "1970-01-01T00:00:02Z", - "visited_at": "1970-01-01T00:00:02Z", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655441202", - "raw_memo_html": "

    Topics to Cover

    \n
      \n
    • Q3 performance review
    • \n
    • Team feedback
    • \n
    • Next quarter planning
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442002", - "title": "Product Roadmap Discussion Notes", - "created_at": "1970-01-01T00:00:03Z", - "visited_at": "1970-01-01T00:00:03Z", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655441206", - "raw_memo_html": "

    Key Features

    \n
      \n
    • User authentication
    • \n
    • Dashboard redesign
    • \n
    \n

    Timeline

    \n
      \n
    • Q1 2024 launch target
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442003", - "title": "Sprint Planning Preparation", - "created_at": "1970-01-01T00:00:04Z", - "visited_at": "1970-01-01T00:00:04Z", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655441208", - "raw_memo_html": "

    Sprint Goals

    \n
      \n
    • Complete user story X
    • \n
    • Fix critical bugs
    • \n
    \n

    Resources

    \n
      \n
    • 2 developers, 1 designer
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442004", - "title": "Follow-up Discussion Notes", - "created_at": "1970-01-01T00:00:05Z", - "visited_at": "1970-01-01T00:00:05Z", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655441230", - "raw_memo_html": "

    Decisions Made

    \n
      \n
    • Proceed with Plan A
    • \n
    • Allocate additional resources
    • \n
    \n

    Next Steps

    \n
      \n
    • Schedule follow-up in 2 weeks
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442005", - "title": "Project Phoenix Kickoff", - "created_at": "1970-01-01T00:00:06Z", - "visited_at": "1970-01-01T00:00:06Z", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655441232", - "raw_memo_html": "

    Project Goals

    \n
      \n
    • Launch by Q4
    • \n
    • Target 10k users
    • \n
    \n

    Risks

    \n
      \n
    • Resource constraints
    • \n
    • Technical challenges
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442006", - "title": "Q3 Strategy Session", - "created_at": "1970-01-01T00:00:07Z", - "visited_at": "1970-01-01T00:00:07Z", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655441234", - "raw_memo_html": "

    Key Metrics

    \n
      \n
    • Revenue growth: 25%
    • \n
    • User acquisition: 15%
    • \n
    \n

    Focus Areas

    \n
      \n
    • Product optimization
    • \n
    • Market expansion
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442007", - "title": "Quick Ideas", - "created_at": "1970-01-01T00:00:08Z", - "visited_at": "1970-01-01T00:00:08Z", - "calendar_event_id": null, - "raw_memo_html": "

    Random Thoughts

    \n
      \n
    • New feature idea: dark mode
    • \n
    • Bug: login form validation
    • \n
    • Todo: Update documentation
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442008", - "title": "Personal Notes", - "created_at": "1970-01-01T00:00:09Z", - "visited_at": "1970-01-01T00:00:09Z", - "calendar_event_id": null, - "raw_memo_html": "

    Personal Reminders

    \n
      \n
    • Call dentist
    • \n
    • Review insurance policy
    • \n
    • Book vacation
    • \n
    ", - "enhanced_memo_html": "

    Personal Reminders

    \n
      \n
    • Call dentist ✓
    • \n
    • Review insurance policy
    • \n
    • Book vacation
    • \n
    ", - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442009", - "title": "Week Review", - "created_at": "1970-01-01T00:00:10Z", - "visited_at": "1970-01-01T00:00:10Z", - "calendar_event_id": null, - "raw_memo_html": "", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442010", - "title": "Old Ideas", - "created_at": "1970-01-01T00:00:11Z", - "visited_at": "1970-01-01T00:00:11Z", - "calendar_event_id": null, - "raw_memo_html": "

    Brainstorming

    \n
      \n
    • App redesign concepts
    • \n
    • User experience improvements
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "550e8400-e29b-41d4-a716-446655442011", - "title": "Archived Notes", - "created_at": "1970-01-01T00:00:12Z", - "visited_at": "1970-01-01T00:00:12Z", - "calendar_event_id": null, - "raw_memo_html": "

    Historical Notes

    \n
      \n
    • Old project ideas
    • \n
    • Archive for reference
    • \n
    ", - "enhanced_memo_html": null, - "words": [], - "user_id": "{{ CURRENT_USER_ID }}", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - } - ], - "tags": [ - { - "id": "550e8400-e29b-41d4-a716-446655443000", - "name": "Customer" - }, - { - "id": "550e8400-e29b-41d4-a716-446655443001", - "name": "Product" - } - ] -} diff --git a/plugins/db/seed/onboarding.json b/plugins/db/seed/onboarding.json deleted file mode 100644 index a0c81424b5..0000000000 --- a/plugins/db/seed/onboarding.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "$schema": "./schema.json", - "organizations": [ - { - "id": "550e8400-e29b-41d4-a716-446655440000", - "name": "Fastrepl", - "description": "https://github.com/fastrepl" - } - ], - "humans": [ - { - "id": "550e8400-e29b-41d4-a716-446655440001", - "full_name": "John Jeong", - "email": "john@hyprnote.com", - "organization_id": "550e8400-e29b-41d4-a716-446655440000", - "is_user": false, - "job_title": null, - "linkedin_username": "johntopia" - }, - { - "id": "550e8400-e29b-41d4-a716-446655440002", - "full_name": "Yujong Lee", - "email": "yujonglee@hyprnote.com", - "organization_id": "550e8400-e29b-41d4-a716-446655440000", - "is_user": false, - "job_title": null, - "linkedin_username": "yujong1ee" - }, - { - "id": "550e8400-e29b-41d4-a716-446655440004", - "full_name": "Duck Lee", - "email": "duck@hyprnote.com", - "organization_id": "550e8400-e29b-41d4-a716-446655440000", - "is_user": false, - "job_title": null, - "linkedin_username": null - } - ], - "calendars": [ - { - "id": "550e8400-e29b-41d4-a716-446655440010", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655440011", - "name": "Default", - "platform": "Apple", - "selected": false, - "source": null - } - ], - "events": [ - { - "id": "550e8400-e29b-41d4-a716-446655440020", - "user_id": "{{ CURRENT_USER_ID }}", - "tracking_id": "550e8400-e29b-41d4-a716-446655440021", - "name": "Welcome to Hyprnote", - "note": "", - "calendar_id": "550e8400-e29b-41d4-a716-446655440010", - "start_date": "1970-01-01T00:03:00Z", - "end_date": "1970-01-01T00:10:00Z", - "google_event_url": null, - "participants": null, - "is_recurring": false - } - ], - "sessions": [ - { - "id": "df1d8c52-6d9d-4471-aff1-5dbd35899cbe", - "title": "Welcome to Hyprnote", - "raw_memo_html": "ONBOARDING_RAW_HTML_CONTENT", - "enhanced_memo_html": null, - "words": [], - "created_at": "1970-01-01T00:00:00Z", - "visited_at": "1970-01-01T00:00:00Z", - "user_id": "{{ CURRENT_USER_ID }}", - "calendar_event_id": "550e8400-e29b-41d4-a716-446655440020", - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - }, - { - "id": "872cf207-6a28-4229-bd66-492d0dce43c0", - "title": "Thank you", - "raw_memo_html": "", - "enhanced_memo_html": null, - "words": [], - "created_at": "1970-01-01T00:00:00Z", - "visited_at": "1970-01-01T00:00:00Z", - "user_id": "{{ CURRENT_USER_ID }}", - "calendar_event_id": null, - "record_start": null, - "record_end": null, - "pre_meeting_memo_html": null - } - ], - "tags": [] -} diff --git a/plugins/db/seed/schema.json b/plugins/db/seed/schema.json deleted file mode 100644 index 900e9f349b..0000000000 --- a/plugins/db/seed/schema.json +++ /dev/null @@ -1,578 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "SeedData", - "type": "object", - "required": [ - "calendars", - "events", - "humans", - "organizations", - "sessions", - "tags" - ], - "properties": { - "organizations": { - "type": "array", - "items": { - "$ref": "#/definitions/Organization" - } - }, - "humans": { - "type": "array", - "items": { - "$ref": "#/definitions/Human" - } - }, - "calendars": { - "type": "array", - "items": { - "$ref": "#/definitions/Calendar" - } - }, - "events": { - "type": "array", - "items": { - "$ref": "#/definitions/Event" - } - }, - "sessions": { - "type": "array", - "items": { - "$ref": "#/definitions/Session" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "config": { - "anyOf": [ - { - "$ref": "#/definitions/Config" - }, - { - "type": "null" - } - ] - } - }, - "definitions": { - "Organization": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": [ - "string", - "null" - ] - } - } - }, - "Human": { - "type": "object", - "required": [ - "id", - "is_user" - ], - "properties": { - "id": { - "type": "string" - }, - "organization_id": { - "type": [ - "string", - "null" - ] - }, - "is_user": { - "type": "boolean" - }, - "full_name": { - "type": [ - "string", - "null" - ] - }, - "email": { - "type": [ - "string", - "null" - ] - }, - "job_title": { - "type": [ - "string", - "null" - ] - }, - "linkedin_username": { - "type": [ - "string", - "null" - ] - } - } - }, - "Calendar": { - "type": "object", - "required": [ - "id", - "name", - "platform", - "selected", - "tracking_id", - "user_id" - ], - "properties": { - "id": { - "type": "string" - }, - "tracking_id": { - "type": "string" - }, - "user_id": { - "type": "string" - }, - "platform": { - "$ref": "#/definitions/Platform" - }, - "name": { - "type": "string" - }, - "selected": { - "type": "boolean" - }, - "source": { - "type": [ - "string", - "null" - ] - } - } - }, - "Platform": { - "type": "string", - "enum": [ - "Apple", - "Google", - "Outlook" - ] - }, - "Event": { - "type": "object", - "required": [ - "end_date", - "id", - "is_recurring", - "name", - "note", - "start_date", - "tracking_id", - "user_id" - ], - "properties": { - "id": { - "type": "string" - }, - "user_id": { - "type": "string" - }, - "tracking_id": { - "type": "string" - }, - "calendar_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "note": { - "type": "string" - }, - "start_date": { - "type": "string", - "format": "date-time" - }, - "end_date": { - "type": "string", - "format": "date-time" - }, - "google_event_url": { - "type": [ - "string", - "null" - ] - }, - "participants": { - "type": [ - "string", - "null" - ] - }, - "is_recurring": { - "type": "boolean" - } - } - }, - "Session": { - "type": "object", - "required": [ - "created_at", - "id", - "raw_memo_html", - "title", - "user_id", - "visited_at", - "words" - ], - "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "visited_at": { - "type": "string", - "format": "date-time" - }, - "user_id": { - "type": "string" - }, - "calendar_event_id": { - "type": [ - "string", - "null" - ] - }, - "title": { - "type": "string" - }, - "raw_memo_html": { - "type": "string" - }, - "enhanced_memo_html": { - "type": [ - "string", - "null" - ] - }, - "words": { - "type": "array", - "items": { - "$ref": "#/definitions/Word2" - } - }, - "record_start": { - "type": [ - "string", - "null" - ], - "format": "date-time" - }, - "record_end": { - "type": [ - "string", - "null" - ], - "format": "date-time" - }, - "pre_meeting_memo_html": { - "type": [ - "string", - "null" - ] - } - } - }, - "Word2": { - "type": "object", - "required": [ - "text" - ], - "properties": { - "text": { - "type": "string" - }, - "speaker": { - "anyOf": [ - { - "$ref": "#/definitions/SpeakerIdentity" - }, - { - "type": "null" - } - ] - }, - "confidence": { - "type": [ - "number", - "null" - ], - "format": "float" - }, - "start_ms": { - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 0.0 - }, - "end_ms": { - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 0.0 - } - }, - "additionalProperties": false - }, - "SpeakerIdentity": { - "oneOf": [ - { - "type": "object", - "required": [ - "type", - "value" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "unassigned" - ] - }, - "value": { - "type": "object", - "required": [ - "index" - ], - "properties": { - "index": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "type", - "value" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "assigned" - ] - }, - "value": { - "type": "object", - "required": [ - "id", - "label" - ], - "properties": { - "id": { - "type": "string" - }, - "label": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Tag": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "Config": { - "type": "object", - "required": [ - "ai", - "general", - "id", - "notification", - "user_id" - ], - "properties": { - "id": { - "type": "string" - }, - "user_id": { - "type": "string" - }, - "general": { - "$ref": "#/definitions/ConfigGeneral" - }, - "notification": { - "$ref": "#/definitions/ConfigNotification" - }, - "ai": { - "$ref": "#/definitions/ConfigAI" - } - } - }, - "ConfigGeneral": { - "type": "object", - "required": [ - "autostart", - "display_language", - "telemetry_consent" - ], - "properties": { - "autostart": { - "type": "boolean" - }, - "display_language": { - "type": "string", - "pattern": "^[a-zA-Z]{2}$" - }, - "spoken_languages": { - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Language" - } - }, - "jargons": { - "default": [], - "type": "array", - "items": { - "type": "string" - } - }, - "telemetry_consent": { - "type": "boolean" - }, - "save_recordings": { - "type": [ - "boolean", - "null" - ] - }, - "selected_template_id": { - "type": [ - "string", - "null" - ] - }, - "summary_language": { - "default": "en", - "type": "string", - "pattern": "^[a-zA-Z]{2}$" - } - } - }, - "Language": { - "type": "object", - "required": [ - "iso639" - ], - "properties": { - "iso639": { - "type": "string", - "pattern": "^[a-zA-Z]{2}$" - } - } - }, - "ConfigNotification": { - "type": "object", - "required": [ - "auto", - "before" - ], - "properties": { - "before": { - "type": "boolean" - }, - "auto": { - "type": "boolean" - }, - "ignoredPlatforms": { - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - } - } - }, - "ConfigAI": { - "type": "object", - "properties": { - "api_base": { - "type": [ - "string", - "null" - ] - }, - "api_key": { - "type": [ - "string", - "null" - ] - }, - "ai_specificity": { - "type": [ - "integer", - "null" - ], - "format": "uint8", - "minimum": 0.0 - }, - "redemption_time_ms": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - } - } - } - } -} \ No newline at end of file diff --git a/plugins/db/src/commands/calendars.rs b/plugins/db/src/commands/calendars.rs deleted file mode 100644 index b1babd700f..0000000000 --- a/plugins/db/src/commands/calendars.rs +++ /dev/null @@ -1,77 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_calendar( - state: tauri::State<'_, crate::ManagedState>, - calendar_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.get_calendar(&calendar_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_calendars( - state: tauri::State<'_, crate::ManagedState>, - user_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_calendars(&user_id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn upsert_calendar( - state: tauri::State<'_, crate::ManagedState>, - calendar: hypr_db_user::Calendar, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.upsert_calendar(calendar) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn toggle_calendar_selected( - state: tauri::State<'_, crate::ManagedState>, - tracking_id: String, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.toggle_calendar_selected(tracking_id) - .await - .map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/chats.rs b/plugins/db/src/commands/chats.rs deleted file mode 100644 index 9f001febee..0000000000 --- a/plugins/db/src/commands/chats.rs +++ /dev/null @@ -1,97 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_chat_groups( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_chat_groups(session_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_chat_messages( - state: tauri::State<'_, crate::ManagedState>, - group_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_chat_messages(group_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn create_chat_group( - state: tauri::State<'_, crate::ManagedState>, - group: hypr_db_user::ChatGroup, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.create_chat_group(group).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn upsert_chat_message( - state: tauri::State<'_, crate::ManagedState>, - message: hypr_db_user::ChatMessage, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.upsert_chat_message(message) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn delete_chat_messages( - state: tauri::State<'_, crate::ManagedState>, - group_id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.delete_chat_messages(group_id) - .await - .map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/chats_v2.rs b/plugins/db/src/commands/chats_v2.rs deleted file mode 100644 index 3f5e3aecf3..0000000000 --- a/plugins/db/src/commands/chats_v2.rs +++ /dev/null @@ -1,102 +0,0 @@ -use hypr_db_user::{ChatConversation, ChatMessageV2}; - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn create_conversation( - state: tauri::State<'_, crate::ManagedState>, - conversation: ChatConversation, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.create_conversation(conversation) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_conversations( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_conversations(session_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn create_message_v2( - state: tauri::State<'_, crate::ManagedState>, - message: ChatMessageV2, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.create_message_v2(message) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_messages_v2( - state: tauri::State<'_, crate::ManagedState>, - conversation_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_messages_v2(conversation_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn update_message_v2_parts( - state: tauri::State<'_, crate::ManagedState>, - id: String, - parts: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.update_message_v2_parts(id, parts) - .await - .map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/configs.rs b/plugins/db/src/commands/configs.rs deleted file mode 100644 index 1f93fefa0d..0000000000 --- a/plugins/db/src/commands/configs.rs +++ /dev/null @@ -1,54 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_config( - state: tauri::State<'_, crate::ManagedState>, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - let user_id = guard - .user_id - .as_ref() - .ok_or(crate::Error::NoneUser) - .map_err(|e| e.to_string())?; - - let config = db.get_config(user_id).await.map_err(|e| e.to_string())?; - - match config { - Some(config) => Ok(config), - None => { - let config = hypr_db_user::Config { - id: uuid::Uuid::new_v4().to_string(), - user_id: user_id.clone(), - general: hypr_db_user::ConfigGeneral::default(), - notification: hypr_db_user::ConfigNotification::default(), - ai: hypr_db_user::ConfigAI::default(), - }; - Ok(config) - } - } -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn set_config( - state: tauri::State<'_, crate::ManagedState>, - config: hypr_db_user::Config, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.set_config(config).await.map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/events.rs b/plugins/db/src/commands/events.rs deleted file mode 100644 index 3bf0175bd5..0000000000 --- a/plugins/db/src/commands/events.rs +++ /dev/null @@ -1,35 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_event( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.get_event(id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_events( - state: tauri::State<'_, crate::ManagedState>, - filter: Option, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_events(filter).await.map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/humans.rs b/plugins/db/src/commands/humans.rs deleted file mode 100644 index 7efab02524..0000000000 --- a/plugins/db/src/commands/humans.rs +++ /dev/null @@ -1,71 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_human( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.get_human(id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn delete_human( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.delete_human(id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn upsert_human( - state: tauri::State<'_, crate::ManagedState>, - human: hypr_db_user::Human, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.upsert_human(human).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_humans( - state: tauri::State<'_, crate::ManagedState>, - filter: Option, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_humans(filter).await.map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/mod.rs b/plugins/db/src/commands/mod.rs deleted file mode 100644 index 57141d09c3..0000000000 --- a/plugins/db/src/commands/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub mod calendars; -pub mod chats; -pub mod chats_v2; -pub mod configs; -pub mod events; -pub mod humans; -pub mod organizations; -pub mod sessions; -pub mod tags; -pub mod templates; diff --git a/plugins/db/src/commands/organizations.rs b/plugins/db/src/commands/organizations.rs deleted file mode 100644 index ecca8484ac..0000000000 --- a/plugins/db/src/commands/organizations.rs +++ /dev/null @@ -1,115 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_organizations( - state: tauri::State<'_, crate::ManagedState>, - filter: Option, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_organizations(filter) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn delete_organization( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.delete_organization(id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_organization_members( - state: tauri::State<'_, crate::ManagedState>, - organization_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_organization_members(organization_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_organization( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.get_organization(id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_organization_by_user_id( - state: tauri::State<'_, crate::ManagedState>, - user_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.get_organization_by_user_id(user_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn upsert_organization( - state: tauri::State<'_, crate::ManagedState>, - organization: hypr_db_user::Organization, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.upsert_organization(organization) - .await - .map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/sessions.rs b/plugins/db/src/commands/sessions.rs deleted file mode 100644 index 55934f0df0..0000000000 --- a/plugins/db/src/commands/sessions.rs +++ /dev/null @@ -1,265 +0,0 @@ -use hypr_db_user::UserDatabase; - -#[tauri::command] -#[specta::specta] -pub async fn thank_you_session_id() -> Result { - let id = UserDatabase::thank_you_session_id(); - Ok(id) -} - -#[tauri::command] -#[specta::specta] -pub async fn onboarding_session_id() -> Result { - let id = UserDatabase::onboarding_session_id(); - Ok(id) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_words_onboarding( - state: tauri::State<'_, crate::ManagedState>, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - let v = db.get_words_onboarding().await.map_err(|e| e.to_string())?; - Ok(v) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn session_list_deleted_participant_ids( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.session_list_deleted_participant_ids(session_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_words( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - let v = db.get_words(session_id).await.map_err(|e| e.to_string())?; - Ok(v) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn upsert_session( - state: tauri::State<'_, crate::ManagedState>, - session: hypr_db_user::Session, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.upsert_session(session).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_sessions( - state: tauri::State<'_, crate::ManagedState>, - filter: Option, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_sessions(filter).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn get_session( - state: tauri::State<'_, crate::ManagedState>, - filter: hypr_db_user::GetSessionFilter, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.get_session(filter).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn visit_session( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.visit_session(id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn delete_session( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.delete_session(id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn set_session_event( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, - event_id: Option, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.session_set_event(session_id, event_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn session_add_participant( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, - human_id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.session_add_participant(session_id, human_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn session_remove_participant( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, - human_id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.session_remove_participant(session_id, human_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn session_list_participants( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.session_list_participants(session_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn session_get_event( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.session_get_event(session_id) - .await - .map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/tags.rs b/plugins/db/src/commands/tags.rs deleted file mode 100644 index c12d12099c..0000000000 --- a/plugins/db/src/commands/tags.rs +++ /dev/null @@ -1,114 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_all_tags( - state: tauri::State<'_, crate::ManagedState>, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_all_tags().await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_session_tags( - state: tauri::State<'_, crate::ManagedState>, - session_id: String, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.list_session_tags(session_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn assign_tag_to_session( - state: tauri::State<'_, crate::ManagedState>, - tag_id: String, - session_id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.assign_tag_to_session(tag_id, session_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn unassign_tag_from_session( - state: tauri::State<'_, crate::ManagedState>, - tag_id: String, - session_id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.unassign_tag_from_session(tag_id, session_id) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn upsert_tag( - state: tauri::State<'_, crate::ManagedState>, - tag: hypr_db_user::Tag, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.upsert_tag(tag).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn delete_tag( - state: tauri::State<'_, crate::ManagedState>, - tag_id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.delete_tag(tag_id).await.map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/commands/templates.rs b/plugins/db/src/commands/templates.rs deleted file mode 100644 index 4fd34c500c..0000000000 --- a/plugins/db/src/commands/templates.rs +++ /dev/null @@ -1,60 +0,0 @@ -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn list_templates( - state: tauri::State<'_, crate::ManagedState>, -) -> Result, String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - let user_id = guard - .user_id - .as_ref() - .ok_or(crate::Error::NoneUser) - .map_err(|e| e.to_string())?; - - db.list_templates(user_id).await.map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn upsert_template( - state: tauri::State<'_, crate::ManagedState>, - template: hypr_db_user::Template, -) -> Result { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.upsert_template(template) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -#[specta::specta] -#[tracing::instrument(skip(state))] -pub async fn delete_template( - state: tauri::State<'_, crate::ManagedState>, - id: String, -) -> Result<(), String> { - let guard = state.lock().await; - - let db = guard - .db - .as_ref() - .ok_or(crate::Error::NoneDatabase) - .map_err(|e| e.to_string())?; - - db.delete_template(id).await.map_err(|e| e.to_string()) -} diff --git a/plugins/db/src/error.rs b/plugins/db/src/error.rs deleted file mode 100644 index 4b8d0eaf59..0000000000 --- a/plugins/db/src/error.rs +++ /dev/null @@ -1,26 +0,0 @@ -use serde::{Serialize, ser::Serializer}; - -pub type Result = std::result::Result; - -#[derive(Debug, thiserror::Error)] -pub enum Error { - #[error("user is None")] - NoneUser, - #[error("database is None")] - NoneDatabase, - #[error(transparent)] - TauriError(#[from] tauri::Error), - #[error(transparent)] - DatabaseCoreError(#[from] hypr_db_core::Error), - #[error(transparent)] - IoError(#[from] std::io::Error), -} - -impl Serialize for Error { - fn serialize(&self, serializer: S) -> std::result::Result - where - S: Serializer, - { - serializer.serialize_str(self.to_string().as_ref()) - } -} diff --git a/plugins/db/src/ext.rs b/plugins/db/src/ext.rs deleted file mode 100644 index 3a138da5b7..0000000000 --- a/plugins/db/src/ext.rs +++ /dev/null @@ -1,131 +0,0 @@ -pub struct Database<'a, R: tauri::Runtime, M: tauri::Manager> { - manager: &'a M, - _runtime: std::marker::PhantomData R>, -} - -impl<'a, R: tauri::Runtime, M: tauri::Manager> Database<'a, R, M> { - pub async fn user_id(&self) -> Result, crate::Error> { - let state = self.manager.state::(); - let guard = state.lock().await; - Ok(guard.user_id.clone()) - } - - pub fn local_path(&self) -> Result { - use tauri::path::BaseDirectory; - let v = { - let dir = self - .manager - .path() - .resolve("hyprnote", BaseDirectory::Data)?; - std::fs::create_dir_all(&dir)?; - - dir.join("db.sqlite").to_str().unwrap().to_string() - }; - - tracing::info!(path = %v, "local_db"); - Ok(v) - } - - pub async fn attach(&self, db: hypr_db_core::Database) -> Result<(), crate::Error> { - let state = self.manager.state::(); - let mut s = state.lock().await; - - let user_db = hypr_db_user::UserDatabase::from(db); - hypr_db_user::migrate(&user_db).await?; - - s.db = Some(user_db); - - Ok(()) - } - - pub async fn sync(&self) -> Result<(), crate::Error> { - let state = self.manager.state::(); - let guard = state.lock().await; - - let db = guard.db.as_ref().ok_or(crate::Error::NoneDatabase)?; - db.sync().await?; - Ok(()) - } - - pub async fn ensure_user(&self, user_id: impl Into) -> Result { - let state = self.manager.state::(); - let mut guard = state.lock().await; - - let user_id_string = user_id.into(); - guard.user_id = Some(user_id_string.clone()); - - let db = guard.db.as_ref().ok_or(crate::Error::NoneDatabase)?; - - match db.get_human(&user_id_string).await? { - Some(_) => Ok(false), - None => { - let human = hypr_db_user::Human { - id: user_id_string, - is_user: true, - organization_id: None, - full_name: None, - email: None, - job_title: None, - linkedin_username: None, - }; - - db.upsert_human(human).await?; - Ok(true) - } - } - } - - pub async fn get_session( - &self, - session_id: impl Into, - ) -> Result, crate::Error> { - let state = self.manager.state::(); - let guard = state.lock().await; - - let db = guard.db.as_ref().ok_or(crate::Error::NoneDatabase)?; - let session = db - .get_session(hypr_db_user::GetSessionFilter::Id(session_id.into())) - .await?; - Ok(session) - } - - pub async fn upsert_session(&self, session: hypr_db_user::Session) -> Result<(), crate::Error> { - let state = self.manager.state::(); - let guard = state.lock().await; - - let db = guard.db.as_ref().ok_or(crate::Error::NoneDatabase)?; - db.upsert_session(session).await?; - - Ok(()) - } - - pub async fn get_config( - &self, - user_id: impl Into, - ) -> Result, crate::Error> { - let state = self.manager.state::(); - let guard = state.lock().await; - - let db = guard.db.as_ref().ok_or(crate::Error::NoneDatabase)?; - let config = db.get_config(user_id.into()).await?; - Ok(config) - } -} - -pub trait DatabasePluginExt { - fn db(&self) -> Database<'_, R, Self> - where - Self: tauri::Manager + Sized; -} - -impl> DatabasePluginExt for T { - fn db(&self) -> Database<'_, R, Self> - where - Self: Sized, - { - Database { - manager: self, - _runtime: std::marker::PhantomData, - } - } -} diff --git a/plugins/db/src/lib.rs b/plugins/db/src/lib.rs deleted file mode 100644 index ceecaf571b..0000000000 --- a/plugins/db/src/lib.rs +++ /dev/null @@ -1,126 +0,0 @@ -use tauri::Manager; -use tokio::sync::Mutex; - -mod commands; -mod error; -mod ext; - -pub use error::{Error, Result}; -pub use ext::{Database, DatabasePluginExt}; -pub use hypr_db_user::UserDatabase; - -pub type ManagedState = Mutex; - -#[derive(Default)] -pub struct State { - pub user_id: Option, - pub db: Option, -} - -const PLUGIN_NAME: &str = "db"; - -fn make_specta_builder() -> tauri_specta::Builder { - tauri_specta::Builder::::new() - .plugin_name(PLUGIN_NAME) - .commands(tauri_specta::collect_commands![ - commands::events::get_event, - commands::events::list_events, - commands::calendars::get_calendar, - commands::calendars::list_calendars, - commands::calendars::upsert_calendar, - commands::calendars::toggle_calendar_selected, - commands::sessions::upsert_session, - commands::sessions::visit_session, - commands::templates::list_templates, - commands::templates::upsert_template, - commands::templates::delete_template, - commands::sessions::onboarding_session_id, - commands::sessions::thank_you_session_id, - commands::sessions::list_sessions, - commands::sessions::delete_session, - commands::sessions::get_session, - commands::sessions::set_session_event, - commands::sessions::session_add_participant, - commands::sessions::session_list_deleted_participant_ids, - commands::sessions::session_remove_participant, - commands::sessions::session_list_participants, - commands::sessions::session_get_event, - commands::sessions::get_words, - commands::sessions::get_words_onboarding, - commands::configs::get_config, - commands::configs::set_config, - commands::humans::get_human, - commands::humans::upsert_human, - commands::humans::list_humans, - commands::humans::delete_human, - commands::organizations::get_organization, - commands::organizations::delete_organization, - commands::organizations::get_organization_by_user_id, - commands::organizations::upsert_organization, - commands::organizations::list_organizations, - commands::organizations::list_organization_members, - commands::chats::list_chat_groups, - commands::chats::list_chat_messages, - commands::chats::create_chat_group, - commands::chats::upsert_chat_message, - commands::chats::delete_chat_messages, - commands::tags::list_all_tags, - commands::tags::list_session_tags, - commands::tags::assign_tag_to_session, - commands::tags::unassign_tag_from_session, - commands::tags::upsert_tag, - commands::tags::delete_tag, - commands::chats_v2::create_conversation, - commands::chats_v2::list_conversations, - commands::chats_v2::create_message_v2, - commands::chats_v2::list_messages_v2, - commands::chats_v2::update_message_v2_parts, - ]) - .error_handling(tauri_specta::ErrorHandlingMode::Result) -} - -pub fn init() -> tauri::plugin::TauriPlugin { - let specta_builder = make_specta_builder(); - - tauri::plugin::Builder::new(PLUGIN_NAME) - .invoke_handler(specta_builder.invoke_handler()) - .setup(|app, _api| { - app.manage(ManagedState::default()); - Ok(()) - }) - .build() -} - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn export_types() { - const OUTPUT_FILE: &str = "./js/bindings.gen.ts"; - - make_specta_builder::() - .export( - specta_typescript::Typescript::default() - .formatter(specta_typescript::formatter::prettier) - .bigint(specta_typescript::BigIntExportBehavior::Number), - OUTPUT_FILE, - ) - .unwrap(); - - let content = std::fs::read_to_string(OUTPUT_FILE).unwrap(); - std::fs::write(OUTPUT_FILE, format!("// @ts-nocheck\n{content}")).unwrap(); - } - - fn create_app(builder: tauri::Builder) -> tauri::App { - builder - .plugin(init()) - .build(tauri::test::mock_context(tauri::test::noop_assets())) - .unwrap() - } - - #[test] - fn test_db() { - let _app = create_app(tauri::test::mock_builder()); - } -} diff --git a/plugins/db/tsconfig.json b/plugins/db/tsconfig.json deleted file mode 100644 index 13b985325d..0000000000 --- a/plugins/db/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "include": ["./js/*.ts"], - "exclude": ["node_modules"] -} diff --git a/plugins/notification/Cargo.toml b/plugins/notification/Cargo.toml index c80b7b6072..c48ccad13d 100644 --- a/plugins/notification/Cargo.toml +++ b/plugins/notification/Cargo.toml @@ -21,7 +21,6 @@ hypr-intercept = { workspace = true } hypr-notification = { workspace = true, features = ["legacy"] } tauri-plugin-analytics = { workspace = true } -tauri-plugin-db = { workspace = true } tauri-plugin-dialog = { workspace = true } tauri-plugin-listener = { workspace = true } tauri-plugin-windows = { workspace = true }