koishi-plugin-minecraft-notifier 1.11.3 → 1.12.0
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/helper/git-platform-helper.d.ts +0 -14
- package/lib/index.cjs +0 -46
- package/lib/index.d.ts +0 -3
- package/package.json +2 -2
|
@@ -4,7 +4,6 @@ import { Context } from 'koishi';
|
|
|
4
4
|
* Git 平台类型
|
|
5
5
|
*/
|
|
6
6
|
export declare enum GitPlatform {
|
|
7
|
-
GITEE = "gitee",
|
|
8
7
|
GITCODE = "gitcode"
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
@@ -27,19 +26,6 @@ interface FileUploadParams {
|
|
|
27
26
|
token: string;
|
|
28
27
|
branch?: string;
|
|
29
28
|
}
|
|
30
|
-
/**
|
|
31
|
-
* 上传或更新 Gitee 仓库中的文本文件
|
|
32
|
-
* @param ctx - Koishi 上下文
|
|
33
|
-
* @param owner - 仓库所有者用户名
|
|
34
|
-
* @param repo - 仓库名称
|
|
35
|
-
* @param path - 文件路径(例如 'docs/update.txt')
|
|
36
|
-
* @param content - 文件内容(纯文本字符串,会自动 Base64 编码)
|
|
37
|
-
* @param message - Commit 消息
|
|
38
|
-
* @param token - Gitee Personal Access Token
|
|
39
|
-
* @param branch - 分支名(默认 'master')
|
|
40
|
-
* @returns Promise<OperationResult>
|
|
41
|
-
*/
|
|
42
|
-
export declare function upsertFileToGitee(ctx: Context, owner: string, repo: string, path: string, content: string, message: string, token: string, branch?: string): Promise<OperationResult>;
|
|
43
29
|
/**
|
|
44
30
|
* 上传或更新 GitCode 仓库中的文本文件
|
|
45
31
|
* @param ctx - Koishi 上下文
|
package/lib/index.cjs
CHANGED
|
@@ -399,10 +399,6 @@ As the Minecraft Update Log JSON Summary Specialist, you must adhere to the abov
|
|
|
399
399
|
// src/helper/git-platform-helper.ts
|
|
400
400
|
var import_axios2 = __toESM(require("axios"), 1);
|
|
401
401
|
var PLATFORM_CONFIG = {
|
|
402
|
-
["gitee" /* GITEE */]: {
|
|
403
|
-
baseUrl: "https://gitee.com/api/v5",
|
|
404
|
-
name: "Gitee"
|
|
405
|
-
},
|
|
406
402
|
["gitcode" /* GITCODE */]: {
|
|
407
403
|
baseUrl: "https://api.gitcode.com/api/v5",
|
|
408
404
|
name: "GitCode"
|
|
@@ -469,17 +465,6 @@ async function upsertFileToGitPlatform(ctx, platform, params) {
|
|
|
469
465
|
};
|
|
470
466
|
}
|
|
471
467
|
}
|
|
472
|
-
async function upsertFileToGitee(ctx, owner, repo, path3, content, message, token, branch = "master") {
|
|
473
|
-
return upsertFileToGitPlatform(ctx, "gitee" /* GITEE */, {
|
|
474
|
-
owner,
|
|
475
|
-
repo,
|
|
476
|
-
path: path3,
|
|
477
|
-
content,
|
|
478
|
-
message,
|
|
479
|
-
token,
|
|
480
|
-
branch
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
468
|
async function upsertFileToGitCode(ctx, owner, repo, path3, content, message, token, branch = "master") {
|
|
484
469
|
return upsertFileToGitPlatform(ctx, "gitcode" /* GITCODE */, {
|
|
485
470
|
owner,
|
|
@@ -632,34 +617,6 @@ async function exportXaml(ctx, cfg, summary, version) {
|
|
|
632
617
|
let fullHomePagePath = import_node_path.default.join(xamlPath, "PCL.HomePage.xaml");
|
|
633
618
|
await import_node_fs.promises.writeFile(fullXamlPath, xaml);
|
|
634
619
|
await import_node_fs.promises.copyFile(fullXamlPath, fullHomePagePath);
|
|
635
|
-
if (cfg.giteeApiToken && cfg.giteeOwner && cfg.giteeRepo) {
|
|
636
|
-
await upsertFileToGitee(
|
|
637
|
-
ctx,
|
|
638
|
-
cfg.giteeOwner,
|
|
639
|
-
cfg.giteeRepo,
|
|
640
|
-
"Custom.xaml",
|
|
641
|
-
xaml,
|
|
642
|
-
`feat: update PCL HomePage XAML for version ${version}`,
|
|
643
|
-
cfg.giteeApiToken,
|
|
644
|
-
"master"
|
|
645
|
-
).then((result) => {
|
|
646
|
-
if (result.success) {
|
|
647
|
-
ctx.logger("minecraft-notifier").info("Upsert successful of gitee.");
|
|
648
|
-
} else {
|
|
649
|
-
ctx.logger("minecraft-notifier").warn("Upsert failed of gitee:", result.error);
|
|
650
|
-
}
|
|
651
|
-
});
|
|
652
|
-
await upsertFileToGitee(
|
|
653
|
-
ctx,
|
|
654
|
-
cfg.giteeOwner,
|
|
655
|
-
cfg.giteeRepo,
|
|
656
|
-
"Custom.xaml.ini",
|
|
657
|
-
version,
|
|
658
|
-
`feat: update PCL HomePage XAML INI for version ${version}`,
|
|
659
|
-
cfg.giteeApiToken,
|
|
660
|
-
"master"
|
|
661
|
-
);
|
|
662
|
-
}
|
|
663
620
|
if (cfg.gitcodeApiToken && cfg.gitcodeOwner && cfg.gitcodeRepo) {
|
|
664
621
|
await upsertFileToGitCode(
|
|
665
622
|
ctx,
|
|
@@ -1045,9 +1002,6 @@ var Config = import_koishi.Schema.object({
|
|
|
1045
1002
|
enableWebSearch: import_koishi.Schema.boolean().default(true).description("\u662F\u5426\u542F\u7528\u7F51\u7EDC\u641C\u7D22\u529F\u80FD"),
|
|
1046
1003
|
apiKey: import_koishi.Schema.string().role("secret").default("").description("AI \u63A5\u53E3\u7684 API \u5BC6\u94A5").required(),
|
|
1047
1004
|
notifyChannel: import_koishi.Schema.array(String).default([]).description("\u7528\u4E8E\u63A5\u6536\u66F4\u65B0\u901A\u77E5\u7684\u9891\u9053 ID \u5217\u8868"),
|
|
1048
|
-
giteeApiToken: import_koishi.Schema.string().role("secret").default("").description("Gitee API \u8BBF\u95EE\u4EE4\u724C\uFF0C\u7528\u4E8E\u4E0A\u4F20 XAML \u6587\u4EF6"),
|
|
1049
|
-
giteeOwner: import_koishi.Schema.string().default("").description("Gitee \u4ED3\u5E93\u6240\u6709\u8005\u7528\u6237\u540D"),
|
|
1050
|
-
giteeRepo: import_koishi.Schema.string().default("").description("Gitee \u4ED3\u5E93\u540D\u79F0"),
|
|
1051
1005
|
gitcodeApiToken: import_koishi.Schema.string().role("secret").default("").description("GitCode API \u8BBF\u95EE\u4EE4\u724C\uFF0C\u7528\u4E8E\u4E0A\u4F20 XAML \u6587\u4EF6"),
|
|
1052
1006
|
gitcodeOwner: import_koishi.Schema.string().default("").description("GitCode \u4ED3\u5E93\u6240\u6709\u8005\u7528\u6237\u540D"),
|
|
1053
1007
|
gitcodeRepo: import_koishi.Schema.string().default("").description("GitCode \u4ED3\u5E93\u540D\u79F0")
|
package/lib/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/pynickle/koishi-plugin-minecraft-notifier"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.12.0",
|
|
9
9
|
"main": "lib/index.cjs",
|
|
10
10
|
"typings": "lib/index.d.ts",
|
|
11
11
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@semantic-release/git": "^10.0.1",
|
|
37
37
|
"@semantic-release/npm": "^13.1.3",
|
|
38
38
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
39
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^24.10.9",
|
|
40
40
|
"@types/turndown": "^5.0.6",
|
|
41
41
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
42
42
|
"esbuild": "^0.27.2",
|