chore: update deps
This commit is contained in:
38
package.json
38
package.json
@@ -15,19 +15,19 @@
|
|||||||
"@radix-ui/react-dialog": "^1.1.1",
|
"@radix-ui/react-dialog": "^1.1.1",
|
||||||
"@radix-ui/react-progress": "^1.1.0",
|
"@radix-ui/react-progress": "^1.1.0",
|
||||||
"@radix-ui/react-scroll-area": "^1.1.0",
|
"@radix-ui/react-scroll-area": "^1.1.0",
|
||||||
"@tanstack/react-query": "^5.51.23",
|
"@tanstack/react-query": "^5.56.2",
|
||||||
"@tanstack/react-router": "^1.48.1",
|
"@tanstack/react-router": "^1.57.13",
|
||||||
"@tauri-apps/api": "^2.0.0-rc.1",
|
"@tauri-apps/api": "2.0.0-rc.4",
|
||||||
"@tauri-apps/plugin-clipboard-manager": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-clipboard-manager": "2.0.0-rc.1",
|
||||||
"@tauri-apps/plugin-dialog": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-dialog": "2.0.0-rc.1",
|
||||||
"@tauri-apps/plugin-fs": "^2.0.0-rc.1",
|
"@tauri-apps/plugin-fs": "2.0.0-rc.2",
|
||||||
"@tauri-apps/plugin-notification": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-notification": "2.0.0-rc.1",
|
||||||
"@tauri-apps/plugin-os": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-os": "2.0.0-rc.1",
|
||||||
"@tauri-apps/plugin-process": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-process": "2.0.0-rc.1",
|
||||||
"@tauri-apps/plugin-shell": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-shell": "2.0.0-rc.1",
|
||||||
"@tauri-apps/plugin-updater": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-updater": "2.0.0-rc.2",
|
||||||
"dayjs": "^1.11.12",
|
"dayjs": "^1.11.13",
|
||||||
"lru-cache": "^11.0.0",
|
"lru-cache": "^11.0.1",
|
||||||
"minidenticons": "^4.2.1",
|
"minidenticons": "^4.2.1",
|
||||||
"nostr-tools": "^2.7.2",
|
"nostr-tools": "^2.7.2",
|
||||||
"react": "19.0.0-rc-d025ddd3-20240722",
|
"react": "19.0.0-rc-d025ddd3-20240722",
|
||||||
@@ -37,20 +37,20 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.8.3",
|
"@biomejs/biome": "1.8.3",
|
||||||
"@tanstack/router-plugin": "^1.47.0",
|
"@tanstack/router-plugin": "^1.57.13",
|
||||||
"@tauri-apps/cli": "^2.0.0-rc.4",
|
"@tauri-apps/cli": "2.0.0-rc.13",
|
||||||
"@types/react": "npm:types-react@19.0.0-rc.1",
|
"@types/react": "npm:types-react@19.0.0-rc.1",
|
||||||
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
|
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
|
||||||
"@vitejs/plugin-react": "^4.3.1",
|
"@vitejs/plugin-react": "^4.3.1",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"babel-plugin-react-compiler": "0.0.0-experimental-696af53-20240625",
|
"babel-plugin-react-compiler": "0.0.0-experimental-696af53-20240625",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"postcss": "^8.4.41",
|
"postcss": "^8.4.45",
|
||||||
"tailwind-gradient-mask-image": "^1.2.0",
|
"tailwind-gradient-mask-image": "^1.2.0",
|
||||||
"tailwind-merge": "^2.5.2",
|
"tailwind-merge": "^2.5.2",
|
||||||
"tailwindcss": "^3.4.10",
|
"tailwindcss": "^3.4.11",
|
||||||
"typescript": "^5.5.4",
|
"typescript": "^5.6.2",
|
||||||
"vite": "^5.4.1",
|
"vite": "^5.4.5",
|
||||||
"vite-tsconfig-paths": "^4.3.2"
|
"vite-tsconfig-paths": "^4.3.2"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|||||||
1070
pnpm-lock.yaml
generated
1070
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
614
src-tauri/Cargo.lock
generated
614
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@ tauri-build = { version = "2.0.0-rc", features = [] }
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", features = [
|
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", features = [
|
||||||
"sqlite",
|
"lmdb",
|
||||||
] }
|
] }
|
||||||
tauri = { version = "2.0.0-rc", features = [
|
tauri = { version = "2.0.0-rc", features = [
|
||||||
"tray-icon",
|
"tray-icon",
|
||||||
@@ -32,13 +32,13 @@ tauri-plugin-updater = "2.0.0-rc"
|
|||||||
tauri-plugin-process = "2.0.0-rc"
|
tauri-plugin-process = "2.0.0-rc"
|
||||||
tauri-plugin-fs = "2.0.0-rc"
|
tauri-plugin-fs = "2.0.0-rc"
|
||||||
tauri-plugin-notification = "2.0.0-rc"
|
tauri-plugin-notification = "2.0.0-rc"
|
||||||
tauri-plugin-decorum = "1.0.0"
|
tauri-plugin-decorum = "1.1.0"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
keyring = { version = "3", features = [
|
keyring = { version = "3", features = [
|
||||||
"apple-native",
|
"apple-native",
|
||||||
"windows-native",
|
"windows-native",
|
||||||
"sync-secret-service",
|
"linux-native",
|
||||||
] }
|
] }
|
||||||
keyring-search = "1.2.0"
|
keyring-search = "1.2.0"
|
||||||
itertools = "0.13.0"
|
itertools = "0.13.0"
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ pub async fn connect_account(uri: String, state: State<'_, Nostr>) -> Result<Str
|
|||||||
Ok(bunker_uri) => {
|
Ok(bunker_uri) => {
|
||||||
// Local user
|
// Local user
|
||||||
let app_keys = Keys::generate();
|
let app_keys = Keys::generate();
|
||||||
let app_secret = app_keys.secret_key().to_string();
|
let app_secret = app_keys.secret_key().to_secret_hex();
|
||||||
|
|
||||||
// Get remote user
|
// Get remote user
|
||||||
let remote_user = bunker_uri.signer_public_key().unwrap();
|
let remote_user = bunker_uri.signer_public_key().unwrap();
|
||||||
@@ -275,7 +275,7 @@ pub async fn login(
|
|||||||
{
|
{
|
||||||
if let Some(event) = events.into_iter().next() {
|
if let Some(event) = events.into_iter().next() {
|
||||||
let urls = event
|
let urls = event
|
||||||
.tags()
|
.tags
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|tag| {
|
.filter_map(|tag| {
|
||||||
if let Some(TagStandard::Relay(relay)) = tag.as_standardized() {
|
if let Some(TagStandard::Relay(relay)) = tag.as_standardized() {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ pub async fn get_chats(state: State<'_, Nostr>) -> Result<Vec<String>, String> {
|
|||||||
|
|
||||||
let filter = Filter::new().kind(Kind::PrivateDirectMessage).pubkey(public_key);
|
let filter = Filter::new().kind(Kind::PrivateDirectMessage).pubkey(public_key);
|
||||||
|
|
||||||
match client.database().query(vec![filter], Order::Asc).await {
|
match client.database().query(vec![filter]).await {
|
||||||
Ok(events) => {
|
Ok(events) => {
|
||||||
let ev = events
|
let ev = events
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@@ -44,7 +44,7 @@ pub async fn get_chat_messages(id: String, state: State<'_, Nostr>) -> Result<Ve
|
|||||||
let sender_filter =
|
let sender_filter =
|
||||||
Filter::new().kind(Kind::PrivateDirectMessage).author(receiver).pubkey(sender);
|
Filter::new().kind(Kind::PrivateDirectMessage).author(receiver).pubkey(sender);
|
||||||
|
|
||||||
match client.database().query(vec![recv_filter, sender_filter], Order::Desc).await {
|
match client.database().query(vec![recv_filter, sender_filter]).await {
|
||||||
Ok(events) => {
|
Ok(events) => {
|
||||||
let ev = events.into_iter().map(|ev| ev.as_json()).collect::<Vec<_>>();
|
let ev = events.into_iter().map(|ev| ev.as_json()).collect::<Vec<_>>();
|
||||||
Ok(ev)
|
Ok(ev)
|
||||||
|
|||||||
@@ -8,32 +8,6 @@ use tauri::{Manager, State};
|
|||||||
|
|
||||||
use crate::Nostr;
|
use crate::Nostr;
|
||||||
|
|
||||||
async fn connect_nip65_relays(public_key: PublicKey, client: &Client) -> Vec<String> {
|
|
||||||
let filter = Filter::new().author(public_key).kind(Kind::RelayList).limit(1);
|
|
||||||
let mut relay_list: Vec<String> = Vec::new();
|
|
||||||
|
|
||||||
if let Ok(events) =
|
|
||||||
client.get_events_of(vec![filter], EventSource::relays(Some(Duration::from_secs(3)))).await
|
|
||||||
{
|
|
||||||
if let Some(event) = events.first() {
|
|
||||||
for (url, ..) in nip65::extract_relay_list(event) {
|
|
||||||
let _ = client.add_relay(url).await;
|
|
||||||
relay_list.push(url.to_string())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
relay_list
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn disconnect_nip65_relays(relays: Vec<String>, client: &Client) {
|
|
||||||
for relay in relays.iter() {
|
|
||||||
if let Err(e) = client.disconnect_relay(relay).await {
|
|
||||||
println!("Disconnect failed: {}", e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
#[specta::specta]
|
#[specta::specta]
|
||||||
pub fn get_bootstrap_relays(app: tauri::AppHandle) -> Result<Vec<String>, String> {
|
pub fn get_bootstrap_relays(app: tauri::AppHandle) -> Result<Vec<String>, String> {
|
||||||
@@ -75,7 +49,7 @@ pub async fn collect_inbox_relays(
|
|||||||
Ok(events) => {
|
Ok(events) => {
|
||||||
if let Some(event) = events.into_iter().next() {
|
if let Some(event) = events.into_iter().next() {
|
||||||
let urls = event
|
let urls = event
|
||||||
.tags()
|
.tags
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|tag| {
|
.filter_map(|tag| {
|
||||||
if let Some(TagStandard::Relay(relay)) = tag.as_standardized() {
|
if let Some(TagStandard::Relay(relay)) = tag.as_standardized() {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ use std::{
|
|||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
use tauri::{async_runtime::Mutex, Manager};
|
use tauri::{async_runtime::Mutex, Manager};
|
||||||
#[cfg(not(target_os = "linux"))]
|
|
||||||
use tauri_plugin_decorum::WebviewWindowExt;
|
use tauri_plugin_decorum::WebviewWindowExt;
|
||||||
use tauri_specta::{collect_commands, Builder};
|
use tauri_specta::{collect_commands, Builder};
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ fn main() {
|
|||||||
let main_window = app.get_webview_window("main").unwrap();
|
let main_window = app.get_webview_window("main").unwrap();
|
||||||
|
|
||||||
// Set custom decoration
|
// Set custom decoration
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(not(target_os = "macos"))]
|
||||||
main_window.create_overlay_titlebar().unwrap();
|
main_window.create_overlay_titlebar().unwrap();
|
||||||
|
|
||||||
// Set traffic light inset
|
// Set traffic light inset
|
||||||
@@ -97,11 +96,13 @@ fn main() {
|
|||||||
|
|
||||||
let (client, bootstrap_relays) = tauri::async_runtime::block_on(async move {
|
let (client, bootstrap_relays) = tauri::async_runtime::block_on(async move {
|
||||||
// Create data folder if not exist
|
// Create data folder if not exist
|
||||||
let dir = handle.path().app_config_dir().expect("App config directory not found.");
|
let dir =
|
||||||
let _ = fs::create_dir_all(dir.clone());
|
handle.path().app_config_dir().expect("Error: config directory not found.");
|
||||||
|
let _ = fs::create_dir_all(&dir);
|
||||||
|
|
||||||
// Setup database
|
// Setup database
|
||||||
let database = SQLiteDatabase::open(dir.join("nostr.db")).await.expect("Error.");
|
let database = NostrLMDB::open(dir.join("nostr-lmdb"))
|
||||||
|
.expect("Error: cannot create database.");
|
||||||
|
|
||||||
// Setup nostr client
|
// Setup nostr client
|
||||||
let opts = Options::new()
|
let opts = Options::new()
|
||||||
@@ -131,7 +132,7 @@ fn main() {
|
|||||||
} else {
|
} else {
|
||||||
RelayOptions::new().write(true).read(false)
|
RelayOptions::new().write(true).read(false)
|
||||||
};
|
};
|
||||||
let _ = client.add_relay_with_opts(relay, opts).await;
|
let _ = client.pool().add_relay(relay, opts).await;
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
println!("Connecting to relay...: {}", relay);
|
println!("Connecting to relay...: {}", relay);
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ type __EventObj__<T> = {
|
|||||||
once: (
|
once: (
|
||||||
cb: TAURI_API_EVENT.EventCallback<T>,
|
cb: TAURI_API_EVENT.EventCallback<T>,
|
||||||
) => ReturnType<typeof TAURI_API_EVENT.once<T>>;
|
) => ReturnType<typeof TAURI_API_EVENT.once<T>>;
|
||||||
emit: T extends null
|
emit: null extends T
|
||||||
? (payload?: T) => ReturnType<typeof TAURI_API_EVENT.emit>
|
? (payload?: T) => ReturnType<typeof TAURI_API_EVENT.emit>
|
||||||
: (payload: T) => ReturnType<typeof TAURI_API_EVENT.emit>;
|
: (payload: T) => ReturnType<typeof TAURI_API_EVENT.emit>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -196,21 +196,140 @@ declare module '@tanstack/react-router' {
|
|||||||
|
|
||||||
// Create and export the route tree
|
// Create and export the route tree
|
||||||
|
|
||||||
export const routeTree = rootRoute.addChildren({
|
interface AccountChatsLazyRouteChildren {
|
||||||
IndexRoute,
|
AccountChatsIdRoute: typeof AccountChatsIdRoute
|
||||||
BootstrapRelaysRoute,
|
AccountChatsNewLazyRoute: typeof AccountChatsNewLazyRoute
|
||||||
NewLazyRoute,
|
}
|
||||||
ResetLazyRoute,
|
|
||||||
AccountContactsRoute,
|
const AccountChatsLazyRouteChildren: AccountChatsLazyRouteChildren = {
|
||||||
AccountRelaysRoute,
|
AccountChatsIdRoute: AccountChatsIdRoute,
|
||||||
AuthConnectRoute,
|
AccountChatsNewLazyRoute: AccountChatsNewLazyRoute,
|
||||||
AuthImportRoute,
|
}
|
||||||
AuthNewRoute,
|
|
||||||
AccountChatsLazyRoute: AccountChatsLazyRoute.addChildren({
|
const AccountChatsLazyRouteWithChildren =
|
||||||
AccountChatsIdRoute,
|
AccountChatsLazyRoute._addFileChildren(AccountChatsLazyRouteChildren)
|
||||||
AccountChatsNewLazyRoute,
|
|
||||||
}),
|
export interface FileRoutesByFullPath {
|
||||||
})
|
'/': typeof IndexRoute
|
||||||
|
'/bootstrap-relays': typeof BootstrapRelaysRoute
|
||||||
|
'/new': typeof NewLazyRoute
|
||||||
|
'/reset': typeof ResetLazyRoute
|
||||||
|
'/$account/contacts': typeof AccountContactsRoute
|
||||||
|
'/$account/relays': typeof AccountRelaysRoute
|
||||||
|
'/auth/connect': typeof AuthConnectRoute
|
||||||
|
'/auth/import': typeof AuthImportRoute
|
||||||
|
'/auth/new': typeof AuthNewRoute
|
||||||
|
'/$account/chats': typeof AccountChatsLazyRouteWithChildren
|
||||||
|
'/$account/chats/$id': typeof AccountChatsIdRoute
|
||||||
|
'/$account/chats/new': typeof AccountChatsNewLazyRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FileRoutesByTo {
|
||||||
|
'/': typeof IndexRoute
|
||||||
|
'/bootstrap-relays': typeof BootstrapRelaysRoute
|
||||||
|
'/new': typeof NewLazyRoute
|
||||||
|
'/reset': typeof ResetLazyRoute
|
||||||
|
'/$account/contacts': typeof AccountContactsRoute
|
||||||
|
'/$account/relays': typeof AccountRelaysRoute
|
||||||
|
'/auth/connect': typeof AuthConnectRoute
|
||||||
|
'/auth/import': typeof AuthImportRoute
|
||||||
|
'/auth/new': typeof AuthNewRoute
|
||||||
|
'/$account/chats': typeof AccountChatsLazyRouteWithChildren
|
||||||
|
'/$account/chats/$id': typeof AccountChatsIdRoute
|
||||||
|
'/$account/chats/new': typeof AccountChatsNewLazyRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FileRoutesById {
|
||||||
|
__root__: typeof rootRoute
|
||||||
|
'/': typeof IndexRoute
|
||||||
|
'/bootstrap-relays': typeof BootstrapRelaysRoute
|
||||||
|
'/new': typeof NewLazyRoute
|
||||||
|
'/reset': typeof ResetLazyRoute
|
||||||
|
'/$account/contacts': typeof AccountContactsRoute
|
||||||
|
'/$account/relays': typeof AccountRelaysRoute
|
||||||
|
'/auth/connect': typeof AuthConnectRoute
|
||||||
|
'/auth/import': typeof AuthImportRoute
|
||||||
|
'/auth/new': typeof AuthNewRoute
|
||||||
|
'/$account/chats': typeof AccountChatsLazyRouteWithChildren
|
||||||
|
'/$account/chats/$id': typeof AccountChatsIdRoute
|
||||||
|
'/$account/chats/new': typeof AccountChatsNewLazyRoute
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FileRouteTypes {
|
||||||
|
fileRoutesByFullPath: FileRoutesByFullPath
|
||||||
|
fullPaths:
|
||||||
|
| '/'
|
||||||
|
| '/bootstrap-relays'
|
||||||
|
| '/new'
|
||||||
|
| '/reset'
|
||||||
|
| '/$account/contacts'
|
||||||
|
| '/$account/relays'
|
||||||
|
| '/auth/connect'
|
||||||
|
| '/auth/import'
|
||||||
|
| '/auth/new'
|
||||||
|
| '/$account/chats'
|
||||||
|
| '/$account/chats/$id'
|
||||||
|
| '/$account/chats/new'
|
||||||
|
fileRoutesByTo: FileRoutesByTo
|
||||||
|
to:
|
||||||
|
| '/'
|
||||||
|
| '/bootstrap-relays'
|
||||||
|
| '/new'
|
||||||
|
| '/reset'
|
||||||
|
| '/$account/contacts'
|
||||||
|
| '/$account/relays'
|
||||||
|
| '/auth/connect'
|
||||||
|
| '/auth/import'
|
||||||
|
| '/auth/new'
|
||||||
|
| '/$account/chats'
|
||||||
|
| '/$account/chats/$id'
|
||||||
|
| '/$account/chats/new'
|
||||||
|
id:
|
||||||
|
| '__root__'
|
||||||
|
| '/'
|
||||||
|
| '/bootstrap-relays'
|
||||||
|
| '/new'
|
||||||
|
| '/reset'
|
||||||
|
| '/$account/contacts'
|
||||||
|
| '/$account/relays'
|
||||||
|
| '/auth/connect'
|
||||||
|
| '/auth/import'
|
||||||
|
| '/auth/new'
|
||||||
|
| '/$account/chats'
|
||||||
|
| '/$account/chats/$id'
|
||||||
|
| '/$account/chats/new'
|
||||||
|
fileRoutesById: FileRoutesById
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RootRouteChildren {
|
||||||
|
IndexRoute: typeof IndexRoute
|
||||||
|
BootstrapRelaysRoute: typeof BootstrapRelaysRoute
|
||||||
|
NewLazyRoute: typeof NewLazyRoute
|
||||||
|
ResetLazyRoute: typeof ResetLazyRoute
|
||||||
|
AccountContactsRoute: typeof AccountContactsRoute
|
||||||
|
AccountRelaysRoute: typeof AccountRelaysRoute
|
||||||
|
AuthConnectRoute: typeof AuthConnectRoute
|
||||||
|
AuthImportRoute: typeof AuthImportRoute
|
||||||
|
AuthNewRoute: typeof AuthNewRoute
|
||||||
|
AccountChatsLazyRoute: typeof AccountChatsLazyRouteWithChildren
|
||||||
|
}
|
||||||
|
|
||||||
|
const rootRouteChildren: RootRouteChildren = {
|
||||||
|
IndexRoute: IndexRoute,
|
||||||
|
BootstrapRelaysRoute: BootstrapRelaysRoute,
|
||||||
|
NewLazyRoute: NewLazyRoute,
|
||||||
|
ResetLazyRoute: ResetLazyRoute,
|
||||||
|
AccountContactsRoute: AccountContactsRoute,
|
||||||
|
AccountRelaysRoute: AccountRelaysRoute,
|
||||||
|
AuthConnectRoute: AuthConnectRoute,
|
||||||
|
AuthImportRoute: AuthImportRoute,
|
||||||
|
AuthNewRoute: AuthNewRoute,
|
||||||
|
AccountChatsLazyRoute: AccountChatsLazyRouteWithChildren,
|
||||||
|
}
|
||||||
|
|
||||||
|
export const routeTree = rootRoute
|
||||||
|
._addFileChildren(rootRouteChildren)
|
||||||
|
._addFileTypes<FileRouteTypes>()
|
||||||
|
|
||||||
/* prettier-ignore-end */
|
/* prettier-ignore-end */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user