Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
Koishi Nestjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
Koishi Nestjs
Commits
07b39724
Commit
07b39724
authored
Nov 14, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adapt SessionError changes
parent
6e65943a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
122 additions
and
111 deletions
+122
-111
package-lock.json
package-lock.json
+91
-91
package.json
package.json
+1
-1
src/koishi-exception-handler/koishi-exception-handler.service.ts
...shi-exception-handler/koishi-exception-handler.service.ts
+12
-8
src/utility/wrap-action.ts
src/utility/wrap-action.ts
+0
-10
tests/koishi-tests.spec.ts
tests/koishi-tests.spec.ts
+10
-0
tests/utility/testing-module.ts
tests/utility/testing-module.ts
+8
-1
No files found.
package-lock.json
View file @
07b39724
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
"peerDependencies"
:
{
"peerDependencies"
:
{
"@nestjs/common"
:
"^9.0.3 || ^8.0.0"
,
"@nestjs/common"
:
"^9.0.3 || ^8.0.0"
,
"@nestjs/core"
:
"^9.0.3 || ^8.0.0"
,
"@nestjs/core"
:
"^9.0.3 || ^8.0.0"
,
"koishi"
:
"^4.
9.7
"
,
"koishi"
:
"^4.
10.1
"
,
"rxjs"
:
"^7.5.5"
"rxjs"
:
"^7.5.5"
}
}
},
},
...
@@ -1243,22 +1243,22 @@
...
@@ -1243,22 +1243,22 @@
}
}
},
},
"node_modules/@koishijs/core"
:
{
"node_modules/@koishijs/core"
:
{
"version"
:
"4.
9.7
"
,
"version"
:
"4.
10.1
"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/core/-/core-4.
9.7
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/core/-/core-4.
10.1
.tgz"
,
"integrity"
:
"sha512-
jmt6BKvH0az25z/BJs4SNFn9dvx7Ji3TjIRl5AtvagO0bzOQfbn1Tavhtfn3sHVJqQUQIZQcFR3969G4dvchh
A=="
,
"integrity"
:
"sha512-
+1Is4rGASRllDz6SzQmkzWjjS0MgWhkqQfmDXuaV/h3H9zGrP0HAlZ7y4Jyj5O/QmNL4JVpQM3ENoLS/lZ32e
A=="
,
"peer"
:
true
,
"peer"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"@koishijs/utils"
:
"^6.2.
4
"
,
"@koishijs/utils"
:
"^6.2.
5
"
,
"@minatojs/core"
:
"^1.3.2"
,
"@minatojs/core"
:
"^1.3.2"
,
"@satorijs/core"
:
"^1.3.
1
"
,
"@satorijs/core"
:
"^1.3.
7
"
,
"cordis"
:
"^2.5.0"
,
"cordis"
:
"^2.5.0"
,
"cosmokit"
:
"^1.3.3"
"cosmokit"
:
"^1.3.3"
}
}
},
},
"node_modules/@koishijs/utils"
:
{
"node_modules/@koishijs/utils"
:
{
"version"
:
"6.2.
4
"
,
"version"
:
"6.2.
5
"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/utils/-/utils-6.2.
4
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/utils/-/utils-6.2.
5
.tgz"
,
"integrity"
:
"sha512-
AfZA1TX8oOQCNFTOmG5cBRPC0YbSUPgbUYkninFg8F2sp98C8VSn1hua1OVjCM5zC9XISWtj5QpKJHPJRIa+BA
=="
,
"integrity"
:
"sha512-
ZpiHO6LBRIUm/bWJlGHC2N/f6hl0jgVU2QmUwiL3PfAH4i2xu17TZpU8hoQkrP751Lw37W9GcXoxw22mGaqdXw
=="
,
"peer"
:
true
,
"peer"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"cosmokit"
:
"^1.3.3"
,
"cosmokit"
:
"^1.3.3"
,
...
@@ -1543,14 +1543,14 @@
...
@@ -1543,14 +1543,14 @@
}
}
},
},
"node_modules/@satorijs/core"
:
{
"node_modules/@satorijs/core"
:
{
"version"
:
"1.3.
1
"
,
"version"
:
"1.3.
7
"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/core/-/core-1.3.
1
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/core/-/core-1.3.
7
.tgz"
,
"integrity"
:
"sha512-
kwjHQ+PYtY97/RBN2D0B5q4Duf6t5xwbHa8qQFVMQ2K1w+Rq0gbwke4eccsj6l5w0gjo5W5UIJUcnwrDYo4sww
=="
,
"integrity"
:
"sha512-
9orP2YYokEwBapEMZ6obPzKSOVpcS0TOnUVnJM12YM+22HgxDdXd3cNxTksogiPeEvBvvuR5iuwpkOSFlLdaIA
=="
,
"peer"
:
true
,
"peer"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"@satorijs/element"
:
"^2.0.0"
,
"@satorijs/element"
:
"^2.0.0"
,
"cordis"
:
"^2.5.0"
,
"cordis"
:
"^2.5.0"
,
"cordis-axios"
:
"^2.1.
3
"
,
"cordis-axios"
:
"^2.1.
4
"
,
"cosmokit"
:
"^1.3.3"
,
"cosmokit"
:
"^1.3.3"
,
"reggol"
:
"^1.3.1"
,
"reggol"
:
"^1.3.1"
,
"schemastery"
:
"^3.5.4"
,
"schemastery"
:
"^3.5.4"
,
...
@@ -1567,13 +1567,13 @@
...
@@ -1567,13 +1567,13 @@
}
}
},
},
"node_modules/@satorijs/satori"
:
{
"node_modules/@satorijs/satori"
:
{
"version"
:
"1.3.
1
"
,
"version"
:
"1.3.
7
"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/satori/-/satori-1.3.
1
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/satori/-/satori-1.3.
7
.tgz"
,
"integrity"
:
"sha512-
T7elZqVtoQiXo6rLxlNx8KB0Y3b8zJuuSTjiSNjrqhEvd0QCGKxSzs3RSvCfIHqc5kdhXzdH48CEE5hQgYkrFw
=="
,
"integrity"
:
"sha512-
97POcpucME22ALdM8TqosGvNJWu6cNere0fE4NcHVhh0LXhuWyhMN5kviqNqeyZisDSK2EGd4ZqKUVxlQkxqDQ
=="
,
"peer"
:
true
,
"peer"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"@koa/router"
:
"^10.1.1"
,
"@koa/router"
:
"^10.1.1"
,
"@satorijs/core"
:
"1.3.
1
"
,
"@satorijs/core"
:
"1.3.
7
"
,
"@types/koa"
:
"*"
,
"@types/koa"
:
"*"
,
"@types/koa__router"
:
"*"
,
"@types/koa__router"
:
"*"
,
"@types/ws"
:
"^8.5.3"
,
"@types/ws"
:
"^8.5.3"
,
...
@@ -1592,29 +1592,6 @@
...
@@ -1592,29 +1592,6 @@
"node"
:
">=12.0.0"
"node"
:
">=12.0.0"
}
}
},
},
"node_modules/@satorijs/satori/node_modules/@tootallnate/once"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz"
,
"integrity"
:
"sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A=="
,
"peer"
:
true
,
"engines"
:
{
"node"
:
">= 10"
}
},
"node_modules/@satorijs/satori/node_modules/http-proxy-agent"
:
{
"version"
:
"5.0.0"
,
"resolved"
:
"https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz"
,
"integrity"
:
"sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w=="
,
"peer"
:
true
,
"dependencies"
:
{
"@tootallnate/once"
:
"2"
,
"agent-base"
:
"6"
,
"debug"
:
"4"
},
"engines"
:
{
"node"
:
">= 6"
}
},
"node_modules/@satorijs/satori/node_modules/path-to-regexp"
:
{
"node_modules/@satorijs/satori/node_modules/path-to-regexp"
:
{
"version"
:
"6.2.1"
,
"version"
:
"6.2.1"
,
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz"
,
...
@@ -1651,6 +1628,15 @@
...
@@ -1651,6 +1628,15 @@
"integrity"
:
"sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="
,
"integrity"
:
"sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="
,
"peer"
:
true
"peer"
:
true
},
},
"node_modules/@tootallnate/once"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz"
,
"integrity"
:
"sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A=="
,
"peer"
:
true
,
"engines"
:
{
"node"
:
">= 10"
}
},
"node_modules/@types/accepts"
:
{
"node_modules/@types/accepts"
:
{
"version"
:
"1.3.5"
,
"version"
:
"1.3.5"
,
"resolved"
:
"https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz"
,
...
@@ -2888,9 +2874,9 @@
...
@@ -2888,9 +2874,9 @@
}
}
},
},
"node_modules/cordis-axios"
:
{
"node_modules/cordis-axios"
:
{
"version"
:
"2.1.
3
"
,
"version"
:
"2.1.
4
"
,
"resolved"
:
"https://registry.npmjs.org/cordis-axios/-/cordis-axios-2.1.
3
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/cordis-axios/-/cordis-axios-2.1.
4
.tgz"
,
"integrity"
:
"sha512-
W6RCzZ4u+q/2D+BSAYV3aA3dMuz1bi+c9L1RI8g9SLaA5Z2QoaJ5zX1faIrS8y79AWtXm8joIGj+gzPVnvO8ww
=="
,
"integrity"
:
"sha512-
znwVVXxmvv3/RHY/5i9sDjmEGOrR0dki+QcfwawnrVlM5R8YqHwFLlZTapzbuP8pKvHjJ9GfkkQYwk5CaTFWQg
=="
,
"peer"
:
true
,
"peer"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"axios"
:
"^1.1.2"
,
"axios"
:
"^1.1.2"
,
...
@@ -4174,6 +4160,20 @@
...
@@ -4174,6 +4160,20 @@
"node"
:
">= 0.8"
"node"
:
">= 0.8"
}
}
},
},
"node_modules/http-proxy-agent"
:
{
"version"
:
"5.0.0"
,
"resolved"
:
"https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz"
,
"integrity"
:
"sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w=="
,
"peer"
:
true
,
"dependencies"
:
{
"@tootallnate/once"
:
"2"
,
"agent-base"
:
"6"
,
"debug"
:
"4"
},
"engines"
:
{
"node"
:
">= 6"
}
},
"node_modules/https-proxy-agent"
:
{
"node_modules/https-proxy-agent"
:
{
"version"
:
"5.0.1"
,
"version"
:
"5.0.1"
,
"resolved"
:
"https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz"
,
...
@@ -5256,14 +5256,14 @@
...
@@ -5256,14 +5256,14 @@
}
}
},
},
"node_modules/koishi"
:
{
"node_modules/koishi"
:
{
"version"
:
"4.
9.7
"
,
"version"
:
"4.
10.1
"
,
"resolved"
:
"https://registry.npmjs.org/koishi/-/koishi-4.
9.7
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/koishi/-/koishi-4.
10.1
.tgz"
,
"integrity"
:
"sha512-
InvvfPx5sqRkgOlTWksQu1dWjASCcf92guRGQmm+UIqZh0GBTJi+uFmpAMPA/E+nHOoLDOy/U9DVtpSPipi2+
g=="
,
"integrity"
:
"sha512-
nET+NfATO+99tNKasgPpyZzFv3kmjzrDmSyJmPlWDsokbjvouMIQHh6EGBiwLCipp7KKsQNZabB3FEFbwzL7Q
g=="
,
"peer"
:
true
,
"peer"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"@koishijs/core"
:
"^4.
9.7
"
,
"@koishijs/core"
:
"^4.
10.1
"
,
"@koishijs/utils"
:
"^6.2.
4
"
,
"@koishijs/utils"
:
"^6.2.
5
"
,
"@satorijs/satori"
:
"^1.3.
1
"
,
"@satorijs/satori"
:
"^1.3.
7
"
,
"file-type"
:
"^16.5.4"
,
"file-type"
:
"^16.5.4"
,
"ns-require"
:
"^1.1.4"
"ns-require"
:
"^1.1.4"
},
},
...
@@ -8500,22 +8500,22 @@
...
@@ -8500,22 +8500,22 @@
}
}
},
},
"@koishijs/core"
:
{
"@koishijs/core"
:
{
"version"
:
"4.
9.7
"
,
"version"
:
"4.
10.1
"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/core/-/core-4.
9.7
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/core/-/core-4.
10.1
.tgz"
,
"integrity"
:
"sha512-
jmt6BKvH0az25z/BJs4SNFn9dvx7Ji3TjIRl5AtvagO0bzOQfbn1Tavhtfn3sHVJqQUQIZQcFR3969G4dvchh
A=="
,
"integrity"
:
"sha512-
+1Is4rGASRllDz6SzQmkzWjjS0MgWhkqQfmDXuaV/h3H9zGrP0HAlZ7y4Jyj5O/QmNL4JVpQM3ENoLS/lZ32e
A=="
,
"peer"
:
true
,
"peer"
:
true
,
"requires"
:
{
"requires"
:
{
"@koishijs/utils"
:
"^6.2.
4
"
,
"@koishijs/utils"
:
"^6.2.
5
"
,
"@minatojs/core"
:
"^1.3.2"
,
"@minatojs/core"
:
"^1.3.2"
,
"@satorijs/core"
:
"^1.3.
1
"
,
"@satorijs/core"
:
"^1.3.
7
"
,
"cordis"
:
"^2.5.0"
,
"cordis"
:
"^2.5.0"
,
"cosmokit"
:
"^1.3.3"
"cosmokit"
:
"^1.3.3"
}
}
},
},
"@koishijs/utils"
:
{
"@koishijs/utils"
:
{
"version"
:
"6.2.
4
"
,
"version"
:
"6.2.
5
"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/utils/-/utils-6.2.
4
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@koishijs/utils/-/utils-6.2.
5
.tgz"
,
"integrity"
:
"sha512-
AfZA1TX8oOQCNFTOmG5cBRPC0YbSUPgbUYkninFg8F2sp98C8VSn1hua1OVjCM5zC9XISWtj5QpKJHPJRIa+BA
=="
,
"integrity"
:
"sha512-
ZpiHO6LBRIUm/bWJlGHC2N/f6hl0jgVU2QmUwiL3PfAH4i2xu17TZpU8hoQkrP751Lw37W9GcXoxw22mGaqdXw
=="
,
"peer"
:
true
,
"peer"
:
true
,
"requires"
:
{
"requires"
:
{
"cosmokit"
:
"^1.3.3"
,
"cosmokit"
:
"^1.3.3"
,
...
@@ -8661,14 +8661,14 @@
...
@@ -8661,14 +8661,14 @@
}
}
},
},
"@satorijs/core"
:
{
"@satorijs/core"
:
{
"version"
:
"1.3.
1
"
,
"version"
:
"1.3.
7
"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/core/-/core-1.3.
1
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/core/-/core-1.3.
7
.tgz"
,
"integrity"
:
"sha512-
kwjHQ+PYtY97/RBN2D0B5q4Duf6t5xwbHa8qQFVMQ2K1w+Rq0gbwke4eccsj6l5w0gjo5W5UIJUcnwrDYo4sww
=="
,
"integrity"
:
"sha512-
9orP2YYokEwBapEMZ6obPzKSOVpcS0TOnUVnJM12YM+22HgxDdXd3cNxTksogiPeEvBvvuR5iuwpkOSFlLdaIA
=="
,
"peer"
:
true
,
"peer"
:
true
,
"requires"
:
{
"requires"
:
{
"@satorijs/element"
:
"^2.0.0"
,
"@satorijs/element"
:
"^2.0.0"
,
"cordis"
:
"^2.5.0"
,
"cordis"
:
"^2.5.0"
,
"cordis-axios"
:
"^2.1.
3
"
,
"cordis-axios"
:
"^2.1.
4
"
,
"cosmokit"
:
"^1.3.3"
,
"cosmokit"
:
"^1.3.3"
,
"reggol"
:
"^1.3.1"
,
"reggol"
:
"^1.3.1"
,
"schemastery"
:
"^3.5.4"
,
"schemastery"
:
"^3.5.4"
,
...
@@ -8685,13 +8685,13 @@
...
@@ -8685,13 +8685,13 @@
}
}
},
},
"@satorijs/satori"
:
{
"@satorijs/satori"
:
{
"version"
:
"1.3.
1
"
,
"version"
:
"1.3.
7
"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/satori/-/satori-1.3.
1
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@satorijs/satori/-/satori-1.3.
7
.tgz"
,
"integrity"
:
"sha512-
T7elZqVtoQiXo6rLxlNx8KB0Y3b8zJuuSTjiSNjrqhEvd0QCGKxSzs3RSvCfIHqc5kdhXzdH48CEE5hQgYkrFw
=="
,
"integrity"
:
"sha512-
97POcpucME22ALdM8TqosGvNJWu6cNere0fE4NcHVhh0LXhuWyhMN5kviqNqeyZisDSK2EGd4ZqKUVxlQkxqDQ
=="
,
"peer"
:
true
,
"peer"
:
true
,
"requires"
:
{
"requires"
:
{
"@koa/router"
:
"^10.1.1"
,
"@koa/router"
:
"^10.1.1"
,
"@satorijs/core"
:
"1.3.
1
"
,
"@satorijs/core"
:
"1.3.
7
"
,
"@types/koa"
:
"*"
,
"@types/koa"
:
"*"
,
"@types/koa__router"
:
"*"
,
"@types/koa__router"
:
"*"
,
"@types/ws"
:
"^8.5.3"
,
"@types/ws"
:
"^8.5.3"
,
...
@@ -8707,23 +8707,6 @@
...
@@ -8707,23 +8707,6 @@
"ws"
:
"^8.8.1"
"ws"
:
"^8.8.1"
},
},
"dependencies"
:
{
"dependencies"
:
{
"@tootallnate/once"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz"
,
"integrity"
:
"sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A=="
,
"peer"
:
true
},
"http-proxy-agent"
:
{
"version"
:
"5.0.0"
,
"resolved"
:
"https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz"
,
"integrity"
:
"sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w=="
,
"peer"
:
true
,
"requires"
:
{
"@tootallnate/once"
:
"2"
,
"agent-base"
:
"6"
,
"debug"
:
"4"
}
},
"path-to-regexp"
:
{
"path-to-regexp"
:
{
"version"
:
"6.2.1"
,
"version"
:
"6.2.1"
,
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz"
,
...
@@ -8762,6 +8745,12 @@
...
@@ -8762,6 +8745,12 @@
"integrity"
:
"sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="
,
"integrity"
:
"sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="
,
"peer"
:
true
"peer"
:
true
},
},
"@tootallnate/once"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz"
,
"integrity"
:
"sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A=="
,
"peer"
:
true
},
"@types/accepts"
:
{
"@types/accepts"
:
{
"version"
:
"1.3.5"
,
"version"
:
"1.3.5"
,
"resolved"
:
"https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz"
,
"resolved"
:
"https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz"
,
...
@@ -9750,9 +9739,9 @@
...
@@ -9750,9 +9739,9 @@
}
}
},
},
"cordis-axios"
:
{
"cordis-axios"
:
{
"version"
:
"2.1.
3
"
,
"version"
:
"2.1.
4
"
,
"resolved"
:
"https://registry.npmjs.org/cordis-axios/-/cordis-axios-2.1.
3
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/cordis-axios/-/cordis-axios-2.1.
4
.tgz"
,
"integrity"
:
"sha512-
W6RCzZ4u+q/2D+BSAYV3aA3dMuz1bi+c9L1RI8g9SLaA5Z2QoaJ5zX1faIrS8y79AWtXm8joIGj+gzPVnvO8ww
=="
,
"integrity"
:
"sha512-
znwVVXxmvv3/RHY/5i9sDjmEGOrR0dki+QcfwawnrVlM5R8YqHwFLlZTapzbuP8pKvHjJ9GfkkQYwk5CaTFWQg
=="
,
"peer"
:
true
,
"peer"
:
true
,
"requires"
:
{
"requires"
:
{
"axios"
:
"^1.1.2"
,
"axios"
:
"^1.1.2"
,
...
@@ -10735,6 +10724,17 @@
...
@@ -10735,6 +10724,17 @@
"toidentifier"
:
"1.0.1"
"toidentifier"
:
"1.0.1"
}
}
},
},
"http-proxy-agent"
:
{
"version"
:
"5.0.0"
,
"resolved"
:
"https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz"
,
"integrity"
:
"sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w=="
,
"peer"
:
true
,
"requires"
:
{
"@tootallnate/once"
:
"2"
,
"agent-base"
:
"6"
,
"debug"
:
"4"
}
},
"https-proxy-agent"
:
{
"https-proxy-agent"
:
{
"version"
:
"5.0.1"
,
"version"
:
"5.0.1"
,
"resolved"
:
"https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz"
,
"resolved"
:
"https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz"
,
...
@@ -11553,14 +11553,14 @@
...
@@ -11553,14 +11553,14 @@
}
}
},
},
"koishi"
:
{
"koishi"
:
{
"version"
:
"4.
9.7
"
,
"version"
:
"4.
10.1
"
,
"resolved"
:
"https://registry.npmjs.org/koishi/-/koishi-4.
9.7
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/koishi/-/koishi-4.
10.1
.tgz"
,
"integrity"
:
"sha512-
InvvfPx5sqRkgOlTWksQu1dWjASCcf92guRGQmm+UIqZh0GBTJi+uFmpAMPA/E+nHOoLDOy/U9DVtpSPipi2+
g=="
,
"integrity"
:
"sha512-
nET+NfATO+99tNKasgPpyZzFv3kmjzrDmSyJmPlWDsokbjvouMIQHh6EGBiwLCipp7KKsQNZabB3FEFbwzL7Q
g=="
,
"peer"
:
true
,
"peer"
:
true
,
"requires"
:
{
"requires"
:
{
"@koishijs/core"
:
"^4.
9.7
"
,
"@koishijs/core"
:
"^4.
10.1
"
,
"@koishijs/utils"
:
"^6.2.
4
"
,
"@koishijs/utils"
:
"^6.2.
5
"
,
"@satorijs/satori"
:
"^1.3.
1
"
,
"@satorijs/satori"
:
"^1.3.
7
"
,
"file-type"
:
"^16.5.4"
,
"file-type"
:
"^16.5.4"
,
"ns-require"
:
"^1.1.4"
"ns-require"
:
"^1.1.4"
}
}
...
...
package.json
View file @
07b39724
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
"peerDependencies"
:
{
"peerDependencies"
:
{
"@nestjs/common"
:
"^9.0.3 || ^8.0.0"
,
"@nestjs/common"
:
"^9.0.3 || ^8.0.0"
,
"@nestjs/core"
:
"^9.0.3 || ^8.0.0"
,
"@nestjs/core"
:
"^9.0.3 || ^8.0.0"
,
"koishi"
:
"^4.
9.7
"
,
"koishi"
:
"^4.
10.1
"
,
"rxjs"
:
"^7.5.5"
"rxjs"
:
"^7.5.5"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
...
...
src/koishi-exception-handler/koishi-exception-handler.service.ts
View file @
07b39724
...
@@ -5,6 +5,7 @@ import {
...
@@ -5,6 +5,7 @@ import {
Injectable
,
Injectable
,
}
from
'
@nestjs/common
'
;
}
from
'
@nestjs/common
'
;
import
{
WsException
}
from
'
@nestjs/websockets
'
;
import
{
WsException
}
from
'
@nestjs/websockets
'
;
import
{
SessionError
}
from
'
koishi
'
;
import
{
KOISHI_MODULE_OPTIONS
}
from
'
../utility/koishi.constants
'
;
import
{
KOISHI_MODULE_OPTIONS
}
from
'
../utility/koishi.constants
'
;
import
{
KoishiModuleOptions
}
from
'
../utility/koishi.interfaces
'
;
import
{
KoishiModuleOptions
}
from
'
../utility/koishi.interfaces
'
;
...
@@ -18,16 +19,19 @@ export class KoishiExceptionHandlerService extends ConsoleLogger {
...
@@ -18,16 +19,19 @@ export class KoishiExceptionHandlerService extends ConsoleLogger {
}
}
handleActionException
(
e
:
Error
)
{
handleActionException
(
e
:
Error
)
{
if
(
e
instanceof
SessionError
)
{
console
.
log
(
'
session error
'
);
throw
e
;
}
if
(
e
instanceof
HttpException
||
e
instanceof
WsException
)
{
if
(
e
instanceof
HttpException
||
e
instanceof
WsException
)
{
return
e
.
message
;
return
e
.
message
;
}
else
{
this
.
error
(
e
.
message
,
e
.
stack
);
if
(
this
.
koishiModuleOptions
.
actionErrorMessage
===
''
)
{
return
;
}
return
(
this
.
koishiModuleOptions
.
actionErrorMessage
??
'
Internal Server Error
'
);
}
}
this
.
error
(
e
.
message
,
e
.
stack
);
if
(
this
.
koishiModuleOptions
.
actionErrorMessage
===
''
)
{
return
;
}
return
(
this
.
koishiModuleOptions
.
actionErrorMessage
??
'
Internal Server Error
'
);
}
}
}
}
src/utility/wrap-action.ts
deleted
100644 → 0
View file @
6e65943a
import
{
HttpException
}
from
'
@nestjs/common
'
;
import
{
WsException
}
from
'
@nestjs/websockets
'
;
export
function
handleActionException
(
e
:
Error
)
{
if
(
e
instanceof
HttpException
||
e
instanceof
WsException
)
{
return
e
.
message
;
}
else
{
throw
e
;
}
}
tests/koishi-tests.spec.ts
View file @
07b39724
...
@@ -165,6 +165,16 @@ describe('Koishi in Nest.js', () => {
...
@@ -165,6 +165,16 @@ describe('Koishi in Nest.js', () => {
);
);
});
});
/*
it('should handle SessionError', () => {
const command = koishiApp.command('hoo');
expect(command).toBeDefined();
expect(command.execute({ options: { content: 'hoo' } })).resolves.toBe(
'hoo!',
);
});
*/
it
(
'
should work on template
'
,
()
=>
{
it
(
'
should work on template
'
,
()
=>
{
const
command
=
koishiApp
.
command
(
'
mii
'
);
const
command
=
koishiApp
.
command
(
'
mii
'
);
expect
(
command
).
toBeDefined
();
expect
(
command
).
toBeDefined
();
...
...
tests/utility/testing-module.ts
View file @
07b39724
import
{
Injectable
,
NotFoundException
}
from
'
@nestjs/common
'
;
import
{
Injectable
,
NotFoundException
}
from
'
@nestjs/common
'
;
import
{
KoishiCommandInterceptor
}
from
'
../../src/utility/koishi.interfaces
'
;
import
{
KoishiCommandInterceptor
}
from
'
../../src/utility/koishi.interfaces
'
;
import
{
Argv
,
Context
}
from
'
koishi
'
;
import
{
Argv
,
Context
,
SessionError
}
from
'
koishi
'
;
import
{
import
{
CommandTemplate
,
CommandUsage
,
CommandUsage
,
OnGuild
,
OnGuild
,
OnPlatform
,
OnPlatform
,
...
@@ -74,6 +75,12 @@ export class KoishiTestService {
...
@@ -74,6 +75,12 @@ export class KoishiTestService {
throw
new
Error
(
'
bow!
'
);
throw
new
Error
(
'
bow!
'
);
}
}
@
UseCommand
(
'
hoo
'
)
@
CommandTemplate
(
'
.hoo
'
,
'
hoo!
'
)
async
onHoo
()
{
throw
new
SessionError
(
'
.hoo
'
);
}
@
UseCommand
(
'
moo
'
)
@
UseCommand
(
'
moo
'
)
@
CommandInterceptors
(
MooInterceptor
)
@
CommandInterceptors
(
MooInterceptor
)
async
onMoo
()
{
async
onMoo
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment