update to tauri v2-rc, update rust version, frontend now uses tauri_plugin_log
This commit is contained in:
parent
af7afe9a54
commit
c6afae6cb6
152
package-lock.json
generated
152
package-lock.json
generated
@ -8,14 +8,20 @@
|
|||||||
"name": "fanslysync-desktop",
|
"name": "fanslysync-desktop",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^1.6.0"
|
"@tauri-apps/api": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-clipboard-manager": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-dialog": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-log": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-notification": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-os": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-updater": "^2.0.0-rc.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-auto": "^3.0.0",
|
"@sveltejs/adapter-auto": "^3.0.0",
|
||||||
"@sveltejs/adapter-static": "^3.0.2",
|
"@sveltejs/adapter-static": "^3.0.2",
|
||||||
"@sveltejs/kit": "^2.0.0",
|
"@sveltejs/kit": "^2.0.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||||
"@tauri-apps/cli": "^1.6.0",
|
"@tauri-apps/cli": "^2.0.0-rc.0",
|
||||||
"@types/eslint": "^8.56.7",
|
"@types/eslint": "^8.56.7",
|
||||||
"autoprefixer": "^10.4.19",
|
"autoprefixer": "^10.4.19",
|
||||||
"eslint": "^9.0.0",
|
"eslint": "^9.0.0",
|
||||||
@ -1000,11 +1006,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/api": {
|
"node_modules/@tauri-apps/api": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/api/-/api-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/api/-/api-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-rqI++FWClU5I2UBp4HXFvl+sBWkdigBkxnpJDQUWttNyG7IZP4FwQGhTNL5EOw0vI8i6eSAJ5frLqO7n7jbJdg==",
|
"integrity": "sha512-v454Qs3REHc3Za59U+/eSmBsdmF+3NE5+76+lFDaitVqN4ZglDHENDaMARYKGJVZuxiSkzyqG0SeG7lLQjVkPA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 14.6.0",
|
"node": ">= 18.18",
|
||||||
"npm": ">= 6.6.0",
|
"npm": ">= 6.6.0",
|
||||||
"yarn": ">= 1.19.1"
|
"yarn": ">= 1.19.1"
|
||||||
},
|
},
|
||||||
@ -1014,9 +1020,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli": {
|
"node_modules/@tauri-apps/cli": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli/-/cli-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli/-/cli-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-DBBpBl6GhTzm8ImMbKkfaZ4fDTykWrC7Q5OXP4XqD91recmDEn2LExuvuiiS3HYe7uP8Eb5B9NPHhqJb+Zo7qQ==",
|
"integrity": "sha512-X9N/R7e3zeTpU0HgQi2kaNYncMFoSTzXstnUyGOcKrJcCkR4ebbA2nYqhGvIPfglLKHNFRTZwfPNhixx2Ftxxg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tauri": "tauri.js"
|
"tauri": "tauri.js"
|
||||||
@ -1029,22 +1035,22 @@
|
|||||||
"url": "https://opencollective.com/tauri"
|
"url": "https://opencollective.com/tauri"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@tauri-apps/cli-darwin-arm64": "1.6.0",
|
"@tauri-apps/cli-darwin-arm64": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-darwin-x64": "1.6.0",
|
"@tauri-apps/cli-darwin-x64": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-linux-arm-gnueabihf": "1.6.0",
|
"@tauri-apps/cli-linux-arm-gnueabihf": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-linux-arm64-gnu": "1.6.0",
|
"@tauri-apps/cli-linux-arm64-gnu": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-linux-arm64-musl": "1.6.0",
|
"@tauri-apps/cli-linux-arm64-musl": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-linux-x64-gnu": "1.6.0",
|
"@tauri-apps/cli-linux-x64-gnu": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-linux-x64-musl": "1.6.0",
|
"@tauri-apps/cli-linux-x64-musl": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-win32-arm64-msvc": "1.6.0",
|
"@tauri-apps/cli-win32-arm64-msvc": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-win32-ia32-msvc": "1.6.0",
|
"@tauri-apps/cli-win32-ia32-msvc": "2.0.0-rc.0",
|
||||||
"@tauri-apps/cli-win32-x64-msvc": "1.6.0"
|
"@tauri-apps/cli-win32-x64-msvc": "2.0.0-rc.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-darwin-arm64": {
|
"node_modules/@tauri-apps/cli-darwin-arm64": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-SNRwUD9nqGxY47mbY1CGTt/jqyQOU7Ps7Mx/mpgahL0FVUDiCEY/5L9QfEPPhEgccgcelEVn7i6aQHIkHyUtCA==",
|
"integrity": "sha512-jpQc++6ESFUuBpoXvJNPTRtrmToMIByOynZ4K5SAwI9RkKUikSaDmlRZV0GisOVPT7TT08khk7MPtAQeFyjqwA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@ -1058,9 +1064,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-darwin-x64": {
|
"node_modules/@tauri-apps/cli-darwin-x64": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-g2/uDR/eeH2arvuawA4WwaEOqv/7jDO/ZLNI3JlBjP5Pk8GGb3Kdy0ro1xQzF94mtk2mOnOXa4dMgAet4sUJ1A==",
|
"integrity": "sha512-EnqsgcNUwH29YjQ4JdBID5kILQQdIJgZ36VQgtju/BBvnd1lr+6Bswdk1/4y41hhAVz9WyHeMCnTH33CSKvNxw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@ -1074,9 +1080,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-linux-arm-gnueabihf": {
|
"node_modules/@tauri-apps/cli-linux-arm-gnueabihf": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-EVwf4oRkQyG8BpSrk0gqO7oA0sDM2MdNDtJpMfleYFEgCxLIOGZKNqaOW3M7U+0Y4qikmG3TtRK+ngc8Ymtrjg==",
|
"integrity": "sha512-YKg/qThAmQYRToiV8lx/DvMf0VaUJAutIfv8ALq9Or4zdg7mZlAlKvF+7lZQQRmKhQ62+0gnoJS2HyN8feaagw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@ -1090,9 +1096,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-linux-arm64-gnu": {
|
"node_modules/@tauri-apps/cli-linux-arm64-gnu": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-YdpY17cAySrhK9dX4BUVEmhAxE2o+6skIEFg8iN/xrDwRxhaNPI9I80YXPatUTX54Kx55T5++25VJG9+3iw83A==",
|
"integrity": "sha512-UnflWuNhH/u41GSmG1jm6qhWUM4o1AB463QCaf2fAjLo5GWiI78U6rJOOXZvOOmWIQuzsmAUZjNDORWW13+osA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@ -1106,9 +1112,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-linux-arm64-musl": {
|
"node_modules/@tauri-apps/cli-linux-arm64-musl": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-4U628tuf2U8pMr4tIBJhEkrFwt+46dwhXrDlpdyWSZtnop5RJAVKHODm0KbWns4xGKfTW1F3r6sSv+2ZxLcISA==",
|
"integrity": "sha512-sWRaDyb332gtHWHr0KvoLzkzvXqRpZ0vpQYxKF2/mIZtaUuMtU56GmRwFVX4VjQYgWb3yWmzTr+tEKjCjXbjng==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@ -1122,9 +1128,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-linux-x64-gnu": {
|
"node_modules/@tauri-apps/cli-linux-x64-gnu": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-AKRzp76fVUaJyXj5KRJT9bJyhwZyUnRQU0RqIRqOtZCT5yr6qGP8rjtQ7YhCIzWrseBlOllc3Qvbgw3Yl0VQcA==",
|
"integrity": "sha512-1dokW+9ZfhwzwYz42jYR5A0/VnGoEGVW7HyN1N6KvHeL1FpSbh0LoTsDODjVjZSjXd62+Aac/stbJqBZChQWbA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@ -1138,9 +1144,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-linux-x64-musl": {
|
"node_modules/@tauri-apps/cli-linux-x64-musl": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-0edIdq6aMBTaRMIXddHfyAFL361JqulLLd2Wi2aoOie7DkQ2MYh6gv3hA7NB9gqFwNIGE+xtJ4BkXIP2tSGPlg==",
|
"integrity": "sha512-7tb34p3vLEGS4pGRpmxcz7eq37yD7DVe4XFfgj8ZO0KsaRBVivzNK2snNDLnd0dVZcx/lJjZc8Cf0B5W1/x/Jw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@ -1154,9 +1160,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-win32-arm64-msvc": {
|
"node_modules/@tauri-apps/cli-win32-arm64-msvc": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-QwWpWk4ubcwJ1rljsRAmINgB2AwkyzZhpYbalA+MmzyYMREcdXWGkyixWbRZgqc6fEWEBmq5UG73qz5eBJiIKg==",
|
"integrity": "sha512-Ilw3Gro8ZBew9yfBXcaET9lLj0g4jehWDMH6j2Wdje1rnvBbQShMaSn3WNMfJypyet5nqM88nGA3YipzmVcIBA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@ -1170,9 +1176,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-win32-ia32-msvc": {
|
"node_modules/@tauri-apps/cli-win32-ia32-msvc": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-Vtw0yxO9+aEFuhuxQ57ALG43tjECopRimRuKGbtZYDCriB/ty5TrT3QWMdy0dxBkpDTu3Rqsz30sbDzw6tlP3Q==",
|
"integrity": "sha512-AWzgDlvv0BssWH3aNsDXLRkKbGynWdm5X6DenSQKtZm5dmDBZsNlZRMgkyPb8WSHK/7ARznKs2OdnkuHWuh9ww==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
@ -1186,9 +1192,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/cli-win32-x64-msvc": {
|
"node_modules/@tauri-apps/cli-win32-x64-msvc": {
|
||||||
"version": "1.6.0",
|
"version": "2.0.0-rc.0",
|
||||||
"resolved": "https://npm.hep.gg/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.0.0-rc.0.tgz",
|
||||||
"integrity": "sha512-h54FHOvGi7+LIfRchzgZYSCHB1HDlP599vWXQQJ/XnwJY+6Rwr2E5bOe/EhqoG8rbGkfK0xX3KPAvXPbUlmggg==",
|
"integrity": "sha512-zmXDUkBmzZ6lk6jT6AoOAE2w+kmkLX5uf/vaJHHzE6WsrZ6UymH0HTLwbRXhaplvpnzXGVyLuSlv3/BK6Q69aQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@ -1201,6 +1207,54 @@
|
|||||||
"node": ">= 10"
|
"node": ">= 10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@tauri-apps/plugin-clipboard-manager": {
|
||||||
|
"version": "2.0.0-rc.0",
|
||||||
|
"resolved": "https://npm.hep.gg/@tauri-apps/plugin-clipboard-manager/-/plugin-clipboard-manager-2.0.0-rc.0.tgz",
|
||||||
|
"integrity": "sha512-2fS3wbRQEtorkk3Np2msJUeKCXRqLQ9sSo2FzlFdUPYNzThsu43uWCF55McGLAfltNOvXQIcQLUBf05jbBL/5w==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2.0.0-rc.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tauri-apps/plugin-dialog": {
|
||||||
|
"version": "2.0.0-rc.0",
|
||||||
|
"resolved": "https://npm.hep.gg/@tauri-apps/plugin-dialog/-/plugin-dialog-2.0.0-rc.0.tgz",
|
||||||
|
"integrity": "sha512-DPOXYe8SQ6Radk/67EOdaomlxL7oF99JO/ZUaPp1IBEs3Wro7lhlz63CfdKIBfKIZTLJLzP1R7/EiPL/GTA3Bg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2.0.0-rc.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tauri-apps/plugin-log": {
|
||||||
|
"version": "2.0.0-rc.0",
|
||||||
|
"resolved": "https://npm.hep.gg/@tauri-apps/plugin-log/-/plugin-log-2.0.0-rc.0.tgz",
|
||||||
|
"integrity": "sha512-ztKfzUcq03dtr08vBu+xcwIEPusP6mCpuLAt6kpXEwG+HvYsC8e1/KFFokn3xvfwD+oBJ3UTL1h4kdM30GAqGw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2.0.0-rc.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tauri-apps/plugin-notification": {
|
||||||
|
"version": "2.0.0-rc.0",
|
||||||
|
"resolved": "https://npm.hep.gg/@tauri-apps/plugin-notification/-/plugin-notification-2.0.0-rc.0.tgz",
|
||||||
|
"integrity": "sha512-0qsT/kvxQ6Ky4g6eQ4SUiHXzM4szTVc6thjz9vnGPYaApLoZrCJ9GdG+vEqeB+cT2dvE+wmxUFETh3ZXYVw8UA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2.0.0-rc.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tauri-apps/plugin-os": {
|
||||||
|
"version": "2.0.0-rc.0",
|
||||||
|
"resolved": "https://npm.hep.gg/@tauri-apps/plugin-os/-/plugin-os-2.0.0-rc.0.tgz",
|
||||||
|
"integrity": "sha512-OWAl8mooKnGykSD4iog8WRqcnOSx0gGmTJBlEExHdFeIuOHg0Ezvd+WiVLhT9LBg7go3ibNWRWpe/ZG7YEp4Vw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2.0.0-rc.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tauri-apps/plugin-updater": {
|
||||||
|
"version": "2.0.0-rc.0",
|
||||||
|
"resolved": "https://npm.hep.gg/@tauri-apps/plugin-updater/-/plugin-updater-2.0.0-rc.0.tgz",
|
||||||
|
"integrity": "sha512-EKajf/sBpFif0cwXhTo3BmNvTZ2t2DDLRyhA8FFKugZNoOeqU97bHhPT5DIqMUPRE1tyDk9o7sXm8dKf7oz+EA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tauri-apps/api": "^2.0.0-rc.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/cookie": {
|
"node_modules/@types/cookie": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://npm.hep.gg/@types/cookie/-/cookie-0.6.0.tgz",
|
"resolved": "https://npm.hep.gg/@types/cookie/-/cookie-0.6.0.tgz",
|
||||||
|
10
package.json
10
package.json
@ -17,7 +17,7 @@
|
|||||||
"@sveltejs/adapter-static": "^3.0.2",
|
"@sveltejs/adapter-static": "^3.0.2",
|
||||||
"@sveltejs/kit": "^2.0.0",
|
"@sveltejs/kit": "^2.0.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||||
"@tauri-apps/cli": "^1.6.0",
|
"@tauri-apps/cli": "^2.0.0-rc.0",
|
||||||
"@types/eslint": "^8.56.7",
|
"@types/eslint": "^8.56.7",
|
||||||
"autoprefixer": "^10.4.19",
|
"autoprefixer": "^10.4.19",
|
||||||
"eslint": "^9.0.0",
|
"eslint": "^9.0.0",
|
||||||
@ -37,6 +37,12 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^1.6.0"
|
"@tauri-apps/api": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-clipboard-manager": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-dialog": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-log": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-notification": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-os": "^2.0.0-rc.0",
|
||||||
|
"@tauri-apps/plugin-updater": "^2.0.0-rc.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2390
src-tauri/Cargo.lock
generated
2390
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -7,22 +7,28 @@ license = ""
|
|||||||
repository = ""
|
repository = ""
|
||||||
default-run = "app"
|
default-run = "app"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.60"
|
rust-version = "1.80"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "1.5.3", features = [] }
|
tauri-build = { version = "2.0.0-rc", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tauri = { version = "1.7.0", features = [ "app-all", "updater", "os-all", "notification-all", "dialog-confirm", "clipboard-all", "dialog-message", "dialog-ask"] }
|
tauri = { version = "2.0.0-rc", features = [] }
|
||||||
dirs = "5.0.1"
|
dirs = "5.0.1"
|
||||||
reqwest = { version = "0.11.18", features = ["json"] }
|
reqwest = { version = "0.11.18", features = ["json"] }
|
||||||
lazy_static = "1.5.0"
|
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 = "2.0.0-alpha.2"
|
||||||
|
tauri-plugin-dialog = "2.0.0-alpha.2"
|
||||||
|
tauri-plugin-clipboard-manager = "2.0.0-alpha.2"
|
||||||
|
tauri-plugin-notification = "2.0.0-alpha.3"
|
||||||
|
tauri-plugin-updater = "2.0.0-alpha.3"
|
||||||
|
tauri-plugin-log = "2.0.0-rc.0"
|
||||||
|
|
||||||
[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.
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
tauri_build::build()
|
tauri_build::build()
|
||||||
}
|
}
|
||||||
|
33
src-tauri/capabilities/migrated.json
Normal file
33
src-tauri/capabilities/migrated.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
}
|
1
src-tauri/gen/schemas/acl-manifests.json
Normal file
1
src-tauri/gen/schemas/acl-manifests.json
Normal file
File diff suppressed because one or more lines are too long
1
src-tauri/gen/schemas/capabilities.json
Normal file
1
src-tauri/gen/schemas/capabilities.json
Normal file
@ -0,0 +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"]}}
|
2812
src-tauri/gen/schemas/desktop-schema.json
Normal file
2812
src-tauri/gen/schemas/desktop-schema.json
Normal file
File diff suppressed because it is too large
Load Diff
2812
src-tauri/gen/schemas/windows-schema.json
Normal file
2812
src-tauri/gen/schemas/windows-schema.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -99,7 +99,9 @@ impl Fansly {
|
|||||||
);
|
);
|
||||||
headers.insert(
|
headers.insert(
|
||||||
reqwest::header::USER_AGENT,
|
reqwest::header::USER_AGENT,
|
||||||
"FanslySync/1.0.0 (tanner@teamhydra.dev)".parse().unwrap(),
|
"FanslySync/1.0.0 (tanner@fanslycreatorbot.com)"
|
||||||
|
.parse()
|
||||||
|
.unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
headers.insert(
|
headers.insert(
|
||||||
@ -137,7 +139,9 @@ impl Fansly {
|
|||||||
);
|
);
|
||||||
headers.insert(
|
headers.insert(
|
||||||
reqwest::header::USER_AGENT,
|
reqwest::header::USER_AGENT,
|
||||||
"FanslySync/1.0.0 (sticks@teamhydra.dev)".parse().unwrap(),
|
"FanslySync/1.0.0 (tanner@fanslycreatorbot.com)"
|
||||||
|
.parse()
|
||||||
|
.unwrap(),
|
||||||
);
|
);
|
||||||
headers.insert(
|
headers.insert(
|
||||||
reqwest::header::CONTENT_TYPE,
|
reqwest::header::CONTENT_TYPE,
|
||||||
|
@ -5,13 +5,49 @@ mod commands;
|
|||||||
mod handlers;
|
mod handlers;
|
||||||
mod structs;
|
mod structs;
|
||||||
|
|
||||||
|
use std::fs;
|
||||||
|
use std::io;
|
||||||
|
|
||||||
use commands::config::{get_config, init_config, save_config};
|
use commands::config::{get_config, init_config, save_config};
|
||||||
use commands::fansly::{fansly_get_me, fansly_set_token, fansly_sync};
|
use commands::fansly::{fansly_get_me, fansly_set_token, fansly_sync};
|
||||||
use commands::utils::quit;
|
use commands::utils::quit;
|
||||||
|
use tauri_plugin_log::{Target, TargetKind};
|
||||||
|
|
||||||
|
fn get_log_path() -> io::Result<String> {
|
||||||
|
let mut config_dir = dirs::config_dir().ok_or_else(|| {
|
||||||
|
io::Error::new(
|
||||||
|
io::ErrorKind::NotFound,
|
||||||
|
"Could not determine user's config directory",
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
config_dir.push("FanslySync");
|
||||||
|
fs::create_dir_all(&config_dir)?;
|
||||||
|
config_dir.push("runtime");
|
||||||
|
|
||||||
|
// Return the path as a string
|
||||||
|
Ok(config_dir.to_string_lossy().to_string())
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
|
.plugin(tauri_plugin_log::Builder::new().build())
|
||||||
|
.plugin(tauri_plugin_notification::init())
|
||||||
|
.plugin(tauri_plugin_clipboard_manager::init())
|
||||||
|
.plugin(tauri_plugin_dialog::init())
|
||||||
|
.plugin(tauri_plugin_os::init())
|
||||||
|
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||||
|
.plugin(
|
||||||
|
tauri_plugin_log::Builder::new()
|
||||||
|
.targets([
|
||||||
|
Target::new(TargetKind::Stdout),
|
||||||
|
Target::new(TargetKind::LogDir {
|
||||||
|
file_name: Some(get_log_path().unwrap()),
|
||||||
|
}),
|
||||||
|
Target::new(TargetKind::Webview),
|
||||||
|
])
|
||||||
|
.build(),
|
||||||
|
)
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
init_config,
|
init_config,
|
||||||
get_config,
|
get_config,
|
||||||
|
@ -1,92 +1,69 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeBuildCommand": "npm run build",
|
"beforeBuildCommand": "npm run build",
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
"devPath": "http://localhost:5173",
|
"frontendDist": "../build",
|
||||||
"distDir": "../build"
|
"devUrl": "http://localhost:5173"
|
||||||
},
|
},
|
||||||
"package": {
|
"bundle": {
|
||||||
"productName": "FanslySync",
|
"active": true,
|
||||||
"version": "0.1.2"
|
"category": "DeveloperTool",
|
||||||
},
|
"copyright": "",
|
||||||
"tauri": {
|
"targets": "all",
|
||||||
"allowlist": {
|
"externalBin": [],
|
||||||
"clipboard": {
|
"icon": [
|
||||||
"all": true,
|
"icons/32x32.png",
|
||||||
"readText": false,
|
"icons/128x128.png",
|
||||||
"writeText": false
|
"icons/128x128@2x.png",
|
||||||
},
|
"icons/icon.icns",
|
||||||
"dialog": {
|
"icons/icon.ico"
|
||||||
"all": false,
|
],
|
||||||
"ask": true,
|
"windows": {
|
||||||
"confirm": true,
|
"certificateThumbprint": null,
|
||||||
"message": true,
|
"digestAlgorithm": "sha256",
|
||||||
"open": false,
|
"timestampUrl": ""
|
||||||
"save": false
|
},
|
||||||
},
|
"longDescription": "",
|
||||||
"notification": {
|
"macOS": {
|
||||||
"all": true
|
"entitlements": null,
|
||||||
},
|
"exceptionDomain": "",
|
||||||
"os": {
|
"frameworks": [],
|
||||||
"all": true
|
"providerShortName": null,
|
||||||
},
|
"signingIdentity": null
|
||||||
"app": {
|
},
|
||||||
"all": true
|
"resources": [],
|
||||||
}
|
"shortDescription": "",
|
||||||
},
|
"linux": {
|
||||||
"bundle": {
|
"deb": {
|
||||||
"active": true,
|
"depends": []
|
||||||
"category": "DeveloperTool",
|
}
|
||||||
"copyright": "",
|
},
|
||||||
"deb": {
|
"createUpdaterArtifacts": "v1Compatible"
|
||||||
"depends": []
|
},
|
||||||
},
|
"productName": "FanslySync",
|
||||||
"externalBin": [],
|
"version": "0.1.3",
|
||||||
"icon": [
|
"identifier": "com.fanslycreatorbot.fanslysync",
|
||||||
"icons/32x32.png",
|
"plugins": {
|
||||||
"icons/128x128.png",
|
"updater": {
|
||||||
"icons/128x128@2x.png",
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJFODZGRDI4NjBFMDQ1RUMKUldUc1JlQmdLUDJHTGdRdSt6dWFISXE0MThsa0tvUDA2RWdMSStjQ0J6NVBhdmU4ajRMMms4a1cK",
|
||||||
"icons/icon.icns",
|
"endpoints": [
|
||||||
"icons/icon.ico"
|
"https://cdn.crabnebula.app/update/fansly-creator-bot/fansly-sync/{{target}}-{{arch}}/{{current_version}}"
|
||||||
],
|
]
|
||||||
"identifier": "com.fanslycreatorbot.fanslysync",
|
}
|
||||||
"longDescription": "",
|
},
|
||||||
"macOS": {
|
"app": {
|
||||||
"entitlements": null,
|
"windows": [
|
||||||
"exceptionDomain": "",
|
{
|
||||||
"frameworks": [],
|
"fullscreen": false,
|
||||||
"providerShortName": null,
|
"height": 650,
|
||||||
"signingIdentity": null
|
"resizable": false,
|
||||||
},
|
"title": "FanslySync",
|
||||||
"resources": [],
|
"width": 600
|
||||||
"shortDescription": "",
|
}
|
||||||
"targets": "all",
|
],
|
||||||
"windows": {
|
"security": {
|
||||||
"certificateThumbprint": null,
|
"csp": null
|
||||||
"digestAlgorithm": "sha256",
|
}
|
||||||
"timestampUrl": ""
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
"security": {
|
|
||||||
"csp": null
|
|
||||||
},
|
|
||||||
"updater": {
|
|
||||||
"active": true,
|
|
||||||
"endpoints": [
|
|
||||||
"https://cdn.crabnebula.app/update/fansly-creator-bot/fansly-sync/{{target}}-{{arch}}/{{current_version}}"
|
|
||||||
],
|
|
||||||
"dialog": true,
|
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJFODZGRDI4NjBFMDQ1RUMKUldUc1JlQmdLUDJHTGdRdSt6dWFISXE0MThsa0tvUDA2RWdMSStjQ0J6NVBhdmU4ajRMMms4a1cK"
|
|
||||||
},
|
|
||||||
"windows": [
|
|
||||||
{
|
|
||||||
"fullscreen": false,
|
|
||||||
"height": 650,
|
|
||||||
"resizable": false,
|
|
||||||
"title": "FanslySync",
|
|
||||||
"width": 600
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,23 +1,33 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let status = 'Initializing...';
|
import { info, error } from '@tauri-apps/plugin-log';
|
||||||
import { invoke } from '@tauri-apps/api/tauri';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
import { dialog, clipboard } from '@tauri-apps/api';
|
import { writeText } from '@tauri-apps/plugin-clipboard-manager';
|
||||||
|
import { message } from '@tauri-apps/plugin-dialog';
|
||||||
import { awaiter } from '$lib/utils';
|
import { awaiter } from '$lib/utils';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import type { Config } from '$lib/types';
|
import type { Config } from '$lib/types';
|
||||||
import { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification';
|
import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';
|
||||||
|
|
||||||
|
let status = 'Initializing...';
|
||||||
|
info(
|
||||||
|
`[FanslySync::init] Marking beginning of initialization and logfile session. Current time: ${new Date().toISOString()}`
|
||||||
|
);
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
info(`[FanslySync::init] onMount() called. Starting initialization...`);
|
||||||
|
info(`[FanslySync::init] Initializing configuration...`);
|
||||||
const [_, configInitError] = await awaiter(invoke('init_config'));
|
const [_, configInitError] = await awaiter(invoke('init_config'));
|
||||||
|
|
||||||
if (configInitError) {
|
if (configInitError) {
|
||||||
|
error(`[FanslySync::init] Failed to initialize configuration. Error: ${configInitError}`);
|
||||||
|
error(`[FanslySync::init] Initialization failed due to configuration error. Exiting...`);
|
||||||
status = 'Failed to initialize configuration';
|
status = 'Failed to initialize configuration';
|
||||||
await dialog.message(
|
await message(
|
||||||
`Something went wrong while initializing the configuration. We've copied the error to your clipboard. Please contact us.\n\nError: ${configInitError}\n\nThe application will now close.`,
|
`Something went wrong while initializing the configuration. We've copied the error to your clipboard. Please contact us.\n\nError: ${configInitError}\n\nThe application will now close.`,
|
||||||
{ title: 'FanslySync | Initialization Error', type: 'error' }
|
{ title: 'FanslySync | Initialization Error', kind: 'error' }
|
||||||
);
|
);
|
||||||
|
|
||||||
await clipboard.writeText(configInitError);
|
await writeText(configInitError);
|
||||||
invoke('quit', { code: 1 });
|
invoke('quit', { code: 1 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -25,25 +35,39 @@
|
|||||||
const [config, configError] = await awaiter(invoke('get_config') as Promise<Config>);
|
const [config, configError] = await awaiter(invoke('get_config') as Promise<Config>);
|
||||||
|
|
||||||
if (configError || !config || config === null) {
|
if (configError || !config || config === null) {
|
||||||
|
error(
|
||||||
|
`[FanslySync::init] Failed to get configuration. Error: ${configError ?? 'Config was null'}`
|
||||||
|
);
|
||||||
status = 'Failed to get configuration';
|
status = 'Failed to get configuration';
|
||||||
await dialog.message(
|
await message(
|
||||||
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please contact us.\n\nError: ${configError ?? 'Config was null'}\n\nThe application will now close.`,
|
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please contact us.\n\nError: ${configError ?? 'Config was null'}\n\nThe application will now close.`,
|
||||||
{ title: 'FanslySync | Configuration Error', type: 'error' }
|
{ title: 'FanslySync | Configuration Error', kind: 'error' }
|
||||||
);
|
);
|
||||||
|
|
||||||
await clipboard.writeText(configError);
|
await writeText(configError);
|
||||||
invoke('quit', { code: 1 });
|
invoke('quit', { code: 1 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info(
|
||||||
|
`[FanslySync::init] Configuration initialized successfully. Checking notification permissions...`
|
||||||
|
);
|
||||||
|
|
||||||
const permissionGranted = await isPermissionGranted();
|
const permissionGranted = await isPermissionGranted();
|
||||||
if (!permissionGranted) {
|
if (!permissionGranted) {
|
||||||
|
info(`[FanslySync::init] Notification permissions not granted. Requesting permission...`);
|
||||||
let result = await requestPermission();
|
let result = await requestPermission();
|
||||||
if (result !== 'granted') {
|
if (result !== 'granted') {
|
||||||
|
error(
|
||||||
|
`[FanslySync::init] Notification permission denied but we require it to function properly.`
|
||||||
|
);
|
||||||
|
error(
|
||||||
|
`[FanslySync::init] Initialization failed due to notification permission error. Exiting...`
|
||||||
|
);
|
||||||
status = 'Notification permission denied';
|
status = 'Notification permission denied';
|
||||||
await dialog.message(
|
await message(
|
||||||
`FanslySync requires notification permissions to function properly. Please enable notifications and restart the application.`,
|
`FanslySync requires notification permissions to function properly. Please enable notifications and restart the application.`,
|
||||||
{ title: 'FanslySync | Notification Permission Error', type: 'error' }
|
{ title: 'FanslySync | Notification Permission Error', kind: 'error' }
|
||||||
);
|
);
|
||||||
|
|
||||||
invoke('quit', { code: 1 });
|
invoke('quit', { code: 1 });
|
||||||
@ -51,14 +75,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info(`[FanslySync::init] Notification permissions granted. Checking if first run...`);
|
||||||
status = 'Initialization complete!';
|
status = 'Initialization complete!';
|
||||||
|
|
||||||
if (config.is_first_run) {
|
if (config.is_first_run) {
|
||||||
|
info(`[FanslySync::init] First run detected. Redirecting to /setup...`);
|
||||||
// Navigate to /setup
|
// Navigate to /setup
|
||||||
window.location.href = '/setup';
|
window.location.href = '/setup';
|
||||||
} else {
|
} else {
|
||||||
// todo: set jwt for future requests
|
// todo: set jwt for future requests
|
||||||
|
info(`[FanslySync::init] Not first run. Setting Fansly token...`);
|
||||||
await invoke('fansly_set_token', { token: config.fansly_token });
|
await invoke('fansly_set_token', { token: config.fansly_token });
|
||||||
|
info(`[FanslySync::init] Fansly token set.`);
|
||||||
|
info(`[FanslySync::init] Initialization complete. Redirecting to /home...`);
|
||||||
window.location.href = '/home';
|
window.location.href = '/home';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { invoke } from '@tauri-apps/api/tauri';
|
import { info, error } from '@tauri-apps/plugin-log';
|
||||||
import { awaiter } from '$lib/utils';
|
import { awaiter } from '$lib/utils';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import type { Config, SyncData } from '$lib/types';
|
import type { Config, SyncData } from '$lib/types';
|
||||||
import { clipboard, dialog } from '@tauri-apps/api';
|
|
||||||
import { slide } from 'svelte/transition';
|
import { slide } from 'svelte/transition';
|
||||||
import { sendNotification } from '@tauri-apps/api/notification';
|
import { sendNotification } from '@tauri-apps/plugin-notification';
|
||||||
import { platform } from '@tauri-apps/api/os';
|
import { platform } from '@tauri-apps/plugin-os';
|
||||||
import { checkUpdate, installUpdate, type UpdateManifest } from '@tauri-apps/api/updater';
|
import { check, Update } from '@tauri-apps/plugin-updater';
|
||||||
import { getVersion, getTauriVersion } from '@tauri-apps/api/app';
|
import { getVersion, getTauriVersion } from '@tauri-apps/api/app';
|
||||||
import { ask } from '@tauri-apps/api/dialog';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
|
import { ask, message } from '@tauri-apps/plugin-dialog';
|
||||||
|
import { writeText } from '@tauri-apps/plugin-clipboard-manager';
|
||||||
|
|
||||||
let loadingSync = true;
|
let loadingSync = true;
|
||||||
let upToDate: boolean | null = null;
|
let upToDate: boolean | null = null;
|
||||||
let updateMeta: UpdateManifest | null = null;
|
let updateData: Update | null = null;
|
||||||
let versionData = {
|
let versionData = {
|
||||||
appVersion: 'Loading...',
|
appVersion: 'Loading...',
|
||||||
tauriVersion: 'Loading...'
|
tauriVersion: 'Loading...'
|
||||||
@ -30,34 +31,53 @@
|
|||||||
let config: Config | null = null;
|
let config: Config | null = null;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
info(`[FanslySync::page_init:home] onMount() called. Starting page initialization...`);
|
||||||
const [configData, configError] = await awaiter(invoke('get_config') as Promise<Config>);
|
const [configData, configError] = await awaiter(invoke('get_config') as Promise<Config>);
|
||||||
|
|
||||||
if (configError || !configData) {
|
if (configError || !configData) {
|
||||||
await dialog.message(
|
error(
|
||||||
|
`[FanslySync::page_init:home] Failed to get configuration. Error: ${configError ?? 'Config was null'}`
|
||||||
|
);
|
||||||
|
info(
|
||||||
|
`[FanslySync::page_init:home] Page Initialization failed due to configuration error. Exiting...`
|
||||||
|
);
|
||||||
|
await message(
|
||||||
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please report this issue on GitHub.\n\nError: ${configError ?? 'Config was null'}\n\nThe application will now close.`,
|
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please report this issue on GitHub.\n\nError: ${configError ?? 'Config was null'}\n\nThe application will now close.`,
|
||||||
{ title: 'FanslySync | Configuration Error', type: 'error' }
|
{ title: 'FanslySync | Configuration Error', kind: 'error' }
|
||||||
);
|
);
|
||||||
|
|
||||||
await clipboard.writeText(configError);
|
await writeText(configError);
|
||||||
invoke('quit', { code: 1 });
|
invoke('quit', { code: 1 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info(
|
||||||
|
`[FanslySync::page_init:home] Configuration initialized successfully. Checking for updates...`
|
||||||
|
);
|
||||||
config = configData;
|
config = configData;
|
||||||
loadingSync = false;
|
loadingSync = false;
|
||||||
|
|
||||||
const updateStatus = await checkUpdate();
|
const updateStatus = await check();
|
||||||
upToDate = !updateStatus.shouldUpdate;
|
upToDate = !updateStatus?.available ?? false;
|
||||||
updateMeta = updateStatus.manifest || null;
|
updateData = updateStatus;
|
||||||
console.log('[updateStatus]', updateStatus);
|
info(
|
||||||
console.log('[upToDate]', upToDate);
|
`[FanslySync::page_init:home] Update check completed. Up to date: ${upToDate}, Update data: ${updateData}`
|
||||||
console.log('[updateMeta]', updateMeta);
|
);
|
||||||
|
info(`[FanslySync::page_init:home] Getting app and Tauri versions...`);
|
||||||
|
|
||||||
versionData.appVersion = await getVersion();
|
versionData.appVersion = await getVersion();
|
||||||
versionData.tauriVersion = await getTauriVersion();
|
versionData.tauriVersion = await getTauriVersion();
|
||||||
|
|
||||||
|
info(
|
||||||
|
`[FanslySync::page_init:home] App and Tauri versions fetched. We are running App version: ${versionData.appVersion}, atop Tauri version: ${versionData.tauriVersion}`
|
||||||
|
);
|
||||||
|
|
||||||
|
info(`[FanslySync::page_init:home] Page initialization completed successfully.`);
|
||||||
});
|
});
|
||||||
|
|
||||||
async function syncNow() {
|
async function syncNow() {
|
||||||
|
info(`[FanslySync::syncNow] Starting manual sync...`);
|
||||||
|
|
||||||
syncState.error = false;
|
syncState.error = false;
|
||||||
syncState.success = false;
|
syncState.success = false;
|
||||||
syncState.syncing = true;
|
syncState.syncing = true;
|
||||||
@ -67,6 +87,9 @@
|
|||||||
console.log(syncData, syncError);
|
console.log(syncData, syncError);
|
||||||
|
|
||||||
if (syncError || syncData === null) {
|
if (syncError || syncData === null) {
|
||||||
|
error(
|
||||||
|
`[FanslySync::syncNow] Failed to sync data. Error: ${syncError ?? 'Sync data was null'}`
|
||||||
|
);
|
||||||
syncState.syncing = false;
|
syncState.syncing = false;
|
||||||
syncState.error = true;
|
syncState.error = true;
|
||||||
syncState.message = syncError ?? 'Sync data was null';
|
syncState.message = syncError ?? 'Sync data was null';
|
||||||
@ -83,6 +106,7 @@
|
|||||||
invoke('save_config', { config }) as Promise<boolean>
|
invoke('save_config', { config }) as Promise<boolean>
|
||||||
);
|
);
|
||||||
if (saveConfigError) {
|
if (saveConfigError) {
|
||||||
|
error(`[FanslySync::syncNow] Failed to save config data. Error: ${saveConfigError}`);
|
||||||
syncState.syncing = false;
|
syncState.syncing = false;
|
||||||
syncState.error = true;
|
syncState.error = true;
|
||||||
syncState.message = saveConfigError ?? 'Save config data was null';
|
syncState.message = saveConfigError ?? 'Save config data was null';
|
||||||
@ -92,12 +116,12 @@
|
|||||||
syncState.syncing = false;
|
syncState.syncing = false;
|
||||||
syncState.success = true;
|
syncState.success = true;
|
||||||
|
|
||||||
const platformName = await platform();
|
const platformName = platform();
|
||||||
let soundName;
|
let soundName;
|
||||||
|
|
||||||
if (platformName === 'win32') {
|
if (platformName === 'windows') {
|
||||||
soundName = 'ms-winsoundevent:Notification.Default';
|
soundName = 'ms-winsoundevent:Notification.Default';
|
||||||
} else if (platformName === 'darwin') {
|
} else if (platformName === 'macos') {
|
||||||
soundName = 'Ping';
|
soundName = 'Ping';
|
||||||
} else {
|
} else {
|
||||||
soundName = 'completion-sucess';
|
soundName = 'completion-sucess';
|
||||||
@ -108,21 +132,32 @@
|
|||||||
body: 'Data synced successfully. Please look at the app for more details.',
|
body: 'Data synced successfully. Please look at the app for more details.',
|
||||||
sound: soundName
|
sound: soundName
|
||||||
});
|
});
|
||||||
|
|
||||||
|
info(`[FanslySync::syncNow] Manual sync completed successfully.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function doUpdate() {
|
async function doUpdate() {
|
||||||
|
if (!updateData || !updateData.available) {
|
||||||
|
message('You are up to date! Current version: ' + versionData.appVersion, {
|
||||||
|
title: 'FanslySync | Update',
|
||||||
|
kind: 'info'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const confirm = await ask(
|
const confirm = await ask(
|
||||||
`An update is available for FanslySync. Would you like to update now?\n\nCurrent version: ${versionData.appVersion}\nNew (remote) version: ${updateMeta?.version ?? 'Unknown'}`,
|
`An update is available for FanslySync. Would you like to update now?\n\nCurrent version: ${versionData.appVersion}\nNew (remote) version: ${updateData?.version ?? 'Unknown'}\n\nThe application will close after the update completes.`,
|
||||||
{
|
{
|
||||||
title: 'Update Available',
|
title: 'Update Available',
|
||||||
okLabel: 'Yes',
|
okLabel: 'Yes',
|
||||||
cancelLabel: 'No',
|
cancelLabel: 'No',
|
||||||
type: 'info'
|
kind: 'info'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
await installUpdate();
|
await updateData.downloadAndInstall();
|
||||||
|
await invoke('quit', { code: 0 });
|
||||||
} else {
|
} else {
|
||||||
console.log('User declined update');
|
console.log('User declined update');
|
||||||
}
|
}
|
||||||
@ -312,7 +347,7 @@
|
|||||||
<button
|
<button
|
||||||
class="bg-white text-blue-600 px-2 py-1 rounded-lg"
|
class="bg-white text-blue-600 px-2 py-1 rounded-lg"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
clipboard.writeText(syncState.url);
|
writeText(syncState.url);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Copy
|
Copy
|
||||||
|
@ -9,23 +9,23 @@
|
|||||||
fanslyToken: ''
|
fanslyToken: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
import { invoke } from '@tauri-apps/api/tauri';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
import { dialog, clipboard } from '@tauri-apps/api';
|
import { writeText } from '@tauri-apps/plugin-clipboard-manager';
|
||||||
|
import { message } from '@tauri-apps/plugin-dialog';
|
||||||
import { awaiter } from '$lib/utils';
|
import { awaiter } from '$lib/utils';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import type { AccountInfo, Config } from '$lib/types';
|
import type { AccountInfo, Config } from '$lib/types';
|
||||||
import NoWorkResult from 'postcss/lib/no-work-result';
|
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const [config, configError] = await awaiter(invoke('get_config'));
|
const [config, configError] = await awaiter(invoke('get_config'));
|
||||||
|
|
||||||
if (configError) {
|
if (configError) {
|
||||||
await dialog.message(
|
await message(
|
||||||
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please report this issue on GitHub.\n\nError: ${configError}\n\nThe application will now close.`,
|
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please report this issue on GitHub.\n\nError: ${configError}\n\nThe application will now close.`,
|
||||||
{ title: 'BambuConnect | Configuration Error', type: 'error' }
|
{ title: 'BambuConnect | Configuration Error', kind: 'error' }
|
||||||
);
|
);
|
||||||
|
|
||||||
await clipboard.writeText(configError);
|
await writeText(configError);
|
||||||
invoke('quit', { code: 1 });
|
invoke('quit', { code: 1 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -37,12 +37,12 @@
|
|||||||
const [config, configError] = (await awaiter(invoke('get_config'))) as [Config, any | null];
|
const [config, configError] = (await awaiter(invoke('get_config'))) as [Config, any | null];
|
||||||
|
|
||||||
if (configError) {
|
if (configError) {
|
||||||
await dialog.message(
|
await message(
|
||||||
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please report this issue on GitHub.\n\nError: ${configError}\n\nThe application will now close.`,
|
`Something went wrong while getting the configuration. We've copied the error to your clipboard. Please report this issue on GitHub.\n\nError: ${configError}\n\nThe application will now close.`,
|
||||||
{ title: 'BambuConnect | Configuration Error', type: 'error' }
|
{ title: 'BambuConnect | Configuration Error', kind: 'error' }
|
||||||
);
|
);
|
||||||
|
|
||||||
await clipboard.writeText(configError);
|
await writeText(configError);
|
||||||
invoke('quit', { code: 1 });
|
invoke('quit', { code: 1 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user