Commit 34baf6d5 authored by nanahira's avatar nanahira

bump

parent 001a9c8a
......@@ -36,8 +36,8 @@
"ws": "^8.3.0"
},
"peerDependencies": {
"koishi": "^4.6.0",
"koishi-plugin-pics": "^9.0.0"
"koishi": "^4.6.1",
"koishi-plugin-pics": "^9.0.3"
}
},
"node_modules/@ampproject/remapping": {
......@@ -1070,15 +1070,15 @@
}
},
"node_modules/@koishijs/core": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.0.tgz",
"integrity": "sha512-m+K2h/Oqmpcw39dQhJ/D9MBmwnWNUf9uFqymJ94+nP4CR7rcM1DTWNiaMGshGUqNu+s4q0ildoEDlQrE4hVuWA==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.1.tgz",
"integrity": "sha512-2HzdUi76YSLFZYpPXcmEwwVyHQLPF8BL0GJR6PuCYdOYfHykzwA5NmqOGx29EyeuYzs8sS6yr25IQktxMYqsdg==",
"peer": true,
"dependencies": {
"@koishijs/utils": "^5.4.0",
"cosmotype": "^1.0.3",
"@koishijs/utils": "^5.4.1",
"cosmotype": "^1.0.6",
"fastest-levenshtein": "^1.0.12",
"ns-require": "^1.1.0"
"ns-require": "^1.1.2"
},
"engines": {
"node": ">=12.0.0"
......@@ -1157,15 +1157,15 @@
"peer": true
},
"node_modules/@koishijs/utils": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.0.tgz",
"integrity": "sha512-w5SHArw032cXVtxp5nXkc5jzP6Fn3LrF7FQTanPnOgmjGv/AIOAKfJ6bqaOUsSg+ttcK3iO8xs65W6XsNz3g7g==",
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.1.tgz",
"integrity": "sha512-M3L9KqtdTyCzQK1LxTtp7QCucc75IA2vRwnYJA1gXMAxPC3SoEjUVmsk/oNFBSknmfADdViI5mFJtUXMCpJW1g==",
"peer": true,
"dependencies": {
"@koishijs/segment": "^1.1.1",
"cosmokit": "^1.1.1",
"reggol": "^1.0.1",
"schemastery": "^3.3.2",
"cosmokit": "^1.1.2",
"reggol": "^1.0.2",
"schemastery": "^3.3.3",
"supports-color": "^8.1.1"
}
},
......@@ -2602,18 +2602,18 @@
"peer": true
},
"node_modules/cosmokit": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.1.1.tgz",
"integrity": "sha512-+f8x9pFGIc7I6HTObS90dq2K5YsI4U3Me4l9OminU9woVtF9Sv3CAHb5vKbFZ93XpTFctAQ6qAVSGjkGvGI9iw=="
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.1.2.tgz",
"integrity": "sha512-cSNrcyxZ3GT+tjSlUzWIzMiK7Wndq1Nm/2tlRhT65RXltSIcH5zaHdmnz1TnIhLuOViaO9qfSdnRPzxNkxMv0g=="
},
"node_modules/cosmotype": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cosmotype/-/cosmotype-1.0.3.tgz",
"integrity": "sha512-JykvyDjyjaDjycm8CcK8GD4Xt6/Glu4pJU9uJ5lsDuE5B5bdmAykiTPMHfs+Is8QUsNaDKpsHfxtxCUBDPYgdw==",
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/cosmotype/-/cosmotype-1.0.9.tgz",
"integrity": "sha512-ot2m5LYBj9UNFvYpQNQ28hWYDG4GWmym094us2HNn6qgYzvALmjs4FxEVBsjA+VBnIf3ykuMGRYcex5cqZTvJQ==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.1",
"ns-require": "^1.1.0"
"cosmokit": "^1.1.2",
"ns-require": "^1.1.2"
}
},
"node_modules/cosmotype-decorators": {
......@@ -5178,14 +5178,14 @@
}
},
"node_modules/koishi": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.0.tgz",
"integrity": "sha512-QhjFWTGhrFnYfpVg4dNNxgHER38zSij3nyM/RB3YrLTM4VwImVk5unpgg0QryViwWxSYM4zJ0YUoys4A9jgG6A==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.1.tgz",
"integrity": "sha512-9NtcXrIKLN8AG9zEf3GzweSiHQubew0AWfjaci0grIxy760T77D8iLVsDbVhzmGSnc26WOR2q3CMFdRmE2igVA==",
"peer": true,
"dependencies": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.6.0",
"@koishijs/utils": "^5.4.0",
"@koishijs/core": "^4.6.1",
"@koishijs/utils": "^5.4.1",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^8.5.3",
......@@ -5218,16 +5218,16 @@
}
},
"node_modules/koishi-plugin-pics": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.0.0.tgz",
"integrity": "sha512-oRbgqbTs2sZvER5+i6OeD6TYR4ttSC3BfQjXuGq5em1Itt9KPLkQ6ZXcZPYMdidFQokFDfBvCu8abA6IDZBLjQ==",
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.0.3.tgz",
"integrity": "sha512-ZXzRJnGwg1W7dNRdmcaRyYFiGDFuOPq8qLh/Qer0Bk/dHVTW9tYZcdViXfA5TSe7sxluoB2koTRB8JvwPTnhVA==",
"peer": true,
"dependencies": {
"koishi-thirdeye": "^10.0.0",
"koishi-thirdeye": "^10.0.5",
"lodash": "^4.17.21"
},
"peerDependencies": {
"koishi": "^4.6.0"
"koishi": "^4.6.1"
}
},
"node_modules/koishi-thirdeye": {
......@@ -5543,9 +5543,9 @@
}
},
"node_modules/ns-require": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.0.tgz",
"integrity": "sha512-Iw349zwWNgkGZjYJtruf+BXUe8YHOiMZE0iUNffvpt/A1yTSabTnpBMQ0zNl65G1LhpzwCo1KMCqjmJF0z8O6g==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.2.tgz",
"integrity": "sha512-GUF6I1hWDsGx1cA9FW27KIRAlkMel2UZagR39dVNPAPBgwWK1Ez0XB96WEz2OFcwHsCORI9h75dEZueHqZ/1pA==",
"peer": true
},
"node_modules/nwsapi": {
......@@ -6159,12 +6159,12 @@
}
},
"node_modules/reggol": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/reggol/-/reggol-1.0.1.tgz",
"integrity": "sha512-ZMOp3rZG6YQFVp/DC+BgFZaXSQcxHDayCmo7cL/kGujsSEoUzee0VJq1KCe9sgNt0qsM6JzkuSlj/+5SmmoO7Q==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/reggol/-/reggol-1.0.2.tgz",
"integrity": "sha512-BP7gx5nUBntWChG4x/yf7xLdpxy1R5PMtF/LJlOsz+XkWtip4YVNkQp2Flmio9hXSc2UxrwUyP0WrQ1M/FFWXw==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.0",
"cosmokit": "^1.1.2",
"supports-color": "^8.1.1"
}
},
......@@ -6327,12 +6327,12 @@
}
},
"node_modules/schemastery": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.2.tgz",
"integrity": "sha512-Z1C850OPtNEBs+D4QBPdC+Wu1t6Fn1BrOJILRHs2b+I/u61hUKP2vIPMAXFLvmmONnwqAW8ksPdCD6Zz9n8zhg==",
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.3.tgz",
"integrity": "sha512-DwRsse6C+Qao90P/Bz+4G3gmAjM3he/VgHk3TykmEWv3KFqvwmqEn61SF3BPaTPP0L77a5Kc6q4+KQvdN1bBqA==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.0"
"cosmokit": "^1.1.2"
}
},
"node_modules/schemastery-gen": {
......@@ -8486,15 +8486,15 @@
}
},
"@koishijs/core": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.0.tgz",
"integrity": "sha512-m+K2h/Oqmpcw39dQhJ/D9MBmwnWNUf9uFqymJ94+nP4CR7rcM1DTWNiaMGshGUqNu+s4q0ildoEDlQrE4hVuWA==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.1.tgz",
"integrity": "sha512-2HzdUi76YSLFZYpPXcmEwwVyHQLPF8BL0GJR6PuCYdOYfHykzwA5NmqOGx29EyeuYzs8sS6yr25IQktxMYqsdg==",
"peer": true,
"requires": {
"@koishijs/utils": "^5.4.0",
"cosmotype": "^1.0.3",
"@koishijs/utils": "^5.4.1",
"cosmotype": "^1.0.6",
"fastest-levenshtein": "^1.0.12",
"ns-require": "^1.1.0"
"ns-require": "^1.1.2"
}
},
"@koishijs/plugin-cache-lru": {
......@@ -8557,15 +8557,15 @@
"peer": true
},
"@koishijs/utils": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.0.tgz",
"integrity": "sha512-w5SHArw032cXVtxp5nXkc5jzP6Fn3LrF7FQTanPnOgmjGv/AIOAKfJ6bqaOUsSg+ttcK3iO8xs65W6XsNz3g7g==",
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.1.tgz",
"integrity": "sha512-M3L9KqtdTyCzQK1LxTtp7QCucc75IA2vRwnYJA1gXMAxPC3SoEjUVmsk/oNFBSknmfADdViI5mFJtUXMCpJW1g==",
"peer": true,
"requires": {
"@koishijs/segment": "^1.1.1",
"cosmokit": "^1.1.1",
"reggol": "^1.0.1",
"schemastery": "^3.3.2",
"cosmokit": "^1.1.2",
"reggol": "^1.0.2",
"schemastery": "^3.3.3",
"supports-color": "^8.1.1"
}
},
......@@ -9748,18 +9748,18 @@
"peer": true
},
"cosmokit": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.1.1.tgz",
"integrity": "sha512-+f8x9pFGIc7I6HTObS90dq2K5YsI4U3Me4l9OminU9woVtF9Sv3CAHb5vKbFZ93XpTFctAQ6qAVSGjkGvGI9iw=="
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.1.2.tgz",
"integrity": "sha512-cSNrcyxZ3GT+tjSlUzWIzMiK7Wndq1Nm/2tlRhT65RXltSIcH5zaHdmnz1TnIhLuOViaO9qfSdnRPzxNkxMv0g=="
},
"cosmotype": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cosmotype/-/cosmotype-1.0.3.tgz",
"integrity": "sha512-JykvyDjyjaDjycm8CcK8GD4Xt6/Glu4pJU9uJ5lsDuE5B5bdmAykiTPMHfs+Is8QUsNaDKpsHfxtxCUBDPYgdw==",
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/cosmotype/-/cosmotype-1.0.9.tgz",
"integrity": "sha512-ot2m5LYBj9UNFvYpQNQ28hWYDG4GWmym094us2HNn6qgYzvALmjs4FxEVBsjA+VBnIf3ykuMGRYcex5cqZTvJQ==",
"peer": true,
"requires": {
"cosmokit": "^1.1.1",
"ns-require": "^1.1.0"
"cosmokit": "^1.1.2",
"ns-require": "^1.1.2"
}
},
"cosmotype-decorators": {
......@@ -11679,14 +11679,14 @@
}
},
"koishi": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.0.tgz",
"integrity": "sha512-QhjFWTGhrFnYfpVg4dNNxgHER38zSij3nyM/RB3YrLTM4VwImVk5unpgg0QryViwWxSYM4zJ0YUoys4A9jgG6A==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.1.tgz",
"integrity": "sha512-9NtcXrIKLN8AG9zEf3GzweSiHQubew0AWfjaci0grIxy760T77D8iLVsDbVhzmGSnc26WOR2q3CMFdRmE2igVA==",
"peer": true,
"requires": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.6.0",
"@koishijs/utils": "^5.4.0",
"@koishijs/core": "^4.6.1",
"@koishijs/utils": "^5.4.1",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^8.5.3",
......@@ -11713,12 +11713,12 @@
}
},
"koishi-plugin-pics": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.0.0.tgz",
"integrity": "sha512-oRbgqbTs2sZvER5+i6OeD6TYR4ttSC3BfQjXuGq5em1Itt9KPLkQ6ZXcZPYMdidFQokFDfBvCu8abA6IDZBLjQ==",
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.0.3.tgz",
"integrity": "sha512-ZXzRJnGwg1W7dNRdmcaRyYFiGDFuOPq8qLh/Qer0Bk/dHVTW9tYZcdViXfA5TSe7sxluoB2koTRB8JvwPTnhVA==",
"peer": true,
"requires": {
"koishi-thirdeye": "^10.0.0",
"koishi-thirdeye": "^10.0.5",
"lodash": "^4.17.21"
}
},
......@@ -11973,9 +11973,9 @@
}
},
"ns-require": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.0.tgz",
"integrity": "sha512-Iw349zwWNgkGZjYJtruf+BXUe8YHOiMZE0iUNffvpt/A1yTSabTnpBMQ0zNl65G1LhpzwCo1KMCqjmJF0z8O6g==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.2.tgz",
"integrity": "sha512-GUF6I1hWDsGx1cA9FW27KIRAlkMel2UZagR39dVNPAPBgwWK1Ez0XB96WEz2OFcwHsCORI9h75dEZueHqZ/1pA==",
"peer": true
},
"nwsapi": {
......@@ -12412,12 +12412,12 @@
"dev": true
},
"reggol": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/reggol/-/reggol-1.0.1.tgz",
"integrity": "sha512-ZMOp3rZG6YQFVp/DC+BgFZaXSQcxHDayCmo7cL/kGujsSEoUzee0VJq1KCe9sgNt0qsM6JzkuSlj/+5SmmoO7Q==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/reggol/-/reggol-1.0.2.tgz",
"integrity": "sha512-BP7gx5nUBntWChG4x/yf7xLdpxy1R5PMtF/LJlOsz+XkWtip4YVNkQp2Flmio9hXSc2UxrwUyP0WrQ1M/FFWXw==",
"peer": true,
"requires": {
"cosmokit": "^1.1.0",
"cosmokit": "^1.1.2",
"supports-color": "^8.1.1"
}
},
......@@ -12527,12 +12527,12 @@
}
},
"schemastery": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.2.tgz",
"integrity": "sha512-Z1C850OPtNEBs+D4QBPdC+Wu1t6Fn1BrOJILRHs2b+I/u61hUKP2vIPMAXFLvmmONnwqAW8ksPdCD6Zz9n8zhg==",
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.3.tgz",
"integrity": "sha512-DwRsse6C+Qao90P/Bz+4G3gmAjM3he/VgHk3TykmEWv3KFqvwmqEn61SF3BPaTPP0L77a5Kc6q4+KQvdN1bBqA==",
"peer": true,
"requires": {
"cosmokit": "^1.1.0"
"cosmokit": "^1.1.2"
}
},
"schemastery-gen": {
......
......@@ -31,8 +31,8 @@
},
"homepage": "https://code.mycard.moe/3rdeye/koishi-plugin-picsource-heisi",
"peerDependencies": {
"koishi": "^4.6.0",
"koishi-plugin-pics": "^9.0.0"
"koishi": "^4.6.1",
"koishi-plugin-pics": "^9.0.3"
},
"dependencies": {
"koishi-thirdeye": "^10.0.5",
......
// import 'source-map-support/register';
import { Context, Quester, Cache, Logger, Random } from 'koishi';
import { PicsourceHeisiConfig, PicsourceHeisiConfigLike } from './config';
import {
DefinePlugin,
InjectConfig,
Inject,
OnApply,
InjectLogger,
} from 'koishi-thirdeye';
import PicsContainer, { PicSource } from 'koishi-plugin-pics';
import { Quester, Cache, Random } from 'koishi';
import { PicsourceHeisiConfig } from './config';
import { DefinePlugin, Inject } from 'koishi-thirdeye';
import { PicSourcePlugin } from 'koishi-plugin-pics';
export * from './config';
declare module 'koishi' {
......@@ -21,31 +15,17 @@ declare module 'koishi' {
}
@DefinePlugin({ name: 'picsource-heisi', schema: PicsourceHeisiConfig })
export default class PicsourceHeisi extends PicSource implements OnApply {
constructor(ctx: Context, config: PicsourceHeisiConfigLike) {
super(ctx);
}
@InjectConfig()
private config: PicsourceHeisiConfig;
@Inject('http')
private http: Quester;
@Inject('pics', true)
private pics: PicsContainer;
export default class PicsourceHeisi extends PicSourcePlugin<PicsourceHeisiConfig> {
@Inject('cache', true)
private cache: Cache;
@InjectLogger()
private logger: Logger;
@Inject(true)
private http: Quester;
onApply() {
this.logger.info(`Initializing pic source ${this.config.name}...`);
this.config.applyTo(this);
this.cache.table('heisiList', { maxAge: this.config.ttl });
this.pics.addSource(this, this.ctx);
this.getRandomUrl().then();
super.onApply();
}
async randomPic() {
......
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