@anyul/koishi-plugin-rss 4.8.11
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/index.d.ts +256 -0
- package/lib/index.js +1240 -0
- package/package.json +40 -0
- package/readme.md +256 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { Context, Schema } from 'koishi';
|
|
2
|
+
export declare const name = "@anyul/koishi-plugin-rss";
|
|
3
|
+
export declare const inject: {
|
|
4
|
+
required: string[];
|
|
5
|
+
optional: string[];
|
|
6
|
+
};
|
|
7
|
+
declare module 'koishi' {
|
|
8
|
+
interface rssOwl {
|
|
9
|
+
id: string | number;
|
|
10
|
+
url: string;
|
|
11
|
+
platform: string;
|
|
12
|
+
guildId: string;
|
|
13
|
+
author: string;
|
|
14
|
+
rssId: number;
|
|
15
|
+
arg: rssArg;
|
|
16
|
+
title: string;
|
|
17
|
+
lastPubDate: Date;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
interface Config {
|
|
21
|
+
basic?: BasicConfig;
|
|
22
|
+
template?: TemplateConfig;
|
|
23
|
+
net?: NetConfig;
|
|
24
|
+
msg?: MsgConfig;
|
|
25
|
+
debug?: "disable" | "error" | "info" | "details";
|
|
26
|
+
}
|
|
27
|
+
interface BasicConfig {
|
|
28
|
+
usePoster: boolean;
|
|
29
|
+
margeVideo: boolean;
|
|
30
|
+
defaultTemplate?: 'auto' | 'content' | 'only text' | 'only media' | 'only image' | 'proto' | 'default' | 'only description' | 'custom' | 'link';
|
|
31
|
+
timeout?: number;
|
|
32
|
+
refresh?: number;
|
|
33
|
+
merge?: '不合并' | '有多条更新时合并' | '一直合并';
|
|
34
|
+
maxRssItem?: number;
|
|
35
|
+
firstLoad?: boolean;
|
|
36
|
+
urlDeduplication?: boolean;
|
|
37
|
+
resendUpdataContent: 'disable' | 'latest' | 'all';
|
|
38
|
+
imageMode?: 'base64' | 'File';
|
|
39
|
+
videoMode?: 'filter' | 'href' | 'base64' | 'File';
|
|
40
|
+
autoSplitImage?: boolean;
|
|
41
|
+
cacheDir?: string;
|
|
42
|
+
replaceDir?: string;
|
|
43
|
+
authority: number;
|
|
44
|
+
advancedAuthority: number;
|
|
45
|
+
}
|
|
46
|
+
interface TemplateConfig {
|
|
47
|
+
customRemark: string;
|
|
48
|
+
bodyWidth?: number;
|
|
49
|
+
bodyPadding?: number;
|
|
50
|
+
bodyFontSize?: number;
|
|
51
|
+
content?: string;
|
|
52
|
+
custom?: string;
|
|
53
|
+
customTemplate: any[];
|
|
54
|
+
}
|
|
55
|
+
interface NetConfig {
|
|
56
|
+
userAgent?: string;
|
|
57
|
+
proxyAgent?: proxyAgent;
|
|
58
|
+
}
|
|
59
|
+
interface MsgConfig {
|
|
60
|
+
censor?: boolean;
|
|
61
|
+
keywordFilter?: Array<string>;
|
|
62
|
+
keywordBlock?: Array<string>;
|
|
63
|
+
blockString?: string;
|
|
64
|
+
rssHubUrl?: string;
|
|
65
|
+
}
|
|
66
|
+
interface proxyAgent {
|
|
67
|
+
enabled?: boolean;
|
|
68
|
+
autoUseProxy?: boolean;
|
|
69
|
+
protocol?: string;
|
|
70
|
+
host?: string;
|
|
71
|
+
port?: number;
|
|
72
|
+
auth?: auth;
|
|
73
|
+
}
|
|
74
|
+
interface auth {
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
username: string;
|
|
77
|
+
password: string;
|
|
78
|
+
}
|
|
79
|
+
export interface rss {
|
|
80
|
+
url: string;
|
|
81
|
+
id: string | number;
|
|
82
|
+
arg: rssArg;
|
|
83
|
+
title: string;
|
|
84
|
+
author: string;
|
|
85
|
+
lastPubDate: Date;
|
|
86
|
+
}
|
|
87
|
+
export interface rssArg {
|
|
88
|
+
template?: 'auto' | 'content' | 'only text' | 'only media' | 'only image' | 'only video' | 'proto' | 'default' | 'only description' | 'custom' | 'link';
|
|
89
|
+
content: string | never;
|
|
90
|
+
forceLength?: number;
|
|
91
|
+
timeout?: number;
|
|
92
|
+
interval?: number;
|
|
93
|
+
reverse?: boolean;
|
|
94
|
+
firstLoad?: boolean;
|
|
95
|
+
merge?: boolean;
|
|
96
|
+
maxRssItem?: number;
|
|
97
|
+
proxyAgent?: proxyAgent;
|
|
98
|
+
bodyWidth?: number;
|
|
99
|
+
bodyPadding?: number;
|
|
100
|
+
filter?: Array<string>;
|
|
101
|
+
block?: Array<string>;
|
|
102
|
+
split?: number;
|
|
103
|
+
nextUpdataTime?: number;
|
|
104
|
+
}
|
|
105
|
+
export declare const usage = "\nRSS-OWL \u8BA2\u9605\u5668\u4F7F\u7528\u8BF4\u660E\n\n\u57FA\u672C\u547D\u4EE4:\n rsso <url> - \u8BA2\u9605RSS\u94FE\u63A5\n rsso -l - \u67E5\u770B\u8BA2\u9605\u5217\u8868\n rsso -l [id] - \u67E5\u770B\u8BA2\u9605\u8BE6\u60C5\n rsso -r <content> - \u5220\u9664\u8BA2\u9605(\u9700\u8981\u6743\u9650)\n rsso -T <url> - \u6D4B\u8BD5\u8BA2\u9605\n\n\u5E38\u7528\u9009\u9879:\n -i <template> - \u8BBE\u7F6E\u6D88\u606F\u6A21\u677F\n \u53EF\u9009\u503C: content(\u6587\u5B57) | default(\u56FE\u7247) | custom(\u81EA\u5B9A\u4E49) | only text | only media \u7B49\n -t <title> - \u81EA\u5B9A\u4E49\u8BA2\u9605\u6807\u9898\n -a <arg> - \u81EA\u5B9A\u4E49\u914D\u7F6E (\u683C\u5F0F: key:value,key2:value2)\n \u4F8B\u5982: -a timeout:30,merge:true\n\n\u9AD8\u7EA7\u9009\u9879:\n -f <content> - \u5173\u6CE8\u8BA2\u9605\uFF0C\u66F4\u65B0\u65F6\u63D0\u9192\n -fAll <content> - \u5168\u4F53\u5173\u6CE8(\u9700\u8981\u9AD8\u7EA7\u6743\u9650)\n -target <groupId> - \u8DE8\u7FA4\u8BA2\u9605(\u9700\u8981\u9AD8\u7EA7\u6743\u9650)\n -d <time> - \u5B9A\u65F6\u63A8\u9001 (\u683C\u5F0F: \"HH:mm/\u6570\u91CF\" \u6216 \"HH:mm\")\n \u4F8B\u5982: -d \"08:00/5\" \u8868\u793A\u6BCF\u59298\u70B9\u63A8\u90015\u6761\n -p <id> - \u624B\u52A8\u62C9\u53D6\u6700\u65B0\u5185\u5BB9\n\n\u5FEB\u901F\u8BA2\u9605:\n rsso -q - \u67E5\u770B\u5FEB\u901F\u8BA2\u9605\u5217\u8868\n rsso -q [\u7F16\u53F7] - \u67E5\u770B\u5FEB\u901F\u8BA2\u9605\u8BE6\u60C5\n rsso -T tg:channel_name - \u5FEB\u901F\u8BA2\u9605Telegram\u9891\u9053\n\n\u914D\u7F6E\u793A\u4F8B:\n rsso -T -i content \"https://example.com/rss\"\n rsso \"https://example.com/rss\" -t \"\u6211\u7684\u8BA2\u9605\" -a \"timeout:60,merge:true\"\n rsso -d \"09:00/3\" \"https://example.com/rss\"\n\n\u66F4\u591A\u4FE1\u606F\u8BF7\u8BBF\u95EE: https://github.com/borraken/koishi-plugin-rss-owl\n";
|
|
106
|
+
export declare const Config: Schema<Schemastery.ObjectS<{
|
|
107
|
+
basic: Schema<Schemastery.ObjectS<{
|
|
108
|
+
defaultTemplate: Schema<string, string>;
|
|
109
|
+
timeout: Schema<number, number>;
|
|
110
|
+
refresh: Schema<number, number>;
|
|
111
|
+
authority: Schema<number, number>;
|
|
112
|
+
advancedAuthority: Schema<number, number>;
|
|
113
|
+
merge: Schema<"不合并" | "有多条更新时合并" | "一直合并", "不合并" | "有多条更新时合并" | "一直合并">;
|
|
114
|
+
maxRssItem: Schema<number, number>;
|
|
115
|
+
firstLoad: Schema<boolean, boolean>;
|
|
116
|
+
urlDeduplication: Schema<boolean, boolean>;
|
|
117
|
+
resendUpdataContent: Schema<"disable" | "latest" | "all", "disable" | "latest" | "all">;
|
|
118
|
+
imageMode: Schema<"base64" | "File", "base64" | "File">;
|
|
119
|
+
videoMode: Schema<"base64" | "File" | "filter" | "href", "base64" | "File" | "filter" | "href">;
|
|
120
|
+
margeVideo: Schema<boolean, boolean>;
|
|
121
|
+
usePoster: Schema<boolean, boolean>;
|
|
122
|
+
autoSplitImage: Schema<boolean, boolean>;
|
|
123
|
+
cacheDir: Schema<string, string>;
|
|
124
|
+
replaceDir: Schema<string, string>;
|
|
125
|
+
}>, Schemastery.ObjectT<{
|
|
126
|
+
defaultTemplate: Schema<string, string>;
|
|
127
|
+
timeout: Schema<number, number>;
|
|
128
|
+
refresh: Schema<number, number>;
|
|
129
|
+
authority: Schema<number, number>;
|
|
130
|
+
advancedAuthority: Schema<number, number>;
|
|
131
|
+
merge: Schema<"不合并" | "有多条更新时合并" | "一直合并", "不合并" | "有多条更新时合并" | "一直合并">;
|
|
132
|
+
maxRssItem: Schema<number, number>;
|
|
133
|
+
firstLoad: Schema<boolean, boolean>;
|
|
134
|
+
urlDeduplication: Schema<boolean, boolean>;
|
|
135
|
+
resendUpdataContent: Schema<"disable" | "latest" | "all", "disable" | "latest" | "all">;
|
|
136
|
+
imageMode: Schema<"base64" | "File", "base64" | "File">;
|
|
137
|
+
videoMode: Schema<"base64" | "File" | "filter" | "href", "base64" | "File" | "filter" | "href">;
|
|
138
|
+
margeVideo: Schema<boolean, boolean>;
|
|
139
|
+
usePoster: Schema<boolean, boolean>;
|
|
140
|
+
autoSplitImage: Schema<boolean, boolean>;
|
|
141
|
+
cacheDir: Schema<string, string>;
|
|
142
|
+
replaceDir: Schema<string, string>;
|
|
143
|
+
}>>;
|
|
144
|
+
template: Schema<Schemastery.ObjectS<{
|
|
145
|
+
bodyWidth: Schema<number, number>;
|
|
146
|
+
bodyPadding: Schema<number, number>;
|
|
147
|
+
bodyFontSize: Schema<number, number>;
|
|
148
|
+
content: Schema<string, string>;
|
|
149
|
+
custom: Schema<string, string>;
|
|
150
|
+
customRemark: Schema<string, string>;
|
|
151
|
+
}>, Schemastery.ObjectT<{
|
|
152
|
+
bodyWidth: Schema<number, number>;
|
|
153
|
+
bodyPadding: Schema<number, number>;
|
|
154
|
+
bodyFontSize: Schema<number, number>;
|
|
155
|
+
content: Schema<string, string>;
|
|
156
|
+
custom: Schema<string, string>;
|
|
157
|
+
customRemark: Schema<string, string>;
|
|
158
|
+
}>>;
|
|
159
|
+
net: Schema<Schemastery.ObjectS<{
|
|
160
|
+
proxyAgent: Schema<Schemastery.ObjectS<{}>, {} & import("cosmokit").Dict>;
|
|
161
|
+
userAgent: Schema<string, string>;
|
|
162
|
+
}>, Schemastery.ObjectT<{
|
|
163
|
+
proxyAgent: Schema<Schemastery.ObjectS<{}>, {} & import("cosmokit").Dict>;
|
|
164
|
+
userAgent: Schema<string, string>;
|
|
165
|
+
}>>;
|
|
166
|
+
msg: Schema<Schemastery.ObjectS<{
|
|
167
|
+
rssHubUrl: Schema<string, string>;
|
|
168
|
+
keywordFilter: Schema<string[], string[]>;
|
|
169
|
+
keywordBlock: Schema<string[], string[]>;
|
|
170
|
+
blockString: Schema<string, string>;
|
|
171
|
+
censor: Schema<boolean, boolean>;
|
|
172
|
+
}>, Schemastery.ObjectT<{
|
|
173
|
+
rssHubUrl: Schema<string, string>;
|
|
174
|
+
keywordFilter: Schema<string[], string[]>;
|
|
175
|
+
keywordBlock: Schema<string[], string[]>;
|
|
176
|
+
blockString: Schema<string, string>;
|
|
177
|
+
censor: Schema<boolean, boolean>;
|
|
178
|
+
}>>;
|
|
179
|
+
debug: Schema<string, string>;
|
|
180
|
+
}>, Schemastery.ObjectT<{
|
|
181
|
+
basic: Schema<Schemastery.ObjectS<{
|
|
182
|
+
defaultTemplate: Schema<string, string>;
|
|
183
|
+
timeout: Schema<number, number>;
|
|
184
|
+
refresh: Schema<number, number>;
|
|
185
|
+
authority: Schema<number, number>;
|
|
186
|
+
advancedAuthority: Schema<number, number>;
|
|
187
|
+
merge: Schema<"不合并" | "有多条更新时合并" | "一直合并", "不合并" | "有多条更新时合并" | "一直合并">;
|
|
188
|
+
maxRssItem: Schema<number, number>;
|
|
189
|
+
firstLoad: Schema<boolean, boolean>;
|
|
190
|
+
urlDeduplication: Schema<boolean, boolean>;
|
|
191
|
+
resendUpdataContent: Schema<"disable" | "latest" | "all", "disable" | "latest" | "all">;
|
|
192
|
+
imageMode: Schema<"base64" | "File", "base64" | "File">;
|
|
193
|
+
videoMode: Schema<"base64" | "File" | "filter" | "href", "base64" | "File" | "filter" | "href">;
|
|
194
|
+
margeVideo: Schema<boolean, boolean>;
|
|
195
|
+
usePoster: Schema<boolean, boolean>;
|
|
196
|
+
autoSplitImage: Schema<boolean, boolean>;
|
|
197
|
+
cacheDir: Schema<string, string>;
|
|
198
|
+
replaceDir: Schema<string, string>;
|
|
199
|
+
}>, Schemastery.ObjectT<{
|
|
200
|
+
defaultTemplate: Schema<string, string>;
|
|
201
|
+
timeout: Schema<number, number>;
|
|
202
|
+
refresh: Schema<number, number>;
|
|
203
|
+
authority: Schema<number, number>;
|
|
204
|
+
advancedAuthority: Schema<number, number>;
|
|
205
|
+
merge: Schema<"不合并" | "有多条更新时合并" | "一直合并", "不合并" | "有多条更新时合并" | "一直合并">;
|
|
206
|
+
maxRssItem: Schema<number, number>;
|
|
207
|
+
firstLoad: Schema<boolean, boolean>;
|
|
208
|
+
urlDeduplication: Schema<boolean, boolean>;
|
|
209
|
+
resendUpdataContent: Schema<"disable" | "latest" | "all", "disable" | "latest" | "all">;
|
|
210
|
+
imageMode: Schema<"base64" | "File", "base64" | "File">;
|
|
211
|
+
videoMode: Schema<"base64" | "File" | "filter" | "href", "base64" | "File" | "filter" | "href">;
|
|
212
|
+
margeVideo: Schema<boolean, boolean>;
|
|
213
|
+
usePoster: Schema<boolean, boolean>;
|
|
214
|
+
autoSplitImage: Schema<boolean, boolean>;
|
|
215
|
+
cacheDir: Schema<string, string>;
|
|
216
|
+
replaceDir: Schema<string, string>;
|
|
217
|
+
}>>;
|
|
218
|
+
template: Schema<Schemastery.ObjectS<{
|
|
219
|
+
bodyWidth: Schema<number, number>;
|
|
220
|
+
bodyPadding: Schema<number, number>;
|
|
221
|
+
bodyFontSize: Schema<number, number>;
|
|
222
|
+
content: Schema<string, string>;
|
|
223
|
+
custom: Schema<string, string>;
|
|
224
|
+
customRemark: Schema<string, string>;
|
|
225
|
+
}>, Schemastery.ObjectT<{
|
|
226
|
+
bodyWidth: Schema<number, number>;
|
|
227
|
+
bodyPadding: Schema<number, number>;
|
|
228
|
+
bodyFontSize: Schema<number, number>;
|
|
229
|
+
content: Schema<string, string>;
|
|
230
|
+
custom: Schema<string, string>;
|
|
231
|
+
customRemark: Schema<string, string>;
|
|
232
|
+
}>>;
|
|
233
|
+
net: Schema<Schemastery.ObjectS<{
|
|
234
|
+
proxyAgent: Schema<Schemastery.ObjectS<{}>, {} & import("cosmokit").Dict>;
|
|
235
|
+
userAgent: Schema<string, string>;
|
|
236
|
+
}>, Schemastery.ObjectT<{
|
|
237
|
+
proxyAgent: Schema<Schemastery.ObjectS<{}>, {} & import("cosmokit").Dict>;
|
|
238
|
+
userAgent: Schema<string, string>;
|
|
239
|
+
}>>;
|
|
240
|
+
msg: Schema<Schemastery.ObjectS<{
|
|
241
|
+
rssHubUrl: Schema<string, string>;
|
|
242
|
+
keywordFilter: Schema<string[], string[]>;
|
|
243
|
+
keywordBlock: Schema<string[], string[]>;
|
|
244
|
+
blockString: Schema<string, string>;
|
|
245
|
+
censor: Schema<boolean, boolean>;
|
|
246
|
+
}>, Schemastery.ObjectT<{
|
|
247
|
+
rssHubUrl: Schema<string, string>;
|
|
248
|
+
keywordFilter: Schema<string[], string[]>;
|
|
249
|
+
keywordBlock: Schema<string[], string[]>;
|
|
250
|
+
blockString: Schema<string, string>;
|
|
251
|
+
censor: Schema<boolean, boolean>;
|
|
252
|
+
}>>;
|
|
253
|
+
debug: Schema<string, string>;
|
|
254
|
+
}>>;
|
|
255
|
+
export declare function apply(ctx: Context, config: Config): void;
|
|
256
|
+
export {};
|