diff --git a/package.json b/package.json index 1eefcf9..177900a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kokkoro/web", - "version": "0.1.2", + "version": "0.1.3", "description": "Create web serve for kokkoro.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -30,6 +30,7 @@ "uuid": "^9.0.0" }, "devDependencies": { + "@kokkoro/database": "^1.0.1", "@kokkoro/utils": "^0.6.0", "@types/jsonwebtoken": "^9.0.1", "@types/koa": "^2.13.5", @@ -37,7 +38,7 @@ "@types/koa__cors": "^3.3.0", "@types/koa__router": "^12.0.0", "@types/uuid": "^9.0.0", - "kokkoro": "^2.0.0-alpha.3" + "kokkoro": "^2.0.0-alpha.7" }, "files": [ "lib" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index edd1658..e5df994 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,6 +3,7 @@ lockfileVersion: 5.4 specifiers: '@koa/cors': ^4.0.0 '@koa/router': ^12.0.0 + '@kokkoro/database': ^1.0.1 '@kokkoro/utils': ^0.6.0 '@types/jsonwebtoken': ^9.0.1 '@types/koa': ^2.13.5 @@ -14,7 +15,7 @@ specifiers: koa: ^2.14.1 koa-body: ^6.0.1 koa-static: ^5.0.0 - kokkoro: ^2.0.0-alpha.3 + kokkoro: ^2.0.0-alpha.7 uuid: ^9.0.0 dependencies: @@ -27,6 +28,7 @@ dependencies: uuid: 9.0.0 devDependencies: + '@kokkoro/database': 1.0.1 '@kokkoro/utils': 0.6.0 '@types/jsonwebtoken': 9.0.1 '@types/koa': 2.13.5 @@ -34,264 +36,15 @@ devDependencies: '@types/koa__cors': 3.3.0 '@types/koa__router': 12.0.0 '@types/uuid': 9.0.0 - kokkoro: 2.0.0-alpha.3 + kokkoro: 2.0.0-alpha.7 packages: - /@babel/helper-string-parser/7.19.4: - resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-validator-identifier/7.19.1: - resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/parser/7.20.15: - resolution: {integrity: sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.20.7 - dev: true - - /@babel/types/7.20.7: - resolution: {integrity: sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.19.4 - '@babel/helper-validator-identifier': 7.19.1 - to-fast-properties: 2.0.0 - dev: true - - /@ctrl/tinycolor/3.5.0: - resolution: {integrity: sha512-tlJpwF40DEQcfR/QF+wNMVyGMaO9FQp6Z1Wahj4Gk3CJQYHwA2xVG7iKDFdW6zuxZY9XWOpGcfNCTsX4McOsOg==} - engines: {node: '>=10'} - dev: true - - /@element-plus/icons-vue/2.0.10_vue@3.2.47: - resolution: {integrity: sha512-ygEZ1mwPjcPo/OulhzLE7mtDrQBWI8vZzEWSNB2W/RNCRjoQGwbaK4N8lV4rid7Ts4qvySU3njMN7YCiSlSaTQ==} - peerDependencies: - vue: ^3.2.0 - dependencies: - vue: 3.2.47 - dev: true - - /@esbuild/android-arm/0.16.17: - resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-arm64/0.16.17: - resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-x64/0.16.17: - resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-arm64/0.16.17: - resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-x64/0.16.17: - resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-arm64/0.16.17: - resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-x64/0.16.17: - resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm/0.16.17: - resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm64/0.16.17: - resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ia32/0.16.17: - resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-loong64/0.16.17: - resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-mips64el/0.16.17: - resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ppc64/0.16.17: - resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-riscv64/0.16.17: - resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-s390x/0.16.17: - resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-x64/0.16.17: - resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/netbsd-x64/0.16.17: - resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/openbsd-x64/0.16.17: - resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/sunos-x64/0.16.17: - resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-arm64/0.16.17: - resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-ia32/0.16.17: - resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-x64/0.16.17: - resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@floating-ui/core/1.2.0: - resolution: {integrity: sha512-GHUXPEhMEmTpnpIfesFA2KAoMJPb1SPQw964tToQwt+BbGXdhqTCWT1rOb0VURGylsxsYxiGMnseJ3IlclVpVA==} - dev: true - - /@floating-ui/dom/1.2.0: - resolution: {integrity: sha512-QXzg57o1cjLz3cGETzKXjI3kx1xyS49DW9l7kV2jw2c8Yftd434t2hllX0sVGn2Q8MtcW/4pNm8bfE1/4n6mng==} - dependencies: - '@floating-ui/core': 1.2.0 - dev: true - /@koa/cors/4.0.0: resolution: {integrity: sha512-Y4RrbvGTlAaa04DBoPBWJqDR5gPj32OOz827ULXfgB1F7piD1MB/zwn8JR2LAnvdILhxUbXbkXGWuNVsFuVFCQ==} engines: {node: '>= 14.0.0'} dependencies: vary: 1.1.2 - dev: false /@koa/router/12.0.0: resolution: {integrity: sha512-cnnxeKHXlt7XARJptflGURdJaO+ITpNkOHmQu7NHmCoRinPbyvFzce/EG/E8Zy81yQ1W9MoSdtklc3nyaDReUw==} @@ -301,57 +54,37 @@ packages: koa-compose: 4.1.0 methods: 1.1.2 path-to-regexp: 6.2.1 - dev: false - /@kokkoro/admin/0.1.0: - resolution: {integrity: sha512-IRmF/vq0JatlcK3b83UJvR3fq9ew4inPjS15x/umL72cc+OY+K5ugakYu3u+qMtdY6Hxla7M7QtBn4spbfINmQ==} + /@kokkoro/admin/0.2.0: + resolution: {integrity: sha512-RvH2PFpVM+pBgl9gSZ2KszezxOvK6VbXQSGxhuVbfus8b0TRtLNZ5EFs1kN0VSIwCTjYAy8gAABBu6GXv+23Vg==} engines: {node: '>=16.0.0', npm: '>= 7.0.0'} - dependencies: - '@element-plus/icons-vue': 2.0.10_vue@3.2.47 - '@vitejs/plugin-vue': 4.0.0_vite@4.1.1+vue@3.2.47 - axios: 1.3.2 - echarts: 5.4.1 - element-plus: 2.2.29_vue@3.2.47 - js-cookie: 3.0.1 - mitt: 3.0.0 - nprogress: 0.2.0 - pinia: 2.0.30_vue@3.2.47 - qrcodejs2-fixes: 0.0.2 - qs: 6.11.0 - sass: 1.58.0 - screenfull: 6.0.2 - sortablejs: 1.15.0 - vite: 4.1.1_sass@1.58.0 - vite-plugin-vue-setup-extend: 0.4.0_vite@4.1.1 - vue: 3.2.47 - vue-clipboard3: 2.0.0 - vue-router: 4.1.6_vue@3.2.47 - transitivePeerDependencies: - - '@types/node' - - '@vue/composition-api' - - debug - - less - - stylus - - sugarss - - terser - - typescript dev: true - /@kokkoro/jsondb/1.2.3: - resolution: {integrity: sha512-Qkagnn/HILvj8JOiGAPXYbQ62Z6mQiDBXiGkkBoGQsuzhBxFvBrxB44Nyp6YqYjv+Alpd88MSLOXnHqPbQn2Og==} + /@kokkoro/database/1.0.1: + resolution: {integrity: sha512-XYqRXWaZmSbWAwTWxv9cXyQAsdzMVr8Q1FyRy+1rfKFHqYb5Qtu11ImMdTzKtu2DTcXTzpNAWxtC1HV0xhpUFQ==} + dependencies: + classic-level: 1.2.0 dev: true /@kokkoro/utils/0.6.0: resolution: {integrity: sha512-RHFhuiS+Ia8KdXt5FrsbFtJOrD9faZR1T66nvjYaWnvOn+cm0jqbCg/n103H+pMdldfYLoW+klIRTQKu7d+Z0Q==} dev: true - /@kokkoro/web/0.1.0: - resolution: {integrity: sha512-mjRSX6B8ycvKkF5cG116QjqdAvDvcbt7GFzkGq4dt4JIO1j6xOqzW7dVTY0vBBXZEnyTQPUP3BOS5KR+KkIUdA==} + /@kokkoro/utils/0.7.1: + resolution: {integrity: sha512-5cOvi8AFpsNWQLIohkWiRa+NQCT3Y5moFF2Kiq/TrNf0Z7De18Be6l4IvU2UMz8FD3bx9TwiACKXd3VxUikZEg==} dependencies: + internal-ip: 6.2.0 + public-ip: 4.0.4 + dev: true + + /@kokkoro/web/0.1.2: + resolution: {integrity: sha512-vn/WhAHYFko5L6EpSzhE1eakGXc5PD6qNuoafapmwOoqmzWfriJi+6d6/eo4B4eijzjgIqirHjF/dnBTfq/FBw==} + dependencies: + '@koa/cors': 4.0.0 + '@koa/router': 12.0.0 jsonwebtoken: 9.0.0 koa: 2.14.1 koa-body: 6.0.1 - koa-router: 10.1.1 koa-static: 5.0.0 uuid: 9.0.0 transitivePeerDependencies: @@ -367,10 +100,6 @@ packages: engines: {node: '>=6'} dev: true - /@sxzz/popperjs-es/2.11.7: - resolution: {integrity: sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==} - dev: true - /@szmarczak/http-timer/1.1.2: resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==} engines: {node: '>=6'} @@ -381,24 +110,24 @@ packages: /@types/accepts/1.3.5: resolution: {integrity: sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 /@types/body-parser/1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 18.11.19 + '@types/node': 18.13.0 /@types/co-body/6.1.0: resolution: {integrity: sha512-3e0q2jyDAnx/DSZi0z2H0yoZ2wt5yRDZ+P7ymcMObvq0ufWRT4tsajyO+Q1VwVWiv9PRR4W3YEjEzBjeZlhF+w==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 '@types/qs': 6.9.7 /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 /@types/content-disposition/0.5.5: resolution: {integrity: sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==} @@ -409,12 +138,12 @@ packages: '@types/connect': 3.4.35 '@types/express': 4.17.17 '@types/keygrip': 1.0.2 - '@types/node': 18.11.19 + '@types/node': 18.13.0 /@types/express-serve-static-core/4.17.33: resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 @@ -429,7 +158,7 @@ packages: /@types/formidable/2.0.5: resolution: {integrity: sha512-uvMcdn/KK3maPOaVUAc3HEYbCEhjaGFwww4EsX6IJfWIJ1tzHtDHczuImH3GKdusPnAAmzB07St90uabZeCKPA==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 /@types/http-assert/1.5.3: resolution: {integrity: sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA==} @@ -440,7 +169,7 @@ packages: /@types/jsonwebtoken/9.0.1: resolution: {integrity: sha512-c5ltxazpWabia/4UzhIoaDcIza4KViOQhdbjRlfcIGVnsE3c3brkz9Z+F/EeJIECOQP7W7US2hNE930cWWkPiw==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 dev: true /@types/keygrip/1.0.2: @@ -449,7 +178,7 @@ packages: /@types/keyv/3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 dev: true /@types/koa-compose/3.2.5: @@ -480,7 +209,7 @@ packages: '@types/http-errors': 2.0.1 '@types/keygrip': 1.0.2 '@types/koa-compose': 3.2.5 - '@types/node': 18.11.19 + '@types/node': 18.13.0 /@types/koa__cors/3.3.0: resolution: {integrity: sha512-FUN8YxcBakIs+walVe3+HcNP+Bxd0SB8BJHBWkglZ5C1XQWljlKcEFDG/dPiCIqwVCUbc5X0nYDlH62uEhdHMA==} @@ -494,21 +223,11 @@ packages: '@types/koa': 2.13.5 dev: true - /@types/lodash-es/4.17.6: - resolution: {integrity: sha512-R+zTeVUKDdfoRxpAryaQNRKk3105Rrgx2CFRClIgRGaqDTdjsm8h6IYA8ir584W3ePzkZfst5xIgDwYrlh9HLg==} - dependencies: - '@types/lodash': 4.14.191 - dev: true - - /@types/lodash/4.14.191: - resolution: {integrity: sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==} - dev: true - /@types/mime/3.0.1: resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} - /@types/node/18.11.19: - resolution: {integrity: sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==} + /@types/node/18.13.0: + resolution: {integrity: sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==} /@types/qs/6.9.7: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} @@ -519,144 +238,30 @@ packages: /@types/responselike/1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 18.11.19 + '@types/node': 18.13.0 dev: true /@types/serve-static/1.15.0: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: '@types/mime': 3.0.1 - '@types/node': 18.11.19 + '@types/node': 18.13.0 /@types/uuid/9.0.0: resolution: {integrity: sha512-kr90f+ERiQtKWMz5rP32ltJ/BtULDI5RVO0uavn1HQUOwjx0R1h0rnDYNL0CepF1zL5bSY6FISAfd9tOdDhU5Q==} dev: true - /@types/web-bluetooth/0.0.16: - resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} - dev: true - - /@vitejs/plugin-vue/4.0.0_vite@4.1.1+vue@3.2.47: - resolution: {integrity: sha512-e0X4jErIxAB5oLtDqbHvHpJe/uWNkdpYV83AOG2xo2tEVSzCzewgJMtREZM30wXnM5ls90hxiOtAuVU6H5JgbA==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^4.0.0 - vue: ^3.2.25 - dependencies: - vite: 4.1.1_sass@1.58.0 - vue: 3.2.47 - dev: true - - /@vue/compiler-core/3.2.47: - resolution: {integrity: sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==} - dependencies: - '@babel/parser': 7.20.15 - '@vue/shared': 3.2.47 - estree-walker: 2.0.2 - source-map: 0.6.1 - dev: true - - /@vue/compiler-dom/3.2.47: - resolution: {integrity: sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==} - dependencies: - '@vue/compiler-core': 3.2.47 - '@vue/shared': 3.2.47 - dev: true - - /@vue/compiler-sfc/3.2.47: - resolution: {integrity: sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==} - dependencies: - '@babel/parser': 7.20.15 - '@vue/compiler-core': 3.2.47 - '@vue/compiler-dom': 3.2.47 - '@vue/compiler-ssr': 3.2.47 - '@vue/reactivity-transform': 3.2.47 - '@vue/shared': 3.2.47 - estree-walker: 2.0.2 - magic-string: 0.25.9 - postcss: 8.4.21 - source-map: 0.6.1 - dev: true - - /@vue/compiler-ssr/3.2.47: - resolution: {integrity: sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==} - dependencies: - '@vue/compiler-dom': 3.2.47 - '@vue/shared': 3.2.47 - dev: true - - /@vue/devtools-api/6.5.0: - resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} - dev: true - - /@vue/reactivity-transform/3.2.47: - resolution: {integrity: sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==} - dependencies: - '@babel/parser': 7.20.15 - '@vue/compiler-core': 3.2.47 - '@vue/shared': 3.2.47 - estree-walker: 2.0.2 - magic-string: 0.25.9 - dev: true - - /@vue/reactivity/3.2.47: - resolution: {integrity: sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==} - dependencies: - '@vue/shared': 3.2.47 - dev: true - - /@vue/runtime-core/3.2.47: - resolution: {integrity: sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==} - dependencies: - '@vue/reactivity': 3.2.47 - '@vue/shared': 3.2.47 - dev: true - - /@vue/runtime-dom/3.2.47: - resolution: {integrity: sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==} - dependencies: - '@vue/runtime-core': 3.2.47 - '@vue/shared': 3.2.47 - csstype: 2.6.21 - dev: true - - /@vue/server-renderer/3.2.47_vue@3.2.47: - resolution: {integrity: sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==} - peerDependencies: - vue: 3.2.47 - dependencies: - '@vue/compiler-ssr': 3.2.47 - '@vue/shared': 3.2.47 - vue: 3.2.47 - dev: true - - /@vue/shared/3.2.47: - resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==} - dev: true - - /@vueuse/core/9.12.0_vue@3.2.47: - resolution: {integrity: sha512-h/Di8Bvf6xRcvS/PvUVheiMYYz3U0tH3X25YxONSaAUBa841ayMwxkuzx/DGUMCW/wHWzD8tRy2zYmOC36r4sg==} - dependencies: - '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.12.0 - '@vueuse/shared': 9.12.0_vue@3.2.47 - vue-demi: 0.13.11_vue@3.2.47 - transitivePeerDependencies: - - '@vue/composition-api' - - vue - dev: true - - /@vueuse/metadata/9.12.0: - resolution: {integrity: sha512-9oJ9MM9lFLlmvxXUqsR1wLt1uF7EVbP5iYaHJYqk+G2PbMjY6EXvZeTjbdO89HgoF5cI6z49o2zT/jD9SVoNpQ==} - dev: true - - /@vueuse/shared/9.12.0_vue@3.2.47: - resolution: {integrity: sha512-TWuJLACQ0BVithVTRbex4Wf1a1VaRuSpVeyEd4vMUWl54PzlE0ciFUshKCXnlLuD0lxIaLK4Ypj3NXYzZh4+SQ==} + /abstract-level/1.0.3: + resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} + engines: {node: '>=12'} dependencies: - vue-demi: 0.13.11_vue@3.2.47 - transitivePeerDependencies: - - '@vue/composition-api' - - vue + buffer: 6.0.3 + catering: 2.1.1 + is-buffer: 2.0.5 + level-supports: 4.0.1 + level-transcoder: 1.0.1 + module-error: 1.0.2 + queue-microtask: 1.2.3 dev: true /accepts/1.3.8: @@ -666,21 +271,9 @@ packages: mime-types: 2.1.35 negotiator: 0.6.3 - /anymatch/3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - /asap/2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} - /async-validator/4.2.5: - resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} - dev: true - /asynckit/0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: true @@ -694,31 +287,20 @@ packages: - debug dev: true - /axios/1.3.2: - resolution: {integrity: sha512-1M3O703bYqYuPhbHeya5bnhpYVsDDRyQSabNja04mZtboLNSuZ4YrltestrLXfHgmzua4TpUqRiVKbiQuo2epw==} - dependencies: - follow-redirects: 1.15.2 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug + /base64-js/1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: true - /binary-extensions/2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true + /buffer-equal-constant-time/1.0.1: + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} - /braces/3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} + /buffer/6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} dependencies: - fill-range: 7.0.1 + base64-js: 1.5.1 + ieee754: 1.2.1 dev: true - /buffer-equal-constant-time/1.0.1: - resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} - /bytes/3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -749,27 +331,21 @@ packages: function-bind: 1.1.1 get-intrinsic: 1.2.0 - /chokidar/3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.2 + /catering/2.1.1: + resolution: {integrity: sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==} + engines: {node: '>=6'} dev: true - /clipboard/2.0.11: - resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==} + /classic-level/1.2.0: + resolution: {integrity: sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==} + engines: {node: '>=12'} + requiresBuild: true dependencies: - good-listener: 1.2.2 - select: 1.1.2 - tiny-emitter: 2.1.0 + abstract-level: 1.0.3 + catering: 2.1.1 + module-error: 1.0.2 + napi-macros: 2.0.0 + node-gyp-build: 4.6.0 dev: true /clone-response/1.0.3: @@ -820,8 +396,13 @@ packages: luxon: 3.2.1 dev: true - /csstype/2.6.21: - resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==} + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 dev: true /date-format/4.0.14: @@ -829,10 +410,6 @@ packages: engines: {node: '>=4.0'} dev: true - /dayjs/1.11.7: - resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==} - dev: true - /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -875,6 +452,13 @@ packages: /deep-equal/1.0.1: resolution: {integrity: sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==} + /default-gateway/6.0.3: + resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==} + engines: {node: '>= 10'} + dependencies: + execa: 5.1.1 + dev: true + /defer-to-connect/1.1.3: resolution: {integrity: sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==} dev: true @@ -884,10 +468,6 @@ packages: engines: {node: '>=0.4.0'} dev: true - /delegate/3.2.0: - resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==} - dev: true - /delegates/1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} @@ -937,41 +517,9 @@ packages: dependencies: safe-buffer: 5.2.1 - /echarts/5.4.1: - resolution: {integrity: sha512-9ltS3M2JB0w2EhcYjCdmtrJ+6haZcW6acBolMGIuf01Hql1yrIV01L1aRj7jsaaIULJslEP9Z3vKlEmnJaWJVQ==} - dependencies: - tslib: 2.3.0 - zrender: 5.4.1 - dev: true - /ee-first/1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - /element-plus/2.2.29_vue@3.2.47: - resolution: {integrity: sha512-g4dcrURrKkR5uUX8n5RVnnqGnimoki9HfqS4yHHG6XwCHBkZGozdq4x+478BzeWUe31h++BO+7dakSx4VnM8RQ==} - peerDependencies: - vue: ^3.2.0 - dependencies: - '@ctrl/tinycolor': 3.5.0 - '@element-plus/icons-vue': 2.0.10_vue@3.2.47 - '@floating-ui/dom': 1.2.0 - '@popperjs/core': /@sxzz/popperjs-es/2.11.7 - '@types/lodash': 4.14.191 - '@types/lodash-es': 4.17.6 - '@vueuse/core': 9.12.0_vue@3.2.47 - async-validator: 4.2.5 - dayjs: 1.11.7 - escape-html: 1.0.3 - lodash: 4.17.21 - lodash-es: 4.17.21 - lodash-unified: 1.0.3_3ib2ivapxullxkx3xftsimdk7u - memoize-one: 6.0.0 - normalize-wheel-es: 1.2.0 - vue: 3.2.47 - transitivePeerDependencies: - - '@vue/composition-api' - dev: true - /encodeurl/1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} @@ -982,48 +530,22 @@ packages: once: 1.4.0 dev: true - /esbuild/0.16.17: - resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.16.17 - '@esbuild/android-arm64': 0.16.17 - '@esbuild/android-x64': 0.16.17 - '@esbuild/darwin-arm64': 0.16.17 - '@esbuild/darwin-x64': 0.16.17 - '@esbuild/freebsd-arm64': 0.16.17 - '@esbuild/freebsd-x64': 0.16.17 - '@esbuild/linux-arm': 0.16.17 - '@esbuild/linux-arm64': 0.16.17 - '@esbuild/linux-ia32': 0.16.17 - '@esbuild/linux-loong64': 0.16.17 - '@esbuild/linux-mips64el': 0.16.17 - '@esbuild/linux-ppc64': 0.16.17 - '@esbuild/linux-riscv64': 0.16.17 - '@esbuild/linux-s390x': 0.16.17 - '@esbuild/linux-x64': 0.16.17 - '@esbuild/netbsd-x64': 0.16.17 - '@esbuild/openbsd-x64': 0.16.17 - '@esbuild/sunos-x64': 0.16.17 - '@esbuild/win32-arm64': 0.16.17 - '@esbuild/win32-ia32': 0.16.17 - '@esbuild/win32-x64': 0.16.17 - dev: true - /escape-html/1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - /estree-walker/2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - dev: true - - /fill-range/7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} + /execa/5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} dependencies: - to-regex-range: 5.0.1 + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 dev: true /flatted/3.2.7: @@ -1070,14 +592,6 @@ packages: universalify: 0.1.2 dev: true - /fsevents/2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: true - optional: true - /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} @@ -1102,17 +616,9 @@ packages: pump: 3.0.0 dev: true - /glob-parent/5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - dependencies: - is-glob: 4.0.3 - dev: true - - /good-listener/1.2.2: - resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==} - dependencies: - delegate: 3.2.0 + /get-stream/6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} dev: true /got/9.6.0: @@ -1198,14 +704,19 @@ packages: statuses: 2.0.1 toidentifier: 1.0.1 + /human-signals/2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + /iconv-lite/0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 - /immutable/4.2.4: - resolution: {integrity: sha512-WDxL3Hheb1JkRN3sQkyujNlL/xRjAo3rJtaU5xeufUauG66JdMr32bLj4gF+vWl84DIA3Zxw7tiAjneYzRRw+w==} + /ieee754/1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: true /inflation/2.0.0: @@ -1218,27 +729,29 @@ packages: /inherits/2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - /ip-regex/4.3.0: - resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==} - engines: {node: '>=8'} + /internal-ip/6.2.0: + resolution: {integrity: sha512-D8WGsR6yDt8uq7vDMu7mjcR+yRMm3dW8yufyChmszWRjcSHuxLBkR3GdS2HZAjodsaGuCvXeEJpueisXJULghg==} + engines: {node: '>=10'} + dependencies: + default-gateway: 6.0.3 + ipaddr.js: 1.9.1 + is-ip: 3.1.0 + p-event: 4.2.0 dev: true - /is-binary-path/2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + /ip-regex/4.3.0: + resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==} engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 dev: true - /is-core-module/2.11.0: - resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} - dependencies: - has: 1.0.3 + /ipaddr.js/1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} dev: true - /is-extglob/2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} + /is-buffer/2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} dev: true /is-generator-function/1.0.10: @@ -1247,13 +760,6 @@ packages: dependencies: has-tostringtag: 1.0.0 - /is-glob/4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - dependencies: - is-extglob: 2.1.1 - dev: true - /is-ip/3.1.0: resolution: {integrity: sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==} engines: {node: '>=8'} @@ -1261,14 +767,13 @@ packages: ip-regex: 4.3.0 dev: true - /is-number/7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} + /is-stream/2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} dev: true - /js-cookie/3.0.1: - resolution: {integrity: sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==} - engines: {node: '>=12'} + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true /json-buffer/3.0.0: @@ -1327,7 +832,7 @@ packages: '@types/koa': 2.13.5 co-body: 6.1.0 formidable: 2.1.1 - zod: 3.20.2 + zod: 3.20.6 /koa-compose/4.1.0: resolution: {integrity: sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==} @@ -1339,19 +844,6 @@ packages: co: 4.6.0 koa-compose: 4.1.0 - /koa-router/10.1.1: - resolution: {integrity: sha512-z/OzxVjf5NyuNO3t9nJpx7e1oR3FSBAauiwXtMQu4ppcnuNZzTaQ4p21P8A6r2Es8uJJM339oc4oVW+qX7SqnQ==} - engines: {node: '>= 8.0.0'} - dependencies: - debug: 4.3.4 - http-errors: 1.8.1 - koa-compose: 4.1.0 - methods: 1.1.2 - path-to-regexp: 6.2.1 - transitivePeerDependencies: - - supports-color - dev: true - /koa-send/5.0.1: resolution: {integrity: sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==} engines: {node: '>= 8'} @@ -1401,46 +893,34 @@ packages: transitivePeerDependencies: - supports-color - /kokkoro/2.0.0-alpha.3: - resolution: {integrity: sha512-4ZHzjxFK8qiUg5c1HmfzWZtc8JlXAGXdbjphqySc4e9VvKRydQd/6mlzfKthrlk/g8LdJ/Ra4+jbtkahEnmhSA==} + /kokkoro/2.0.0-alpha.7: + resolution: {integrity: sha512-FXc39SQ9HBZZZP99PG92FqSC9cIUgK2C5+lswwLSr6ofz5g6hbzkcsU6sWrQYAnlWyMEPsODiOqyZ2KvmC3WeQ==} engines: {node: '>= v15'} dependencies: - '@kokkoro/admin': 0.1.0 - '@kokkoro/jsondb': 1.2.3 - '@kokkoro/utils': 0.6.0 - '@kokkoro/web': 0.1.0 - chokidar: 3.5.3 + '@kokkoro/admin': 0.2.0 + '@kokkoro/database': 1.0.1 + '@kokkoro/utils': 0.7.1 + '@kokkoro/web': 0.1.2 cron: 2.2.0 dotenv: 16.0.3 jsqr: 1.4.0 oicq: 2.3.1 - public-ip: 4.0.4 transitivePeerDependencies: - - '@types/node' - - '@vue/composition-api' - debug - - less - - stylus - - sugarss - supports-color - - terser - - typescript dev: true - /lodash-es/4.17.21: - resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + /level-supports/4.0.1: + resolution: {integrity: sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==} + engines: {node: '>=12'} dev: true - /lodash-unified/1.0.3_3ib2ivapxullxkx3xftsimdk7u: - resolution: {integrity: sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==} - peerDependencies: - '@types/lodash-es': '*' - lodash: '*' - lodash-es: '*' + /level-transcoder/1.0.1: + resolution: {integrity: sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==} + engines: {node: '>=12'} dependencies: - '@types/lodash-es': 4.17.6 - lodash: 4.17.21 - lodash-es: 4.17.21 + buffer: 6.0.3 + module-error: 1.0.2 dev: true /lodash.merge/4.6.2: @@ -1488,18 +968,12 @@ packages: engines: {node: '>=12'} dev: true - /magic-string/0.25.9: - resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} - dependencies: - sourcemap-codec: 1.4.8 - dev: true - /media-typer/0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} - /memoize-one/6.0.0: - resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==} + /merge-stream/2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true /methods/1.1.2: @@ -1516,13 +990,19 @@ packages: dependencies: mime-db: 1.52.0 + /mimic-fn/2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + /mimic-response/1.0.1: resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} engines: {node: '>=4'} dev: true - /mitt/3.0.0: - resolution: {integrity: sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==} + /module-error/1.0.2: + resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} + engines: {node: '>=10'} dev: true /ms/2.0.0: @@ -1535,10 +1015,8 @@ packages: /ms/2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - /nanoid/3.3.4: - resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true + /napi-macros/2.0.0: + resolution: {integrity: sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==} dev: true /needle/2.9.1: @@ -1557,9 +1035,9 @@ packages: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} - /normalize-path/3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} + /node-gyp-build/4.6.0: + resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==} + hasBin: true dev: true /normalize-url/4.5.1: @@ -1567,12 +1045,11 @@ packages: engines: {node: '>=8'} dev: true - /normalize-wheel-es/1.2.0: - resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==} - dev: true - - /nprogress/0.2.0: - resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==} + /npm-run-path/4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 dev: true /object-inspect/1.12.3: @@ -1603,6 +1080,13 @@ packages: dependencies: wrappy: 1.0.2 + /onetime/5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + /only/0.0.2: resolution: {integrity: sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==} @@ -1611,6 +1095,25 @@ packages: engines: {node: '>=6'} dev: true + /p-event/4.2.0: + resolution: {integrity: sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==} + engines: {node: '>=8'} + dependencies: + p-timeout: 3.2.0 + dev: true + + /p-finally/1.0.0: + resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} + engines: {node: '>=4'} + dev: true + + /p-timeout/3.2.0: + resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==} + engines: {node: '>=8'} + dependencies: + p-finally: 1.0.0 + dev: true + /parseurl/1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -1619,53 +1122,19 @@ packages: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} - /path-parse/1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} dev: true /path-to-regexp/6.2.1: resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==} - /picocolors/1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - dev: true - - /picomatch/2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - dev: true - - /pinia/2.0.30_vue@3.2.47: - resolution: {integrity: sha512-q6DUmxWwe/mQgg+55QQjykpKC+aGeGdaJV3niminl19V08dE+LRTvSEuqi6/NLSGCKHI49KGL6tMNEOssFiMyA==} - peerDependencies: - '@vue/composition-api': ^1.4.0 - typescript: '>=4.4.4' - vue: ^2.6.14 || ^3.2.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - typescript: - optional: true - dependencies: - '@vue/devtools-api': 6.5.0 - vue: 3.2.47 - vue-demi: 0.13.11_vue@3.2.47 - dev: true - /pngjs/6.0.0: resolution: {integrity: sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==} engines: {node: '>=12.13.0'} dev: true - /postcss/8.4.21: - resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.4 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - /prepend-http/2.0.0: resolution: {integrity: sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==} engines: {node: '>=4'} @@ -1681,10 +1150,6 @@ packages: - supports-color dev: true - /proxy-from-env/1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - /public-ip/4.0.4: resolution: {integrity: sha512-EJ0VMV2vF6Cu7BIPo3IMW1Maq6ME+fbR0NcPmqDfpfNGIRPue1X8QrGjrg/rfjDkOsIkKHIf2S5FlEa48hFMTA==} engines: {node: '>=8'} @@ -1701,16 +1166,16 @@ packages: once: 1.4.0 dev: true - /qrcodejs2-fixes/0.0.2: - resolution: {integrity: sha512-wMUXYMOixAEJlLnjk5MbLiFaz0gQObWYm/TIFWB5+j7sTY5gPyr09Cx1EpcLYbsgfFdN3wHjrKAhZofTuCBGhg==} - dev: true - /qs/6.11.0: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + /raw-body/2.5.1: resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} engines: {node: '>= 0.8'} @@ -1720,13 +1185,6 @@ packages: iconv-lite: 0.4.24 unpipe: 1.0.0 - /readdirp/3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.1 - dev: true - /resolve-path/1.4.0: resolution: {integrity: sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==} engines: {node: '>= 0.8'} @@ -1734,15 +1192,6 @@ packages: http-errors: 1.6.3 path-is-absolute: 1.0.1 - /resolve/1.22.1: - resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} - hasBin: true - dependencies: - is-core-module: 2.11.0 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - /responselike/1.0.2: resolution: {integrity: sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==} dependencies: @@ -1753,43 +1202,16 @@ packages: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} dev: true - /rollup/3.14.0: - resolution: {integrity: sha512-o23sdgCLcLSe3zIplT9nQ1+r97okuaiR+vmAPZPTDYB7/f3tgWIYNyiQveMsZwshBT0is4eGax/HH83Q7CG+/Q==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 - dev: true - /safe-buffer/5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} /safer-buffer/2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - /sass/1.58.0: - resolution: {integrity: sha512-PiMJcP33DdKtZ/1jSjjqVIKihoDc6yWmYr9K/4r3fVVIEDAluD0q7XZiRKrNJcPK3qkLRF/79DND1H5q1LBjgg==} - engines: {node: '>=12.0.0'} - hasBin: true - dependencies: - chokidar: 3.5.3 - immutable: 4.2.4 - source-map-js: 1.0.2 - dev: true - /sax/1.2.4: resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} dev: true - /screenfull/6.0.2: - resolution: {integrity: sha512-AQdy8s4WhNvUZ6P8F6PB21tSPIYKniic+Ogx0AacBMjKP1GUHN2E9URxQHtCusiwxudnCKkdy4GrHXPPJSkCCw==} - engines: {node: ^14.13.1 || >=16.0.0} - dev: true - - /select/1.1.2: - resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==} - dev: true - /semver/7.3.8: resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} engines: {node: '>=10'} @@ -1803,6 +1225,18 @@ packages: /setprototypeof/1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + /side-channel/1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -1810,23 +1244,8 @@ packages: get-intrinsic: 1.2.0 object-inspect: 1.12.3 - /sortablejs/1.15.0: - resolution: {integrity: sha512-bv9qgVMjUMf89wAvM6AxVvS/4MX3sPeN0+agqShejLU5z5GX4C75ow1O2e5k4L6XItUyAK3gH6AxSbXrOM5e8w==} - dev: true - - /source-map-js/1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} - dev: true - - /source-map/0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - dev: true - - /sourcemap-codec/1.4.8: - resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead + /signal-exit/3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true /statuses/1.5.0: @@ -1856,18 +1275,9 @@ packages: - supports-color dev: true - /supports-preserve-symlinks-flag/1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - dev: true - - /tiny-emitter/2.1.0: - resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} - dev: true - - /to-fast-properties/2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} + /strip-final-newline/2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} dev: true /to-readable-stream/1.0.0: @@ -1875,21 +1285,10 @@ packages: engines: {node: '>=6'} dev: true - /to-regex-range/5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - dependencies: - is-number: 7.0.0 - dev: true - /toidentifier/1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} - /tslib/2.3.0: - resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} - dev: true - /tsscmp/1.0.6: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} engines: {node: '>=0.6.x'} @@ -1925,88 +1324,12 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /vite-plugin-vue-setup-extend/0.4.0_vite@4.1.1: - resolution: {integrity: sha512-WMbjPCui75fboFoUTHhdbXzu4Y/bJMv5N9QT9a7do3wNMNHHqrk+Tn2jrSJU0LS5fGl/EG+FEDBYVUeWIkDqXQ==} - peerDependencies: - vite: '>=2.0.0' - dependencies: - '@vue/compiler-sfc': 3.2.47 - magic-string: 0.25.9 - vite: 4.1.1_sass@1.58.0 - dev: true - - /vite/4.1.1_sass@1.58.0: - resolution: {integrity: sha512-LM9WWea8vsxhr782r9ntg+bhSFS06FJgCvvB0+8hf8UWtvaiDagKYWXndjfX6kGl74keHJUcpzrQliDXZlF5yg==} - engines: {node: ^14.18.0 || >=16.0.0} - hasBin: true - peerDependencies: - '@types/node': '>= 14' - less: '*' - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - esbuild: 0.16.17 - postcss: 8.4.21 - resolve: 1.22.1 - rollup: 3.14.0 - sass: 1.58.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - - /vue-clipboard3/2.0.0: - resolution: {integrity: sha512-Q9S7dzWGax7LN5iiSPcu/K1GGm2gcBBlYwmMsUc5/16N6w90cbKow3FnPmPs95sungns4yvd9/+JhbAznECS2A==} - dependencies: - clipboard: 2.0.11 - dev: true - - /vue-demi/0.13.11_vue@3.2.47: - resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} - engines: {node: '>=12'} + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} hasBin: true - requiresBuild: true - peerDependencies: - '@vue/composition-api': ^1.0.0-rc.1 - vue: ^3.0.0-0 || ^2.6.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - dependencies: - vue: 3.2.47 - dev: true - - /vue-router/4.1.6_vue@3.2.47: - resolution: {integrity: sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ==} - peerDependencies: - vue: ^3.2.0 dependencies: - '@vue/devtools-api': 6.5.0 - vue: 3.2.47 - dev: true - - /vue/3.2.47: - resolution: {integrity: sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==} - dependencies: - '@vue/compiler-dom': 3.2.47 - '@vue/compiler-sfc': 3.2.47 - '@vue/runtime-dom': 3.2.47 - '@vue/server-renderer': 3.2.47_vue@3.2.47 - '@vue/shared': 3.2.47 + isexe: 2.0.0 dev: true /wrappy/1.0.2: @@ -2019,11 +1342,5 @@ packages: resolution: {integrity: sha512-RXRJzMiK6U2ye0BlGGZnmpwJDPgakn6aNQ0A7gHRbD4I0uvK4TW6UqkK1V0pp9jskjJBAXd3dRrbzWkqJ+6cxA==} engines: {node: '>= 4.0.0'} - /zod/3.20.2: - resolution: {integrity: sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==} - - /zrender/5.4.1: - resolution: {integrity: sha512-M4Z05BHWtajY2241EmMPHglDQAJ1UyHQcYsxDNzD9XLSkPDqMq4bB28v9Pb4mvHnVQ0GxyTklZ/69xCFP6RXBA==} - dependencies: - tslib: 2.3.0 - dev: true + /zod/3.20.6: + resolution: {integrity: sha512-oyu0m54SGCtzh6EClBVqDDlAYRz4jrVtKwQ7ZnsEmMI9HnzuZFj8QFwAY1M5uniIYACdGvv0PBWPF2kO0aNofA==} diff --git a/src/app.ts b/src/app.ts index d8c14ad..465b19f 100644 --- a/src/app.ts +++ b/src/app.ts @@ -3,6 +3,7 @@ import { join } from 'path'; import cors from "@koa/cors"; import serve from "koa-static"; import { HttpMethodEnum, koaBody } from 'koa-body'; + import router from './router'; import responseHandler from './middleware/response.middleware'; @@ -19,7 +20,7 @@ export class SourceError extends Error { export const app = new Koa(); -const view_path = join(require.resolve('@kokkoro/admin'), '../dist'); +const view_path = join(require.resolve('@kokkoro/admin'), '../../dist'); app.use(serve(view_path, { extensions: ['html'], @@ -27,7 +28,7 @@ app.use(serve(view_path, { app.use(cors()); app.use(responseHandler); app.use(koaBody({ - parsedMethods: ['POST', 'PUT', 'GET', 'DELETE'] as HttpMethodEnum[] + parsedMethods: ['POST', 'PUT', 'GET', 'DELETE'] as HttpMethodEnum[], })); app.use(router.routes()); app.use(router.allowedMethods()); diff --git a/src/controller/bot.controller.ts b/src/controller/bot.controller.ts index 9ab3efc..36c5d84 100644 --- a/src/controller/bot.controller.ts +++ b/src/controller/bot.controller.ts @@ -55,6 +55,54 @@ class BotController { }; return next(); } + + async getFriendList(ctx: Context, next: Next) { + const { uin } = ctx.request.body; + const list = botService.getFriendList(uin); + + ctx.result = { + data: { + list, + }, + message: '获取成功', + }; + return next(); + } + + async getGroupList(ctx: Context, next: Next) { + const { uin } = ctx.request.body; + const list = botService.getGroupList(uin); + + ctx.result = { + data: { + list, + }, + message: '获取成功', + }; + return next(); + } + + async sendPrivateMsg(ctx: Context, next: Next) { + const { uin, user_id, message, source } = ctx.request.body; + const data = await botService.sendPrivateMsg(uin, user_id, message, source); + + ctx.result = { + data, + message: '发送成功', + }; + return next(); + } + + async sendGroupMsg(ctx: Context, next: Next) { + const { uin, group_id, message, source } = ctx.request.body; + const data = await botService.sendGroupMsg(uin, group_id, message, source); + + ctx.result = { + data, + message: '发送成功', + }; + return next(); + } } export default new BotController(); diff --git a/src/controller/config.controller.ts b/src/controller/config.controller.ts new file mode 100644 index 0000000..55f2ef0 --- /dev/null +++ b/src/controller/config.controller.ts @@ -0,0 +1,17 @@ +import { Next } from 'koa'; +import { Context } from '../app'; +import configService from '../service/config.service'; + +class ConfigController { + async kokkoro(ctx: Context, next: Next) { + const data = configService.getKokkoroConfig(); + + ctx.result = { + data, + message: '获取成功', + }; + return next(); + } +} + +export default new ConfigController(); diff --git a/src/controller/user.controller.ts b/src/controller/user.controller.ts index 947cdd3..f628598 100644 --- a/src/controller/user.controller.ts +++ b/src/controller/user.controller.ts @@ -5,12 +5,10 @@ import userService from '../service/user.service'; class UserController { async list(ctx: Context, next: Next) { - const list = userService.getUserList(); + const data = await userService.getUserList(); ctx.result = { - data: { - list, - }, + data, message: '获取成功', }; return next(); @@ -36,7 +34,7 @@ class UserController { async register(ctx: Context, next: Next) { const { account, password } = ctx.request.body; - const data = userService.registerUser(account, password); + const data = await userService.registerUser(account, password); ctx.result = { data, @@ -48,7 +46,7 @@ class UserController { async modify(ctx: Context, next: Next) { const oldUser = ctx.state.user; const newUser = ctx.request.body; - const data = userService.modifyUser(oldUser, newUser); + const data = await userService.modifyUser(oldUser, newUser); ctx.result = { data, @@ -60,7 +58,7 @@ class UserController { async remove(ctx: Context, next: Next) { const { account } = ctx.request.body; const { account: self } = ctx.state.user; - const data = userService.removeUser(account, self); + const data = await userService.removeUser(account, self); ctx.result = { data, diff --git a/src/db.ts b/src/db.ts index 43638d7..585c229 100644 --- a/src/db.ts +++ b/src/db.ts @@ -1,3 +1,8 @@ -import { Database } from 'kokkoro'; +import { Database } from '@kokkoro/database'; +import User from './model/user.model'; -export const db = new Database('kokkoro'); +const db = new Database('kokkoro', { + valueEncoding: 'json', +}); + +export default db; diff --git a/src/middleware/bot.middleware.ts b/src/middleware/bot.middleware.ts new file mode 100644 index 0000000..e5b329b --- /dev/null +++ b/src/middleware/bot.middleware.ts @@ -0,0 +1,51 @@ +import { Next } from 'koa'; +import { Context, SourceError } from '../app'; +import botService from '../service/bot.service'; + +export async function verifyOnline(ctx: Context, next: Next) { + const { uin } = ctx.request.body ?? {}; + const bot = botService.getBot(uin); + const is_online = bot.isOnline(); + + if (!is_online) { + throw new SourceError(409, '该 bot 未登录'); + } + await next(); +} + +export async function verifyKey(ctx: Context, next: Next) { + const { KOKKORO_API_KEY } = process.env; + const { api_key } = ctx.request.body ?? {}; + + if (KOKKORO_API_KEY && (KOKKORO_API_KEY !== api_key)) { + throw new SourceError(403, '无效的 api key'); + } + await next(); +} + +export async function verifyUin(ctx: Context, next: Next) { + const { uin } = ctx.request.body ?? {}; + + if (!uin) { + throw new SourceError(403, 'uin 不能为空'); + } + await next(); +} + +export async function verifyPrivateMsg(ctx: Context, next: Next) { + const { user_id, message } = ctx.request.body ?? {}; + + if (!user_id || !message) { + throw new SourceError(403, '参数不能为空'); + } + await next(); +} + +export async function verifyGroupMsg(ctx: Context, next: Next) { + const { group_id, message } = ctx.request.body ?? {}; + + if (!group_id || !message) { + throw new SourceError(403, '参数不能为空'); + } + await next(); +} diff --git a/src/middleware/user.middleware.ts b/src/middleware/user.middleware.ts index 02895d9..7e1b0bc 100644 --- a/src/middleware/user.middleware.ts +++ b/src/middleware/user.middleware.ts @@ -20,7 +20,7 @@ export async function verifyRegister(ctx: Context, next: Next) { if (!account || !password) { throw new SourceError(403, '用户名与密码不能为空'); } - const has_user = userService.hasUser(account); + const has_user = await userService.hasUser(account); if (has_user) { throw new SourceError(409, '用户名已被注册'); diff --git a/src/router/bot.route.ts b/src/router/bot.route.ts index 640e9f7..e49d456 100644 --- a/src/router/bot.route.ts +++ b/src/router/bot.route.ts @@ -1,6 +1,7 @@ import Router from '@koa/router'; import botController from '../controller/bot.controller'; import authHandler from '../middleware/auth.middleware'; +import { verifyOnline, verifyKey, verifyUin, verifyGroupMsg, verifyPrivateMsg } from '../middleware/bot.middleware'; const router = new Router({ prefix: '/bot', @@ -9,6 +10,10 @@ const router = new Router({ router.get('/list', botController.list); router.post('/login', botController.login); router.post('/logout', botController.logout); -router.post('/query-qrcode-result', botController.queryQrcodeResult); +router.post('/query-qrcode-result', verifyUin, botController.queryQrcodeResult); +router.post('/get-friend-list', verifyKey, verifyOnline, verifyUin, botController.getFriendList); +router.post('/get-group-list', verifyKey, verifyOnline, verifyUin, botController.getGroupList); +router.post('/send-private-msg', verifyKey, verifyOnline, verifyPrivateMsg, botController.sendPrivateMsg); +router.post('/send-group-msg', verifyKey, verifyOnline, verifyGroupMsg, botController.sendGroupMsg); export default router; diff --git a/src/router/config.route.ts b/src/router/config.route.ts new file mode 100644 index 0000000..0d3e28c --- /dev/null +++ b/src/router/config.route.ts @@ -0,0 +1,11 @@ +import Router from '@koa/router'; +import configController from '../controller/config.controller'; +import authHandler from '../middleware/auth.middleware'; + +const router = new Router({ + prefix: '/config', +}); + +router.get('/kokkoro', configController.kokkoro); + +export default router; diff --git a/src/router/index.ts b/src/router/index.ts index a52caef..3ad7ba9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,7 @@ import Router from '@koa/router'; import bot from './bot.route'; import user from './user.route'; +import config from './config.route'; import plugin from './plugin.route'; const router = new Router({ @@ -9,6 +10,7 @@ const router = new Router({ router.use(bot.routes()); router.use(user.routes()); +router.use(config.routes()); router.use(plugin.routes()); export default router; diff --git a/src/service/bot.service.ts b/src/service/bot.service.ts index a181f84..2594337 100644 --- a/src/service/bot.service.ts +++ b/src/service/bot.service.ts @@ -54,6 +54,36 @@ class BotService { const bot = this.getBot(uin); return bot.queryQrcodeResult(); } + + getFriendList(uin: number) { + const bot = this.getBot(uin); + + return { + list: bot.fl, + }; + } + + getGroupList(uin: number) { + const bot = this.getBot(uin); + + return { + list: bot.gl, + }; + } + + async sendPrivateMsg(uin: number, ...params: Parameters) { + const bot = this.getBot(uin); + const result = await bot.sendPrivateMsg(...params); + + return result; + } + + async sendGroupMsg(uin: number, ...params: Parameters) { + const bot = this.getBot(uin); + const result = await bot.sendGroupMsg(...params); + + return result; + } } export default new BotService(); diff --git a/src/service/config.service.ts b/src/service/config.service.ts new file mode 100644 index 0000000..cb71ad8 --- /dev/null +++ b/src/service/config.service.ts @@ -0,0 +1,10 @@ +import { getConfig, KokkoroConfig } from 'kokkoro'; +import { SourceError } from '../app'; + +class ConfigService { + public getKokkoroConfig(): KokkoroConfig { + return getConfig(); + } +} + +export default new ConfigService(); diff --git a/src/service/user.service.ts b/src/service/user.service.ts index 68edc7b..52b3bdf 100644 --- a/src/service/user.service.ts +++ b/src/service/user.service.ts @@ -1,29 +1,38 @@ -import { deepClone } from '@kokkoro/utils'; -import { db } from '../db'; import { SourceError } from '../app'; +import db from '../db'; import User from '../model/user.model'; class UserService { - registerUser(account: string, password: string) { - const has_user = this.hasUser(account); + constructor() { + this.initUser(); + } + + private async initUser(): Promise { + const has_user = await db.has('user'); + + if (!has_user) { + await db.put('user', []); + } + } + + public async registerUser(account: string, password: string) { + const has_user = await this.hasUser(account); if (has_user) { throw new SourceError(409, '用户名已被注册'); } - const user = deepClone(db.user); + const user = await db.get('user'); user.push(new User(account, password)); - db.user = user; + await db.put('user', user); return { account, - } + }; } - hasUser(account: string): boolean { - db.user ??= []; - - const user = deepClone(db.user); + public async hasUser(account: string): Promise { + const user = await db.get('user'); const user_count = user.length; for (let i = 0; i < user_count; i++) { @@ -36,23 +45,26 @@ class UserService { return false; } - getUserList() { - db.user ??= []; - - const user = deepClone(db.user); + public async getUserList() { + const user = await db.get('user'); const user_count = user.length; + const userList = []; for (let i = 0; i < user_count; i++) { - const element = user[i]; - delete element.password; + const { id, account, createTime } = user[i]; + const info = { + id, account, createTime, + }; + + userList.push(info); } - return user; + return { + list: userList, + }; } - loginUser(account: string, password: string) { - db.user ??= []; - - const user = deepClone(db.user); + public async loginUser(account: string, password: string) { + const user = await db.get('user'); const user_count = user.length; for (let i = 0; i < user_count; i++) { @@ -64,8 +76,8 @@ class UserService { } } - modifyUser(oldUser: User, newUser: Omit) { - const user = deepClone(db.user); + public async modifyUser(oldUser: User, newUser: Omit) { + const user = await db.get('user'); const user_count = user.length; for (let i = 0; i < user_count; i++) { @@ -77,23 +89,23 @@ class UserService { user[i].account = newUser.account; user[i].password = newUser.password; - db.user = user; + await db.put('user', user); } return { account: newUser.account, - } + }; } - removeUser(account: string, self: string) { + public async removeUser(account: string, self: string) { if (account === self) { - throw new SourceError(409, '不能自己删除自己'); + throw new SourceError(409, '不能删除自己'); } const has_user = this.hasUser(account); if (!has_user) { throw new SourceError(409, '用户名不存在'); } - const user = deepClone(db.user); + const user = await db.get('user'); const user_count = user.length; for (let i = 0; i < user_count; i++) { @@ -103,12 +115,12 @@ class UserService { continue; } user.splice(i, 1); - db.user = user; + await db.put('user', user); } return { account, - } + }; } }