Commit 66ef99a1 authored by nanahira's avatar nanahira

bump

parent 295a19e3
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"version": "9.0.2", "version": "9.0.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"koishi-thirdeye": "^10.0.5", "koishi-thirdeye": "^10.0.20",
"read-dir-deep": "^7.0.1" "read-dir-deep": "^7.0.1"
}, },
"devDependencies": { "devDependencies": {
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
"ws": "^8.3.0" "ws": "^8.3.0"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.6.1", "koishi": "^4.6.2",
"koishi-plugin-pics": "^9.0.3" "koishi-plugin-pics": "^9.1.2"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
...@@ -1070,13 +1070,13 @@ ...@@ -1070,13 +1070,13 @@
} }
}, },
"node_modules/@koishijs/core": { "node_modules/@koishijs/core": {
"version": "4.6.1", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.1.tgz", "resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.2.tgz",
"integrity": "sha512-2HzdUi76YSLFZYpPXcmEwwVyHQLPF8BL0GJR6PuCYdOYfHykzwA5NmqOGx29EyeuYzs8sS6yr25IQktxMYqsdg==", "integrity": "sha512-GM0497Bd5BDPXuzJMppJik+Zb55bbLTX14aJmkFgPW9maU9oz3ZZRW+EeMpFK449fPG83P2UsIulJHNbD5L/hQ==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koishijs/utils": "^5.4.1", "@koishijs/utils": "^5.4.2",
"cosmotype": "^1.0.6", "cosmotype": "^1.0.9",
"fastest-levenshtein": "^1.0.12", "fastest-levenshtein": "^1.0.12",
"ns-require": "^1.1.2" "ns-require": "^1.1.2"
}, },
...@@ -1139,9 +1139,9 @@ ...@@ -1139,9 +1139,9 @@
"peer": true "peer": true
}, },
"node_modules/@koishijs/utils": { "node_modules/@koishijs/utils": {
"version": "5.4.1", "version": "5.4.2",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.1.tgz", "resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.2.tgz",
"integrity": "sha512-M3L9KqtdTyCzQK1LxTtp7QCucc75IA2vRwnYJA1gXMAxPC3SoEjUVmsk/oNFBSknmfADdViI5mFJtUXMCpJW1g==", "integrity": "sha512-cUwrqVQqTM/F2DZO9APEDlfz2mrUe5L7b2pYmhaTi8Pggk9kT78hvBx4fnLWrHiFV3BPuikghqZSfkladFcugw==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koishijs/segment": "^1.1.1", "@koishijs/segment": "^1.1.1",
...@@ -5235,14 +5235,14 @@ ...@@ -5235,14 +5235,14 @@
} }
}, },
"node_modules/koishi": { "node_modules/koishi": {
"version": "4.6.1", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.1.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.2.tgz",
"integrity": "sha512-9NtcXrIKLN8AG9zEf3GzweSiHQubew0AWfjaci0grIxy760T77D8iLVsDbVhzmGSnc26WOR2q3CMFdRmE2igVA==", "integrity": "sha512-vgjKxSJxAOsFwBnO097d8Oo8AC0jTvdfrsAHgu8u1d3DDJkHzUr8vQEjcJjvAp411Ev5VIvswFeSpeTVWDv6VA==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.6.1", "@koishijs/core": "^4.6.2",
"@koishijs/utils": "^5.4.1", "@koishijs/utils": "^5.4.2",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.5.3", "@types/ws": "^8.5.3",
...@@ -5260,9 +5260,9 @@ ...@@ -5260,9 +5260,9 @@
} }
}, },
"node_modules/koishi-decorators": { "node_modules/koishi-decorators": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.0.tgz", "resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.1.tgz",
"integrity": "sha512-YAbjOLdBxJU0DnBM7vqH+UNfSqMrejlcTEc+m++ZvuMbkUA4tHZ5iciwJFV2iPZUKSZy7GbmImNbXDmmjowF5w==", "integrity": "sha512-dDrBS4Su1NtmrkIeCdcCKsC6uaBYTRTspDdeeoPLOMuSJf6fqqXwxa2qEosvG5475MXs9SaNQDaKjh0gq/NY6A==",
"dependencies": { "dependencies": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
...@@ -5275,34 +5275,34 @@ ...@@ -5275,34 +5275,34 @@
} }
}, },
"node_modules/koishi-plugin-pics": { "node_modules/koishi-plugin-pics": {
"version": "9.0.3", "version": "9.1.2",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.0.3.tgz", "resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.1.2.tgz",
"integrity": "sha512-ZXzRJnGwg1W7dNRdmcaRyYFiGDFuOPq8qLh/Qer0Bk/dHVTW9tYZcdViXfA5TSe7sxluoB2koTRB8JvwPTnhVA==", "integrity": "sha512-8Zuof7PTGl7efxWB7Y4W3h40+bhw3dFIvL0DIGTSJl8D2c5dgGbUT9ApHH5W4yWZcZEADwOgcg7oyH1lGSHzEg==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"koishi-thirdeye": "^10.0.5", "koishi-thirdeye": "^10.0.20",
"lodash": "^4.17.21" "lodash": "^4.17.21"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.6.1" "koishi": "^4.6.2"
} }
}, },
"node_modules/koishi-thirdeye": { "node_modules/koishi-thirdeye": {
"version": "10.0.5", "version": "10.0.20",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.0.5.tgz", "resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.0.20.tgz",
"integrity": "sha512-GzPNyJCnUNklHefi0vc0nArV+dEh1QuTddom9MQ6Sawa6nbjbnZNWKFY08eQxNR6CR87tYK93WtO+URwcBbEew==", "integrity": "sha512-aYBiQ6R4A8VcZ7xw0qfECIJvWsuEoW3MWdBH+SuWi0dcrwhvfF3naEtkC0ZGEnWOkauyW1YyOzTK/Fieikmv4w==",
"dependencies": { "dependencies": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
"cosmotype-decorators": "^2.0.5", "cosmotype-decorators": "^2.0.5",
"koishi-decorators": "^2.0.0", "koishi-decorators": "^2.0.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.4", "schemastery-gen": "^3.1.10",
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.6.0", "koishi": "^4.6.2",
"schemastery": "^3.1.0" "schemastery": "^3.1.0"
} }
}, },
...@@ -6500,16 +6500,16 @@ ...@@ -6500,16 +6500,16 @@
} }
}, },
"node_modules/schemastery-gen": { "node_modules/schemastery-gen": {
"version": "3.1.4", "version": "3.1.10",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.4.tgz", "resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.10.tgz",
"integrity": "sha512-zhM5A2p/SdPKe8ouObCYSOA3k5I1CpbOfSvv8DWp7kCbVnSgfOMSBCB4Yue3/D81+MAE2re93nSt7k/Tolz3mQ==", "integrity": "sha512-hwCLOICGEodCcQt+eLoEEvNhm7iSEwJB37JQ+27cHbggTry/Rq07ivXVsPw63Et74EobEaOGDVOTzJ4kIQa01w==",
"dependencies": { "dependencies": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
}, },
"peerDependencies": { "peerDependencies": {
"schemastery": "^3.3.2" "schemastery": "^3.3.3"
} }
}, },
"node_modules/semver": { "node_modules/semver": {
...@@ -8611,13 +8611,13 @@ ...@@ -8611,13 +8611,13 @@
} }
}, },
"@koishijs/core": { "@koishijs/core": {
"version": "4.6.1", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.1.tgz", "resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.2.tgz",
"integrity": "sha512-2HzdUi76YSLFZYpPXcmEwwVyHQLPF8BL0GJR6PuCYdOYfHykzwA5NmqOGx29EyeuYzs8sS6yr25IQktxMYqsdg==", "integrity": "sha512-GM0497Bd5BDPXuzJMppJik+Zb55bbLTX14aJmkFgPW9maU9oz3ZZRW+EeMpFK449fPG83P2UsIulJHNbD5L/hQ==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koishijs/utils": "^5.4.1", "@koishijs/utils": "^5.4.2",
"cosmotype": "^1.0.6", "cosmotype": "^1.0.9",
"fastest-levenshtein": "^1.0.12", "fastest-levenshtein": "^1.0.12",
"ns-require": "^1.1.2" "ns-require": "^1.1.2"
} }
...@@ -8665,9 +8665,9 @@ ...@@ -8665,9 +8665,9 @@
"peer": true "peer": true
}, },
"@koishijs/utils": { "@koishijs/utils": {
"version": "5.4.1", "version": "5.4.2",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.1.tgz", "resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.2.tgz",
"integrity": "sha512-M3L9KqtdTyCzQK1LxTtp7QCucc75IA2vRwnYJA1gXMAxPC3SoEjUVmsk/oNFBSknmfADdViI5mFJtUXMCpJW1g==", "integrity": "sha512-cUwrqVQqTM/F2DZO9APEDlfz2mrUe5L7b2pYmhaTi8Pggk9kT78hvBx4fnLWrHiFV3BPuikghqZSfkladFcugw==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koishijs/segment": "^1.1.1", "@koishijs/segment": "^1.1.1",
...@@ -11842,14 +11842,14 @@ ...@@ -11842,14 +11842,14 @@
} }
}, },
"koishi": { "koishi": {
"version": "4.6.1", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.1.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.2.tgz",
"integrity": "sha512-9NtcXrIKLN8AG9zEf3GzweSiHQubew0AWfjaci0grIxy760T77D8iLVsDbVhzmGSnc26WOR2q3CMFdRmE2igVA==", "integrity": "sha512-vgjKxSJxAOsFwBnO097d8Oo8AC0jTvdfrsAHgu8u1d3DDJkHzUr8vQEjcJjvAp411Ev5VIvswFeSpeTVWDv6VA==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.6.1", "@koishijs/core": "^4.6.2",
"@koishijs/utils": "^5.4.1", "@koishijs/utils": "^5.4.2",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.5.3", "@types/ws": "^8.5.3",
...@@ -11864,9 +11864,9 @@ ...@@ -11864,9 +11864,9 @@
} }
}, },
"koishi-decorators": { "koishi-decorators": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.0.tgz", "resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.1.tgz",
"integrity": "sha512-YAbjOLdBxJU0DnBM7vqH+UNfSqMrejlcTEc+m++ZvuMbkUA4tHZ5iciwJFV2iPZUKSZy7GbmImNbXDmmjowF5w==", "integrity": "sha512-dDrBS4Su1NtmrkIeCdcCKsC6uaBYTRTspDdeeoPLOMuSJf6fqqXwxa2qEosvG5475MXs9SaNQDaKjh0gq/NY6A==",
"requires": { "requires": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
...@@ -11876,27 +11876,27 @@ ...@@ -11876,27 +11876,27 @@
} }
}, },
"koishi-plugin-pics": { "koishi-plugin-pics": {
"version": "9.0.3", "version": "9.1.2",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.0.3.tgz", "resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.1.2.tgz",
"integrity": "sha512-ZXzRJnGwg1W7dNRdmcaRyYFiGDFuOPq8qLh/Qer0Bk/dHVTW9tYZcdViXfA5TSe7sxluoB2koTRB8JvwPTnhVA==", "integrity": "sha512-8Zuof7PTGl7efxWB7Y4W3h40+bhw3dFIvL0DIGTSJl8D2c5dgGbUT9ApHH5W4yWZcZEADwOgcg7oyH1lGSHzEg==",
"peer": true, "peer": true,
"requires": { "requires": {
"koishi-thirdeye": "^10.0.5", "koishi-thirdeye": "^10.0.20",
"lodash": "^4.17.21" "lodash": "^4.17.21"
} }
}, },
"koishi-thirdeye": { "koishi-thirdeye": {
"version": "10.0.5", "version": "10.0.20",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.0.5.tgz", "resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.0.20.tgz",
"integrity": "sha512-GzPNyJCnUNklHefi0vc0nArV+dEh1QuTddom9MQ6Sawa6nbjbnZNWKFY08eQxNR6CR87tYK93WtO+URwcBbEew==", "integrity": "sha512-aYBiQ6R4A8VcZ7xw0qfECIJvWsuEoW3MWdBH+SuWi0dcrwhvfF3naEtkC0ZGEnWOkauyW1YyOzTK/Fieikmv4w==",
"requires": { "requires": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
"cosmotype-decorators": "^2.0.5", "cosmotype-decorators": "^2.0.5",
"koishi-decorators": "^2.0.0", "koishi-decorators": "^2.0.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.4", "schemastery-gen": "^3.1.10",
"typed-reflector": "^1.0.10" "typed-reflector": "^1.0.10"
} }
}, },
...@@ -12792,9 +12792,9 @@ ...@@ -12792,9 +12792,9 @@
} }
}, },
"schemastery-gen": { "schemastery-gen": {
"version": "3.1.4", "version": "3.1.10",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.4.tgz", "resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.10.tgz",
"integrity": "sha512-zhM5A2p/SdPKe8ouObCYSOA3k5I1CpbOfSvv8DWp7kCbVnSgfOMSBCB4Yue3/D81+MAE2re93nSt7k/Tolz3mQ==", "integrity": "sha512-hwCLOICGEodCcQt+eLoEEvNhm7iSEwJB37JQ+27cHbggTry/Rq07ivXVsPw63Et74EobEaOGDVOTzJ4kIQa01w==",
"requires": { "requires": {
"lodash": "^4.17.21", "lodash": "^4.17.21",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
......
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
}, },
"homepage": "https://github.com/koishijs/koishi-plugin-picsource-localfs", "homepage": "https://github.com/koishijs/koishi-plugin-picsource-localfs",
"dependencies": { "dependencies": {
"koishi-thirdeye": "^10.0.5", "koishi-thirdeye": "^10.0.20",
"read-dir-deep": "^7.0.1" "read-dir-deep": "^7.0.1"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.6.1", "koishi": "^4.6.2",
"koishi-plugin-pics": "^9.0.3" "koishi-plugin-pics": "^9.1.2"
}, },
"devDependencies": { "devDependencies": {
"@koishijs/plugin-cache-lru": "^1.0.0-rc.0", "@koishijs/plugin-cache-lru": "^1.0.0-rc.0",
......
...@@ -3,10 +3,9 @@ import { PicSourceConfig } from 'koishi-plugin-pics'; ...@@ -3,10 +3,9 @@ import { PicSourceConfig } from 'koishi-plugin-pics';
import { DefineSchema, RegisterSchema } from 'schemastery-gen'; import { DefineSchema, RegisterSchema } from 'schemastery-gen';
@RegisterSchema() @RegisterSchema()
export class LocalSourceConfig extends PicSourceConfig { export class LocalSourceConfig {
constructor(config: Partial<LocalSourceConfig>) { constructor(config: Partial<LocalSourceConfig>) {}
super(config);
}
@DefineSchema({ description: '目录路径', required: true }) @DefineSchema({ description: '目录路径', required: true })
path: string; path: string;
@DefineSchema({ @DefineSchema({
......
import { Random } from 'koishi'; import { Random } from 'koishi';
import { import { PicResult, PicSourcePlugin } from 'koishi-plugin-pics';
DefineMultiSourcePlugin, import { DefinePlugin, MultiInstancePlugin } from 'koishi-thirdeye';
PicResult,
PicSourcePlugin,
} from 'koishi-plugin-pics';
import { DefinePlugin } from 'koishi-thirdeye';
import path from 'path'; import path from 'path';
import { readDirDeep } from 'read-dir-deep'; import { readDirDeep } from 'read-dir-deep';
import { LocalSourceConfig } from './config'; import { LocalSourceConfig } from './config';
import fs from 'fs'; import fs from 'fs';
@DefinePlugin({ name: 'picsource-local', schema: LocalSourceConfig }) @DefinePlugin()
export class LocalSource extends PicSourcePlugin<LocalSourceConfig> { export class LocalSource extends PicSourcePlugin(LocalSourceConfig) {
async randomPic(picTags: string[]): Promise<PicResult> { async randomPic(picTags: string[]): Promise<PicResult> {
const absolutePath = path.resolve(process.cwd(), this.config.path); const absolutePath = path.resolve(process.cwd(), this.config.path);
const files = ( const files = (
...@@ -38,7 +34,7 @@ export class LocalSource extends PicSourcePlugin<LocalSourceConfig> { ...@@ -38,7 +34,7 @@ export class LocalSource extends PicSourcePlugin<LocalSourceConfig> {
} }
} }
export default class LocalSourcePlugin extends DefineMultiSourcePlugin( @DefinePlugin()
export default class LocalSourcePlugin extends MultiInstancePlugin(
LocalSource, LocalSource,
LocalSourceConfig,
) {} ) {}
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