修改同步逻辑

This commit is contained in:
lyswhut 2023-08-28 13:29:22 +08:00
parent 2bd130315f
commit 5a69be8c7b
22 changed files with 421 additions and 293 deletions

View File

@ -48,6 +48,15 @@ module.exports = {
allowBoolean: true, allowBoolean: true,
}, },
], ],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: {
arguments: false,
attributes: false,
},
},
],
'@typescript-eslint/naming-convention': 'off', '@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/return-await': 'off', '@typescript-eslint/return-await': 'off',
'@typescript-eslint/comma-dangle': 'off', '@typescript-eslint/comma-dangle': 'off',

374
package-lock.json generated
View File

@ -1,21 +1,21 @@
{ {
"name": "lx-music-mobile", "name": "lx-music-mobile",
"version": "1.1.0-beta.1", "version": "1.1.0-beta.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "lx-music-mobile", "name": "lx-music-mobile",
"version": "1.1.0-beta.1", "version": "1.1.0-beta.2",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@craftzdog/react-native-buffer": "^6.0.5", "@craftzdog/react-native-buffer": "^6.0.5",
"@react-native-async-storage/async-storage": "^1.19.2", "@react-native-async-storage/async-storage": "^1.19.3",
"@react-native-clipboard/clipboard": "^1.11.2", "@react-native-clipboard/clipboard": "^1.11.2",
"@react-native-community/slider": "^4.4.3", "@react-native-community/slider": "^4.4.3",
"iconv-lite": "^0.6.3", "iconv-lite": "^0.6.3",
"lrc-file-parser": "^2.4.1", "lrc-file-parser": "^2.4.1",
"message2call": "^0.1.0", "message2call": "^0.1.2",
"pako": "^2.1.0", "pako": "^2.1.0",
"react": "18.2.0", "react": "18.2.0",
"react-native": "0.72.4", "react-native": "0.72.4",
@ -30,25 +30,25 @@
"react-native-vector-icons": "^10.0.0" "react-native-vector-icons": "^10.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.22.10", "@babel/core": "^7.22.11",
"@babel/eslint-parser": "^7.22.10", "@babel/eslint-parser": "^7.22.11",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9", "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/preset-env": "^7.22.10", "@babel/preset-env": "^7.22.10",
"@babel/runtime": "^7.22.10", "@babel/runtime": "^7.22.11",
"@react-native/metro-config": "^0.72.11", "@react-native/metro-config": "^0.72.11",
"@tsconfig/react-native": "^3.0.2", "@tsconfig/react-native": "^3.0.2",
"@types/react": "^18.2.20", "@types/react": "^18.2.21",
"@types/react-native": "^0.70.14", "@types/react-native": "^0.70.14",
"@types/react-native-background-timer": "^2.0.0", "@types/react-native-background-timer": "^2.0.0",
"@types/react-native-vector-icons": "^6.4.14", "@types/react-native-vector-icons": "^6.4.14",
"babel-plugin-module-resolver": "^5.0.0", "babel-plugin-module-resolver": "^5.0.0",
"changelog-parser": "^3.0.1", "changelog-parser": "^3.0.1",
"eslint-config-standard": "^17.1.0", "eslint-config-standard": "^17.1.0",
"eslint-config-standard-with-typescript": "^38.0.0", "eslint-config-standard-with-typescript": "^39.0.0",
"eslint-plugin-react": "^7.33.2", "eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"metro-react-native-babel-preset": "0.76.8", "metro-react-native-babel-preset": "0.76.8",
"typescript": "^5.1.6" "typescript": "^5.2.2"
}, },
"engines": { "engines": {
"node": ">= 16", "node": ">= 16",
@ -157,24 +157,24 @@
} }
}, },
"node_modules/@babel/core": { "node_modules/@babel/core": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.11.tgz",
"integrity": "sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==", "integrity": "sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==",
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.22.10", "@babel/code-frame": "^7.22.10",
"@babel/generator": "^7.22.10", "@babel/generator": "^7.22.10",
"@babel/helper-compilation-targets": "^7.22.10", "@babel/helper-compilation-targets": "^7.22.10",
"@babel/helper-module-transforms": "^7.22.9", "@babel/helper-module-transforms": "^7.22.9",
"@babel/helpers": "^7.22.10", "@babel/helpers": "^7.22.11",
"@babel/parser": "^7.22.10", "@babel/parser": "^7.22.11",
"@babel/template": "^7.22.5", "@babel/template": "^7.22.5",
"@babel/traverse": "^7.22.10", "@babel/traverse": "^7.22.11",
"@babel/types": "^7.22.10", "@babel/types": "^7.22.11",
"convert-source-map": "^1.7.0", "convert-source-map": "^1.7.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.2", "gensync": "^1.0.0-beta.2",
"json5": "^2.2.2", "json5": "^2.2.3",
"semver": "^6.3.1" "semver": "^6.3.1"
}, },
"engines": { "engines": {
@ -186,9 +186,9 @@
} }
}, },
"node_modules/@babel/eslint-parser": { "node_modules/@babel/eslint-parser": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.11.tgz",
"integrity": "sha512-0J8DNPRXQRLeR9rPaUMM3fA+RbixjnVLe/MRMYCkp3hzgsSuxCHQ8NN8xQG1wIHKJ4a1DTROTvFJdW+B5/eOsg==", "integrity": "sha512-YjOYZ3j7TjV8OhLW6NCtyg8G04uStATEUe5eiLuCZaXz2VSDQ3dsAtm2D+TuQyAqNMUK2WacGo0/uma9Pein1w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
@ -531,13 +531,13 @@
} }
}, },
"node_modules/@babel/helpers": { "node_modules/@babel/helpers": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.11.tgz",
"integrity": "sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==", "integrity": "sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==",
"dependencies": { "dependencies": {
"@babel/template": "^7.22.5", "@babel/template": "^7.22.5",
"@babel/traverse": "^7.22.10", "@babel/traverse": "^7.22.11",
"@babel/types": "^7.22.10" "@babel/types": "^7.22.11"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -613,9 +613,9 @@
} }
}, },
"node_modules/@babel/parser": { "node_modules/@babel/parser": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.11.tgz",
"integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==", "integrity": "sha512-R5zb8eJIBPJriQtbH/htEQy4k7E2dHWlD2Y2VT07JCzwYZHBxV5ZYtM0UhXSNMT74LyxuM+b1jdL7pSesXbC/g==",
"bin": { "bin": {
"parser": "bin/babel-parser.js" "parser": "bin/babel-parser.js"
}, },
@ -2163,9 +2163,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@babel/runtime": { "node_modules/@babel/runtime": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz",
"integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==",
"dependencies": { "dependencies": {
"regenerator-runtime": "^0.14.0" "regenerator-runtime": "^0.14.0"
}, },
@ -2193,9 +2193,9 @@
} }
}, },
"node_modules/@babel/traverse": { "node_modules/@babel/traverse": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.11.tgz",
"integrity": "sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==", "integrity": "sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==",
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.22.10", "@babel/code-frame": "^7.22.10",
"@babel/generator": "^7.22.10", "@babel/generator": "^7.22.10",
@ -2203,8 +2203,8 @@
"@babel/helper-function-name": "^7.22.5", "@babel/helper-function-name": "^7.22.5",
"@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6", "@babel/helper-split-export-declaration": "^7.22.6",
"@babel/parser": "^7.22.10", "@babel/parser": "^7.22.11",
"@babel/types": "^7.22.10", "@babel/types": "^7.22.11",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
}, },
@ -2213,9 +2213,9 @@
} }
}, },
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz",
"integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==",
"dependencies": { "dependencies": {
"@babel/helper-string-parser": "^7.22.5", "@babel/helper-string-parser": "^7.22.5",
"@babel/helper-validator-identifier": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5",
@ -2588,9 +2588,9 @@
} }
}, },
"node_modules/@react-native-async-storage/async-storage": { "node_modules/@react-native-async-storage/async-storage": {
"version": "1.19.2", "version": "1.19.3",
"resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.2.tgz", "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.3.tgz",
"integrity": "sha512-7jTQKbT3BdhFHQMnfElsLeeyVqNICv72lPKbeNHnNgLP9eH3+Yk1GFMWWb7A8qRMYianSmwmx1cYofNe9H9hLQ==", "integrity": "sha512-CwGfoHCWdPOTPS+2fW6YRE1fFBpT9++ahLEroX5hkgwyoQ+TkmjOaUxixdEIoVua9Pz5EF2pGOIJzqOTMWfBlA==",
"dependencies": { "dependencies": {
"merge-options": "^3.0.4" "merge-options": "^3.0.4"
}, },
@ -3536,9 +3536,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/react": { "node_modules/@types/react": {
"version": "18.2.20", "version": "18.2.21",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.20.tgz", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.21.tgz",
"integrity": "sha512-WKNtmsLWJM/3D5mG4U84cysVY31ivmyw85dE84fOCk5Hx78wezB/XEjVPWl2JTZ5FkEeaTJf+VgUAUn3PE7Isw==", "integrity": "sha512-neFKG/sBAwGxHgXiIxnbm3/AAVQ/cMRS93hvBpg8xYRbeQSPVABp9U2bRnPf0iI4+Ucdv3plSxKK+3CW2ENJxA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/prop-types": "*", "@types/prop-types": "*",
@ -3607,17 +3607,17 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz",
"integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.5.1", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/type-utils": "6.4.0", "@typescript-eslint/type-utils": "6.4.1",
"@typescript-eslint/utils": "6.4.0", "@typescript-eslint/utils": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.4", "ignore": "^5.2.4",
@ -3679,15 +3679,15 @@
"peer": true "peer": true
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz",
"integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "6.4.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@ -3707,13 +3707,13 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz",
"integrity": "sha512-TUS7vaKkPWDVvl7GDNHFQMsMruD+zhkd3SdVW0d7b+7Zo+bd/hXJQ8nsiUZMi1jloWo6c9qt3B7Sqo+flC1nig==", "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0" "@typescript-eslint/visitor-keys": "6.4.1"
}, },
"engines": { "engines": {
"node": "^16.0.0 || >=18.0.0" "node": "^16.0.0 || >=18.0.0"
@ -3724,14 +3724,14 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz",
"integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "6.4.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/utils": "6.4.0", "@typescript-eslint/utils": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^1.0.1" "ts-api-utils": "^1.0.1"
}, },
@ -3752,9 +3752,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz",
"integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^16.0.0 || >=18.0.0" "node": "^16.0.0 || >=18.0.0"
@ -3765,13 +3765,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz",
"integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -3825,18 +3825,18 @@
"dev": true "dev": true
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz",
"integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.4.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "6.4.0", "@typescript-eslint/typescript-estree": "6.4.1",
"semver": "^7.5.4" "semver": "^7.5.4"
}, },
"engines": { "engines": {
@ -3887,12 +3887,12 @@
"peer": true "peer": true
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz",
"integrity": "sha512-yJSfyT+uJm+JRDWYRYdCm2i+pmvXJSMtPR9Cq5/XQs4QIgNoLcoRtDdzsLbLsFM/c6um6ohQkg/MLxWvoIndJA==", "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"eslint-visitor-keys": "^3.4.1" "eslint-visitor-keys": "^3.4.1"
}, },
"engines": { "engines": {
@ -5424,16 +5424,16 @@
} }
}, },
"node_modules/eslint-config-standard-with-typescript": { "node_modules/eslint-config-standard-with-typescript": {
"version": "38.0.0", "version": "39.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-38.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-39.0.0.tgz",
"integrity": "sha512-G7JR6I8tmWEQjzbESo/9gVq4AQctbVO4J8PINQj8l2lgbJF/W9KCJ4uDLiKmLMjWszW/F5SsucoA/5VpHvfwOQ==", "integrity": "sha512-CiV2LS4NUeeRmDTDf1ocUMpMxitSyW0g+Y/N7ecElwGj188GahbcQgqfBNyVsIXQxHlZVBlOjkbg3oUI0R3KBg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/parser": "^6.1.0", "@typescript-eslint/parser": "^6.4.0",
"eslint-config-standard": "17.1.0" "eslint-config-standard": "17.1.0"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/eslint-plugin": "^6.4.0",
"eslint": "^8.0.1", "eslint": "^8.0.1",
"eslint-plugin-import": "^2.25.2", "eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ", "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
@ -7865,9 +7865,9 @@
} }
}, },
"node_modules/message2call": { "node_modules/message2call": {
"version": "0.1.0", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/message2call/-/message2call-0.1.0.tgz", "resolved": "https://registry.npmjs.org/message2call/-/message2call-0.1.2.tgz",
"integrity": "sha512-10zubfIMTkxevtenynScyYN6GdWUgROrGqi9rU06tg+WY8SJIPwvKaDFuoKF8d2pbaFXD4hlOON2vf0ptCIN/A==" "integrity": "sha512-jUYYyrVwhd5PWKtQXp1qTKKMxllm3lRZ/Vka1pzSZ0zT957YY6c4Vg1mp3YXsU7cukrZkjXXvQJrteJwBzrKsQ=="
}, },
"node_modules/metro": { "node_modules/metro": {
"version": "0.76.7", "version": "0.76.7",
@ -10792,9 +10792,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.1.6", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
@ -11314,31 +11314,31 @@
"integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==" "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ=="
}, },
"@babel/core": { "@babel/core": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.11.tgz",
"integrity": "sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==", "integrity": "sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==",
"requires": { "requires": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.22.10", "@babel/code-frame": "^7.22.10",
"@babel/generator": "^7.22.10", "@babel/generator": "^7.22.10",
"@babel/helper-compilation-targets": "^7.22.10", "@babel/helper-compilation-targets": "^7.22.10",
"@babel/helper-module-transforms": "^7.22.9", "@babel/helper-module-transforms": "^7.22.9",
"@babel/helpers": "^7.22.10", "@babel/helpers": "^7.22.11",
"@babel/parser": "^7.22.10", "@babel/parser": "^7.22.11",
"@babel/template": "^7.22.5", "@babel/template": "^7.22.5",
"@babel/traverse": "^7.22.10", "@babel/traverse": "^7.22.11",
"@babel/types": "^7.22.10", "@babel/types": "^7.22.11",
"convert-source-map": "^1.7.0", "convert-source-map": "^1.7.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.2", "gensync": "^1.0.0-beta.2",
"json5": "^2.2.2", "json5": "^2.2.3",
"semver": "^6.3.1" "semver": "^6.3.1"
} }
}, },
"@babel/eslint-parser": { "@babel/eslint-parser": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.11.tgz",
"integrity": "sha512-0J8DNPRXQRLeR9rPaUMM3fA+RbixjnVLe/MRMYCkp3hzgsSuxCHQ8NN8xQG1wIHKJ4a1DTROTvFJdW+B5/eOsg==", "integrity": "sha512-YjOYZ3j7TjV8OhLW6NCtyg8G04uStATEUe5eiLuCZaXz2VSDQ3dsAtm2D+TuQyAqNMUK2WacGo0/uma9Pein1w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
@ -11564,13 +11564,13 @@
} }
}, },
"@babel/helpers": { "@babel/helpers": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.11.tgz",
"integrity": "sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==", "integrity": "sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==",
"requires": { "requires": {
"@babel/template": "^7.22.5", "@babel/template": "^7.22.5",
"@babel/traverse": "^7.22.10", "@babel/traverse": "^7.22.11",
"@babel/types": "^7.22.10" "@babel/types": "^7.22.11"
} }
}, },
"@babel/highlight": { "@babel/highlight": {
@ -11630,9 +11630,9 @@
} }
}, },
"@babel/parser": { "@babel/parser": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.11.tgz",
"integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==" "integrity": "sha512-R5zb8eJIBPJriQtbH/htEQy4k7E2dHWlD2Y2VT07JCzwYZHBxV5ZYtM0UhXSNMT74LyxuM+b1jdL7pSesXbC/g=="
}, },
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": {
"version": "7.22.5", "version": "7.22.5",
@ -12565,9 +12565,9 @@
"integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA=="
}, },
"@babel/runtime": { "@babel/runtime": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz",
"integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==",
"requires": { "requires": {
"regenerator-runtime": "^0.14.0" "regenerator-runtime": "^0.14.0"
}, },
@ -12590,9 +12590,9 @@
} }
}, },
"@babel/traverse": { "@babel/traverse": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.11.tgz",
"integrity": "sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==", "integrity": "sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==",
"requires": { "requires": {
"@babel/code-frame": "^7.22.10", "@babel/code-frame": "^7.22.10",
"@babel/generator": "^7.22.10", "@babel/generator": "^7.22.10",
@ -12600,16 +12600,16 @@
"@babel/helper-function-name": "^7.22.5", "@babel/helper-function-name": "^7.22.5",
"@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6", "@babel/helper-split-export-declaration": "^7.22.6",
"@babel/parser": "^7.22.10", "@babel/parser": "^7.22.11",
"@babel/types": "^7.22.10", "@babel/types": "^7.22.11",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
} }
}, },
"@babel/types": { "@babel/types": {
"version": "7.22.10", "version": "7.22.11",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.10.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz",
"integrity": "sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==", "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==",
"requires": { "requires": {
"@babel/helper-string-parser": "^7.22.5", "@babel/helper-string-parser": "^7.22.5",
"@babel/helper-validator-identifier": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5",
@ -12874,9 +12874,9 @@
} }
}, },
"@react-native-async-storage/async-storage": { "@react-native-async-storage/async-storage": {
"version": "1.19.2", "version": "1.19.3",
"resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.2.tgz", "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.19.3.tgz",
"integrity": "sha512-7jTQKbT3BdhFHQMnfElsLeeyVqNICv72lPKbeNHnNgLP9eH3+Yk1GFMWWb7A8qRMYianSmwmx1cYofNe9H9hLQ==", "integrity": "sha512-CwGfoHCWdPOTPS+2fW6YRE1fFBpT9++ahLEroX5hkgwyoQ+TkmjOaUxixdEIoVua9Pz5EF2pGOIJzqOTMWfBlA==",
"requires": { "requires": {
"merge-options": "^3.0.4" "merge-options": "^3.0.4"
} }
@ -13667,9 +13667,9 @@
"dev": true "dev": true
}, },
"@types/react": { "@types/react": {
"version": "18.2.20", "version": "18.2.21",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.20.tgz", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.21.tgz",
"integrity": "sha512-WKNtmsLWJM/3D5mG4U84cysVY31ivmyw85dE84fOCk5Hx78wezB/XEjVPWl2JTZ5FkEeaTJf+VgUAUn3PE7Isw==", "integrity": "sha512-neFKG/sBAwGxHgXiIxnbm3/AAVQ/cMRS93hvBpg8xYRbeQSPVABp9U2bRnPf0iI4+Ucdv3plSxKK+3CW2ENJxA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/prop-types": "*", "@types/prop-types": "*",
@ -13734,17 +13734,17 @@
"integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==" "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA=="
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz",
"integrity": "sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==", "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"requires": { "requires": {
"@eslint-community/regexpp": "^4.5.1", "@eslint-community/regexpp": "^4.5.1",
"@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/type-utils": "6.4.0", "@typescript-eslint/type-utils": "6.4.1",
"@typescript-eslint/utils": "6.4.0", "@typescript-eslint/utils": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.2.4", "ignore": "^5.2.4",
@ -13783,55 +13783,55 @@
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz",
"integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "6.4.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4" "debug": "^4.3.4"
} }
}, },
"@typescript-eslint/scope-manager": { "@typescript-eslint/scope-manager": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz",
"integrity": "sha512-TUS7vaKkPWDVvl7GDNHFQMsMruD+zhkd3SdVW0d7b+7Zo+bd/hXJQ8nsiUZMi1jloWo6c9qt3B7Sqo+flC1nig==", "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0" "@typescript-eslint/visitor-keys": "6.4.1"
} }
}, },
"@typescript-eslint/type-utils": { "@typescript-eslint/type-utils": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz",
"integrity": "sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==", "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"requires": { "requires": {
"@typescript-eslint/typescript-estree": "6.4.0", "@typescript-eslint/typescript-estree": "6.4.1",
"@typescript-eslint/utils": "6.4.0", "@typescript-eslint/utils": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^1.0.1" "ts-api-utils": "^1.0.1"
} }
}, },
"@typescript-eslint/types": { "@typescript-eslint/types": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz",
"integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==",
"dev": true "dev": true
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz",
"integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/visitor-keys": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -13866,18 +13866,18 @@
} }
}, },
"@typescript-eslint/utils": { "@typescript-eslint/utils": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz",
"integrity": "sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==", "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"requires": { "requires": {
"@eslint-community/eslint-utils": "^4.4.0", "@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12", "@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0", "@types/semver": "^7.5.0",
"@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/scope-manager": "6.4.1",
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"@typescript-eslint/typescript-estree": "6.4.0", "@typescript-eslint/typescript-estree": "6.4.1",
"semver": "^7.5.4" "semver": "^7.5.4"
}, },
"dependencies": { "dependencies": {
@ -13911,12 +13911,12 @@
} }
}, },
"@typescript-eslint/visitor-keys": { "@typescript-eslint/visitor-keys": {
"version": "6.4.0", "version": "6.4.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz",
"integrity": "sha512-yJSfyT+uJm+JRDWYRYdCm2i+pmvXJSMtPR9Cq5/XQs4QIgNoLcoRtDdzsLbLsFM/c6um6ohQkg/MLxWvoIndJA==", "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "6.4.0", "@typescript-eslint/types": "6.4.1",
"eslint-visitor-keys": "^3.4.1" "eslint-visitor-keys": "^3.4.1"
} }
}, },
@ -15080,12 +15080,12 @@
"requires": {} "requires": {}
}, },
"eslint-config-standard-with-typescript": { "eslint-config-standard-with-typescript": {
"version": "38.0.0", "version": "39.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-38.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-39.0.0.tgz",
"integrity": "sha512-G7JR6I8tmWEQjzbESo/9gVq4AQctbVO4J8PINQj8l2lgbJF/W9KCJ4uDLiKmLMjWszW/F5SsucoA/5VpHvfwOQ==", "integrity": "sha512-CiV2LS4NUeeRmDTDf1ocUMpMxitSyW0g+Y/N7ecElwGj188GahbcQgqfBNyVsIXQxHlZVBlOjkbg3oUI0R3KBg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/parser": "^6.1.0", "@typescript-eslint/parser": "^6.4.0",
"eslint-config-standard": "17.1.0" "eslint-config-standard": "17.1.0"
} }
}, },
@ -16708,9 +16708,9 @@
"dev": true "dev": true
}, },
"message2call": { "message2call": {
"version": "0.1.0", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/message2call/-/message2call-0.1.0.tgz", "resolved": "https://registry.npmjs.org/message2call/-/message2call-0.1.2.tgz",
"integrity": "sha512-10zubfIMTkxevtenynScyYN6GdWUgROrGqi9rU06tg+WY8SJIPwvKaDFuoKF8d2pbaFXD4hlOON2vf0ptCIN/A==" "integrity": "sha512-jUYYyrVwhd5PWKtQXp1qTKKMxllm3lRZ/Vka1pzSZ0zT957YY6c4Vg1mp3YXsU7cukrZkjXXvQJrteJwBzrKsQ=="
}, },
"metro": { "metro": {
"version": "0.76.7", "version": "0.76.7",
@ -18864,9 +18864,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "5.1.6", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"dev": true "dev": true
}, },
"uglify-es": { "uglify-es": {

View File

@ -1,6 +1,6 @@
{ {
"name": "lx-music-mobile", "name": "lx-music-mobile",
"version": "1.1.0-beta.1", "version": "1.1.0-beta.2",
"versionCode": 60, "versionCode": 60,
"private": true, "private": true,
"scripts": { "scripts": {
@ -44,12 +44,12 @@
"homepage": "https://github.com/lyswhut/lx-music-mobile#readme", "homepage": "https://github.com/lyswhut/lx-music-mobile#readme",
"dependencies": { "dependencies": {
"@craftzdog/react-native-buffer": "^6.0.5", "@craftzdog/react-native-buffer": "^6.0.5",
"@react-native-async-storage/async-storage": "^1.19.2", "@react-native-async-storage/async-storage": "^1.19.3",
"@react-native-clipboard/clipboard": "^1.11.2", "@react-native-clipboard/clipboard": "^1.11.2",
"@react-native-community/slider": "^4.4.3", "@react-native-community/slider": "^4.4.3",
"iconv-lite": "^0.6.3", "iconv-lite": "^0.6.3",
"lrc-file-parser": "^2.4.1", "lrc-file-parser": "^2.4.1",
"message2call": "^0.1.0", "message2call": "^0.1.2",
"pako": "^2.1.0", "pako": "^2.1.0",
"react": "18.2.0", "react": "18.2.0",
"react-native": "0.72.4", "react-native": "0.72.4",
@ -64,24 +64,24 @@
"react-native-vector-icons": "^10.0.0" "react-native-vector-icons": "^10.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.22.10", "@babel/core": "^7.22.11",
"@babel/eslint-parser": "^7.22.10", "@babel/eslint-parser": "^7.22.11",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9", "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/preset-env": "^7.22.10", "@babel/preset-env": "^7.22.10",
"@babel/runtime": "^7.22.10", "@babel/runtime": "^7.22.11",
"@react-native/metro-config": "^0.72.11", "@react-native/metro-config": "^0.72.11",
"@tsconfig/react-native": "^3.0.2", "@tsconfig/react-native": "^3.0.2",
"@types/react": "^18.2.20", "@types/react": "^18.2.21",
"@types/react-native": "^0.70.14", "@types/react-native": "^0.70.14",
"@types/react-native-background-timer": "^2.0.0", "@types/react-native-background-timer": "^2.0.0",
"@types/react-native-vector-icons": "^6.4.14", "@types/react-native-vector-icons": "^6.4.14",
"babel-plugin-module-resolver": "^5.0.0", "babel-plugin-module-resolver": "^5.0.0",
"changelog-parser": "^3.0.1", "changelog-parser": "^3.0.1",
"eslint-config-standard": "^17.1.0", "eslint-config-standard": "^17.1.0",
"eslint-config-standard-with-typescript": "^38.0.0", "eslint-config-standard-with-typescript": "^39.0.0",
"eslint-plugin-react": "^7.33.2", "eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"metro-react-native-babel-preset": "0.76.8", "metro-react-native-babel-preset": "0.76.8",
"typescript": "^5.1.6" "typescript": "^5.2.2"
} }
} }

View File

@ -62,6 +62,8 @@ export const storageDataPrefix = {
fontSize: '@font_size', fontSize: '@font_size',
theme: '@theme', theme: '@theme',
cheatTip: '@cheat_tip',
} as const } as const
// v0.x.x 版本的 data keys // v0.x.x 版本的 data keys
@ -135,24 +137,3 @@ export const DEFAULT_SETTING = {
// query: {}, // query: {},
}, },
} }
export const SYNC_CODE = {
helloMsg: 'Hello~::^-^::~v4~',
idPrefix: 'OjppZDo6',
authMsg: 'lx-music auth::',
authFailed: 'Auth failed',
missingAuthCode: 'Missing auth code',
getServiceIdFailed: 'Get service id failed',
connectServiceFailed: 'Connect service failed',
connecting: 'Connecting...',
unknownServiceAddress: 'Unknown service address',
msgBlockedIp: 'Blocked IP',
msgConnect: 'lx-music connect',
msgAuthFailed: 'Auth failed',
} as const
export const SYNC_CLOSE_CODE = {
normal: 1000,
failed: 4100,
} as const

View File

@ -1,6 +1,5 @@
import { connectServer } from '@/plugins/sync' import { connectServer } from '@/plugins/sync'
import { updateSetting } from '@/core/common' import { updateSetting } from '@/core/common'
// import { SYNC_CODE } from '@/config/constant'
import { getSyncHost } from '@/plugins/sync/data' import { getSyncHost } from '@/plugins/sync/data'

View File

@ -23,7 +23,7 @@ const closeSyncModeModal = () => {
syncActions.setSyncModeComponentId('') syncActions.setSyncModeComponentId('')
} }
} }
export const selectSyncMode = async(serverName: string) => new Promise<LX.Sync.Mode>((resolve, reject) => { export const selectSyncMode = async(serverName: string) => new Promise<LX.Sync.List.SyncMode>((resolve, reject) => {
removeSyncModeEvent() removeSyncModeEvent()
syncActions.setServerNmae(serverName) syncActions.setServerNmae(serverName)
showSyncModeModal() showSyncModeModal()
@ -35,7 +35,7 @@ export const selectSyncMode = async(serverName: string) => new Promise<LX.Sync.M
global.app_event.off('selectSyncMode', handleSelectMode) global.app_event.off('selectSyncMode', handleSelectMode)
} }
const handleSelectMode = (mode: LX.Sync.Mode) => { const handleSelectMode = (mode: LX.Sync.List.SyncMode) => {
removeListeners() removeListeners()
closeSyncModeModal() closeSyncModeModal()
resolve(mode) resolve(mode)

View File

@ -198,7 +198,7 @@ export class AppEvent extends Event {
this.emit('songlistTagInfoChange', name, id) this.emit('songlistTagInfoChange', name, id)
} }
selectSyncMode(mode: LX.Sync.Mode) { selectSyncMode(mode: LX.Sync.List.SyncMode) {
this.emit('selectSyncMode', mode) this.emit('selectSyncMode', mode)
} }
} }

View File

@ -28,7 +28,7 @@ const ModeModal = ({ componentId }: { componentId: string }) => {
setSyncModeComponentId(componentId) setSyncModeComponentId(componentId)
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []) }, [])
const handleSelectMode = (mode: LX.Sync.Mode) => { const handleSelectMode = (mode: LX.Sync.List.SyncMode) => {
if (mode.startsWith('overwrite') && isOverwrite) mode += '_full' if (mode.startsWith('overwrite') && isOverwrite) mode += '_full'
global.app_event.selectSyncMode(mode) global.app_event.selectSyncMode(mode)
} }

View File

@ -1,10 +1,10 @@
import { request, generateRsaKey } from './utils' import { request, generateRsaKey } from './utils'
import { getSyncAuthKey, setSyncAuthKey } from '../data' import { getSyncAuthKey, setSyncAuthKey } from '../data'
import { SYNC_CODE } from '@/config/constant'
import log from '../log' import log from '../log'
import { aesDecrypt, aesEncrypt, rsaDecrypt } from '../utils' import { aesDecrypt, aesEncrypt, rsaDecrypt } from '../utils'
import { getDeviceName } from '@/utils/nativeModules/utils' import { getDeviceName } from '@/utils/nativeModules/utils'
import { toMD5 } from '@/utils/tools' import { toMD5 } from '@/utils/tools'
import { SYNC_CODE } from '../constants'
const hello = async(urlInfo: LX.Sync.UrlInfo) => request(`${urlInfo.httpProtocol}//${urlInfo.hostPath}/hello`) const hello = async(urlInfo: LX.Sync.UrlInfo) => request(`${urlInfo.httpProtocol}//${urlInfo.hostPath}/hello`)
.then(({ text }) => text == SYNC_CODE.helloMsg) .then(({ text }) => text == SYNC_CODE.helloMsg)

View File

@ -1,15 +1,15 @@
import { encryptMsg, decryptMsg } from './utils' import { encryptMsg, decryptMsg } from './utils'
import { modules, callObj } from './modules' import { callObj } from './sync'
// import { action as commonAction } from '@/store/modules/common' // import { action as commonAction } from '@/store/modules/common'
// import { getStore } from '@/store' // import { getStore } from '@/store'
// import registerSyncListHandler from './syncList' // import registerSyncListHandler from './syncList'
import log from '../log' import log from '../log'
import { SYNC_CLOSE_CODE, SYNC_CODE } from '@/config/constant'
import { aesEncrypt } from '../utils' import { aesEncrypt } from '../utils'
import { setSyncStatus } from '@/core/sync' import { setSyncStatus } from '@/core/sync'
import { dateFormat } from '@/utils/common' import { dateFormat } from '@/utils/common'
import { createMsg2call } from 'message2call' import { createMsg2call } from 'message2call'
import { toast } from '@/utils/tools' import { toast } from '@/utils/tools'
import { SYNC_CLOSE_CODE, SYNC_CODE } from '../constants'
let status: LX.Sync.Status = { let status: LX.Sync.Status = {
status: false, status: false,
@ -27,18 +27,6 @@ export const sendSyncMessage = (message: string) => {
setSyncStatus(status) setSyncStatus(status)
} }
const handleConnection = (socket: LX.Sync.Socket) => {
for (const { registerEvent } of Object.values(modules)) {
registerEvent(socket)
}
}
const handleDisconnection = () => {
for (const { unregisterEvent } of Object.values(modules)) {
unregisterEvent()
}
}
const heartbeatTools = { const heartbeatTools = {
failedNum: 0, failedNum: 0,
maxTryNum: 100000, maxTryNum: 100000,
@ -134,15 +122,14 @@ export const connect = (urlInfo: LX.Sync.UrlInfo, keyInfo: LX.Sync.KeyInfo) => {
heartbeatTools.connect(client) heartbeatTools.connect(client)
let closeEvents: Array<(err: Error) => (void | Promise<void>)> = [] let closeEvents: Array<(err: Error) => (void | Promise<void>)> = []
let disconnected = true
const message2read = createMsg2call({ const message2read = createMsg2call<LX.Sync.ServerSyncActions>({
funcsObj: { funcsObj: {
...callObj, ...callObj,
list_sync_finished() { finished() {
log.info('sync list success') toast('Sync connected.')
toast('Sync successfully')
client!.isReady = true client!.isReady = true
handleConnection(client as LX.Sync.Socket)
sendSyncStatus({ sendSyncStatus({
status: true, status: true,
message: '', message: '',
@ -152,6 +139,7 @@ export const connect = (urlInfo: LX.Sync.UrlInfo, keyInfo: LX.Sync.KeyInfo) => {
}, },
timeout: 120 * 1000, timeout: 120 * 1000,
sendMessage(data) { sendMessage(data) {
if (disconnected) throw new Error('disconnected')
void encryptMsg(keyInfo, JSON.stringify(data)).then((data) => { void encryptMsg(keyInfo, JSON.stringify(data)).then((data) => {
client?.send(data) client?.send(data)
}).catch((err) => { }).catch((err) => {
@ -174,13 +162,14 @@ export const connect = (urlInfo: LX.Sync.UrlInfo, keyInfo: LX.Sync.KeyInfo) => {
}, },
}) })
client.remoteSyncList = message2read.createSyncRemote('list') client.remote = message2read.remote
client.remoteQueueList = message2read.createQueueRemote('list')
client.addEventListener('message', ({ data }) => { client.addEventListener('message', ({ data }) => {
if (data == 'ping') return if (data == 'ping') return
if (typeof data === 'string') { if (typeof data === 'string') {
void decryptMsg(keyInfo, data).then((data) => { void decryptMsg(keyInfo, data).then((data) => {
let syncData: LX.Sync.ServerActions let syncData: LX.Sync.ServerSyncActions
try { try {
syncData = JSON.parse(data) syncData = JSON.parse(data)
} catch (err) { } catch (err) {
@ -208,6 +197,10 @@ export const connect = (urlInfo: LX.Sync.UrlInfo, keyInfo: LX.Sync.KeyInfo) => {
// const store = getStore() // const store = getStore()
// global.lx.syncKeyInfo = keyInfo // global.lx.syncKeyInfo = keyInfo
client!.isReady = false client!.isReady = false
client!.moduleReadys = {
list: false,
}
disconnected = false
sendSyncStatus({ sendSyncStatus({
status: false, status: false,
message: initMessage, message: initMessage,
@ -221,7 +214,7 @@ export const connect = (urlInfo: LX.Sync.UrlInfo, keyInfo: LX.Sync.KeyInfo) => {
log.error(err?.message) log.error(err?.message)
} }
closeEvents = [] closeEvents = []
handleDisconnection() disconnected = true
message2read.onDestroy() message2read.onDestroy()
switch (code) { switch (code) {
case SYNC_CLOSE_CODE.normal: case SYNC_CLOSE_CODE.normal:

View File

@ -1,9 +1,9 @@
import handleAuth from './auth' import handleAuth from './auth'
import { connect as socketConnect, disconnect as socketDisconnect, sendSyncStatus, sendSyncMessage } from './client' import { connect as socketConnect, disconnect as socketDisconnect, sendSyncStatus, sendSyncMessage } from './client'
// import { getSyncHost } from '@/utils/data' // import { getSyncHost } from '@/utils/data'
import { SYNC_CODE } from '@/config/constant'
import log from '../log' import log from '../log'
import { parseUrl } from './utils' import { parseUrl } from './utils'
import { SYNC_CODE } from '../constants'
let connectId = 0 let connectId = 0

View File

@ -8,3 +8,7 @@ export const callObj = Object.assign({}, list.handler)
export const modules = { export const modules = {
list, list,
} }
export const featureVersion = {
list: 1,
} as const

View File

@ -1,8 +1,10 @@
// 这个文件导出的方法将暴露给服务端调用,第一个参数固定为当前 socket 对象
import { handleRemoteListAction, getLocalListData, setLocalListData } from '../../../utils' import { handleRemoteListAction, getLocalListData, setLocalListData } from '../../../utils'
import log from '../../../log' import log from '../../../log'
// import { SYNC_CLOSE_CODE } from '@/config/constant' // import { SYNC_CLOSE_CODE } from '@/config/constant'
import { removeSyncModeEvent, selectSyncMode } from '@/core/sync' import { removeSyncModeEvent, selectSyncMode } from '@/core/sync'
import { toMD5 } from '@/utils/tools' import { toMD5 } from '@/utils/tools'
import { registerEvent, unregisterEvent } from './localEvent'
const logInfo = (eventName: string, success = false) => { const logInfo = (eventName: string, success = false) => {
log.info(`[${eventName}]${eventName.replace('list:sync:list_sync_', '').replace(/_/g, ' ')}${success ? ' success' : ''}`) log.info(`[${eventName}]${eventName.replace('list:sync:list_sync_', '').replace(/_/g, ' ')}${success ? ' success' : ''}`)
@ -11,8 +13,8 @@ const logInfo = (eventName: string, success = false) => {
// log.error(`[${eventName}]${eventName.replace('list:sync:list_sync_', '').replace(/_/g, ' ')} error: ${err.message}`) // log.error(`[${eventName}]${eventName.replace('list:sync:list_sync_', '').replace(/_/g, ' ')} error: ${err.message}`)
// } // }
export const onListSyncAction = async(socket: LX.Sync.Socket, action: LX.Sync.ActionList) => { export const onListSyncAction = async(socket: LX.Sync.Socket, action: LX.Sync.List.ActionList) => {
if (!socket.isReady) return if (!socket.moduleReadys?.list) return
await handleRemoteListAction(action) await handleRemoteListAction(action)
} }
@ -34,11 +36,20 @@ export const list_sync_get_list_data = async(socket: LX.Sync.Socket) => {
return getLocalListData() return getLocalListData()
} }
export const list_sync_set_list_data = async(socket: LX.Sync.Socket, data: LX.Sync.ListData) => { export const list_sync_set_list_data = async(socket: LX.Sync.Socket, data: LX.Sync.List.ListData) => {
logInfo('list:sync:list_sync_set_list_data') logInfo('list:sync:list_sync_set_list_data')
await setLocalListData(data) await setLocalListData(data)
} }
export const list_sync_finished = async(socket: LX.Sync.Socket) => {
logInfo('list:sync:finished')
socket.moduleReadys.list = true
registerEvent(socket)
socket.onClose(() => {
unregisterEvent()
})
}
// export default async(socket: LX.Sync.Socket) => new Promise<void>((resolve, reject) => { // export default async(socket: LX.Sync.Socket) => new Promise<void>((resolve, reject) => {
// let listenEvents: Array<() => void> = [] // let listenEvents: Array<() => void> = []
@ -64,7 +75,7 @@ export const list_sync_set_list_data = async(socket: LX.Sync.Socket, data: LX.Sy
// })) // }))
// listenEvents.push(socket.onRemoteEvent('list:sync:list_sync_get_sync_mode', async() => { // listenEvents.push(socket.onRemoteEvent('list:sync:list_sync_get_sync_mode', async() => {
// logInfo('list:sync:list_sync_get_sync_mode') // logInfo('list:sync:list_sync_get_sync_mode')
// let mode: LX.Sync.Mode // let mode: LX.Sync.List.SyncMode
// try { // try {
// mode = await selectSyncMode(socket.data.keyInfo.serverName) // mode = await selectSyncMode(socket.data.keyInfo.serverName)
// } catch (err: unknown) { // } catch (err: unknown) {

View File

@ -8,9 +8,10 @@ export const registerEvent = (socket: LX.Sync.Socket) => {
// unregisterLocalListAction?.() // unregisterLocalListAction?.()
// unregisterLocalListAction = null // unregisterLocalListAction = null
// }) // })
unregisterEvent()
unregisterLocalListAction = registerListActionEvent((action) => { unregisterLocalListAction = registerListActionEvent((action) => {
if (!socket?.isReady) return if (!socket.moduleReadys?.list) return
void socket.remoteSyncList.onListSyncAction(action) void socket.remoteQueueList.onListSyncAction(action)
}) })
} }

View File

@ -0,0 +1,21 @@
// 这个文件导出的方法将暴露给服务端调用,第一个参数固定为当前 socket 对象
// import { getUserSpace } from '@/user'
// import { modules } from '../modules'
import { featureVersion } from '../modules'
export const getEnabledFeatures = async(socket: LX.Sync.Socket, serverType: LX.Sync.ServerType, supportedFeatures: LX.Sync.SupportedFeatures): Promise<LX.Sync.EnabledFeatures> => {
// const userSpace = getUserSpace(socket.userInfo.name)
switch (serverType) {
case 'server':
return {
list: featureVersion.list == supportedFeatures.list,
}
case 'desktop-app':
default:
return {
list: featureVersion.list == supportedFeatures.list,
}
}
}

View File

@ -0,0 +1,8 @@
import * as handler from './handler'
import { callObj as _callObj } from '../modules'
export { modules } from '../modules'
export const callObj = {
...handler,
..._callObj,
}

View File

@ -0,0 +1,65 @@
export const ENV_PARAMS = [
'PORT',
'BIND_IP',
'CONFIG_PATH',
'LOG_PATH',
'DATA_PATH',
'PROXY_HEADER',
'MAX_SNAPSHOT_NUM',
'LIST_ADD_MUSIC_LOCATION_TYPE',
'LX_USER_',
] as const
export const LIST_IDS = {
DEFAULT: 'default',
LOVE: 'love',
TEMP: 'temp',
DOWNLOAD: 'download',
PLAY_LATER: null,
} as const
export const SYNC_CODE = {
helloMsg: 'Hello~::^-^::~v4~',
idPrefix: 'OjppZDo6',
authMsg: 'lx-music auth::',
msgAuthFailed: 'Auth failed',
msgBlockedIp: 'Blocked IP',
msgConnect: 'lx-music connect',
authFailed: 'Auth failed',
missingAuthCode: 'Missing auth code',
getServiceIdFailed: 'Get service id failed',
connectServiceFailed: 'Connect service failed',
connecting: 'Connecting...',
unknownServiceAddress: 'Unknown service address',
} as const
export const SYNC_CLOSE_CODE = {
normal: 1000,
failed: 4100,
} as const
export const TRANS_MODE: Readonly<Record<LX.Sync.List.SyncMode, LX.Sync.List.SyncMode>> = {
merge_local_remote: 'merge_remote_local',
merge_remote_local: 'merge_local_remote',
overwrite_local_remote: 'overwrite_remote_local',
overwrite_remote_local: 'overwrite_local_remote',
overwrite_local_remote_full: 'overwrite_remote_local_full',
overwrite_remote_local_full: 'overwrite_local_remote_full',
cancel: 'cancel',
} as const
export const File = {
serverInfoJSON: 'serverInfo.json',
userDir: 'users',
userDevicesJSON: 'devices.json',
listDir: 'list',
listSnapshotDir: 'snapshot',
listSnapshotInfoJSON: 'snapshotInfo.json',
} as const
export const FeaturesList = [
'list',
] as const

View File

@ -27,7 +27,7 @@ export const rsaDecrypt = (buffer: Buffer, key: string): string => {
return rsaDecryptSync(buffer.toString('base64'), key, RSA_PADDING.OAEPWithSHA1AndMGF1Padding) return rsaDecryptSync(buffer.toString('base64'), key, RSA_PADDING.OAEPWithSHA1AndMGF1Padding)
} }
export const getLocalListData = async(): Promise<LX.Sync.ListData> => { export const getLocalListData = async(): Promise<LX.Sync.List.ListData> => {
return Promise.all([ return Promise.all([
getListMusics(LIST_IDS.DEFAULT), getListMusics(LIST_IDS.DEFAULT),
getListMusics(LIST_IDS.LOVE), getListMusics(LIST_IDS.LOVE),
@ -42,12 +42,12 @@ export const getLocalListData = async(): Promise<LX.Sync.ListData> => {
}) })
} }
export const setLocalListData = async(listData: LX.Sync.ListData) => { export const setLocalListData = async(listData: LX.Sync.List.ListData) => {
await global.list_event.list_data_overwrite(listData, true) await global.list_event.list_data_overwrite(listData, true)
} }
export const registerListActionEvent = (sendListAction: (action: LX.Sync.ActionList) => (void | Promise<void>)) => { export const registerListActionEvent = (sendListAction: (action: LX.Sync.List.ActionList) => (void | Promise<void>)) => {
const list_data_overwrite = async(listData: MakeOptional<LX.List.ListDataFull, 'tempList'>, isRemote: boolean = false) => { const list_data_overwrite = async(listData: MakeOptional<LX.List.ListDataFull, 'tempList'>, isRemote: boolean = false) => {
if (isRemote) return if (isRemote) return
await sendListAction({ action: 'list_data_overwrite', data: listData }) await sendListAction({ action: 'list_data_overwrite', data: listData })
@ -124,7 +124,7 @@ export const registerListActionEvent = (sendListAction: (action: LX.Sync.ActionL
} }
} }
export const handleRemoteListAction = async({ action, data }: LX.Sync.ActionList) => { export const handleRemoteListAction = async({ action, data }: LX.Sync.List.ActionList) => {
// console.log('handleRemoteListAction', action) // console.log('handleRemoteListAction', action)
switch (action) { switch (action) {

View File

@ -16,7 +16,7 @@ import { useSettingValue } from '@/store/setting/hook'
import { useTheme } from '@/store/theme/hook' import { useTheme } from '@/store/theme/hook'
import { useStatus } from '@/store/sync/hook' import { useStatus } from '@/store/sync/hook'
import Text from '@/components/common/Text' import Text from '@/components/common/Text'
import { SYNC_CODE } from '@/config/constant' import { SYNC_CODE } from '@/plugins/sync/constants'
const addressRxp = /^https?:\/\/\S+/i const addressRxp = /^https?:\/\/\S+/i

43
src/types/list_sync.d.ts vendored Normal file
View File

@ -0,0 +1,43 @@
declare namespace LX {
namespace Sync {
namespace List {
interface ListInfo {
lastSyncDate?: number
snapshotKey: string
}
interface SyncActionBase <A> {
action: A
}
interface SyncActionData<A, D> extends SyncActionBase<A> {
data: D
}
type SyncAction<A, D = undefined> = D extends undefined ? SyncActionBase<A> : SyncActionData<A, D>
type ActionList = SyncAction<'list_data_overwrite', LX.List.ListActionDataOverwrite>
| SyncAction<'list_create', LX.List.ListActionAdd>
| SyncAction<'list_remove', LX.List.ListActionRemove>
| SyncAction<'list_update', LX.List.ListActionUpdate>
| SyncAction<'list_update_position', LX.List.ListActionUpdatePosition>
| SyncAction<'list_music_add', LX.List.ListActionMusicAdd>
| SyncAction<'list_music_move', LX.List.ListActionMusicMove>
| SyncAction<'list_music_remove', LX.List.ListActionMusicRemove>
| SyncAction<'list_music_update', LX.List.ListActionMusicUpdate>
| SyncAction<'list_music_update_position', LX.List.ListActionMusicUpdatePosition>
| SyncAction<'list_music_overwrite', LX.List.ListActionMusicOverwrite>
| SyncAction<'list_music_clear', LX.List.ListActionMusicClear>
type ListData = Omit<LX.List.ListDataFull, 'tempList'>
type SyncMode = 'merge_local_remote'
| 'merge_remote_local'
| 'overwrite_local_remote'
| 'overwrite_remote_local'
| 'overwrite_local_remote_full'
| 'overwrite_remote_local_full'
// | 'none'
| 'cancel'
}
}
}

23
src/types/sync.d.ts vendored
View File

@ -12,27 +12,20 @@ declare global {
serverName: string serverName: string
} }
type ListData = Omit<LX.List.ListDataFull, 'tempList'>
type Mode = 'merge_local_remote'
| 'merge_remote_local'
| 'overwrite_local_remote'
| 'overwrite_remote_local'
| 'overwrite_local_remote_full'
| 'overwrite_remote_local_full'
// | 'none'
| 'cancel'
interface Socket extends WebSocket { interface Socket extends WebSocket {
isReady: boolean isReady: boolean
data: { data: {
keyInfo: KeyInfo keyInfo: KeyInfo
urlInfo: UrlInfo urlInfo: UrlInfo
} }
moduleReadys: {
list: boolean
}
onClose: (handler: (err: Error) => (void | Promise<void>)) => () => void onClose: (handler: (err: Error) => (void | Promise<void>)) => () => void
remoteSyncList: LX.Sync.ServerActions remote: LX.Sync.ServerSyncActions
remoteQueueList: LX.Sync.ServerSyncListActions
} }
@ -42,6 +35,12 @@ declare global {
hostPath: string hostPath: string
href: string href: string
} }
type ServerType = 'desktop-app' | 'server'
interface EnabledFeatures {
list: boolean
}
type SupportedFeatures = Partial<{ [k in keyof EnabledFeatures]: number }>
} }
} }
} }

View File

@ -1,30 +1,24 @@
declare namespace LX { declare namespace LX {
namespace Sync { namespace Sync {
type ActionList = SyncAction<'list_data_overwrite', LX.List.ListActionDataOverwrite> type ServerSyncActions = WarpPromiseRecord<{
| SyncAction<'list_create', LX.List.ListActionAdd> onFeatureChanged: (feature: EnabledFeatures) => void
| SyncAction<'list_remove', LX.List.ListActionRemove> }>
| SyncAction<'list_update', LX.List.ListActionUpdate> type ServerSyncListActions = WarpPromiseRecord<{
| SyncAction<'list_update_position', LX.List.ListActionUpdatePosition> onListSyncAction: (action: LX.Sync.List.ActionList) => void
| SyncAction<'list_music_add', LX.List.ListActionMusicAdd> }>
| SyncAction<'list_music_move', LX.List.ListActionMusicMove>
| SyncAction<'list_music_remove', LX.List.ListActionMusicRemove>
| SyncAction<'list_music_update', LX.List.ListActionMusicUpdate>
| SyncAction<'list_music_update_position', LX.List.ListActionMusicUpdatePosition>
| SyncAction<'list_music_overwrite', LX.List.ListActionMusicOverwrite>
| SyncAction<'list_music_clear', LX.List.ListActionMusicClear>
type ServerActions = WarpPromiseRecord<{ type ClientSyncActions = WarpPromiseRecord<{
onListSyncAction: (action: LX.Sync.ActionList) => void getEnabledFeatures: (serverType: ServerType, supportedFeatures: SupportedFeatures) => EnabledFeatures
}> finished: () => void
}>
type ClientActions = WarpPromiseRecord<{ type ClientSyncListActions = WarpPromiseRecord<{
onListSyncAction: (action: LX.Sync.ActionList) => void onListSyncAction: (action: LX.Sync.List.ActionList) => void
list_sync_get_md5: () => string list_sync_get_md5: () => string
list_sync_get_sync_mode: () => Mode list_sync_get_sync_mode: () => LX.Sync.List.SyncMode
list_sync_get_list_data: () => ListData list_sync_get_list_data: () => LX.Sync.List.ListData
list_sync_set_list_data: (data: ListData) => void list_sync_set_list_data: (data: LX.Sync.List.ListData) => void
list_sync_finished: () => void list_sync_finished: () => void
}> }>
} }
} }