Compare commits

..

1 Commits

Author SHA1 Message Date
164c4a8d38 chore(deps): update dependency eslint-config-prettier to v10
Some checks failed
FanslySync Build & Test / FanslySync Test Runner (push) Failing after 22m41s
2025-04-30 01:19:39 +00:00
12 changed files with 453 additions and 1054 deletions

View File

@ -10,13 +10,7 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .", "lint": "prettier --check . && eslint .",
"format": "prettier --write .", "format": "prettier --write .",
"tauri": "tauri", "tauri": "tauri"
"build_prod": "tauri build",
"publish": "npm run build_prod && npm run publish:makedraft && npm run publish:upload && npm run pubish:publishcn",
"publish_nobuild": "npm run publish:makedraft && npm run publish:upload && npm run pubish:publishcn",
"publish:makedraft": "cn release draft fansly-creator-bot/fansly-sync --framework tauri",
"publish:upload": "cn release upload fansly-creator-bot/fansly-sync --framework tauri",
"pubish:publishcn": "cn release publish fansly-creator-bot/fansly-sync --framework tauri"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-auto": "^3.2.5", "@sveltejs/adapter-auto": "^3.2.5",
@ -27,7 +21,7 @@
"@types/eslint": "^9.6.1", "@types/eslint": "^9.6.1",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"eslint": "^9.12.0", "eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^10.0.0",
"eslint-plugin-svelte": "^2.44.1", "eslint-plugin-svelte": "^2.44.1",
"globals": "^15.10.0", "globals": "^15.10.0",
"postcss": "^8.4.47", "postcss": "^8.4.47",
@ -50,8 +44,7 @@
"@tauri-apps/plugin-log": "^2.0.1", "@tauri-apps/plugin-log": "^2.0.1",
"@tauri-apps/plugin-notification": "^2.0.0", "@tauri-apps/plugin-notification": "^2.0.0",
"@tauri-apps/plugin-os": "^2.0.0", "@tauri-apps/plugin-os": "^2.0.0",
"@tauri-apps/plugin-process": "^2.2.1", "@tauri-apps/plugin-updater": "^2.0.0",
"@tauri-apps/plugin-updater": "^2.7.1",
"svelte-french-toast": "^1.2.0" "svelte-french-toast": "^1.2.0"
} }
} }

11
src-tauri/Cargo.lock generated
View File

@ -108,7 +108,6 @@ dependencies = [
"tauri-plugin-log", "tauri-plugin-log",
"tauri-plugin-notification", "tauri-plugin-notification",
"tauri-plugin-os", "tauri-plugin-os",
"tauri-plugin-process",
"tauri-plugin-single-instance", "tauri-plugin-single-instance",
"tauri-plugin-updater", "tauri-plugin-updater",
"thiserror 2.0.12", "thiserror 2.0.12",
@ -4848,16 +4847,6 @@ dependencies = [
"thiserror 2.0.12", "thiserror 2.0.12",
] ]
[[package]]
name = "tauri-plugin-process"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57da5888533e802b6206b9685091f8714aa1f5266dc80051a82388449558b773"
dependencies = [
"tauri",
"tauri-plugin",
]
[[package]] [[package]]
name = "tauri-plugin-single-instance" name = "tauri-plugin-single-instance"
version = "2.2.3" version = "2.2.3"

View File

@ -24,14 +24,13 @@ lazy_static = "1.5.0"
tokio = { version = "1.29.1", features = ["full"] } tokio = { version = "1.29.1", features = ["full"] }
tokio-macros = "2.3.0" tokio-macros = "2.3.0"
tauri-plugin-os = { version = "2.2.1" } tauri-plugin-os = { version = "2.2.1" }
tauri-plugin-dialog = "2.2.1" tauri-plugin-dialog = { version = "2.2.1" }
tauri-plugin-clipboard-manager = { version = "2.2.1" } tauri-plugin-clipboard-manager = { version = "2.2.1" }
tauri-plugin-notification = { version = "2.2.1" } tauri-plugin-notification = { version = "2.2.1" }
tauri-plugin-updater = "2.2.1" tauri-plugin-updater = { version = "2.2.1" }
tauri-plugin-log = { version = "2.2.1" } tauri-plugin-log = { version = "2.2.1" }
log = "0.4.27" log = "0.4.27"
thiserror = "2.0.12" thiserror = "2.0.12"
tauri-plugin-process = "2"
[features] [features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled. # this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
@ -42,4 +41,3 @@ custom-protocol = ["tauri/custom-protocol"]
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-autostart = "2.3.0" tauri-plugin-autostart = "2.3.0"
tauri-plugin-single-instance = "2" tauri-plugin-single-instance = "2"
tauri-plugin-updater = "2"

View File

@ -1,37 +1,32 @@
{ {
"identifier": "migrated", "identifier": "migrated",
"description": "permissions that were migrated from v1", "description": "permissions that were migrated from v1",
"local": true, "local": true,
"windows": [ "windows": ["main"],
"main" "permissions": [
], "core:default",
"permissions": [ "dialog:allow-message",
"core:default", "dialog:allow-ask",
"dialog:allow-message", "dialog:allow-confirm",
"dialog:allow-ask", "notification:default",
"dialog:allow-confirm", "os:allow-platform",
"notification:default", "os:allow-version",
"os:allow-platform", "os:allow-os-type",
"os:allow-version", "os:allow-family",
"os:allow-os-type", "os:allow-arch",
"os:allow-family", "os:allow-exe-extension",
"os:allow-arch", "os:allow-locale",
"os:allow-exe-extension", "os:allow-hostname",
"os:allow-locale", "clipboard-manager:allow-read-text",
"os:allow-hostname", "clipboard-manager:allow-write-text",
"clipboard-manager:allow-read-text", "core:app:allow-app-show",
"clipboard-manager:allow-write-text", "core:app:allow-app-hide",
"core:app:allow-app-show", "os:default",
"core:app:allow-app-hide", "dialog:default",
"os:default", "clipboard-manager:default",
"dialog:default", "notification:default",
"clipboard-manager:default", "updater:default",
"notification:default", "log:default",
"updater:default", "autostart:default"
"log:default", ]
"autostart:default", }
"process:default",
"process:allow-restart",
"process:default"
]
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","notification:default","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","os:default","dialog:default","clipboard-manager:default","notification:default","updater:default","log:default","autostart:default","process:default","process:allow-restart","process:default"]}} {"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","notification:default","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","os:default","dialog:default","clipboard-manager:default","notification:default","updater:default","log:default","autostart:default"]}}

View File

@ -2564,36 +2564,6 @@
"const": "os:deny-version", "const": "os:deny-version",
"markdownDescription": "Denies the version command without any pre-configured scope." "markdownDescription": "Denies the version command without any pre-configured scope."
}, },
{
"description": "This permission set configures which\nprocess features are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n\n#### This default permission set includes:\n\n- `allow-exit`\n- `allow-restart`",
"type": "string",
"const": "process:default",
"markdownDescription": "This permission set configures which\nprocess features are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n\n#### This default permission set includes:\n\n- `allow-exit`\n- `allow-restart`"
},
{
"description": "Enables the exit command without any pre-configured scope.",
"type": "string",
"const": "process:allow-exit",
"markdownDescription": "Enables the exit command without any pre-configured scope."
},
{
"description": "Enables the restart command without any pre-configured scope.",
"type": "string",
"const": "process:allow-restart",
"markdownDescription": "Enables the restart command without any pre-configured scope."
},
{
"description": "Denies the exit command without any pre-configured scope.",
"type": "string",
"const": "process:deny-exit",
"markdownDescription": "Denies the exit command without any pre-configured scope."
},
{
"description": "Denies the restart command without any pre-configured scope.",
"type": "string",
"const": "process:deny-restart",
"markdownDescription": "Denies the restart command without any pre-configured scope."
},
{ {
"description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`", "description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`",
"type": "string", "type": "string",

File diff suppressed because it is too large Load Diff

View File

@ -2564,36 +2564,6 @@
"const": "os:deny-version", "const": "os:deny-version",
"markdownDescription": "Denies the version command without any pre-configured scope." "markdownDescription": "Denies the version command without any pre-configured scope."
}, },
{
"description": "This permission set configures which\nprocess features are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n\n#### This default permission set includes:\n\n- `allow-exit`\n- `allow-restart`",
"type": "string",
"const": "process:default",
"markdownDescription": "This permission set configures which\nprocess features are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n\n#### This default permission set includes:\n\n- `allow-exit`\n- `allow-restart`"
},
{
"description": "Enables the exit command without any pre-configured scope.",
"type": "string",
"const": "process:allow-exit",
"markdownDescription": "Enables the exit command without any pre-configured scope."
},
{
"description": "Enables the restart command without any pre-configured scope.",
"type": "string",
"const": "process:allow-restart",
"markdownDescription": "Enables the restart command without any pre-configured scope."
},
{
"description": "Denies the exit command without any pre-configured scope.",
"type": "string",
"const": "process:deny-exit",
"markdownDescription": "Denies the exit command without any pre-configured scope."
},
{
"description": "Denies the restart command without any pre-configured scope.",
"type": "string",
"const": "process:deny-restart",
"markdownDescription": "Denies the restart command without any pre-configured scope."
},
{ {
"description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`", "description": "This permission set configures which kind of\nupdater functions are exposed to the frontend.\n\n#### Granted Permissions\n\nThe full workflow from checking for updates to installing them\nis enabled.\n\n\n#### This default permission set includes:\n\n- `allow-check`\n- `allow-download`\n- `allow-install`\n- `allow-download-and-install`",
"type": "string", "type": "string",

View File

@ -57,7 +57,6 @@ fn handle_menu(app: &tauri::AppHandle, event: &tauri::menu::MenuEvent) {
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_process::init())
.setup(|app| { .setup(|app| {
// Setup menu items for the tray // Setup menu items for the tray
let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?; let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;

View File

@ -47,11 +47,9 @@
"plugins": { "plugins": {
"updater": { "updater": {
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJFODZGRDI4NjBFMDQ1RUMKUldUc1JlQmdLUDJHTGdRdSt6dWFISXE0MThsa0tvUDA2RWdMSStjQ0J6NVBhdmU4ajRMMms4a1cK", "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJFODZGRDI4NjBFMDQ1RUMKUldUc1JlQmdLUDJHTGdRdSt6dWFISXE0MThsa0tvUDA2RWdMSStjQ0J6NVBhdmU4ajRMMms4a1cK",
"active": true,
"endpoints": [ "endpoints": [
"https://cdn.crabnebula.app/update/fansly-creator-bot/fansly-sync/{{target}}-{{arch}}/{{current_version}}" "https://cdn.crabnebula.app/update/fansly-creator-bot/fansly-sync/{{target}}-{{arch}}/{{current_version}}"
], ]
"dialog": true
} }
}, },
"app": { "app": {

View File

@ -97,15 +97,9 @@
); );
if (uploadErr) { if (uploadErr) {
error('[AutoSync] Upload failed'); error('[AutoSync] Upload failed');
sendNotification({ sendNotification({ title: 'Auto Sync Failed', body: `Retry at ${nextTime}` });
title: 'Auto Sync Failed',
body: `We failed to upload your data. ${uploadErr}. We will try again in ${config.sync_interval} hours.`
});
} else { } else {
sendNotification({ sendNotification({ title: 'Auto Sync Successful', body: `Next at ${nextTime}` });
title: 'Auto Sync Successful',
body: `Your data has been uploaded successfully. Next sync will be at ${nextTime}.`
});
} }
} }
@ -177,13 +171,7 @@
async function enableAutoSync() { async function enableAutoSync() {
if (!(await isEnabled())) { if (!(await isEnabled())) {
const confirm = await ask( const confirm = await ask('Enable auto-start?');
"We've detected that auto-start is disabled. It's required for auto-sync to work. Do you want to enable it?",
{
title: 'Auto Sync Setup',
kind: 'info'
}
);
if (!confirm) return; if (!confirm) return;
await toast.promise(enable(), { await toast.promise(enable(), {
loading: 'Enabling...', loading: 'Enabling...',
@ -191,11 +179,7 @@
error: 'Failed' error: 'Failed'
}); });
} }
if (!config?.sync_token) if (!config?.sync_token) return message('Set a sync token first.', { kind: 'error' });
return message('Set a sync token first.', {
kind: 'error',
title: 'Auto Sync Setup | Error'
});
config!.auto_sync_enabled = !config.auto_sync_enabled; config!.auto_sync_enabled = !config.auto_sync_enabled;
await saveConfig(); await saveConfig();
config.auto_sync_enabled ? scheduleAutoSync() : syncInterval && clearInterval(syncInterval); config.auto_sync_enabled ? scheduleAutoSync() : syncInterval && clearInterval(syncInterval);
@ -323,8 +307,8 @@
</span> </span>
</div> </div>
<p class="text-zinc-400 mb-4"> <p class="text-zinc-400 mb-4">
Your data will be automatically synced to your configured Discord server every {config?.sync_interval} We'll automatically sync your data {config?.sync_interval}
{config?.sync_interval === 1 ? 'hour' : 'hours'} {config?.sync_interval === 1 ? 'hour' : 'hours'} to your configured discord server.
</p> </p>
<div class="flex space-x-4"> <div class="flex space-x-4">
<button <button