diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/CHANGELOG.md b/CHANGELOG.md index d2c6c56..73f5fdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ * 正确顺序为先读取 `$argument` 再读取 `$persistentStore (BoxJs)` * 即,有相同键名时,`$persistentStore (BoxJs)` 的值会覆盖 `$argument` 的值 +### ‼️ Breaking Changes + * 从脚本中移除了 `@nsnanocat/url` polyfill + * 由于 `@nsnanocat/url` 已经被移除,所以 `📰 News` 项目已完全不再支持 `🚀 ShadowRocket` + ### 🔣 Dependencies * 升级了 `@nsnanocat/util` * `util` 由 `submodule` 更改为 `package` diff --git a/arguments-builder.config.ts b/arguments-builder.config.ts index d080a53..5cfcf6d 100644 --- a/arguments-builder.config.ts +++ b/arguments-builder.config.ts @@ -19,11 +19,7 @@ export default defineConfig({ { path: "./dist/iRingo.News.stoverride", template: "./template/stash.handlebars", - }, - { - path: "./dist/iRingo.News.srmodule", - template: "./template/shadowrocket.handlebars", - }, + } ], dts: { isExported: true, @@ -63,5 +59,20 @@ export default defineConfig({ type: "boolean", description: "是否显示News+搜索结果。", }, + { + key: "LogLevel", + name: "[调试] 日志等级", + type: "string", + defaultValue: "WARN", + description: "选择脚本日志的输出等级,低于所选等级的日志将全部输出。", + options: [ + { key: "OFF", label: "关闭" }, + { key: "ERROR", label: "❌ 错误" }, + { key: "WARN", label: "⚠️ 警告" }, + { key: "INFO", label: "ℹ️ 信息" }, + { key: "DEBUG", label: "🅱️ 调试" }, + { key: "ALL", label: "全部" }, + ], + }, ], }); diff --git a/package-lock.json b/package-lock.json index 7059307..4c898e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -324,9 +324,9 @@ } }, "node_modules/@jsonjoy.com/json-pack": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.0.tgz", - "integrity": "sha512-zlQONA+msXPPwHWZMKFVS78ewFczIll5lXiVPwFPCZUsrOKdxc2AvxU1HoNBmMRhqDZUR9HkC3UOm+6pME6Xsg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.1.1.tgz", + "integrity": "sha512-osjeBqMJ2lb/j/M8NCPjs1ylqWIcTRTycIhVB5pt6LgzgeRSb0YRZ7j9RfA8wIUrsr/medIuhVyonXRZWLyfdw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -493,8 +493,8 @@ }, "node_modules/@nsnanocat/util": { "version": "1.7.5", - "resolved": "https://registry.npmjs.org/@nsnanocat/util/-/util-1.7.5.tgz", - "integrity": "sha512-9PQFQV4iRMx7y+m2oKBTEc7zE7Ci4cevbHYqlW7mHggSTM2eI2srLlJ8952vfwPt8hEcHS7do7Cx+6QAT0fodA==", + "resolved": "https://npm.pkg.github.com/download/@nsnanocat/util/1.7.5/1960b48068f6dac20c28c9fb80fc3f339a30af95", + "integrity": "sha512-uzP8/TZpswK+6Ln6/iaVBaVuL+jU0p0gIjNQaULQOZGlc7/+MVUcCJhITg6fmoUUdSDqBQS9br0Eibc7fkeesQ==", "license": "Apache-2.0", "dependencies": { "pako": "^2.1.0" @@ -542,9 +542,9 @@ } }, "node_modules/@puppeteer/browsers/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -608,9 +608,9 @@ } }, "node_modules/@rsbuild/core": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-1.1.8.tgz", - "integrity": "sha512-UhP260og3aJcqGWpnRcQXLVapdOZZ09JXaQKY+tE55A7nBw8DQy+qrtTsFZYvVKas1bq8GzhGfLxuglCst4Lnw==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@rsbuild/core/-/core-1.1.9.tgz", + "integrity": "sha512-mHZveEwlTtW9nxWa+T0xUm6ssm+HkDYZ0NENLfWMUmsL0LjMJrpQzRlbD+p5+9Uf+KXUo3Dbtv0ScA+p7cuGTg==", "dev": true, "license": "MIT", "dependencies": { @@ -1424,43 +1424,15 @@ } }, "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", "dev": true, "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, "engines": { "node": ">= 14" } }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2158,9 +2130,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.0.tgz", - "integrity": "sha512-CCKAP2tkPau7D3GE8+V8R6sQubA9R5foIzGp+85EXCVSCivuxBNAWqcpn72PKYiIcqoViv/kcUDpaEIMBVi1lQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "dev": true, "license": "MIT", "dependencies": { @@ -2908,6 +2880,21 @@ "url": "https://bevry.me/fund" } }, + "node_modules/dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -3023,14 +3010,11 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -3333,9 +3317,9 @@ } }, "node_modules/extract-zip/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -3615,17 +3599,20 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.5.tgz", + "integrity": "sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==", "dev": true, "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -3666,9 +3653,9 @@ } }, "node_modules/get-uri/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -3820,22 +3807,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", - "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -4039,9 +4010,9 @@ } }, "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -4096,13 +4067,13 @@ "license": "MIT" }, "node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { @@ -4110,9 +4081,9 @@ } }, "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -4744,9 +4715,9 @@ } }, "node_modules/memfs": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.14.1.tgz", - "integrity": "sha512-Fq5CMEth+2iprLJ5mNizRcWuiwRZYjNkUD0zKk224jZunE9CRacTRDK8QLALbMBlNX2y3nY6lKZbesCwDwacig==", + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.15.0.tgz", + "integrity": "sha512-q9MmZXd2rRWHS6GU3WEm3HyiXZyyoA1DqdOhEq0lxPBmKb5S7IAOwX0RgUCwJfqjelDCySa5h8ujOy24LqsWcw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -5366,29 +5337,29 @@ } }, "node_modules/pac-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", - "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz", + "integrity": "sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw==", "dev": true, "license": "MIT", "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.5", + "https-proxy-agent": "^7.0.6", "pac-resolver": "^7.0.1", - "socks-proxy-agent": "^8.0.4" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/pac-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -5687,29 +5658,29 @@ } }, "node_modules/proxy-agent": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", - "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "^4.3.4", "http-proxy-agent": "^7.0.1", - "https-proxy-agent": "^7.0.3", + "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", - "pac-proxy-agent": "^7.0.1", + "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", - "socks-proxy-agent": "^8.0.2" + "socks-proxy-agent": "^8.0.5" }, "engines": { "node": ">= 14" } }, "node_modules/proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -5822,9 +5793,9 @@ } }, "node_modules/puppeteer-core/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6568,13 +6539,13 @@ } }, "node_modules/socks-proxy-agent": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", - "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.1.1", + "agent-base": "^7.1.2", "debug": "^4.3.4", "socks": "^2.8.3" }, @@ -6583,9 +6554,9 @@ } }, "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6662,9 +6633,9 @@ } }, "node_modules/spdy-transport/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6702,9 +6673,9 @@ } }, "node_modules/spdy/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -7058,11 +7029,14 @@ "peer": true }, "node_modules/text-decoder": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.1.tgz", - "integrity": "sha512-x9v3H/lTKIJKQQe7RPQkLfKAnc9lUTkWDypIQgTzPJAq+5/GCDHonmshfvlsNSj58yyshbIJJDLmU15qNERrXQ==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.2.tgz", + "integrity": "sha512-/MDslo7ZyWTA2vnk1j7XoDVfXsGk3tp+zFEJHJGm0UjIlQifonVFwlVbQDFh8KJzTBnT8ie115TYqir6bclddA==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } }, "node_modules/thingies": { "version": "1.21.0", diff --git a/src/function/database.mjs b/src/function/database.mjs index 9e6f793..281c44b 100644 --- a/src/function/database.mjs +++ b/src/function/database.mjs @@ -1,194 +1,195 @@ export default { - "News": { - "Settings": { - "CountryCode": "US", - "NewsPlusUser": true - } - }, - "Default": { - "Settings": { - }, - "Configs": { - "Storefront": { - "AE": "143481", - "AF": "143610", - "AG": "143540", - "AI": "143538", - "AL": "143575", - "AM": "143524", - "AO": "143564", - "AR": "143505", - "AT": "143445", - "AU": "143460", - "AZ": "143568", - "BA": "143612", - "BB": "143541", - "BD": "143490", - "BE": "143446", - "BF": "143578", - "BG": "143526", - "BH": "143559", - "BJ": "143576", - "BM": "143542", - "BN": "143560", - "BO": "143556", - "BR": "143503", - "BS": "143539", - "BT": "143577", - "BW": "143525", - "BY": "143565", - "BZ": "143555", - "CA": "143455", - "CD": "143613", - "CG": "143582", - "CH": "143459", - "CI": "143527", - "CL": "143483", - "CM": "143574", - "CN": "143465", - "CO": "143501", - "CR": "143495", - "CV": "143580", - "CY": "143557", - "CZ": "143489", - "DE": "143443", - "DK": "143458", - "DM": "143545", - "DO": "143508", - "DZ": "143563", - "EC": "143509", - "EE": "143518", - "EG": "143516", - "ES": "143454", - "FI": "143447", - "FJ": "143583", - "FM": "143591", - "FR": "143442", - "GA": "143614", - "GB": "143444", - "GD": "143546", - "GF": "143615", - "GH": "143573", - "GM": "143584", - "GR": "143448", - "GT": "143504", - "GW": "143585", - "GY": "143553", - "HK": "143463", - "HN": "143510", - "HR": "143494", - "HU": "143482", - "ID": "143476", - "IE": "143449", - "IL": "143491", - "IN": "143467", - "IQ": "143617", - "IS": "143558", - "IT": "143450", - "JM": "143511", - "JO": "143528", - "JP": "143462", - "KE": "143529", - "KG": "143586", - "KH": "143579", - "KN": "143548", - "KP": "143466", - "KR": "143466", - "KW": "143493", - "KY": "143544", - "KZ": "143517", - "TC": "143552", - "TD": "143581", - "TJ": "143603", - "TH": "143475", - "TM": "143604", - "TN": "143536", - "TO": "143608", - "TR": "143480", - "TT": "143551", - "TW": "143470", - "TZ": "143572", - "LA": "143587", - "LB": "143497", - "LC": "143549", - "LI": "143522", - "LK": "143486", - "LR": "143588", - "LT": "143520", - "LU": "143451", - "LV": "143519", - "LY": "143567", - "MA": "143620", - "MD": "143523", - "ME": "143619", - "MG": "143531", - "MK": "143530", - "ML": "143532", - "MM": "143570", - "MN": "143592", - "MO": "143515", - "MR": "143590", - "MS": "143547", - "MT": "143521", - "MU": "143533", - "MV": "143488", - "MW": "143589", - "MX": "143468", - "MY": "143473", - "MZ": "143593", - "NA": "143594", - "NE": "143534", - "NG": "143561", - "NI": "143512", - "NL": "143452", - "NO": "143457", - "NP": "143484", - "NR": "143606", - "NZ": "143461", - "OM": "143562", - "PA": "143485", - "PE": "143507", - "PG": "143597", - "PH": "143474", - "PK": "143477", - "PL": "143478", - "PT": "143453", - "PW": "143595", - "PY": "143513", - "QA": "143498", - "RO": "143487", - "RS": "143500", - "RU": "143469", - "RW": "143621", - "SA": "143479", - "SB": "143601", - "SC": "143599", - "SE": "143456", - "SG": "143464", - "SI": "143499", - "SK": "143496", - "SL": "143600", - "SN": "143535", - "SR": "143554", - "ST": "143598", - "SV": "143506", - "SZ": "143602", - "UA": "143492", - "UG": "143537", - "US": "143441", - "UY": "143514", - "UZ": "143566", - "VC": "143550", - "VE": "143502", - "VG": "143543", - "VN": "143471", - "VU": "143609", - "XK": "143624", - "YE": "143571", - "ZA": "143472", - "ZM": "143622", - "ZW": "143605", - }, - }, - }, -} + News: { + Settings: { + CountryCode: "US", + NewsPlusUser: true, + }, + }, + Default: { + Settings: { + LogLevel: "WARN", + }, + Configs: { + Storefront: { + AE: "143481", + AF: "143610", + AG: "143540", + AI: "143538", + AL: "143575", + AM: "143524", + AO: "143564", + AR: "143505", + AT: "143445", + AU: "143460", + AZ: "143568", + BA: "143612", + BB: "143541", + BD: "143490", + BE: "143446", + BF: "143578", + BG: "143526", + BH: "143559", + BJ: "143576", + BM: "143542", + BN: "143560", + BO: "143556", + BR: "143503", + BS: "143539", + BT: "143577", + BW: "143525", + BY: "143565", + BZ: "143555", + CA: "143455", + CD: "143613", + CG: "143582", + CH: "143459", + CI: "143527", + CL: "143483", + CM: "143574", + CN: "143465", + CO: "143501", + CR: "143495", + CV: "143580", + CY: "143557", + CZ: "143489", + DE: "143443", + DK: "143458", + DM: "143545", + DO: "143508", + DZ: "143563", + EC: "143509", + EE: "143518", + EG: "143516", + ES: "143454", + FI: "143447", + FJ: "143583", + FM: "143591", + FR: "143442", + GA: "143614", + GB: "143444", + GD: "143546", + GF: "143615", + GH: "143573", + GM: "143584", + GR: "143448", + GT: "143504", + GW: "143585", + GY: "143553", + HK: "143463", + HN: "143510", + HR: "143494", + HU: "143482", + ID: "143476", + IE: "143449", + IL: "143491", + IN: "143467", + IQ: "143617", + IS: "143558", + IT: "143450", + JM: "143511", + JO: "143528", + JP: "143462", + KE: "143529", + KG: "143586", + KH: "143579", + KN: "143548", + KP: "143466", + KR: "143466", + KW: "143493", + KY: "143544", + KZ: "143517", + TC: "143552", + TD: "143581", + TJ: "143603", + TH: "143475", + TM: "143604", + TN: "143536", + TO: "143608", + TR: "143480", + TT: "143551", + TW: "143470", + TZ: "143572", + LA: "143587", + LB: "143497", + LC: "143549", + LI: "143522", + LK: "143486", + LR: "143588", + LT: "143520", + LU: "143451", + LV: "143519", + LY: "143567", + MA: "143620", + MD: "143523", + ME: "143619", + MG: "143531", + MK: "143530", + ML: "143532", + MM: "143570", + MN: "143592", + MO: "143515", + MR: "143590", + MS: "143547", + MT: "143521", + MU: "143533", + MV: "143488", + MW: "143589", + MX: "143468", + MY: "143473", + MZ: "143593", + NA: "143594", + NE: "143534", + NG: "143561", + NI: "143512", + NL: "143452", + NO: "143457", + NP: "143484", + NR: "143606", + NZ: "143461", + OM: "143562", + PA: "143485", + PE: "143507", + PG: "143597", + PH: "143474", + PK: "143477", + PL: "143478", + PT: "143453", + PW: "143595", + PY: "143513", + QA: "143498", + RO: "143487", + RS: "143500", + RU: "143469", + RW: "143621", + SA: "143479", + SB: "143601", + SC: "143599", + SE: "143456", + SG: "143464", + SI: "143499", + SK: "143496", + SL: "143600", + SN: "143535", + SR: "143554", + ST: "143598", + SV: "143506", + SZ: "143602", + UA: "143492", + UG: "143537", + US: "143441", + UY: "143514", + UZ: "143566", + VC: "143550", + VE: "143502", + VG: "143543", + VN: "143471", + VU: "143609", + XK: "143624", + YE: "143571", + ZA: "143472", + ZM: "143622", + ZW: "143605", + }, + }, + }, +}; diff --git a/src/function/setENV.mjs b/src/function/setENV.mjs index 8b49ca7..e4f6e62 100644 --- a/src/function/setENV.mjs +++ b/src/function/setENV.mjs @@ -12,7 +12,7 @@ export default function setENV(name, platforms, database) { Console.log("☑️ Set Environment Variables"); const { Settings, Caches, Configs } = getStorage(name, platforms, database); /***************** Settings *****************/ - Console.debug(`typeof Settings: ${typeof Settings}`, `Settings: ${JSON.stringify(Settings, null, 2)}`); + Console.log(`typeof Settings: ${typeof Settings}`, `Settings: ${JSON.stringify(Settings, null, 2)}`); /***************** Caches *****************/ //Console.debug(`typeof Caches: ${typeof Caches}`, `Caches: ${JSON.stringify(Caches)}`); /***************** Configs *****************/ diff --git a/src/request.dev.js b/src/request.dev.js index 90c1f49..df007b2 100644 --- a/src/request.dev.js +++ b/src/request.dev.js @@ -19,6 +19,7 @@ Console.info(`FORMAT: ${FORMAT}`, ""); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("iRingo", "News", database); + Console.logLevel = Settings.LogLevel; // 创建空数据 let body = {}; // 方法判断 diff --git a/src/request.js b/src/request.js index 5f5bf3b..c707e9a 100644 --- a/src/request.js +++ b/src/request.js @@ -19,6 +19,7 @@ Console.info(`FORMAT: ${FORMAT}`, ""); * @type {{Settings: import('./types').Settings}} */ const { Settings, Caches, Configs } = setENV("iRingo", "News", database); + Console.logLevel = Settings.LogLevel; // 创建空数据 let body = {}; // 方法判断 diff --git a/src/types.d.ts b/src/types.d.ts index 3bf88e6..6ff4c0a 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -1,12 +1,4 @@ export interface Settings { - /** - * 总功能开关 - * - * 是否启用此APP修改。 - * - * @defaultValue true - */ - Switch?: boolean; /** * 国家或地区代码 * @@ -39,4 +31,22 @@ export interface Settings { * @defaultValue true */ NewsPlusUser?: boolean; + /** + * [调试] 日志等级 + * + * 选择脚本日志的输出等级,低于所选等级的日志将全部输出。 + * + * @remarks + * + * Possible values: + * - `'OFF'` - 关闭 + * - `'ERROR'` - ❌ 错误 + * - `'WARN'` - ⚠️ 警告 + * - `'INFO'` - ℹ️ 信息 + * - `'DEBUG'` - 🅱️ 调试 + * - `'ALL'` - 全部 + * + * @defaultValue "WARN" + */ + LogLevel?: 'OFF' | 'ERROR' | 'WARN' | 'INFO' | 'DEBUG' | 'ALL'; } diff --git a/template/boxjs.settings.json b/template/boxjs.settings.json index 86a37cf..31c8b94 100644 --- a/template/boxjs.settings.json +++ b/template/boxjs.settings.json @@ -1 +1 @@ -[{"id":"@iRingo.News.Settings.CountryCode","name":"国家或地区代码","type":"selects","val":"US","items":[{"key":"AUTO","label":"🇺🇳自动(跟随地区检测结果)"},{"key":"CN","label":"🇨🇳中国大陆"},{"key":"HK","label":"🇭🇰香港"},{"key":"TW","label":"🇹🇼台湾"},{"key":"SG","label":"🇸🇬新加坡"},{"key":"US","label":"🇺🇸美国"},{"key":"JP","label":"🇯🇵日本"},{"key":"AU","label":"🇦🇺澳大利亚"},{"key":"GB","label":"🇬🇧英国"},{"key":"KR","label":"🇰🇷韩国"},{"key":"CA","label":"🇨🇦加拿大"},{"key":"IE","label":"🇮🇪爱尔兰"}],"desc":"不同国家或地区提供的内容或有差别。"},{"id":"@iRingo.News.Settings.NewsPlusUser","name":"[搜索]显示News+内容","type":"boolean","val":true,"desc":"是否显示News+搜索结果。"}] \ No newline at end of file +[{"id":"@iRingo.News.Settings.CountryCode","name":"国家或地区代码","type":"selects","val":"US","items":[{"key":"AUTO","label":"🇺🇳自动(跟随地区检测结果)"},{"key":"CN","label":"🇨🇳中国大陆"},{"key":"HK","label":"🇭🇰香港"},{"key":"TW","label":"🇹🇼台湾"},{"key":"SG","label":"🇸🇬新加坡"},{"key":"US","label":"🇺🇸美国"},{"key":"JP","label":"🇯🇵日本"},{"key":"AU","label":"🇦🇺澳大利亚"},{"key":"GB","label":"🇬🇧英国"},{"key":"KR","label":"🇰🇷韩国"},{"key":"CA","label":"🇨🇦加拿大"},{"key":"IE","label":"🇮🇪爱尔兰"}],"desc":"不同国家或地区提供的内容或有差别。"},{"id":"@iRingo.News.Settings.NewsPlusUser","name":"[搜索]显示News+内容","type":"boolean","val":true,"desc":"是否显示News+搜索结果。"},{"id":"@iRingo.News.Settings.LogLevel","name":"[调试] 日志等级","type":"selects","val":"WARN","items":[{"key":"OFF","label":"关闭"},{"key":"ERROR","label":"❌ 错误"},{"key":"WARN","label":"⚠️ 警告"},{"key":"INFO","label":"ℹ️ 信息"},{"key":"DEBUG","label":"🅱️ 调试"},{"key":"ALL","label":"全部"}],"desc":"选择脚本日志的输出等级,低于所选等级的日志将全部输出。"}] \ No newline at end of file diff --git a/template/shadowrocket.handlebars b/template/shadowrocket.handlebars deleted file mode 100644 index 1595ef5..0000000 --- a/template/shadowrocket.handlebars +++ /dev/null @@ -1,17 +0,0 @@ -#!name = {{@package 'displayName'}} -#!desc = {{inline (@package 'description')}}\n注:该模块不包含代理规则组,代理规则组需要匹配代理策略组为🇺🇸🇬🇧🇨🇦🇦🇺线路\n使用过程中gateway.icloud.com应该走与News相同的代理线路。 -#!openUrl = {{@package 'openUrl'}} -#!author = {{@package 'contributors'}} -#!homepage = {{@package 'homepage'}} -#!icon = {{@package 'icon'}} -#!category = {{@package 'organizationName'}} -#!date = {{now "yyyy-MM-dd HH:mm:ss"}} -#!version = {{@package 'version'}} - -[Script] -📰 News.v1.configs.request = type=http-request, pattern=^https?:\/\/news(-todayconfig)?-edge\.apple\.com\/v1\/configs, requires-body=1, script-path=https://github.com/NSRingo/News/releases/download/v{{@package 'version'}}/request.bundle.js, argument= -📰 News.analyticseventsv2.async.request = type=http-request, pattern=^https?:\/\/news(-sports)?-events\.apple\.com\/analyticseventsv2\/async, requires-body=1, script-path=https://github.com/NSRingo/News/releases/download/v{{@package 'version'}}/request.bundle.js, argument= -📰 News.v1.search.request = type=http-request, pattern=^https?:\/\/news-client-search\.apple\.com\/v1\/search, requires-body=0, script-path=https://github.com/NSRingo/News/releases/download/v{{@package 'version'}}/request.bundle.js, argument= - -[MITM] -hostname = %APPEND% news-edge.apple.com, news-todayconfig-edge.apple.com, news-events.apple.com, news-sports-events.apple.com, news-client.apple.com, news-client-search.apple.com