koishi-plugin-best-cave 2.6.8 → 2.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/DataManager.d.ts +2 -2
- package/lib/index.js +6 -6
- package/package.json +2 -2
package/lib/DataManager.d.ts
CHANGED
|
@@ -24,12 +24,12 @@ export declare class DataManager {
|
|
|
24
24
|
*/
|
|
25
25
|
registerCommands(cave: any): void;
|
|
26
26
|
/**
|
|
27
|
-
* @description 导出所有 'active' 状态的回声洞数据到 `
|
|
27
|
+
* @description 导出所有 'active' 状态的回声洞数据到 `cave.json`。
|
|
28
28
|
* @returns 描述导出结果的消息字符串。
|
|
29
29
|
*/
|
|
30
30
|
exportData(): Promise<string>;
|
|
31
31
|
/**
|
|
32
|
-
* @description 从 `
|
|
32
|
+
* @description 从 `cave.json` 文件导入回声洞数据。
|
|
33
33
|
* @returns 描述导入结果的消息字符串。
|
|
34
34
|
*/
|
|
35
35
|
importData(): Promise<string>;
|
package/lib/index.js
CHANGED
|
@@ -239,25 +239,25 @@ var DataManager = class {
|
|
|
239
239
|
return `操作失败: ${error.message}`;
|
|
240
240
|
}
|
|
241
241
|
}, "requireAdmin");
|
|
242
|
-
cave.subcommand(".export", "导出回声洞数据", { hidden: true, authority: 4 }).usage("将所有回声洞数据导出到
|
|
243
|
-
cave.subcommand(".import", "导入回声洞数据", { hidden: true, authority: 4 }).usage("从
|
|
242
|
+
cave.subcommand(".export", "导出回声洞数据", { hidden: true, authority: 4 }).usage("将所有回声洞数据导出到 cave.json 中。").action(requireAdmin(() => this.exportData()));
|
|
243
|
+
cave.subcommand(".import", "导入回声洞数据", { hidden: true, authority: 4 }).usage("从 cave.json 中导入回声洞数据。").action(requireAdmin(() => this.importData()));
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
|
-
* @description 导出所有 'active' 状态的回声洞数据到 `
|
|
246
|
+
* @description 导出所有 'active' 状态的回声洞数据到 `cave.json`。
|
|
247
247
|
* @returns 描述导出结果的消息字符串。
|
|
248
248
|
*/
|
|
249
249
|
async exportData() {
|
|
250
|
-
const fileName = "
|
|
250
|
+
const fileName = "cave.json";
|
|
251
251
|
const cavesToExport = await this.ctx.database.get("cave", { status: "active" });
|
|
252
252
|
await this.fileManager.saveFile(fileName, Buffer.from(JSON.stringify(cavesToExport, null, 2)));
|
|
253
253
|
return `成功导出 ${cavesToExport.length} 条数据`;
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
|
-
* @description 从 `
|
|
256
|
+
* @description 从 `cave.json` 文件导入回声洞数据。
|
|
257
257
|
* @returns 描述导入结果的消息字符串。
|
|
258
258
|
*/
|
|
259
259
|
async importData() {
|
|
260
|
-
const fileName = "
|
|
260
|
+
const fileName = "cave.json";
|
|
261
261
|
let importedCaves;
|
|
262
262
|
try {
|
|
263
263
|
const fileContent = await this.fileManager.readFile(fileName);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-best-cave",
|
|
3
3
|
"description": "功能强大、高度可定制的回声洞。支持丰富的媒体类型、内容查重、人工审核、用户昵称、数据迁移以及本地/S3 双重文件存储后端。",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.10",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Yis_Rime <yis_rime@outlook.com>"
|
|
7
7
|
],
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@aws-sdk/client-s3": "^3.800.0",
|
|
32
|
-
"sharp": "^0.
|
|
32
|
+
"sharp": "^0.34.3"
|
|
33
33
|
}
|
|
34
34
|
}
|