Commit bade7249 authored by nanahira's avatar nanahira

migrate

parent 156f4d91
Pipeline #6082 passed with stages
in 27 seconds
......@@ -12,7 +12,7 @@ npm install koishi-plugin-limit-help
### 直接安装
在 https://cdn01.moecube.com/nanahira/koishi-plugin/limit-help/index.js 下载,并配置 `koishi.config.js`
在 https://cdn02.moecube.com:444/nanahira/koishi-plugin/limit-help/index.js 下载,并配置 `koishi.config.js`
## 配置
......@@ -31,7 +31,7 @@ module.exports = {
```js
module.exports = {
plugins: {
"/path/to/limit-help/index.js": (ctx) => ctx.private()
"/path/to/limit-help/index.js": { $private: true }
}
}
```
{
"name": "koishi-plugin-limit-help",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.0.0",
"name": "koishi-plugin-limit-help",
"version": "1.0.1",
"license": "MIT",
"dependencies": {
"source-map-support": "^0.5.19"
......@@ -17,7 +18,7 @@
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"koishi-core": "^3.13.0",
"koishi": "^4.0.0-alpha.8",
"prettier": "^2.3.2",
"raw-loader": "^4.0.2",
"ts-loader": "^9.2.5",
......@@ -179,9 +180,9 @@
"dev": true
},
"node_modules/@koa/router": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/@koa/router/-/router-10.1.0.tgz",
"integrity": "sha512-QZiCDn8Fd9vVN0qCWw81fToF5GMdtyPD04fIOHXiCCmXB6sznhjHMd3xbVS2ZxrgLWrcN8s6tIItEv0wuXt2Ow==",
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@koa/router/-/router-10.1.1.tgz",
"integrity": "sha512-ORNjq5z4EmQPriKbR0ER3k4Gh7YGNhWDL7JBW+8wXDrHLbWYKYSJaOJ9aN06npF5tbTxe2JBOsurpJDAvjiXKw==",
"dev": true,
"dependencies": {
"debug": "^4.1.1",
......@@ -194,6 +195,43 @@
"node": ">= 8.0.0"
}
},
"node_modules/@koishijs/core": {
"version": "4.0.0-alpha.8",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.0.0-alpha.8.tgz",
"integrity": "sha512-0SSweBTdXfSeD1IlWeBiAKDWD7MYGqHlhhuKAAstZDQm+Hh5oyX5oaZBhTUxbwwDjk//HwYH9AeLqqHTgVZYWw==",
"dev": true,
"dependencies": {
"@koishijs/utils": "^5.0.0-alpha.4",
"fastest-levenshtein": "^1.0.12"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@koishijs/utils": {
"version": "5.0.0-alpha.4",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.0.0-alpha.4.tgz",
"integrity": "sha512-cB1mUh3iLQKVHd8O9Lbdm/8LPmQ/VtiO+DlnAZXwbyczSIBu3HJiQo5t9pjy4LFcOoboEO4iCfbqBXpA2L/JHg==",
"dev": true,
"dependencies": {
"supports-color": "^8.1.0"
}
},
"node_modules/@koishijs/utils/node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
......@@ -325,9 +363,9 @@
}
},
"node_modules/@types/http-assert": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz",
"integrity": "sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ==",
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz",
"integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA==",
"dev": true
},
"node_modules/@types/http-errors": {
......@@ -365,9 +403,9 @@
}
},
"node_modules/@types/koa__router": {
"version": "8.0.7",
"resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.7.tgz",
"integrity": "sha512-OB3Ax75nmTP+WR9AgdzA42DI7YmBtiNKN2g1Wxl+d5Dyek9SWt740t+ukwXSmv/jMBCUPyV3YEI93vZHgdP7UQ==",
"version": "8.0.8",
"resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.8.tgz",
"integrity": "sha512-9pGCaDtzCsj4HJ8HmGuqzk8+s57sPj4njWd08GG5o92n5Xp9io2snc40CPpXFhoKcZ8OKhuu6ht4gNou9e1C2w==",
"dev": true,
"dependencies": {
"@types/koa": "*"
......@@ -382,12 +420,6 @@
"@types/koa": "*"
}
},
"node_modules/@types/lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==",
"dev": true
},
"node_modules/@types/mime": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
......@@ -873,12 +905,6 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
"integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=",
"dev": true
},
"node_modules/argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
......@@ -907,12 +933,12 @@
}
},
"node_modules/axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.0"
}
},
"node_modules/balanced-match": {
......@@ -1768,9 +1794,9 @@
"dev": true
},
"node_modules/follow-redirects": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
"integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==",
"version": "1.14.4",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
"dev": true,
"funding": [
{
......@@ -1961,41 +1987,34 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/http-assert": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz",
"integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==",
"node_modules/has-tostringtag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
"integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
"dev": true,
"dependencies": {
"deep-equal": "~1.0.1",
"http-errors": "~1.7.2"
"has-symbols": "^1.0.2"
},
"engines": {
"node": ">= 0.8"
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/http-assert/node_modules/http-errors": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz",
"integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==",
"node_modules/http-assert": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz",
"integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==",
"dev": true,
"dependencies": {
"depd": "~1.1.2",
"inherits": "2.0.4",
"setprototypeof": "1.1.1",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0"
"deep-equal": "~1.0.1",
"http-errors": "~1.8.0"
},
"engines": {
"node": ">= 0.6"
"node": ">= 0.8"
}
},
"node_modules/http-assert/node_modules/setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==",
"dev": true
},
"node_modules/http-errors": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz",
......@@ -2148,10 +2167,13 @@
}
},
"node_modules/is-generator-function": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz",
"integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==",
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz",
"integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==",
"dev": true,
"dependencies": {
"has-tostringtag": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
},
......@@ -2322,9 +2344,9 @@
}
},
"node_modules/koa": {
"version": "2.13.1",
"resolved": "https://registry.npmjs.org/koa/-/koa-2.13.1.tgz",
"integrity": "sha512-Lb2Dloc72auj5vK4X4qqL7B5jyDPQaZucc9sR/71byg7ryoD1NCaCm63CShk9ID9quQvDEi1bGR/iGjCG7As3w==",
"version": "2.13.3",
"resolved": "https://registry.npmjs.org/koa/-/koa-2.13.3.tgz",
"integrity": "sha512-XhXIoR+ylAwqG3HhXwnMPQAM/4xfywz52OvxZNmxmTWGGHsvmBv4NSIhURha6yMuvEex1WdtplUTHnxnKpQiGw==",
"dev": true,
"dependencies": {
"accepts": "^1.3.5",
......@@ -2332,7 +2354,7 @@
"content-disposition": "~0.5.2",
"content-type": "^1.0.4",
"cookies": "~0.8.0",
"debug": "~3.1.0",
"debug": "^4.3.2",
"delegates": "^1.0.0",
"depd": "^2.0.0",
"destroy": "^1.0.4",
......@@ -2343,7 +2365,7 @@
"http-errors": "^1.6.3",
"is-generator-function": "^1.0.7",
"koa-compose": "^4.1.0",
"koa-convert": "^1.2.0",
"koa-convert": "^2.0.0",
"on-finished": "^2.3.0",
"only": "~0.0.2",
"parseurl": "^1.3.2",
......@@ -2375,34 +2397,16 @@
"dev": true
},
"node_modules/koa-convert": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz",
"integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz",
"integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==",
"dev": true,
"dependencies": {
"co": "^4.6.0",
"koa-compose": "^3.0.0"
"koa-compose": "^4.1.0"
},
"engines": {
"node": ">= 4"
}
},
"node_modules/koa-convert/node_modules/koa-compose": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz",
"integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=",
"dev": true,
"dependencies": {
"any-promise": "^1.1.0"
}
},
"node_modules/koa/node_modules/debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"dependencies": {
"ms": "2.0.0"
"node": ">= 10"
}
},
"node_modules/koa/node_modules/depd": {
......@@ -2414,57 +2418,26 @@
"node": ">= 0.8"
}
},
"node_modules/koa/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
"node_modules/koishi-core": {
"version": "3.13.0",
"resolved": "https://registry.npmjs.org/koishi-core/-/koishi-core-3.13.0.tgz",
"integrity": "sha512-VIB3ykL89xt1/xkRq2bELKk9n2expEy+xrzYOXBJmrjvs8wbCspyUKDYPfCBgj9z+O5tu5nyfn5TjIdwhnIj3g==",
"node_modules/koishi": {
"version": "4.0.0-alpha.8",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.0.0-alpha.8.tgz",
"integrity": "sha512-Q8Zp+K/P8woCHQRHOOWzSYDE1twJo/Frm5wcUDXMuhYySZtX6ci31ciVE+KSIh230yD30wYpWRbo1xhwTzepvg==",
"dev": true,
"dependencies": {
"@koa/router": "^10.0.0",
"@types/koa__router": "^8.0.4",
"@types/lru-cache": "^5.1.0",
"@types/ws": "^7.4.2",
"axios": "^0.21.1",
"fastest-levenshtein": "^1.0.12",
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.0.0-alpha.8",
"@koishijs/utils": "^5.0.0-alpha.4",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^7.4.7",
"axios": "^0.21.4",
"koa": "^2.13.1",
"koa-bodyparser": "^4.3.0",
"koishi-utils": "^4.2.3",
"lru-cache": "^6.0.0"
"koa-bodyparser": "^4.3.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/koishi-utils": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/koishi-utils/-/koishi-utils-4.2.3.tgz",
"integrity": "sha512-FKOEazHwXDXI1XLIYz9Ox950bvXB5ZlYrfLML0OSZlfgY/QMbJi3bMcvMbN/TcT7BhzYTT+CHIWsJyuWt8CdXA==",
"dev": true,
"dependencies": {
"supports-color": "^8.1.0"
}
},
"node_modules/koishi-utils/node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
......@@ -4003,9 +3976,9 @@
"dev": true
},
"@koa/router": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/@koa/router/-/router-10.1.0.tgz",
"integrity": "sha512-QZiCDn8Fd9vVN0qCWw81fToF5GMdtyPD04fIOHXiCCmXB6sznhjHMd3xbVS2ZxrgLWrcN8s6tIItEv0wuXt2Ow==",
"version": "10.1.1",
"resolved": "https://registry.npmjs.org/@koa/router/-/router-10.1.1.tgz",
"integrity": "sha512-ORNjq5z4EmQPriKbR0ER3k4Gh7YGNhWDL7JBW+8wXDrHLbWYKYSJaOJ9aN06npF5tbTxe2JBOsurpJDAvjiXKw==",
"dev": true,
"requires": {
"debug": "^4.1.1",
......@@ -4015,6 +3988,36 @@
"path-to-regexp": "^6.1.0"
}
},
"@koishijs/core": {
"version": "4.0.0-alpha.8",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.0.0-alpha.8.tgz",
"integrity": "sha512-0SSweBTdXfSeD1IlWeBiAKDWD7MYGqHlhhuKAAstZDQm+Hh5oyX5oaZBhTUxbwwDjk//HwYH9AeLqqHTgVZYWw==",
"dev": true,
"requires": {
"@koishijs/utils": "^5.0.0-alpha.4",
"fastest-levenshtein": "^1.0.12"
}
},
"@koishijs/utils": {
"version": "5.0.0-alpha.4",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.0.0-alpha.4.tgz",
"integrity": "sha512-cB1mUh3iLQKVHd8O9Lbdm/8LPmQ/VtiO+DlnAZXwbyczSIBu3HJiQo5t9pjy4LFcOoboEO4iCfbqBXpA2L/JHg==",
"dev": true,
"requires": {
"supports-color": "^8.1.0"
},
"dependencies": {
"supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
......@@ -4137,9 +4140,9 @@
}
},
"@types/http-assert": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.1.tgz",
"integrity": "sha512-PGAK759pxyfXE78NbKxyfRcWYA/KwW17X290cNev/qAsn9eQIxkH4shoNBafH37wewhDG/0p1cHPbK6+SzZjWQ==",
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.3.tgz",
"integrity": "sha512-FyAOrDuQmBi8/or3ns4rwPno7/9tJTijVW6aQQjK02+kOQ8zmoNg2XJtAuQhvQcy1ASJq38wirX5//9J1EqoUA==",
"dev": true
},
"@types/http-errors": {
......@@ -4177,9 +4180,9 @@
}
},
"@types/koa__router": {
"version": "8.0.7",
"resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.7.tgz",
"integrity": "sha512-OB3Ax75nmTP+WR9AgdzA42DI7YmBtiNKN2g1Wxl+d5Dyek9SWt740t+ukwXSmv/jMBCUPyV3YEI93vZHgdP7UQ==",
"version": "8.0.8",
"resolved": "https://registry.npmjs.org/@types/koa__router/-/koa__router-8.0.8.tgz",
"integrity": "sha512-9pGCaDtzCsj4HJ8HmGuqzk8+s57sPj4njWd08GG5o92n5Xp9io2snc40CPpXFhoKcZ8OKhuu6ht4gNou9e1C2w==",
"dev": true,
"requires": {
"@types/koa": "*"
......@@ -4194,12 +4197,6 @@
"@types/koa": "*"
}
},
"@types/lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==",
"dev": true
},
"@types/mime": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
......@@ -4569,12 +4566,6 @@
"color-convert": "^2.0.1"
}
},
"any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
"integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=",
"dev": true
},
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
......@@ -4597,12 +4588,12 @@
"dev": true
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dev": true,
"requires": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.0"
}
},
"balanced-match": {
......@@ -5255,9 +5246,9 @@
"dev": true
},
"follow-redirects": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
"integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==",
"version": "1.14.4",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
"dev": true
},
"fresh": {
......@@ -5388,35 +5379,23 @@
"integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
"dev": true
},
"has-tostringtag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
"integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
"dev": true,
"requires": {
"has-symbols": "^1.0.2"
}
},
"http-assert": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz",
"integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz",
"integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==",
"dev": true,
"requires": {
"deep-equal": "~1.0.1",
"http-errors": "~1.7.2"
},
"dependencies": {
"http-errors": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz",
"integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==",
"dev": true,
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.4",
"setprototypeof": "1.1.1",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0"
}
},
"setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==",
"dev": true
}
"http-errors": "~1.8.0"
}
},
"http-errors": {
......@@ -5529,10 +5508,13 @@
"dev": true
},
"is-generator-function": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz",
"integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==",
"dev": true
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz",
"integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==",
"dev": true,
"requires": {
"has-tostringtag": "^1.0.0"
}
},
"is-glob": {
"version": "4.0.1",
......@@ -5657,9 +5639,9 @@
"dev": true
},
"koa": {
"version": "2.13.1",
"resolved": "https://registry.npmjs.org/koa/-/koa-2.13.1.tgz",
"integrity": "sha512-Lb2Dloc72auj5vK4X4qqL7B5jyDPQaZucc9sR/71byg7ryoD1NCaCm63CShk9ID9quQvDEi1bGR/iGjCG7As3w==",
"version": "2.13.3",
"resolved": "https://registry.npmjs.org/koa/-/koa-2.13.3.tgz",
"integrity": "sha512-XhXIoR+ylAwqG3HhXwnMPQAM/4xfywz52OvxZNmxmTWGGHsvmBv4NSIhURha6yMuvEex1WdtplUTHnxnKpQiGw==",
"dev": true,
"requires": {
"accepts": "^1.3.5",
......@@ -5667,7 +5649,7 @@
"content-disposition": "~0.5.2",
"content-type": "^1.0.4",
"cookies": "~0.8.0",
"debug": "~3.1.0",
"debug": "^4.3.2",
"delegates": "^1.0.0",
"depd": "^2.0.0",
"destroy": "^1.0.4",
......@@ -5678,7 +5660,7 @@
"http-errors": "^1.6.3",
"is-generator-function": "^1.0.7",
"koa-compose": "^4.1.0",
"koa-convert": "^1.2.0",
"koa-convert": "^2.0.0",
"on-finished": "^2.3.0",
"only": "~0.0.2",
"parseurl": "^1.3.2",
......@@ -5687,26 +5669,11 @@
"vary": "^1.1.2"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"dev": true
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
}
}
},
......@@ -5727,62 +5694,30 @@
"dev": true
},
"koa-convert": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz",
"integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz",
"integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==",
"dev": true,
"requires": {
"co": "^4.6.0",
"koa-compose": "^3.0.0"
},
"dependencies": {
"koa-compose": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz",
"integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=",
"dev": true,
"requires": {
"any-promise": "^1.1.0"
}
}
"koa-compose": "^4.1.0"
}
},
"koishi-core": {
"version": "3.13.0",
"resolved": "https://registry.npmjs.org/koishi-core/-/koishi-core-3.13.0.tgz",
"integrity": "sha512-VIB3ykL89xt1/xkRq2bELKk9n2expEy+xrzYOXBJmrjvs8wbCspyUKDYPfCBgj9z+O5tu5nyfn5TjIdwhnIj3g==",
"koishi": {
"version": "4.0.0-alpha.8",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.0.0-alpha.8.tgz",
"integrity": "sha512-Q8Zp+K/P8woCHQRHOOWzSYDE1twJo/Frm5wcUDXMuhYySZtX6ci31ciVE+KSIh230yD30wYpWRbo1xhwTzepvg==",
"dev": true,
"requires": {
"@koa/router": "^10.0.0",
"@types/koa__router": "^8.0.4",
"@types/lru-cache": "^5.1.0",
"@types/ws": "^7.4.2",
"axios": "^0.21.1",
"fastest-levenshtein": "^1.0.12",
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.0.0-alpha.8",
"@koishijs/utils": "^5.0.0-alpha.4",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^7.4.7",
"axios": "^0.21.4",
"koa": "^2.13.1",
"koa-bodyparser": "^4.3.0",
"koishi-utils": "^4.2.3",
"lru-cache": "^6.0.0"
}
},
"koishi-utils": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/koishi-utils/-/koishi-utils-4.2.3.tgz",
"integrity": "sha512-FKOEazHwXDXI1XLIYz9Ox950bvXB5ZlYrfLML0OSZlfgY/QMbJi3bMcvMbN/TcT7BhzYTT+CHIWsJyuWt8CdXA==",
"dev": true,
"requires": {
"supports-color": "^8.1.0"
},
"dependencies": {
"supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
"koa-bodyparser": "^4.3.0"
}
},
"levn": {
......
{
"name": "koishi-plugin-limit-help",
"version": "1.0.1",
"version": "2.0.0",
"description": "Koishi 帮助限制器",
"main": "dist/index.js",
"scripts": {
......@@ -30,7 +30,7 @@
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"koishi-core": "^3.13.0",
"koishi": "^4.0.0-alpha.8",
"prettier": "^2.3.2",
"raw-loader": "^4.0.2",
"ts-loader": "^9.2.5",
......
import 'source-map-support/register';
import type { Context } from 'koishi-core';
import type { Context } from 'koishi';
import { Config, MyPlugin } from './plugin';
export { Config } from './plugin';
export const name = 'limit-help-index';
export const name = 'limit-help';
const plugin = new MyPlugin();
export const schema = plugin.schema;
export function apply(ctx: Context, config: Config) {
ctx.plugin(new MyPlugin(), config);
ctx.plugin(plugin, config);
}
import 'source-map-support/register';
import type { Context } from 'koishi-core';
import { Context, MaybeArray, Schema } from 'koishi';
export type Config = ((ctx: Context) => Context) | null;
const selectors = [
'user',
'guild',
'channel',
'self',
'private',
'platform',
] as const;
type SelectorType = typeof selectors[number];
type SelectorValue = boolean | MaybeArray<string | number>;
type BaseSelection = { [K in SelectorType as `$${K}`]?: SelectorValue };
export interface Selection extends BaseSelection {
$and?: Selection[];
$or?: Selection[];
$not?: Selection;
}
export type Config = Selection;
export class MyPlugin {
config: Config;
ctx: Context;
name = 'limit-help';
name = 'limit-help-main';
schema: Schema<Selection> = Schema.any('帮助作用域。').default({
$user: '10000',
});
apply(ctx: Context, config: Config) {
this.ctx = ctx;
this.config = config || ((ctx) => ctx.intersect(() => false));
this.config = Schema.validate(config, this.schema);
this.disableHelp();
}
disableHelp() {
......@@ -18,6 +40,6 @@ export class MyPlugin {
return;
}
const helpCtx = helpCommand.context;
helpCommand.context = helpCtx.intersect(this.config(helpCtx));
helpCommand.context = helpCtx.intersect(this.ctx.select(this.config));
}
}
......@@ -25,4 +25,7 @@ module.exports = {
},
path: path.resolve(__dirname, "dist"),
},
externals: {
'koishi': 'koishi',
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment