@zhin.js/plugin-60s 3.0.5 → 3.0.6
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/commands/60s.js +7 -0
- package/commands/bing.js +7 -0
- package/commands/douyin/[limit:number=10].js +7 -0
- package/commands/duanzi.js +7 -0
- package/commands/exchange.js +10 -0
- package/commands/fanyi/[text:string].js +7 -0
- package/commands/fuel/[province:string].js +7 -0
- package/commands/gold.js +7 -0
- package/commands/history.js +7 -0
- package/commands/hitokoto/[type:string].js +7 -0
- package/commands/ip/[ip:string].js +7 -0
- package/commands/kfc.js +7 -0
- package/commands/moyu.js +7 -0
- package/commands/toutiao/[limit:number=10].js +7 -0
- package/commands/weather/[city:string].js +7 -0
- package/commands/weibo/[limit:number=10].js +7 -0
- package/commands/zhihu/[limit:number=10].js +7 -0
- package/package.json +7 -7
- package/plugin.js +13 -0
- package/plugin.ts +0 -19
package/commands/60s.js
ADDED
package/commands/bing.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/douyin-hot.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '抖音热搜',
|
|
6
|
+
execute: ({ params }) => handler({ limit: Number(params.limit) }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../lib/handlers/exchange-rate.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '货币汇率',
|
|
6
|
+
execute: ({ args }) => handler({
|
|
7
|
+
from: args[0] != null ? String(args[0]) : undefined,
|
|
8
|
+
to: args[1] != null ? String(args[1]) : undefined,
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/translate.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '文本翻译',
|
|
6
|
+
execute: ({ params, args }) => handler({ text: String(params.text), to: args[0] != null ? String(args[0]) : undefined }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/fuel-price.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '今日油价',
|
|
6
|
+
execute: ({ params }) => handler({ province: params.province != null ? String(params.province) : undefined }),
|
|
7
|
+
});
|
package/commands/gold.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/hitokoto.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '随机一言',
|
|
6
|
+
execute: ({ params }) => handler({ type: params.type != null ? String(params.type) : undefined }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/ip-query.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: 'IP 查询',
|
|
6
|
+
execute: ({ params }) => handler({ ip: params.ip != null ? String(params.ip) : undefined }),
|
|
7
|
+
});
|
package/commands/kfc.js
ADDED
package/commands/moyu.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/toutiao-hot.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '头条热搜',
|
|
6
|
+
execute: ({ params }) => handler({ limit: Number(params.limit) }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/weather.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '查询城市天气',
|
|
6
|
+
execute: ({ params }) => handler({ city: String(params.city) }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/weibo-hot.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '微博热搜',
|
|
6
|
+
execute: ({ params }) => handler({ limit: Number(params.limit) }),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { defineCommand } from '@zhin.js/command';
|
|
3
|
+
import handler from "../../lib/handlers/zhihu-hot.js";
|
|
4
|
+
export default defineCommand({
|
|
5
|
+
description: '知乎热榜',
|
|
6
|
+
execute: ({ params }) => handler({ limit: Number(params.limit) }),
|
|
7
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/plugin-60s",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "60s API aggregation plugin for Zhin.js — news, weather, hot searches, utilities (Plugin Runtime)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"plugin.
|
|
17
|
+
"plugin.js",
|
|
18
18
|
"schema.json",
|
|
19
19
|
"commands",
|
|
20
20
|
"src",
|
|
@@ -45,19 +45,19 @@
|
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@zhin.js/command": "1.0.
|
|
48
|
+
"@zhin.js/command": "1.0.4",
|
|
49
49
|
"@zhin.js/plugin-runtime": "1.1.1",
|
|
50
|
-
"@zhin.js/tool": "1.0.
|
|
50
|
+
"@zhin.js/tool": "1.0.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"typescript": "^6.0.3",
|
|
54
54
|
"vitest": "^4.1.10",
|
|
55
55
|
"zod": "^4.4.3",
|
|
56
|
-
"@zhin.js/agent": "1.0.
|
|
56
|
+
"@zhin.js/agent": "1.0.7"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"zod": "^4.0.0",
|
|
60
|
-
"@zhin.js/agent": "1.0.
|
|
60
|
+
"@zhin.js/agent": "1.0.7"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@zhin.js/agent": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"zhin": {
|
|
83
83
|
"protocol": 1,
|
|
84
84
|
"type": "plugin",
|
|
85
|
-
"entry": "./plugin.
|
|
85
|
+
"entry": "./plugin.js",
|
|
86
86
|
"engine": "^1.0.0",
|
|
87
87
|
"runtime": "trusted",
|
|
88
88
|
"features": [
|
package/plugin.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { definePlugin } from '@zhin.js/plugin-runtime';
|
|
3
|
+
import { DEFAULT_API_BASE, registerSixtySApiBase } from "./lib/runtime-deps.js";
|
|
4
|
+
export default definePlugin({
|
|
5
|
+
name: 'sixty-s',
|
|
6
|
+
metadata: {
|
|
7
|
+
displayName: '60s API',
|
|
8
|
+
},
|
|
9
|
+
setup(context) {
|
|
10
|
+
// 运行时读取配置:config patch 即时生效;卸载时 lifecycle 反注册,无 process.env 残留
|
|
11
|
+
context.lifecycle.add(registerSixtySApiBase(() => context.config.get().apiBase?.trim() || DEFAULT_API_BASE));
|
|
12
|
+
},
|
|
13
|
+
});
|
package/plugin.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { definePlugin } from '@zhin.js/plugin-runtime';
|
|
2
|
-
import { DEFAULT_API_BASE, registerSixtySApiBase } from './src/runtime-deps.js';
|
|
3
|
-
|
|
4
|
-
export interface SixtySConfig {
|
|
5
|
-
readonly apiBase?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default definePlugin<SixtySConfig>({
|
|
9
|
-
name: 'sixty-s',
|
|
10
|
-
metadata: {
|
|
11
|
-
displayName: '60s API',
|
|
12
|
-
},
|
|
13
|
-
setup(context) {
|
|
14
|
-
// 运行时读取配置:config patch 即时生效;卸载时 lifecycle 反注册,无 process.env 残留
|
|
15
|
-
context.lifecycle.add(
|
|
16
|
-
registerSixtySApiBase(() => context.config.get().apiBase?.trim() || DEFAULT_API_BASE),
|
|
17
|
-
);
|
|
18
|
-
},
|
|
19
|
-
});
|