diff --git a/package-lock.json b/package-lock.json index b99cf46..16e7b42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,6 @@ "resolved": "https://registry.npmjs.org/@alcalzone/ansi-tokenize/-/ansi-tokenize-0.1.3.tgz", "integrity": "sha512-3yWxPTq3UQ/FY9p1ErPxIyfT64elWaMvM9lIHnaqpyft63tkxodF5aUElYHrdisWve5cETkh1+KBw1yJuW0aRw==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^4.0.0" @@ -49,7 +48,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -99,6 +97,74 @@ } } }, + "node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20250617.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250617.0.tgz", + "integrity": "sha512-toG8JUKVLIks4oOJLe9FeuixE84pDpMZ32ip7mCpE7JaFc5BqGFvevk0YC/db3T71AQlialjRwioH3jS/dzItA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20250617.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250617.0.tgz", + "integrity": "sha512-JTX0exbC9/ZtMmQQA8tDZEZFMXZrxOpTUj2hHnsUkErWYkr5SSZH04RBhPg6dU4VL8bXuB5/eJAh7+P9cZAp7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20250617.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250617.0.tgz", + "integrity": "sha512-8jkSoVRJ+1bOx3tuWlZCGaGCV2ew7/jFMl6V3CPXOoEtERUHsZBQLVkQIGKcmC/LKSj7f/mpyBUeu2EPTo2HEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20250617.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250617.0.tgz", + "integrity": "sha512-YAzcOyu897z5dQKFzme1oujGWMGEJCR7/Wrrm1nSP6dqutxFPTubRADM8BHn2CV3ij//vaPnAeLmZE3jVwOwig==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, "node_modules/@cloudflare/workerd-windows-64": { "version": "1.20250617.0", "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250617.0.tgz", @@ -120,7 +186,8 @@ "version": "4.20250628.0", "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250628.0.tgz", "integrity": "sha512-V4HthfhtQU2vTpwLeUic8FTLgGSjglsGZMJc9jKBNYEU/k0A1rE55UgQoTb5blKQdGtpQKfVKs3FROeY/lXmbw==", - "license": "MIT OR Apache-2.0" + "license": "MIT OR Apache-2.0", + "peer": true }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", @@ -150,6 +217,17 @@ "resolved": "https://registry.npmjs.org/@edgeone/ef-types/-/ef-types-1.0.5.tgz", "integrity": "sha512-YOxfv4R28Hd94Ric2vAGMWTAu0cxzWa3xHbviLS6h9ai/3rKB1xcI8aa+bg/hiyV3hlfw6UuSrLLhrYTWqZGkQ==" }, + "node_modules/@emnapi/runtime": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz", @@ -587,6 +665,366 @@ "hono": "^4" } }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@img/sharp-win32-x64": { "version": "0.33.5", "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", @@ -1033,7 +1471,6 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", "license": "MIT", - "peer": true, "dependencies": { "environment": "^1.0.0" }, @@ -1131,7 +1568,6 @@ "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-5.0.1.tgz", "integrity": "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg==", "license": "MIT", - "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -1261,6 +1697,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", @@ -1419,7 +1856,6 @@ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -1432,7 +1868,6 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "license": "MIT", - "peer": true, "dependencies": { "restore-cursor": "^4.0.0" }, @@ -1460,7 +1895,6 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", "license": "MIT", - "peer": true, "dependencies": { "slice-ansi": "^5.0.0", "string-width": "^7.0.0" @@ -1477,7 +1911,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1490,7 +1923,6 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.0.0", "is-fullwidth-code-point": "^4.0.0" @@ -1540,7 +1972,6 @@ "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-4.0.0.tgz", "integrity": "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==", "license": "MIT", - "peer": true, "dependencies": { "convert-to-spaces": "^2.0.1" }, @@ -1647,7 +2078,6 @@ "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz", "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==", "license": "MIT", - "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } @@ -2332,8 +2762,7 @@ "version": "10.4.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/enhanced-resolve": { "version": "5.18.2", @@ -2376,7 +2805,6 @@ "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -2426,7 +2854,6 @@ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.39.5.tgz", "integrity": "sha512-z9V0qU4lx1TBXDNFWfAASWk6RNU6c6+TJBKE+FLIg8u0XJ6Yw58Hi0yX8ftEouj6p1QARRlXLFfHbIli93BdQQ==", "license": "MIT", - "peer": true, "workspaces": [ "docs", "benchmarks" @@ -2438,6 +2865,7 @@ "integrity": "sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==", "hasInstallScript": true, "license": "MIT", + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -2833,7 +3261,6 @@ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", "integrity": "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -3115,6 +3542,7 @@ "resolved": "https://registry.npmjs.org/hono/-/hono-4.8.2.tgz", "integrity": "sha512-hM+1RIn9PK1I6SiTNS6/y7O1mvg88awYLFEuEtoiMtRyT3SD2iu9pSFgbBXT3b1Ua4IwzvSTLvwO0SEhDxCi4w==", "license": "MIT", + "peer": true, "engines": { "node": ">=16.9.0" } @@ -3266,7 +3694,6 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -3285,7 +3712,6 @@ "resolved": "https://registry.npmjs.org/ink/-/ink-6.0.1.tgz", "integrity": "sha512-vhhFrCodTHZAPPSdMYzLEbeI0Ug37R9j6yA0kLKok9kSK53lQtj/RJhEQJUjq6OwT4N33nxqSRd/7yXhEhVPIw==", "license": "MIT", - "peer": true, "dependencies": { "@alcalzone/ansi-tokenize": "^0.1.3", "ansi-escapes": "^7.0.0", @@ -3347,7 +3773,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -3360,7 +3785,6 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", "license": "MIT", - "peer": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -3551,7 +3975,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -3564,7 +3987,6 @@ "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-1.0.0.tgz", "integrity": "sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==", "license": "MIT", - "peer": true, "bin": { "is-in-ci": "cli.js" }, @@ -3716,8 +4138,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/jsbn": { "version": "0.1.1", @@ -3861,7 +4282,6 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "license": "MIT", - "peer": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -6356,6 +6776,7 @@ "version": "4.0.2", "inBundle": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -6794,7 +7215,6 @@ "resolved": "https://registry.npmjs.org/patch-console/-/patch-console-2.0.0.tgz", "integrity": "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA==", "license": "MIT", - "peer": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } @@ -7037,7 +7457,6 @@ "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.32.0.tgz", "integrity": "sha512-2NPMOzgTlG0ZWdIf3qG+dcbLSoAc/uLfOwckc3ofy5sSK0pLJqnQLpUFxvGcN2rlXSjnVtGeeFLNimCQEj5gOQ==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.26.0" }, @@ -7052,8 +7471,7 @@ "version": "0.26.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/readable-stream": { "version": "3.6.2", @@ -7219,7 +7637,6 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "license": "MIT", - "peer": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -7280,7 +7697,6 @@ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" } @@ -7311,6 +7727,7 @@ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -7556,7 +7973,6 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" @@ -7573,7 +7989,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -7586,7 +8001,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", "license": "MIT", - "peer": true, "dependencies": { "get-east-asian-width": "^1.0.0" }, @@ -7648,7 +8062,6 @@ "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "license": "MIT", - "peer": true, "dependencies": { "escape-string-regexp": "^2.0.0" }, @@ -7661,7 +8074,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -7702,7 +8114,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "license": "MIT", - "peer": true, "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", @@ -7720,7 +8131,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -7733,7 +8143,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -8008,7 +8417,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "license": "(MIT OR CC0-1.0)", - "peer": true, "engines": { "node": ">=16" }, @@ -8022,6 +8430,7 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8063,6 +8472,7 @@ "integrity": "sha512-B06u0wXkEd+o5gOCMl/ZHl5cfpYbDZKAT+HWTL+Hws6jWu7dCiqBBXXXzMFcFVJb8D4ytAnYmxJA83uwOQRSsg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "defu": "^6.1.4", "exsolve": "^1.0.4", @@ -8202,6 +8612,7 @@ "integrity": "sha512-brOPwM3JnmOa+7kd3NsmOUOwbDAj8FT9xDsG3IW0MgbN9yZV7Oi/s/+MNQ/EcSMqw7qfoRyXPoeEWT8zLVdVGg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", @@ -8250,6 +8661,7 @@ "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^2.1.1", @@ -8380,7 +8792,6 @@ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-5.0.0.tgz", "integrity": "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==", "license": "MIT", - "peer": true, "dependencies": { "string-width": "^7.0.0" }, @@ -8405,6 +8816,7 @@ "dev": true, "hasInstallScript": true, "license": "Apache-2.0", + "peer": true, "bin": { "workerd": "bin/workerd" }, @@ -8925,7 +9337,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", @@ -8943,7 +9354,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -8956,7 +9366,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -8969,7 +9378,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -8985,7 +9393,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -9024,8 +9431,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/yoga-layout/-/yoga-layout-3.2.1.tgz", "integrity": "sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/youch": { "version": "3.3.4", diff --git a/package.json b/package.json index d6572ac..d12513e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cf-worker-api", "scripts": { - "dev-js": "tsx watch src/basic.ts", + "dev-js": "tsx watch --include \"public/**\" src/basic.ts", "build-js": "webpack --mode production", "deploy-js": "node dist/bundle.js", "dev-cf": "wrangler dev", diff --git a/public/index.html b/public/index.html index 49f4338..7eb6a38 100644 --- a/public/index.html +++ b/public/index.html @@ -33,6 +33,7 @@

🔐 OpenList Token 获取工具

+ @@ -133,12 +134,15 @@

🔐 OpenList Token 获取工具

× -

阿里云盘扫码登录v2

+

+ @@ -171,7 +175,9 @@

隐私政策和使用条款

+ + diff --git a/public/static/115qr.js b/public/static/115qr.js new file mode 100644 index 0000000..f95eece --- /dev/null +++ b/public/static/115qr.js @@ -0,0 +1,85 @@ +/** + * @typedef {import('../../src/driver/115cloud_qr.ts').QRCodeResponse} QRCodeResponse + */ + +async function start115CloudQRLogin() { + try { + // 显示模态框 + document.getElementById('qr-modal').style.display = 'block'; + setQRStatus('正在生成二维码...', 'waiting'); + + /** @type {string | null} */ + let uid = null; + + // 生成二维码 - 使用带指纹的请求 + const response = await fetch(`/115cloud_qr/get_qr`); + if (response.ok) { + /** @type {QRCodeResponse} */ + const result = await response.json(); + uid = result.uid + showQRCode(result.qrcode); + + setQRStatus('请使用115 App扫描二维码', 'waiting'); + + checkQRStatus = () => check115CloudQRStatus(result); + + // qr115CheckInterval = setInterval(() => check115CloudQRStatus(result), 2000); + } else { + setQRStatus(response.statusText || '生成二维码失败', 'error'); + document.getElementById('refresh-qr-btn').style.display = 'inline-block'; + } + } catch (error) { + setQRStatus('网络错误,请重试', 'error'); + document.getElementById('refresh-qr-btn').style.display = 'inline-block'; + console.error('生成二维码失败:', error); + } +} + +/** + * @param {QRCodeResponse} body + */ +async function check115CloudQRStatus(body) { + try { + const response = await fetch('/115cloud_qr/check_status', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(body), + }); + /** @type {HTMLButtonElement} */ + const refreshBtn = document.getElementById('refresh-qr-btn'); + if (response.ok) { + const status = await response.text(); + switch (status) { + case '0': + setQRStatus('等待扫描二维码', 'waiting'); + break; + case '1': + setQRStatus('二维码已扫描,请在手机上确认登录', 'waiting'); + break; + case '2': + setQRStatus('登录成功', 'success'); + // clearInterval(qr115CheckInterval); + document.getElementById("access-token").value = body.uid; + closeQRModal(); + break; + case '-1': + setQRStatus('二维码已过期,请刷新重试', 'error'); + refreshBtn.style.display = 'inline-block'; + break; + case '-2': + setQRStatus('登录已取消,请重试', 'error'); + refreshBtn.style.display = 'inline-block'; + break; + default: + setQRStatus(`未知状态: ${status}`, 'info'); + } + } else { + setQRStatus('检查登录状态失败', 'error'); + } + } catch (error) { + setQRStatus('网络错误,请重试', 'error'); + console.error('检查登录状态失败:', error); + } +} \ No newline at end of file diff --git a/public/static/aliv2.js b/public/static/aliv2.js index c16de67..f3e07ed 100644 --- a/public/static/aliv2.js +++ b/public/static/aliv2.js @@ -68,7 +68,8 @@ async function startAlicloud2Login() { // console.log(`会话将在 ${expireMinutes} 分钟后过期`); } - startStatusCheck(); + checkQRStatus = checkAlicloud2Status; + startAliQRStatusCheck(); } else { setQRStatus(result.error || '生成二维码失败', 'error'); document.getElementById('refresh-qr-btn').style.display = 'inline-block'; @@ -80,29 +81,14 @@ async function startAlicloud2Login() { } } -// 显示二维码 -function showQRCode(qrUrl) { - const qrApiUrl = `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(qrUrl)}`; - document.getElementById('qr-code-display').innerHTML = `二维码`; - document.getElementById('qr-code-container').style.display = 'block'; -} - -// 设置状态 -function setQRStatus(message, type) { - const statusEl = document.getElementById('qr-status'); - statusEl.textContent = message; - statusEl.className = `qr-status ${type}`; - statusEl.style.display = 'block'; -} - // 开始状态检查 -function startStatusCheck() { - stopStatusCheck(); +function startAliQRStatusCheck() { + stopAliQRStatusCheck(); alicloud2CheckInterval = setInterval(checkAlicloud2Status, 2000); } // 停止状态检查 -function stopStatusCheck() { +function stopAliQRStatusCheck() { if (alicloud2CheckInterval) { clearInterval(alicloud2CheckInterval); alicloud2CheckInterval = null; @@ -118,7 +104,7 @@ async function checkAlicloud2Status() { if (elapsed > 180000) { // 3分钟 setQRStatus('二维码可能已过期,建议点击刷新重新生成', 'error'); document.getElementById('refresh-qr-btn').style.display = 'inline-block'; - stopStatusCheck(); + stopAliQRStatusCheck(); return; } @@ -138,7 +124,7 @@ async function checkAlicloud2Status() { break; case 'CONFIRMED': setQRStatus('登录成功!正在获取用户信息...', 'success'); - stopStatusCheck(); + stopAliQRStatusCheck(); // 稍等一下确保token已保存 setTimeout(async () => { await getAlicloud2UserInfo(); @@ -146,7 +132,7 @@ async function checkAlicloud2Status() { break; case 'EXPIRED': setQRStatus('二维码已过期,请点击刷新重新生成', 'error'); - stopStatusCheck(); + stopAliQRStatusCheck(); document.getElementById('refresh-qr-btn').style.display = 'inline-block'; break; } @@ -155,7 +141,7 @@ async function checkAlicloud2Status() { if (response.status === 403) { setQRStatus('会话验证失败,请重新生成二维码', 'error'); document.getElementById('refresh-qr-btn').style.display = 'inline-block'; - stopStatusCheck(); + stopAliQRStatusCheck(); } else { setQRStatus('检查状态失败: ' + (result.error || '未知错误'), 'error'); document.getElementById('refresh-qr-btn').style.display = 'inline-block'; @@ -215,35 +201,3 @@ async function getAlicloud2UserInfo() { } } -// 刷新二维码 -async function refreshQRCode() { - document.getElementById('refresh-qr-btn').style.display = 'none'; - // 清理旧会话 - if (alicloud2SessionId) { - try { - await fetchWithFingerprint(`/alicloud2/logout?session_id=${alicloud2SessionId}`); - } catch (e) { - // console.log('清理旧会话失败:', e); - } - alicloud2SessionId = null; - } - await startAlicloud2Login(); -} - -// 关闭模态框 -function closeQRModal() { - document.getElementById('qr-modal').style.display = 'none'; - stopStatusCheck(); - - // 清理会话 - if (alicloud2SessionId) { - fetchWithFingerprint(`/alicloud2/logout?session_id=${alicloud2SessionId}`); - alicloud2SessionId = null; - } - - // 重置界面 - document.getElementById('qr-code-container').style.display = 'none'; - document.getElementById('qr-status').style.display = 'none'; - document.getElementById('refresh-qr-btn').style.display = 'none'; -} - diff --git a/public/static/event.js b/public/static/event.js index 5074ccf..e302185 100644 --- a/public/static/event.js +++ b/public/static/event.js @@ -34,13 +34,13 @@ function onSelect() { // 阿里云盘扫码登录v2不需要客户端ID、应用机密和回调地址 ================ if (driver_txt_input.value === "alicloud_cs" || driver_txt_input.value === "alicloud_tv" + || driver_txt_input.value === "115cloud_qr" ) { // 隐藏整个字段容器 clientIdContainer.style.display = 'none'; appSecretContainer.style.display = 'none'; serverUseContainer.style.display = 'none'; callbackContainer.style.display = 'none'; - server_use_input.checked = true; } else { clientIdContainer.style.display = 'block'; appSecretContainer.style.display = 'block'; diff --git a/public/static/login.js b/public/static/login.js index 1feaf31..b3a618e 100644 --- a/public/static/login.js +++ b/public/static/login.js @@ -1,15 +1,31 @@ // import Swal from 'sweetalert2'; +/** @type {string | undefined} */ +var driver_txt; + // 获取登录秘钥 ####################################################### async function getLogin(refresh = false) { let server_use = document.getElementById("server-use-input").checked; let secret_key = document.getElementById("secret-key-input").value; let client_uid = document.getElementById("client-uid-input").value; let client_key = document.getElementById("client-key-input").value; - let driver_txt = document.getElementById("driver-txt-input").value; + driver_txt = document.getElementById("driver-txt-input").value; let refresh_ui = document.getElementById("refresh-token").value; + /** @type {HTMLHeadingElement} */ + const qrModalTitle = document.getElementById('qr-modal-title'); let driver_pre = driver_txt.split("_")[0] let check_flag = true; + // 阿里云盘扫码v2直接调用专用API,不需要构建传统的requests路径 + if (driver_txt === "alicloud_cs" && !refresh) { + qrModalTitle.textContent = '阿里云盘扫码登录v2'; + await startAlicloud2Login(); + return; + } else if (driver_txt === "115cloud_qr") { + // Ignore refresh + qrModalTitle.textContent = '115网盘扫码登录'; + await start115CloudQRLogin(); + return; + } // 验证秘钥情况 ================================================== if (!server_use) { if (driver_txt !== "alicloud_cs" @@ -26,11 +42,6 @@ async function getLogin(refresh = false) { return; } } - // 阿里云盘扫码v2直接调用专用API,不需要构建传统的requests路径 - if (driver_txt === "alicloud_cs" && !refresh) { - await startAlicloud2Login(); - return; - } // 刷新秘钥情况 ================================================= let base_urls = "/requests?client_uid=" if (refresh) { diff --git a/public/static/qr.js b/public/static/qr.js new file mode 100644 index 0000000..68d1a58 --- /dev/null +++ b/public/static/qr.js @@ -0,0 +1,67 @@ +// 显示二维码 +function showQRCode(qrUrl) { + const qrApiUrl = `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(qrUrl)}`; + document.getElementById('qr-code-display').innerHTML = `二维码`; + document.getElementById('qr-code-container').style.display = 'block'; +} + +// 设置状态 +function setQRStatus(message, type) { + const statusEl = document.getElementById('qr-status'); + statusEl.textContent = message; + statusEl.className = `qr-status ${type}`; + statusEl.style.display = 'block'; +} + +/** @type {() => Promise | null} */ +var checkQRStatus = null; + +/** + * @summary 刷新二维码 + * @param {string} driver_txt 驱动类型 + */ +async function refreshQRCode(driver_txt) { + document.getElementById('refresh-qr-btn').style.display = 'none'; + // 清理旧会话 + switch (driver_txt) { + case 'alicloud_cs': + if (alicloud2SessionId) { + try { + await fetchWithFingerprint(`/alicloud2/logout?session_id=${alicloud2SessionId}`); + } catch (e) { + // console.log('清理旧会话失败:', e); + } + alicloud2SessionId = null; + } + await startAlicloud2Login(); + break; + case '115cloud_qr': + await start115CloudQRLogin(); + break; + } +} + +// 关闭模态框 +function closeQRModal() { + document.getElementById('qr-modal').style.display = 'none'; + switch (driver_txt) { + case 'alicloud_cs': + stopAliQRStatusCheck(); + + // 清理会话 + if (alicloud2SessionId) { + fetchWithFingerprint(`/alicloud2/logout?session_id=${alicloud2SessionId}`); + alicloud2SessionId = null; + } + break; + case '115cloud_qr': + + break; + } + + // 重置界面 + document.getElementById('qr-code-container').style.display = 'none'; + document.getElementById('qr-status').style.display = 'none'; + document.getElementById('refresh-qr-btn').style.display = 'none'; +} + diff --git a/src/driver/115cloud_qr.ts b/src/driver/115cloud_qr.ts new file mode 100644 index 0000000..111c15c --- /dev/null +++ b/src/driver/115cloud_qr.ts @@ -0,0 +1,55 @@ +import type { Context } from "hono"; + +type _QRCodeResponse = { + state: number; + code: number; + message: string; + data: { + uid: string; + time: number; + sign: string; + qrcode: string; + bind_code: number; + }; +}; + +export type QRCodeResponse = _QRCodeResponse["data"] & { + _: string; +}; + +type StatusResponse = { + state: number; + code: number; + message: string; + data: { + msg: string; + status: number; + version: string; + }; +}; + +export async function getQRCode(c: Context) { + const resp = await fetch(`https://qrcodeapi.115.com/api/1.0/web/1.0/token`); + const data: _QRCodeResponse = await resp.json(); + return c.json({ + ...data.data, + _: (new Date().getTime() / 1000).toString(), + }); +} + +export async function getTokenStatus(c: Context) { + const requestBody: QRCodeResponse = await c.req.json(); + const resp = await fetch(`https://qrcodeapi.115.com/get/status/?uid=${requestBody.uid}&time=${requestBody.time}&sign=${requestBody.sign}&_=${requestBody._}`); + const status: StatusResponse = await resp.json(); + return c.text(status.data.status.toString()); + /** + * Status: + * - 0: Waiting + * - 1: Scanned + * - 2: Signed in + * - -1: Expired + * - -2: Cancelled + * + * Reference: https://gist.github.com/ChenyangGao/d26a592a0aeb13465511c885d5c7ad61 + */ +} diff --git a/src/index.ts b/src/index.ts index 1604aca..8630e9e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import * as oneui from './driver/onedrive_oa'; import * as aliui from './driver/alicloud_oa'; import * as aliqr from './driver/alicloud_cs'; import * as ui115 from './driver/115cloud_oa'; +import * as qr115 from './driver/115cloud_qr'; import * as ui123 from './driver/123cloud_oa'; import * as baidu from './driver/baiduyun_oa'; import * as goapi from './driver/googleui_oa'; @@ -121,6 +122,14 @@ app.get('/115cloud/callback', async (c: Context) => { return ui115.oneToken(c); }); +app.get('/115cloud_qr/get_qr', (c: Context) => { // In fact, we should remove all `async` in this file. + return qr115.getQRCode(c); +}); + +app.post('/115cloud_qr/check_status', (c: Context) => { + return qr115.getTokenStatus(c); +}); + // 令牌刷新 ############################################################################## app.get('/115cloud/renewapi', async (c: Context) => { return ui115.genToken(c);