@karinjs/plugin-basic 1.4.11 → 1.4.14
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/dist/apps/logger.js +1 -1
- package/dist/apps/login.js +4 -4
- package/dist/apps/restart.js +3 -3
- package/dist/apps/status.js +3 -3
- package/dist/apps/update.js +4 -3
- package/dist/{chunk-5LTHGJIJ.js → chunk-JTIGPVWD.js} +3 -2
- package/dist/{chunk-7IEYT4QX.js → chunk-MRO5L7CE.js} +7 -6
- package/dist/{chunk-JKALEULG.js → chunk-OEQXSFBL.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/web.config.d.ts +3 -1
- package/dist/web.config.js +9 -3
- package/package.json +2 -2
package/dist/apps/logger.js
CHANGED
package/dist/apps/login.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cfg
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JTIGPVWD.js";
|
|
4
|
+
import "../chunk-MRO5L7CE.js";
|
|
5
|
+
import "../chunk-OEQXSFBL.js";
|
|
6
6
|
|
|
7
7
|
// src/apps/login.ts
|
|
8
8
|
import karin, { common, contactFriend, logger, segment } from "node-karin";
|
|
9
9
|
import axios from "node-karin/axios";
|
|
10
10
|
import os from "os";
|
|
11
11
|
var url = { IPv4: ["https://4.ipw.cn"], IPv6: ["https://6.ipw.cn"] };
|
|
12
|
-
var login = karin.command(
|
|
12
|
+
var login = karin.command(/^#?(面板|web)登录$/i, async (e) => {
|
|
13
13
|
const net = os.networkInterfaces();
|
|
14
14
|
const config = cfg.get();
|
|
15
15
|
const IP = { lan: { ipv4: null, ipv6: null }, net: { ipv4: null, ipv6: null } };
|
package/dist/apps/restart.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cfg
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JTIGPVWD.js";
|
|
4
|
+
import "../chunk-MRO5L7CE.js";
|
|
5
5
|
import {
|
|
6
6
|
plugin
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-OEQXSFBL.js";
|
|
8
8
|
|
|
9
9
|
// src/apps/restart.ts
|
|
10
10
|
import { common, karin, logger, restart, restartDirect } from "node-karin";
|
package/dist/apps/status.js
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
} from "../chunk-ODFXVVIE.js";
|
|
8
8
|
import {
|
|
9
9
|
cfg
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-JTIGPVWD.js";
|
|
11
|
+
import "../chunk-MRO5L7CE.js";
|
|
12
|
+
import "../chunk-OEQXSFBL.js";
|
|
13
13
|
|
|
14
14
|
// src/apps/status.ts
|
|
15
15
|
import { karin } from "node-karin";
|
package/dist/apps/update.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cfg
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-JTIGPVWD.js";
|
|
4
4
|
import {
|
|
5
5
|
sendToFirstAdmin
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-MRO5L7CE.js";
|
|
7
7
|
import {
|
|
8
8
|
render
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-OEQXSFBL.js";
|
|
10
10
|
|
|
11
11
|
// src/apps/update.ts
|
|
12
12
|
import fs from "fs";
|
|
@@ -256,6 +256,7 @@ var parseLog = (pkg, local, count) => {
|
|
|
256
256
|
};
|
|
257
257
|
var TaskUpdate = karin.task("Karin-\u5B9A\u65F6\u66F4\u65B0\u68C0\u67E5", "*/10 * * * *", async () => {
|
|
258
258
|
if (process.env.NODE_ENV === "development") return true;
|
|
259
|
+
if (!cfg.get().updatepush) return true;
|
|
259
260
|
const res = await checkPkgUpdate("node-karin");
|
|
260
261
|
if (res.status !== "yes") return true;
|
|
261
262
|
const botIds = karin.getAllBotID();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
plugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OEQXSFBL.js";
|
|
4
4
|
|
|
5
5
|
// src/config/config.ts
|
|
6
6
|
import fs from "fs";
|
|
@@ -21,7 +21,8 @@ var Config = class {
|
|
|
21
21
|
restart: true,
|
|
22
22
|
domain: "",
|
|
23
23
|
autoupdate: false,
|
|
24
|
-
restartTask: 0
|
|
24
|
+
restartTask: 0,
|
|
25
|
+
updatepush: true
|
|
25
26
|
};
|
|
26
27
|
constructor() {
|
|
27
28
|
this.init();
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// src/utils/utils.ts
|
|
2
2
|
import karin, { config, logger } from "node-karin";
|
|
3
3
|
var sendToFirstAdmin = async (selfId, message) => {
|
|
4
|
+
var _a;
|
|
4
5
|
const list = config.master();
|
|
5
|
-
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const bot = karin.getBot(selfId);
|
|
7
|
+
if (!bot) return false;
|
|
8
|
+
const f = await bot.getFriendList(true);
|
|
9
|
+
const master = (_a = f.find((item) => list.includes(item.userId))) == null ? void 0 : _a.userId;
|
|
9
10
|
try {
|
|
10
11
|
if (!master) return false;
|
|
11
|
-
const
|
|
12
|
-
return
|
|
12
|
+
const send = await karin.sendMaster(selfId, master, message);
|
|
13
|
+
return send.messageId;
|
|
13
14
|
} catch (error) {
|
|
14
15
|
logger.bot("info", selfId, `[${master}] \u53D1\u9001\u4E3B\u52A8\u6D88\u606F\u5931\u8D25:`);
|
|
15
16
|
logger.error(error);
|
|
@@ -7,7 +7,7 @@ import { karinPathBase } from "node-karin";
|
|
|
7
7
|
// package.json
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@karinjs/plugin-basic",
|
|
10
|
-
version: "1.4.
|
|
10
|
+
version: "1.4.14",
|
|
11
11
|
description: "Karin\u7684\u57FA\u7840\u63D2\u4EF6,\u63D0\u4F9B\u6700\u57FA\u7840\u7684\u529F\u80FD",
|
|
12
12
|
homepage: "https://github.com/KarinJS/karin-plugin-basic",
|
|
13
13
|
bugs: {
|
|
@@ -41,7 +41,7 @@ var package_default = {
|
|
|
41
41
|
"@types/node": "24.12.2",
|
|
42
42
|
eslint: "9.39.2",
|
|
43
43
|
neostandard: "0.12.2",
|
|
44
|
-
"node-karin": "1.
|
|
44
|
+
"node-karin": "1.16.2",
|
|
45
45
|
tsup: "8.5.1",
|
|
46
46
|
tsx: "4.21.0",
|
|
47
47
|
typescript: "5.9.3"
|
package/dist/index.js
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
initStat,
|
|
8
8
|
uptime
|
|
9
9
|
} from "./chunk-ODFXVVIE.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-MRO5L7CE.js";
|
|
11
11
|
import {
|
|
12
12
|
plugin
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OEQXSFBL.js";
|
|
14
14
|
|
|
15
15
|
// src/index.ts
|
|
16
16
|
import { logger } from "node-karin";
|
package/dist/web.config.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ interface Config {
|
|
|
16
16
|
autoupdate: boolean;
|
|
17
17
|
/** 定时重启 */
|
|
18
18
|
restartTask: string | number;
|
|
19
|
+
/** 更新推送 */
|
|
20
|
+
updatepush: boolean;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
declare const _default: node_karin.
|
|
23
|
+
declare const _default: node_karin.DefineComponentConfig<Config>;
|
|
22
24
|
|
|
23
25
|
export { _default as default };
|
package/dist/web.config.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cfg
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JTIGPVWD.js";
|
|
4
|
+
import "./chunk-MRO5L7CE.js";
|
|
5
5
|
import {
|
|
6
6
|
plugin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OEQXSFBL.js";
|
|
8
8
|
|
|
9
9
|
// src/web.config.ts
|
|
10
10
|
import { components, defineConfig } from "node-karin";
|
|
@@ -73,6 +73,12 @@ var web_config_default = defineConfig({
|
|
|
73
73
|
error: "\u8BF7\u8F93\u51650\u6216\u6709\u6548\u7684cron\u8868\u8FBE\u5F0F"
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
|
+
}),
|
|
77
|
+
components.switch.create("updatepush", {
|
|
78
|
+
color: "success",
|
|
79
|
+
label: "\u66F4\u65B0\u63A8\u9001",
|
|
80
|
+
description: "\u542F\u7528\u540E\u5C06\u5B9A\u65F6\u76D1\u542CKarin\u66F4\u65B0\u5E76\u8FDB\u884C\u63A8\u9001",
|
|
81
|
+
defaultSelected: config.updatepush
|
|
76
82
|
})
|
|
77
83
|
];
|
|
78
84
|
return list;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karinjs/plugin-basic",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.14",
|
|
4
4
|
"description": "Karin的基础插件,提供最基础的功能",
|
|
5
5
|
"homepage": "https://github.com/KarinJS/karin-plugin-basic",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/node": "24.12.2",
|
|
35
35
|
"eslint": "9.39.2",
|
|
36
36
|
"neostandard": "0.12.2",
|
|
37
|
-
"node-karin": "1.
|
|
37
|
+
"node-karin": "1.16.2",
|
|
38
38
|
"tsup": "8.5.1",
|
|
39
39
|
"tsx": "4.21.0",
|
|
40
40
|
"typescript": "5.9.3"
|