@zhin.js/plugin-rss 1.1.17 → 1.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-rss",
3
- "version": "1.1.17",
3
+ "version": "1.1.18",
4
4
  "description": "RSS/Atom feed subscription plugin for Zhin.js (Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -42,25 +42,25 @@
42
42
  "license": "MIT",
43
43
  "dependencies": {
44
44
  "rss-parser": "^3.13.0",
45
+ "@zhin.js/console-contract": "1.1.5",
45
46
  "@zhin.js/im-contract": "1.1.13",
46
- "@zhin.js/console-contract": "1.1.4",
47
- "@zhin.js/page": "1.1.16",
48
- "@zhin.js/skill": "1.1.15",
49
- "@zhin.js/tool": "1.1.17"
47
+ "@zhin.js/page": "1.1.17",
48
+ "@zhin.js/tool": "1.1.18",
49
+ "@zhin.js/skill": "1.1.16"
50
50
  },
51
51
  "devDependencies": {
52
52
  "typescript": "^6.0.3",
53
53
  "vitest": "^4.1.10",
54
54
  "zod": "^4.4.3",
55
- "zhin.js": "1.1.23"
55
+ "zhin.js": "1.1.24"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "zod": "^4.0.0",
59
- "@zhin.js/page": "^1.1.16",
60
- "@zhin.js/skill": "^1.1.15",
61
- "@zhin.js/tool": "^1.1.17",
62
- "zhin.js": "^1.1.23",
63
- "@zhin.js/command": "^1.1.16"
59
+ "@zhin.js/command": "^1.1.17",
60
+ "@zhin.js/page": "^1.1.17",
61
+ "@zhin.js/skill": "^1.1.16",
62
+ "@zhin.js/tool": "^1.1.18",
63
+ "zhin.js": "^1.1.24"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
66
  "@zhin.js/command": {
@@ -59,11 +59,11 @@ export default createDeclarativePage({
59
59
  {
60
60
  id: 'config',
61
61
  title: { zh: '配置详情', en: 'Configuration Details' },
62
- entries: (data) => ({
63
- pollCron: data.pollCron,
64
- maxItemsPerPoll: String(data.maxItemsPerPoll),
65
- fetchTimeoutMs: `${data.fetchTimeoutMs} ms`,
66
- }),
62
+ entries: [
63
+ { label: 'pollCron', dataKey: 'pollCron' },
64
+ { label: 'maxItemsPerPoll', dataKey: 'maxItemsPerPoll' },
65
+ { label: 'fetchTimeoutMs', value: { $format: '{0} ms', args: ['fetchTimeoutMs'] } },
66
+ ],
67
67
  },
68
68
  ],
69
69
  });
@@ -81,11 +81,11 @@ export default createDeclarativePage<RssConsoleStatus>({
81
81
  {
82
82
  id: 'config',
83
83
  title: { zh: '配置详情', en: 'Configuration Details' },
84
- entries: (data) => ({
85
- pollCron: data.pollCron,
86
- maxItemsPerPoll: String(data.maxItemsPerPoll),
87
- fetchTimeoutMs: `${data.fetchTimeoutMs} ms`,
88
- }),
84
+ entries: [
85
+ { label: 'pollCron', dataKey: 'pollCron' },
86
+ { label: 'maxItemsPerPoll', dataKey: 'maxItemsPerPoll' },
87
+ { label: 'fetchTimeoutMs', value: { $format: '{0} ms', args: ['fetchTimeoutMs'] } },
88
+ ],
89
89
  },
90
90
  ],
91
91
  });
package/plugin.js CHANGED
@@ -52,9 +52,9 @@ export default definePlugin({
52
52
  ],
53
53
  injects: [databaseHostToken, outboundHostToken, scheduleHostToken, projectLocaleToken],
54
54
  features: {
55
- commands: ['rss-add', 'rss-check', 'rss-list', 'rss-preview', 'rss-remove'],
55
+ commands: ['rss-add/[url]', 'rss-check/[[url]]', 'rss-list', 'rss-preview/[url]', 'rss-remove/[url]'],
56
56
  skills: ['rss'],
57
- tools: ['rss_list_subscriptions', 'rss_preview_feed'],
57
+ tools: ['skill/rss/rss_list_subscriptions', 'skill/rss/rss_preview_feed'],
58
58
  pages: ['index'],
59
59
  },
60
60
  }),
@@ -85,10 +85,17 @@ export default definePlugin({
85
85
  await run();
86
86
  };
87
87
  }
88
+ let projectLocale;
89
+ try {
90
+ projectLocale = context.resources.use(projectLocaleToken);
91
+ }
92
+ catch {
93
+ projectLocale = undefined;
94
+ }
88
95
  const runtime = rssRuntimeStore.provide(context, Object.freeze({
89
96
  db,
90
97
  migrationScopes,
91
- locale: resolveLocale(context.resources.use(projectLocaleToken)),
98
+ locale: resolveLocale(projectLocale),
92
99
  config: Object.freeze({ ...config }),
93
100
  outbound: outboundPush,
94
101
  }));