Commit d6d3d2b4 authored by nanahira's avatar nanahira

bump version

parent 4bdd6d17
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
"dependencies": { "dependencies": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
"koishi-decorators": "^2.0.4", "koishi-decorators": "^2.1.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"minato-decorators": "^2.0.6", "minato-decorators": "^2.0.7",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.13", "schemastery-gen": "^3.1.13",
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
}, },
"devDependencies": { "devDependencies": {
"@koishijs/plugin-adapter-onebot": "^4.1.5", "@koishijs/plugin-adapter-onebot": "^4.2.4",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/lodash": "^4.14.177", "@types/lodash": "^4.14.177",
"@types/node": "^16.11.9", "@types/node": "^16.11.9",
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"supertest": "^6.1.6", "supertest": "^6.1.6",
"ts-jest": "^27.0.7", "ts-jest": "^27.0.7",
"typescript": "^4.5.2", "typescript": "^4.6.4",
"ws": "^8.2.3" "ws": "^8.2.3"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.7.0", "koishi": "^4.7.1",
"schemastery": "^3.1.0" "schemastery": "^3.4.3"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
...@@ -1028,31 +1028,49 @@ ...@@ -1028,31 +1028,49 @@
} }
}, },
"node_modules/@koishijs/core": { "node_modules/@koishijs/core": {
"version": "4.7.0", "version": "4.7.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.1.tgz",
"integrity": "sha512-MCF8eJaDV8Bw74N3GesFMaxBmRfrUCvez4SwAPkODjRk2uuQpmnxKCAOJu/AFxyyLLg/vQNTGUMG4mPW8RDIyA==", "integrity": "sha512-vSd2BgyhDrTW/C7Ju1wDr5Z3vp7Qdyk7LgSpGI/b3QtDEfEkhdYKQ9J9LdHIVdUOFL0L0WeRgImW4ZMBtdVlfg==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koishijs/utils": "^5.4.3", "@koishijs/utils": "^5.4.5",
"cordis": "^1.1.1",
"fastest-levenshtein": "^1.0.12", "fastest-levenshtein": "^1.0.12",
"minato": "^1.0.10", "minato": "^1.1.0"
"ns-require": "^1.1.2"
}, },
"engines": { "engines": {
"node": ">=12.0.0" "node": ">=12.0.0"
} }
}, },
"node_modules/@koishijs/plugin-adapter-onebot": { "node_modules/@koishijs/plugin-adapter-onebot": {
"version": "4.1.5", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-adapter-onebot/-/plugin-adapter-onebot-4.1.5.tgz", "resolved": "https://registry.npmjs.org/@koishijs/plugin-adapter-onebot/-/plugin-adapter-onebot-4.2.4.tgz",
"integrity": "sha512-6Lb2ifqbY/hTxnbaSLopDHyVbPUBBfnxdDS7FWDapJ7Z0UeXHCNeIyLSSreuEG93UCn3GDzl43ZCVvOhGQUCHg==", "integrity": "sha512-T1RAzZDAFtdKig/IRAPSM9pa1hIYQ+ANXp34Ko8eqU7l+MzSaUB7esPpct8PbZSztETIWwxH3ly2rFnRP0pu8Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"qface": "^1.2.0", "qface": "^1.2.0",
"ws": "^8.5.0" "ws": "^8.6.0"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.4.2" "koishi": "^4.7.1"
}
},
"node_modules/@koishijs/plugin-help": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-help/-/plugin-help-1.0.0.tgz",
"integrity": "sha512-SvOZiSmtysQxnhOUG0He+/Ftxr+IuIbTApsK6KypRpQ4a1q7OuJWmKb2e+f62zS3GhMYBJ8qT0wRMU+TFPP3AQ==",
"peer": true,
"peerDependencies": {
"koishi": "^4.7.1"
}
},
"node_modules/@koishijs/plugin-suggest": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-suggest/-/plugin-suggest-1.0.0.tgz",
"integrity": "sha512-6jmhymcygID59Z3UblAARGXflJoH0+Tj/qi20GNQO0bxrKkoW4qjxJhlmZe2uv+D1hvTO0q2Yv98iEMDhKyXxw==",
"peer": true,
"peerDependencies": {
"koishi": "^4.7.1"
} }
}, },
"node_modules/@koishijs/segment": { "node_modules/@koishijs/segment": {
...@@ -1062,15 +1080,15 @@ ...@@ -1062,15 +1080,15 @@
"peer": true "peer": true
}, },
"node_modules/@koishijs/utils": { "node_modules/@koishijs/utils": {
"version": "5.4.3", "version": "5.4.5",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.3.tgz", "resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.5.tgz",
"integrity": "sha512-AzkApepb76zEEPNHmWrr1pXCc1DpCpaxL15nANoNMBS+G/2WNaJqUEyZoPQrhWlQzov3MWIzn8KeR4Xl75T4Gg==", "integrity": "sha512-tOmhFFcnuhFAudRcG9Bq7OeVmX1yxGvlSsJMbaSBHvb/hUrFzpXjEd2onqnJw4fyx/QLgYYFBeiFcKXDSujoLg==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koishijs/segment": "^1.1.1", "@koishijs/segment": "^1.1.1",
"cosmokit": "^1.1.2", "cosmokit": "^1.1.2",
"reggol": "^1.0.3", "reggol": "^1.0.3",
"schemastery": "^3.3.3", "schemastery": "^3.4.3",
"supports-color": "^8.1.1" "supports-color": "^8.1.1"
} }
}, },
...@@ -1829,6 +1847,15 @@ ...@@ -1829,6 +1847,15 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/async": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
"peer": true,
"dependencies": {
"lodash": "^4.17.14"
}
},
"node_modules/asynckit": { "node_modules/asynckit": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
...@@ -2288,6 +2315,15 @@ ...@@ -2288,6 +2315,15 @@
"integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=", "integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=",
"peer": true "peer": true
}, },
"node_modules/cordis": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-1.1.1.tgz",
"integrity": "sha512-l1tYxBqy+oEb3EKEvQAlH1g5BICDdnTdcIre1MuCY/qWO4bsrh97qd7jQe2Rq/+tg5HRqs7K6RgP5N/85c57xw==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.2"
}
},
"node_modules/core-util-is": { "node_modules/core-util-is": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
...@@ -4748,14 +4784,16 @@ ...@@ -4748,14 +4784,16 @@
} }
}, },
"node_modules/koishi": { "node_modules/koishi": {
"version": "4.7.0", "version": "4.7.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.0.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.1.tgz",
"integrity": "sha512-aCtfE+QydqbcpoOspOp/QCY1CAXieqnPIR101eKtODgrPBHUVc8XbXbkqGAzx6c2kr6wC7mE4ZLBgECqGBn7tw==", "integrity": "sha512-WtY2ZujFMP4/ySKCc08oXLe2dYlZsdZP7f2eUck1w3cdvOh3eAgndckBP7xpkICAL0l6BYxrbzurIYh32Qck6g==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.7.0", "@koishijs/core": "^4.7.1",
"@koishijs/utils": "^5.4.3", "@koishijs/plugin-help": "^1.0.0",
"@koishijs/plugin-suggest": "^1.0.0",
"@koishijs/utils": "^5.4.5",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.5.3", "@types/ws": "^8.5.3",
...@@ -4763,8 +4801,10 @@ ...@@ -4763,8 +4801,10 @@
"file-type": "^16.5.3", "file-type": "^16.5.3",
"koa": "^2.13.4", "koa": "^2.13.4",
"koa-bodyparser": "^4.3.0", "koa-bodyparser": "^4.3.0",
"ns-require": "^1.1.2",
"parseurl": "^1.3.3", "parseurl": "^1.3.3",
"path-to-regexp": "^6.2.0", "path-to-regexp": "^6.2.0",
"portfinder": "^1.0.28",
"proxy-agent": "^5.0.0", "proxy-agent": "^5.0.0",
"ws": "^8.6.0" "ws": "^8.6.0"
}, },
...@@ -4773,9 +4813,9 @@ ...@@ -4773,9 +4813,9 @@
} }
}, },
"node_modules/koishi-decorators": { "node_modules/koishi-decorators": {
"version": "2.0.4", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.4.tgz", "resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.1.0.tgz",
"integrity": "sha512-FVXURJqWIr9bxgDFMOsaSeg6VrolyBdBhZ+vnNhi8lKOU5liO0v8Nkvvno87C0L+llhoqhxmzFbRZQUy1ik9SA==", "integrity": "sha512-b0opV0YfWXH7/sJ7ecBjPWhz9PsL4esQ1J8EUfymTcZE5jhiTjKhvp+TEdlEC+bDTM49LwMSnohGMU8nZxaD+g==",
"dependencies": { "dependencies": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
...@@ -4785,7 +4825,7 @@ ...@@ -4785,7 +4825,7 @@
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.7.0" "koishi": "^4.7.1"
} }
}, },
"node_modules/leven": { "node_modules/leven": {
...@@ -4982,9 +5022,9 @@ ...@@ -4982,9 +5022,9 @@
} }
}, },
"node_modules/minato": { "node_modules/minato": {
"version": "1.0.10", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/minato/-/minato-1.0.10.tgz", "resolved": "https://registry.npmjs.org/minato/-/minato-1.1.0.tgz",
"integrity": "sha512-1R3cTrtz/xZocWBfmgHsNy6V/nILjyMksKDuGtvqjjToImdgqkQrHmW2ZpdOJaaXM/apivY/KqMEf0o0jksKkw==", "integrity": "sha512-by1KMWxWlzq0iDV7tMkqS3thDRzYNQoS2ECfX5HRpMGaPQJqSgm5aY9IAky7knwAMoW3cMxQ/IhpvEShQqyj6A==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"cosmokit": "^1.1.2", "cosmokit": "^1.1.2",
...@@ -4992,15 +5032,15 @@ ...@@ -4992,15 +5032,15 @@
} }
}, },
"node_modules/minato-decorators": { "node_modules/minato-decorators": {
"version": "2.0.6", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/minato-decorators/-/minato-decorators-2.0.6.tgz", "resolved": "https://registry.npmjs.org/minato-decorators/-/minato-decorators-2.0.7.tgz",
"integrity": "sha512-bDdAbIbcKN0ZJZhw6IOOHZF0LyDXwTHfd2FY5nwO+aqw2IQDztSHAvnxMWT+vWzjqF+xcdQY9WdWffQJ2lX9bg==", "integrity": "sha512-at/tp2GlrnzZ6BIsBH8kzV6u4Od41sc4Mw8wZRVlEe3rccKMDGSBYXelrofj7sF/t66KRbwrc57xAVCg2PaFGg==",
"dependencies": { "dependencies": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
}, },
"peerDependencies": { "peerDependencies": {
"minato": "^1.0.10" "minato": "^1.1.0"
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
...@@ -5016,10 +5056,21 @@ ...@@ -5016,10 +5056,21 @@
} }
}, },
"node_modules/minimist": { "node_modules/minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
"dev": true },
"node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"peer": true,
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
}, },
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.2", "version": "2.1.2",
...@@ -5379,6 +5430,29 @@ ...@@ -5379,6 +5430,29 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/portfinder": {
"version": "1.0.28",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz",
"integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==",
"peer": true,
"dependencies": {
"async": "^2.6.2",
"debug": "^3.1.1",
"mkdirp": "^0.5.5"
},
"engines": {
"node": ">= 0.12.0"
}
},
"node_modules/portfinder/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"peer": true,
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/prelude-ls": { "node_modules/prelude-ls": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
...@@ -5853,9 +5927,9 @@ ...@@ -5853,9 +5927,9 @@
} }
}, },
"node_modules/schemastery": { "node_modules/schemastery": {
"version": "3.3.3", "version": "3.4.3",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.3.tgz", "resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.4.3.tgz",
"integrity": "sha512-DwRsse6C+Qao90P/Bz+4G3gmAjM3he/VgHk3TykmEWv3KFqvwmqEn61SF3BPaTPP0L77a5Kc6q4+KQvdN1bBqA==", "integrity": "sha512-Ui9sPoxOVaKa2EzR6GS08qB/nIMJUczUtkaLfWjeE44kjYZ+GLUFNVE3TpbXRdxjnbIIExwG+paMd0+M7YimqQ==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"cosmokit": "^1.1.2" "cosmokit": "^1.1.2"
...@@ -6554,9 +6628,9 @@ ...@@ -6554,9 +6628,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "4.5.2", "version": "4.6.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
"integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
...@@ -7636,27 +7710,41 @@ ...@@ -7636,27 +7710,41 @@
} }
}, },
"@koishijs/core": { "@koishijs/core": {
"version": "4.7.0", "version": "4.7.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.0.tgz", "resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.1.tgz",
"integrity": "sha512-MCF8eJaDV8Bw74N3GesFMaxBmRfrUCvez4SwAPkODjRk2uuQpmnxKCAOJu/AFxyyLLg/vQNTGUMG4mPW8RDIyA==", "integrity": "sha512-vSd2BgyhDrTW/C7Ju1wDr5Z3vp7Qdyk7LgSpGI/b3QtDEfEkhdYKQ9J9LdHIVdUOFL0L0WeRgImW4ZMBtdVlfg==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koishijs/utils": "^5.4.3", "@koishijs/utils": "^5.4.5",
"cordis": "^1.1.1",
"fastest-levenshtein": "^1.0.12", "fastest-levenshtein": "^1.0.12",
"minato": "^1.0.10", "minato": "^1.1.0"
"ns-require": "^1.1.2"
} }
}, },
"@koishijs/plugin-adapter-onebot": { "@koishijs/plugin-adapter-onebot": {
"version": "4.1.5", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-adapter-onebot/-/plugin-adapter-onebot-4.1.5.tgz", "resolved": "https://registry.npmjs.org/@koishijs/plugin-adapter-onebot/-/plugin-adapter-onebot-4.2.4.tgz",
"integrity": "sha512-6Lb2ifqbY/hTxnbaSLopDHyVbPUBBfnxdDS7FWDapJ7Z0UeXHCNeIyLSSreuEG93UCn3GDzl43ZCVvOhGQUCHg==", "integrity": "sha512-T1RAzZDAFtdKig/IRAPSM9pa1hIYQ+ANXp34Ko8eqU7l+MzSaUB7esPpct8PbZSztETIWwxH3ly2rFnRP0pu8Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"qface": "^1.2.0", "qface": "^1.2.0",
"ws": "^8.5.0" "ws": "^8.6.0"
} }
}, },
"@koishijs/plugin-help": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-help/-/plugin-help-1.0.0.tgz",
"integrity": "sha512-SvOZiSmtysQxnhOUG0He+/Ftxr+IuIbTApsK6KypRpQ4a1q7OuJWmKb2e+f62zS3GhMYBJ8qT0wRMU+TFPP3AQ==",
"peer": true,
"requires": {}
},
"@koishijs/plugin-suggest": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-suggest/-/plugin-suggest-1.0.0.tgz",
"integrity": "sha512-6jmhymcygID59Z3UblAARGXflJoH0+Tj/qi20GNQO0bxrKkoW4qjxJhlmZe2uv+D1hvTO0q2Yv98iEMDhKyXxw==",
"peer": true,
"requires": {}
},
"@koishijs/segment": { "@koishijs/segment": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz",
...@@ -7664,15 +7752,15 @@ ...@@ -7664,15 +7752,15 @@
"peer": true "peer": true
}, },
"@koishijs/utils": { "@koishijs/utils": {
"version": "5.4.3", "version": "5.4.5",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.3.tgz", "resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.5.tgz",
"integrity": "sha512-AzkApepb76zEEPNHmWrr1pXCc1DpCpaxL15nANoNMBS+G/2WNaJqUEyZoPQrhWlQzov3MWIzn8KeR4Xl75T4Gg==", "integrity": "sha512-tOmhFFcnuhFAudRcG9Bq7OeVmX1yxGvlSsJMbaSBHvb/hUrFzpXjEd2onqnJw4fyx/QLgYYFBeiFcKXDSujoLg==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koishijs/segment": "^1.1.1", "@koishijs/segment": "^1.1.1",
"cosmokit": "^1.1.2", "cosmokit": "^1.1.2",
"reggol": "^1.0.3", "reggol": "^1.0.3",
"schemastery": "^3.3.3", "schemastery": "^3.4.3",
"supports-color": "^8.1.1" "supports-color": "^8.1.1"
}, },
"dependencies": { "dependencies": {
...@@ -8281,6 +8369,15 @@ ...@@ -8281,6 +8369,15 @@
"integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
"dev": true "dev": true
}, },
"async": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
"peer": true,
"requires": {
"lodash": "^4.17.14"
}
},
"asynckit": { "asynckit": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
...@@ -8651,6 +8748,15 @@ ...@@ -8651,6 +8748,15 @@
"integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=", "integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=",
"peer": true "peer": true
}, },
"cordis": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-1.1.1.tgz",
"integrity": "sha512-l1tYxBqy+oEb3EKEvQAlH1g5BICDdnTdcIre1MuCY/qWO4bsrh97qd7jQe2Rq/+tg5HRqs7K6RgP5N/85c57xw==",
"peer": true,
"requires": {
"cosmokit": "^1.1.2"
}
},
"core-util-is": { "core-util-is": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
...@@ -10502,14 +10608,16 @@ ...@@ -10502,14 +10608,16 @@
} }
}, },
"koishi": { "koishi": {
"version": "4.7.0", "version": "4.7.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.0.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.1.tgz",
"integrity": "sha512-aCtfE+QydqbcpoOspOp/QCY1CAXieqnPIR101eKtODgrPBHUVc8XbXbkqGAzx6c2kr6wC7mE4ZLBgECqGBn7tw==", "integrity": "sha512-WtY2ZujFMP4/ySKCc08oXLe2dYlZsdZP7f2eUck1w3cdvOh3eAgndckBP7xpkICAL0l6BYxrbzurIYh32Qck6g==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.7.0", "@koishijs/core": "^4.7.1",
"@koishijs/utils": "^5.4.3", "@koishijs/plugin-help": "^1.0.0",
"@koishijs/plugin-suggest": "^1.0.0",
"@koishijs/utils": "^5.4.5",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.5.3", "@types/ws": "^8.5.3",
...@@ -10517,16 +10625,18 @@ ...@@ -10517,16 +10625,18 @@
"file-type": "^16.5.3", "file-type": "^16.5.3",
"koa": "^2.13.4", "koa": "^2.13.4",
"koa-bodyparser": "^4.3.0", "koa-bodyparser": "^4.3.0",
"ns-require": "^1.1.2",
"parseurl": "^1.3.3", "parseurl": "^1.3.3",
"path-to-regexp": "^6.2.0", "path-to-regexp": "^6.2.0",
"portfinder": "^1.0.28",
"proxy-agent": "^5.0.0", "proxy-agent": "^5.0.0",
"ws": "^8.6.0" "ws": "^8.6.0"
} }
}, },
"koishi-decorators": { "koishi-decorators": {
"version": "2.0.4", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.4.tgz", "resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.1.0.tgz",
"integrity": "sha512-FVXURJqWIr9bxgDFMOsaSeg6VrolyBdBhZ+vnNhi8lKOU5liO0v8Nkvvno87C0L+llhoqhxmzFbRZQUy1ik9SA==", "integrity": "sha512-b0opV0YfWXH7/sJ7ecBjPWhz9PsL4esQ1J8EUfymTcZE5jhiTjKhvp+TEdlEC+bDTM49LwMSnohGMU8nZxaD+g==",
"requires": { "requires": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
...@@ -10684,9 +10794,9 @@ ...@@ -10684,9 +10794,9 @@
"dev": true "dev": true
}, },
"minato": { "minato": {
"version": "1.0.10", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/minato/-/minato-1.0.10.tgz", "resolved": "https://registry.npmjs.org/minato/-/minato-1.1.0.tgz",
"integrity": "sha512-1R3cTrtz/xZocWBfmgHsNy6V/nILjyMksKDuGtvqjjToImdgqkQrHmW2ZpdOJaaXM/apivY/KqMEf0o0jksKkw==", "integrity": "sha512-by1KMWxWlzq0iDV7tMkqS3thDRzYNQoS2ECfX5HRpMGaPQJqSgm5aY9IAky7knwAMoW3cMxQ/IhpvEShQqyj6A==",
"peer": true, "peer": true,
"requires": { "requires": {
"cosmokit": "^1.1.2", "cosmokit": "^1.1.2",
...@@ -10694,9 +10804,9 @@ ...@@ -10694,9 +10804,9 @@
} }
}, },
"minato-decorators": { "minato-decorators": {
"version": "2.0.6", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/minato-decorators/-/minato-decorators-2.0.6.tgz", "resolved": "https://registry.npmjs.org/minato-decorators/-/minato-decorators-2.0.7.tgz",
"integrity": "sha512-bDdAbIbcKN0ZJZhw6IOOHZF0LyDXwTHfd2FY5nwO+aqw2IQDztSHAvnxMWT+vWzjqF+xcdQY9WdWffQJ2lX9bg==", "integrity": "sha512-at/tp2GlrnzZ6BIsBH8kzV6u4Od41sc4Mw8wZRVlEe3rccKMDGSBYXelrofj7sF/t66KRbwrc57xAVCg2PaFGg==",
"requires": { "requires": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
...@@ -10712,10 +10822,18 @@ ...@@ -10712,10 +10822,18 @@
} }
}, },
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
"dev": true },
"mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"peer": true,
"requires": {
"minimist": "^1.2.6"
}
}, },
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
...@@ -10987,6 +11105,28 @@ ...@@ -10987,6 +11105,28 @@
"find-up": "^4.0.0" "find-up": "^4.0.0"
} }
}, },
"portfinder": {
"version": "1.0.28",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz",
"integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==",
"peer": true,
"requires": {
"async": "^2.6.2",
"debug": "^3.1.1",
"mkdirp": "^0.5.5"
},
"dependencies": {
"debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"peer": true,
"requires": {
"ms": "^2.1.1"
}
}
}
},
"prelude-ls": { "prelude-ls": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
...@@ -11330,9 +11470,9 @@ ...@@ -11330,9 +11470,9 @@
} }
}, },
"schemastery": { "schemastery": {
"version": "3.3.3", "version": "3.4.3",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.3.tgz", "resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.4.3.tgz",
"integrity": "sha512-DwRsse6C+Qao90P/Bz+4G3gmAjM3he/VgHk3TykmEWv3KFqvwmqEn61SF3BPaTPP0L77a5Kc6q4+KQvdN1bBqA==", "integrity": "sha512-Ui9sPoxOVaKa2EzR6GS08qB/nIMJUczUtkaLfWjeE44kjYZ+GLUFNVE3TpbXRdxjnbIIExwG+paMd0+M7YimqQ==",
"peer": true, "peer": true,
"requires": { "requires": {
"cosmokit": "^1.1.2" "cosmokit": "^1.1.2"
...@@ -11844,9 +11984,9 @@ ...@@ -11844,9 +11984,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "4.5.2", "version": "4.6.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
"integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
"dev": true "dev": true
}, },
"universalify": { "universalify": {
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"author": "Nanahira <nanahira@momobako.com>", "author": "Nanahira <nanahira@momobako.com>",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@koishijs/plugin-adapter-onebot": "^4.1.5", "@koishijs/plugin-adapter-onebot": "^4.2.4",
"@types/jest": "^27.0.3", "@types/jest": "^27.0.3",
"@types/lodash": "^4.14.177", "@types/lodash": "^4.14.177",
"@types/node": "^16.11.9", "@types/node": "^16.11.9",
...@@ -44,15 +44,15 @@ ...@@ -44,15 +44,15 @@
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"supertest": "^6.1.6", "supertest": "^6.1.6",
"ts-jest": "^27.0.7", "ts-jest": "^27.0.7",
"typescript": "^4.5.2", "typescript": "^4.6.4",
"ws": "^8.2.3" "ws": "^8.2.3"
}, },
"dependencies": { "dependencies": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
"koishi-decorators": "^2.0.4", "koishi-decorators": "^2.1.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"minato-decorators": "^2.0.6", "minato-decorators": "^2.0.7",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.13", "schemastery-gen": "^3.1.13",
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
"testEnvironment": "node" "testEnvironment": "node"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.7.0", "koishi": "^4.7.1",
"schemastery": "^3.1.0" "schemastery": "^3.4.3"
} }
} }
...@@ -12,7 +12,6 @@ import { ...@@ -12,7 +12,6 @@ import {
KoishiSystemInjectSymKeys, KoishiSystemInjectSymKeys,
ProvideOptions, ProvideOptions,
SystemInjectFun, SystemInjectFun,
TypedMethodDecorator,
} from './def'; } from './def';
import { TopLevelAction } from 'koishi-decorators'; import { TopLevelAction } from 'koishi-decorators';
import { ModelClassType, ModelRegistrar } from 'minato-decorators'; import { ModelClassType, ModelRegistrar } from 'minato-decorators';
...@@ -27,14 +26,14 @@ export { PluginDef } from 'koishi-decorators'; ...@@ -27,14 +26,14 @@ export { PluginDef } from 'koishi-decorators';
// Service API // Service API
export function Inject( export function Inject(
name?: keyof Context.Services, name?: ServiceName,
addUsing?: boolean, addUsing?: boolean,
): PropertyDecorator; ): PropertyDecorator;
export function Inject(addUsing?: boolean): PropertyDecorator; export function Inject(addUsing?: boolean): PropertyDecorator;
export function Inject( export function Inject(
...args: [(keyof Context.Services | boolean)?, boolean?] ...args: [(ServiceName | boolean)?, boolean?]
): PropertyDecorator { ): PropertyDecorator {
let name: keyof Context.Services; let name: ServiceName;
let addUsing = false; let addUsing = false;
if (args.length === 1) { if (args.length === 1) {
if (typeof args[0] === 'boolean') { if (typeof args[0] === 'boolean') {
...@@ -43,7 +42,7 @@ export function Inject( ...@@ -43,7 +42,7 @@ export function Inject(
name = args[0]; name = args[0];
} }
} else if (args.length >= 2) { } else if (args.length >= 2) {
name = args[0] as keyof Context.Services; name = args[0] as ServiceName;
addUsing = args[1]; addUsing = args[1];
} }
return (obj, key) => { return (obj, key) => {
...@@ -59,7 +58,7 @@ export function Inject( ...@@ -59,7 +58,7 @@ export function Inject(
return dec(obj, key); return dec(obj, key);
} }
} }
const serviceName = name || (key as keyof Context.Services); const serviceName = name || (key as ServiceName);
if (addUsing) { if (addUsing) {
Metadata.appendUnique(KoishiAddUsingList, serviceName)(obj.constructor); Metadata.appendUnique(KoishiAddUsingList, serviceName)(obj.constructor);
} }
...@@ -73,10 +72,10 @@ export function Inject( ...@@ -73,10 +72,10 @@ export function Inject(
} }
export function Provide( export function Provide(
name: keyof Context.Services, name: ServiceName,
options?: ProvideOptions, options?: ProvideOptions,
): ClassDecorator { ): ClassDecorator {
Context.service(name); Context.service(name, options);
return Metadata.append(KoishiServiceProvideSym, { return Metadata.append(KoishiServiceProvideSym, {
...options, ...options,
serviceName: name, serviceName: name,
...@@ -105,7 +104,7 @@ export const Caller = () => ...@@ -105,7 +104,7 @@ export const Caller = () =>
}); });
export function UsingService( export function UsingService(
...services: (keyof Context.Services)[] ...services: ServiceName[]
): ClassDecorator & MethodDecorator { ): ClassDecorator & MethodDecorator {
return (obj, key?) => { return (obj, key?) => {
for (const service of services) { for (const service of services) {
......
// metadatas // metadatas
import { Context, Schema } from 'koishi'; import { Context, Schema } from 'koishi';
import { import { ControlType, ProvideDefinition, SystemInjectFun } from './interfaces';
Condition,
ControlType,
ControlTypeMap,
ProvideDefinition,
SystemInjectFun,
} from './interfaces';
import { ClassType } from 'schemastery-gen'; import { ClassType } from 'schemastery-gen';
export const KoishiServiceInjectSym = 'KoishiServiceInjectSym'; export const KoishiServiceInjectSym = 'KoishiServiceInjectSym';
...@@ -23,13 +17,13 @@ export interface MetadataArrayMap { ...@@ -23,13 +17,13 @@ export interface MetadataArrayMap {
KoishiServiceProvideSym: ProvideDefinition; KoishiServiceProvideSym: ProvideDefinition;
KoishiServiceInjectSymKeys: string; KoishiServiceInjectSymKeys: string;
KoishiSystemInjectSymKeys: string; KoishiSystemInjectSymKeys: string;
KoishiAddUsingList: keyof Context.Services; KoishiAddUsingList: ServiceName;
KoishiPartialUsing: keyof Context.Services; KoishiPartialUsing: ServiceName;
KoishiControl: ControlType; KoishiControl: ControlType;
} }
export interface MetadataMap { export interface MetadataMap {
KoishiServiceInjectSym: keyof Context.Services; KoishiServiceInjectSym: ServiceName;
KoishiSystemInjectSym: SystemInjectFun; KoishiSystemInjectSym: SystemInjectFun;
KoishiPredefineSchema: Schema | ClassType<any>; KoishiPredefineSchema: Schema | ClassType<any>;
KoishiPredefineName: string; KoishiPredefineName: string;
......
...@@ -7,12 +7,14 @@ export * from 'koishi-decorators/dist/src/def/interfaces'; ...@@ -7,12 +7,14 @@ export * from 'koishi-decorators/dist/src/def/interfaces';
export type SystemInjectFun = <T = any>(obj: PluginMeta<T>) => any; export type SystemInjectFun = <T = any>(obj: PluginMeta<T>) => any;
export interface ProvideOptions { export type ServiceName = keyof Context;
export interface ProvideOptions extends Context.ServiceOptions {
immediate?: boolean; immediate?: boolean;
} }
export interface ProvideDefinition extends ProvideOptions { export interface ProvideDefinition extends ProvideOptions {
serviceName: keyof Context.Services; serviceName: ServiceName;
} }
export type Condition<R, T = any, Ext extends any[] = []> = ( export type Condition<R, T = any, Ext extends any[] = []> = (
......
import { MapPluginToConfig, PluginClass } from '../def'; import { MapPluginToConfig, PluginClass } from '../def';
import { Dict } from 'koishi'; import { Dict } from 'koishi';
import { AnyClass, ClassType, Mixin } from 'schemastery-gen'; import { ClassType, Mixin } from 'schemastery-gen';
import { MappingPluginBase } from './mapping-base'; import { MappingPluginBase } from './mapping-base';
import { CreatePluginFactory } from '../plugin-factory'; import { CreatePluginFactory } from '../plugin-factory';
import _ from 'lodash'; import _ from 'lodash';
......
...@@ -69,9 +69,7 @@ export function MultiInstancePlugin< ...@@ -69,9 +69,7 @@ export function MultiInstancePlugin<
const plugin = factory(outerConfig); const plugin = factory(outerConfig);
if (innerPlugin['using']) { if (innerPlugin['using']) {
UsingService(...(innerPlugin['using'] as (keyof Context.Services)[]))( UsingService(...(innerPlugin['using'] as ServiceName[]))(plugin);
plugin,
);
} }
return plugin; return plugin;
......
import { Context, Plugin, Schema, WebSocketLayer } from 'koishi'; import { Context, Plugin, Schema, WebSocketLayer } from 'koishi';
import { import {
Condition,
ControlType, ControlType,
KoishiAddUsingList, KoishiAddUsingList,
KoishiPartialUsing, KoishiPartialUsing,
...@@ -22,7 +21,7 @@ export interface KoishiPluginRegistrationOptions<T = any> { ...@@ -22,7 +21,7 @@ export interface KoishiPluginRegistrationOptions<T = any> {
name?: string; name?: string;
schema?: Schema<T> | Type<T>; schema?: Schema<T> | Type<T>;
Config?: Schema<T> | Type<T>; Config?: Schema<T> | Type<T>;
using?: (keyof Context.Services)[]; using?: ServiceName[];
} }
export interface PluginMeta<T = any> { export interface PluginMeta<T = any> {
...@@ -124,6 +123,8 @@ export function DefinePlugin<T>( ...@@ -124,6 +123,8 @@ export function DefinePlugin<T>(
return this.__ctx[name]; return this.__ctx[name];
}, },
set: (val: any) => { set: (val: any) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.__ctx[name] = val; this.__ctx[name] = val;
}, },
}); });
...@@ -234,6 +235,8 @@ export function DefinePlugin<T>( ...@@ -234,6 +235,8 @@ export function DefinePlugin<T>(
(serviceDef) => !serviceDef.immediate === !immediate, (serviceDef) => !serviceDef.immediate === !immediate,
); );
for (const key of providingServices) { for (const key of providingServices) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.__ctx[key.serviceName] = this as any; this.__ctx[key.serviceName] = this as any;
} }
} }
...@@ -242,6 +245,8 @@ export function DefinePlugin<T>( ...@@ -242,6 +245,8 @@ export function DefinePlugin<T>(
const providingServices = this._getProvidingServices(); const providingServices = this._getProvidingServices();
for (const key of providingServices) { for (const key of providingServices) {
if (this.__ctx[key.serviceName] === (this as never)) { if (this.__ctx[key.serviceName] === (this as never)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.__ctx[key.serviceName] = null; this.__ctx[key.serviceName] = null;
} }
} }
......
...@@ -28,7 +28,7 @@ describe('InjectUsing', () => { ...@@ -28,7 +28,7 @@ describe('InjectUsing', () => {
it('Should include injected using services', () => { it('Should include injected using services', () => {
expect(MyPlugin.name).toBe('foo-plugin'); expect(MyPlugin.name).toBe('foo-plugin');
expect(MyPlugin['Config']).toEqual(Config); expect(MyPlugin['Config']).toEqual(Config);
const usingList = (MyPlugin as any).using as (keyof Context.Services)[]; const usingList = (MyPlugin as any).using as ServiceName[];
expect(usingList).toBeInstanceOf(Array); expect(usingList).toBeInstanceOf(Array);
expect(usingList.length).toEqual(5); expect(usingList.length).toEqual(5);
expect(usingList.includes('database')).toEqual(true); expect(usingList.includes('database')).toEqual(true);
......
...@@ -35,7 +35,7 @@ describe('Scope', () => { ...@@ -35,7 +35,7 @@ describe('Scope', () => {
} as Session; } as Session;
app.plugin(MyClass); app.plugin(MyClass);
const methodCtx = app.command('foo').context; const methodCtx = app.command('foo').ctx;
expect(methodCtx.filter(correctSession)).toBe(true); expect(methodCtx.filter(correctSession)).toBe(true);
expect(methodCtx.filter(wrongSession1)).toBe(false); expect(methodCtx.filter(wrongSession1)).toBe(false);
......
...@@ -60,7 +60,7 @@ class MyConsumer { ...@@ -60,7 +60,7 @@ class MyConsumer {
eagerPongResult: string; eagerPongResult: string;
@UseEvent('service') @UseEvent('service')
async onService(name: keyof Context.Services) { async onService(name: ServiceName) {
if (name === 'myProvider') { if (name === 'myProvider') {
this.pongResult = this.myProvider.ping(); this.pongResult = this.myProvider.ping();
} else if (name === 'myEagerProvider') { } else if (name === 'myEagerProvider') {
...@@ -83,7 +83,7 @@ class MyUsingConsumer { ...@@ -83,7 +83,7 @@ class MyUsingConsumer {
eagerPongResult: string; eagerPongResult: string;
@UseEvent('service') @UseEvent('service')
async onService(name: keyof Context.Services) { async onService(name: ServiceName) {
if (name === 'myProvider') { if (name === 'myProvider') {
this.pongResult = this.myProvider.ping(); this.pongResult = this.myProvider.ping();
} else if (name === 'myEagerProvider') { } else if (name === 'myEagerProvider') {
......
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