@zhin.js/plugin-60s 1.1.5 → 1.1.7

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.
Files changed (42) hide show
  1. package/README.md +5 -3
  2. package/lib/api.d.ts +9 -0
  3. package/lib/api.d.ts.map +1 -0
  4. package/lib/client.d.ts +11 -0
  5. package/lib/client.d.ts.map +1 -0
  6. package/lib/handlers/60s-news.d.ts +3 -0
  7. package/lib/handlers/60s-news.d.ts.map +1 -0
  8. package/lib/handlers/bing-image.d.ts +3 -0
  9. package/lib/handlers/bing-image.d.ts.map +1 -0
  10. package/lib/handlers/douyin-hot.d.ts +5 -0
  11. package/lib/handlers/douyin-hot.d.ts.map +1 -0
  12. package/lib/handlers/duanzi.d.ts +3 -0
  13. package/lib/handlers/duanzi.d.ts.map +1 -0
  14. package/lib/handlers/exchange-rate.d.ts +6 -0
  15. package/lib/handlers/exchange-rate.d.ts.map +1 -0
  16. package/lib/handlers/fuel-price.d.ts +5 -0
  17. package/lib/handlers/fuel-price.d.ts.map +1 -0
  18. package/lib/handlers/gold-price.d.ts +3 -0
  19. package/lib/handlers/gold-price.d.ts.map +1 -0
  20. package/lib/handlers/history-today.d.ts +3 -0
  21. package/lib/handlers/history-today.d.ts.map +1 -0
  22. package/lib/handlers/hitokoto.d.ts +5 -0
  23. package/lib/handlers/hitokoto.d.ts.map +1 -0
  24. package/lib/handlers/ip-query.d.ts +5 -0
  25. package/lib/handlers/ip-query.d.ts.map +1 -0
  26. package/lib/handlers/kfc.d.ts +3 -0
  27. package/lib/handlers/kfc.d.ts.map +1 -0
  28. package/lib/handlers/moyu.d.ts +3 -0
  29. package/lib/handlers/moyu.d.ts.map +1 -0
  30. package/lib/handlers/toutiao-hot.d.ts +5 -0
  31. package/lib/handlers/toutiao-hot.d.ts.map +1 -0
  32. package/lib/handlers/translate.d.ts +6 -0
  33. package/lib/handlers/translate.d.ts.map +1 -0
  34. package/lib/handlers/weather.d.ts +5 -0
  35. package/lib/handlers/weather.d.ts.map +1 -0
  36. package/lib/handlers/weibo-hot.d.ts +5 -0
  37. package/lib/handlers/weibo-hot.d.ts.map +1 -0
  38. package/lib/handlers/zhihu-hot.d.ts +5 -0
  39. package/lib/handlers/zhihu-hot.d.ts.map +1 -0
  40. package/lib/index.d.ts +3 -0
  41. package/lib/index.d.ts.map +1 -0
  42. package/package.json +7 -8
package/README.md CHANGED
@@ -12,12 +12,14 @@ pnpm exec zhin install @zhin.js/plugin-60s
12
12
 
13
13
  ## 配置
14
14
 
15
- 在应用目录运行安装命令,会安装依赖并挂载到 `package.json#zhin.plugins`,实例名为 `60s`。在 `zhin.config.yml` 的实例节点修改配置:
15
+ 在应用目录运行安装命令,会安装依赖并挂载到 主配置 `plugins` 映射,实例名为 `60s`。在 `zhin.config.yml` 的实例节点修改配置:
16
16
 
17
17
  ```yaml
18
+ configVersion: 2
18
19
  plugins:
19
- 60s:
20
- apiBase: https://60s.viki.moe # 可选,默认官方地址
20
+ 60s: "@zhin.js/plugin-60s"
21
+ 60s:
22
+ apiBase: https://60s.viki.moe # 可选,默认官方地址
21
23
  ```
22
24
 
23
25
  每个插件实例拥有独立的 API Client。配置更新由当前 generation 的 Client 即时读取,多个实例不会共享或覆盖运行时地址。
package/lib/api.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export type ListItem = string | Record<string, unknown>;
2
+ /** Untyped 60s API JSON payload narrowed by handlers. */
3
+ export type ApiPayload = Record<string, unknown>;
4
+ /** Coerce nested API JSON objects for property access in handlers. */
5
+ export declare function asRecord(value: unknown): ApiPayload;
6
+ export declare function asString(value: unknown): string;
7
+ export declare function asArray(value: unknown): unknown[];
8
+ export declare function formatList(items: ListItem[], limit?: number): string;
9
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExD,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAInD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/C;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,CAEjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,SAAK,GAAG,MAAM,CAahE"}
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_API_BASE = "https://60s.viki.moe";
2
+ export type SixtySApiBase = () => string | undefined;
3
+ /** Owner-scoped transport for one 60s plugin instance. */
4
+ export declare class SixtySClient {
5
+ #private;
6
+ constructor(getApiBase: SixtySApiBase);
7
+ get apiBase(): string;
8
+ fetch<T = Record<string, unknown>>(endpoint: string, params?: Readonly<Record<string, string>>): Promise<T>;
9
+ }
10
+ export declare const sixtySClientToken: import("zhin.js").Token<SixtySClient>;
11
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,MAAM,MAAM,GAAG,SAAS,CAAC;AAErD,0DAA0D;AAC1D,qBAAa,YAAY;;gBAGX,UAAU,EAAE,aAAa;IAIrC,IAAI,OAAO,IAAI,MAAM,CAEpB;IAEK,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC;CAmCd;AAED,eAAO,MAAM,iBAAiB,uCAG7B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient): Promise<string>;
3
+ //# sourceMappingURL=60s-news.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"60s-news.d.ts","sourceRoot":"","sources":["../../src/handlers/60s-news.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAQlD"}
@@ -0,0 +1,3 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient): Promise<string>;
3
+ //# sourceMappingURL=bing-image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bing-image.d.ts","sourceRoot":"","sources":["../../src/handlers/bing-image.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAUlD"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ limit?: number;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=douyin-hot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"douyin-hot.d.ts","sourceRoot":"","sources":["../../src/handlers/douyin-hot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,mBAG5E"}
@@ -0,0 +1,3 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient): Promise<string>;
3
+ //# sourceMappingURL=duanzi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duanzi.d.ts","sourceRoot":"","sources":["../../src/handlers/duanzi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAGlD"}
@@ -0,0 +1,6 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ from?: string;
4
+ to?: string;
5
+ }): Promise<string>;
6
+ //# sourceMappingURL=exchange-rate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange-rate.d.ts","sourceRoot":"","sources":["../../src/handlers/exchange-rate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,mBAyBxF"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ province?: string;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=fuel-price.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuel-price.d.ts","sourceRoot":"","sources":["../../src/handlers/fuel-price.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,mBAiB/E"}
@@ -0,0 +1,3 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient): Promise<string>;
3
+ //# sourceMappingURL=gold-price.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gold-price.d.ts","sourceRoot":"","sources":["../../src/handlers/gold-price.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAkBlD"}
@@ -0,0 +1,3 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient): Promise<string>;
3
+ //# sourceMappingURL=history-today.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-today.d.ts","sourceRoot":"","sources":["../../src/handlers/history-today.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAalD"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ type?: string;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=hitokoto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hitokoto.d.ts","sourceRoot":"","sources":["../../src/handlers/hitokoto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,mBAa3E"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ ip?: string;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=ip-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip-query.d.ts","sourceRoot":"","sources":["../../src/handlers/ip-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,mBAYzE"}
@@ -0,0 +1,3 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient): Promise<string>;
3
+ //# sourceMappingURL=kfc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kfc.d.ts","sourceRoot":"","sources":["../../src/handlers/kfc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAGlD"}
@@ -0,0 +1,3 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient): Promise<string>;
3
+ //# sourceMappingURL=moyu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moyu.d.ts","sourceRoot":"","sources":["../../src/handlers/moyu.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAgClD"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ limit?: number;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=toutiao-hot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toutiao-hot.d.ts","sourceRoot":"","sources":["../../src/handlers/toutiao-hot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,mBAG5E"}
@@ -0,0 +1,6 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ text: string;
4
+ to?: string;
5
+ }): Promise<string>;
6
+ //# sourceMappingURL=translate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/handlers/translate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,mBAsBvF"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ city: string;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=weather.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../src/handlers/weather.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,mBAmB1E"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ limit?: number;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=weibo-hot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weibo-hot.d.ts","sourceRoot":"","sources":["../../src/handlers/weibo-hot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,mBAG5E"}
@@ -0,0 +1,5 @@
1
+ import type { SixtySClient } from '../client.js';
2
+ export default function (client: SixtySClient, args: {
3
+ limit?: number;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=zhihu-hot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zhihu-hot.d.ts","sourceRoot":"","sources":["../../src/handlers/zhihu-hot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,mBAG5E"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { asArray, asRecord, asString, formatList, } from './api.js';
2
+ export type { ApiPayload, ListItem } from './api.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-60s",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
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",
@@ -8,7 +8,6 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./lib/index.d.ts",
11
- "development": "./src/index.ts",
12
11
  "import": "./lib/index.js"
13
12
  },
14
13
  "./package.json": "./package.json"
@@ -46,19 +45,19 @@
46
45
  },
47
46
  "license": "MIT",
48
47
  "dependencies": {
49
- "@zhin.js/tool": "1.1.5",
50
- "@zhin.js/skill": "1.1.5"
48
+ "@zhin.js/tool": "1.1.7",
49
+ "@zhin.js/skill": "1.1.7"
51
50
  },
52
51
  "devDependencies": {
53
52
  "typescript": "^6.0.3",
54
53
  "vitest": "^4.1.10",
55
54
  "zod": "^4.4.3",
56
- "zhin.js": "1.1.8"
55
+ "zhin.js": "1.1.11"
57
56
  },
58
57
  "peerDependencies": {
59
58
  "zod": "^4.0.0",
60
- "@zhin.js/command": "^1.1.6",
61
- "zhin.js": "^1.1.8"
59
+ "@zhin.js/command": "^1.1.8",
60
+ "zhin.js": "^1.1.11"
62
61
  },
63
62
  "peerDependenciesMeta": {
64
63
  "@zhin.js/command": {
@@ -78,7 +77,7 @@
78
77
  "registry": "https://registry.npmjs.org"
79
78
  },
80
79
  "engines": {
81
- "node": "^20.19.0 || >=22.12.0"
80
+ "node": ">=22.19.0"
82
81
  },
83
82
  "zhin": {
84
83
  "protocol": 1,