-
Notifications
You must be signed in to change notification settings - Fork 901
/
Copy pathenum.ts
448 lines (416 loc) · 11.2 KB
/
enum.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
/**
* 体积单位
*/
export enum ESizeUnit {
ZiB = "ZiB",
EiB = "EiB",
PiB = "PiB",
TiB = "TiB",
GiB = "GiB",
MiB = "MiB",
KiB = "KiB"
}
/**
* 数据请求类型
*/
export enum ERequestType {
JSON = "json",
TEXT = "urlencode"
}
/**
* 数据请求返回类型
*/
export enum ERequestResultType {
JSON = "json",
XML = "xml",
HTML = "html",
TEXT = "text"
}
/**
* 下载服务器(客户端)类型
*/
export enum EDownloadClientType {
transmission = "transmission",
utorrent = "utorrent",
deluge = "deluge",
synologyDownloadStation = "synologyDownloadStation",
rutorrent = "rutorrent",
qbittorrent = "qbittorrent"
}
/**
* 助手按钮类型
*/
export enum EButtonType {
normal = "normal",
label = "label",
spliter = "spliter",
popup = "popup"
}
/**
* 请求类型
*/
export enum ERequestMethod {
POST = "POST",
GET = "GET"
}
/**
* 动作列表
*/
export enum EAction {
// 读取参数
readConfig = "readConfig",
// 保存参数
saveConfig = "saveConfig",
// 从网络中重新加载配置文件
reloadConfig = "reloadConfig",
// 发送种子到默认的下载服务器(客户端)
sendTorrentToDefaultClient = "sendTorrentToDefaultClient",
// 发送种子到指定的客户端
sendTorrentToClient = "sendTorrentToClient",
// 搜索种子
searchTorrent = "searchTorrent",
// 复制文本到剪切板
copyTextToClipboard = "copyTextToClipboard",
// 从指定的URL添加种子
addTorrentFromURL = "addTorrentFromURL",
// 获取可用空间
getFreeSpace = "getFreeSpace",
// 下载当前拖放DOM中的地址
downloadFromDroper = "downloadFromDroper",
// 打开配置页面
openOptions = "openOptions",
// 更新配置页面TabId
updateOptionsTabId = "updateOptionsTabId",
// 获取搜索结果
getSearchResult = "getSearchResult",
// 获取下载记录
getDownloadHistory = "getDownloadHistory",
// 删除指定的下载记录
removeDownloadHistory = "removeDownloadHistory",
// 清除下载记录
clearDownloadHistory = "clearDownloadHistory",
// 测试下载服务器是否可连接
testClientConnectivity = "testClientConnectivity",
// 获取系统日志
getSystemLogs = "getSystemLogs",
// 删除指定的系统日志
removeSystemLogs = "removeSystemLogs",
// 清除系统日志
clearSystemLogs = "clearSystemLogs",
// 读取UI参数
readUIOptions = "readUIOptions",
// 保存UI参数
saveUIOptions = "saveUIOptions",
// 在当前选项卡显示消息
showMessage = "showMessage",
// 写入日志
writeLog = "writeLog",
// 后台服务停止
serviceStoped = "serviceStoped",
// 增加内容页面
addContentPage = "addContentPage",
// 取消搜索
abortSearch = "abortSearch",
// 将参数备份至Google
backupToGoogle = "backupToGoogle",
// 从Google恢复已备份的参数
restoreFromGoogle = "restoreFromGoogle",
// 从Google中清除已备份的参数
clearFromGoogle = "clearFromGoogle",
// 获取种子数据
getTorrentDataFromURL = "getTorrentDataFromURL",
// 获取用户信息
getUserInfo = "getUserInfo",
// 取消获取用户信息请求
abortGetUserInfo = "abortGetUserInfo",
// 刷新用户数据
refreshUserData = "refreshUserData",
// 获取已清理过的配置
getClearedOptions = "getClearedOptions",
// 重置运行时配置
resetRunTimeOptions = "resetRunTimeOptions",
// 根据指定的图片地址获取Base64信息
getBase64FromImageUrl = "getBase64FromImageUrl",
// 获取用户历史数据
getUserHistoryData = "getUserHistoryData",
// 获取电影信息
getMovieInfos = "getMovieInfos",
// 获取电影评分信息
getMovieRatings = "getMovieRatings",
// 根据指定的 doubanId 获取 IMDbId
getIMDbIdFromDouban = "getIMDbIdFromDouban",
// 从豆瓣查询影片信息
queryMovieInfoFromDouban = "queryMovieInfoFromDouban",
// 添加浏览器原生下载
addBrowserDownloads = "addBrowserDownloads",
// 验证权限
checkPermissions = "checkPermissions",
// 请求用户授权
requestPermissions = "requestPermissions",
// 更改语言
changeLanguage = "changeLanguage",
// 获取当前语言资源
getCurrentLanguageResource = "getCurrentLanguageResource",
// 增加新的语言
addLanguage = "addLanguage",
// 替换现有语言
replaceLanguage = "replaceLanguage",
// 隐藏指定的消息(用于前端页面)
hideMessage = "hideMessage",
// 重置用户数据,可用于恢复用户数据
resetUserDatas = "resetUserDatas",
// 备份配置到服务器
backupToServer = "backupToServer",
// 从服务器恢复配置
restoreFromServer = "restoreFromServer",
// 从服务器获取已备份的列表
getBackupListFromServer = "getBackupListFromServer",
// 从服务器删除指定的文件
deleteFileFromBackupServer = "deleteFileFromBackupServer",
// 在后台批量下载指定的链接
sendTorrentsInBackground = "sendTorrentsInBackground",
// 创建备份文件
createBackupFile = "createBackupFile",
// 验证备份数据
checkBackupData = "checkBackupData",
// 将种子添加到收藏
addTorrentToCollection = "addTorrentToCollection",
// 获取种子收藏
getTorrentCollections = "getTorrentCollections",
// 删除种子收藏
deleteTorrentFromCollention = "deleteTorrentFromCollention",
// 清除种子收藏
clearTorrentCollention = "clearTorrentCollention",
// 获取收藏
getTorrentCollention = "getTorrentCollention",
// 获取当前站点指定的选择器配置
getSiteSelectorConfig = "getSiteSelectorConfig",
// 重置收藏,可用于恢复收藏
resetTorrentCollections = "resetTorrentCollections",
// 获取收藏分组
getTorrentCollectionGroups = "getTorrentCollectionGroups",
// 添加收藏分组
addTorrentCollectionGroup = "addTorrentCollectionGroup",
// 将当前收藏添加到分组
addTorrentCollectionToGroup = "addTorrentCollectionToGroup",
// 更新收藏分组信息
updateTorrentCollectionGroup = "updateTorrentCollectionGroup",
// 将收藏从分组中删除
removeTorrentCollectionFromGroup = "removeTorrentCollectionFromGroup",
// 删除收藏分组
removeTorrentCollectionGroup = "removeTorrentCollectionGroup",
// 更新收藏信息
updateTorrentCollention = "updateTorrentCollention",
// 获取所有收藏的链接地址
getAllTorrentCollectionLinks = "getAllTorrentCollectionLinks",
// 恢复Cookies
restoreCookies = "restoreCookies",
// 重置所有站点图标缓存
resetFavicons = "resetFavicons",
// 重置单个站点图标缓存
resetFavicon = "resetFavicon",
// 获取备份文件原始数据
getBackupRawData = "getBackupRawData",
// 测试备份服务器是否可连接
testBackupServerConnectivity = "testBackupServerConnectivity",
// 创建搜索结果快照
createSearchResultSnapshot = "createSearchResultSnapshot",
// 加载搜索结果快照
loadSearchResultSnapshot = "loadSearchResultSnapshot",
// 获取搜索结果快照内容
getSearchResultSnapshot = "getSearchResultSnapshot",
// 删除搜索结果快照
removeSearchResultSnapshot = "removeSearchResultSnapshot",
// 清除搜索结果快照
clearSearchResultSnapshot = "clearSearchResultSnapshot",
// 重置搜索结果快照
resetSearchResultSnapshot = "resetSearchResultSnapshot",
// 创建辅种任务
createKeepUploadTask = "createKeepUploadTask",
// 加载辅种任务
loadKeepUploadTask = "loadKeepUploadTask",
// 获取辅种任务内容
getKeepUploadTask = "getKeepUploadTask",
// 删除辅种任务
removeKeepUploadTask = "removeKeepUploadTask",
// 清除辅种任务
clearKeepUploadTask = "clearKeepUploadTask",
// 重置辅种任务
resetKeepUploadTask = "resetKeepUploadTask",
// 更新辅种任务
updateKeepUploadTask = "updateKeepUploadTask",
// 重置下载历史
resetDownloadHistory = "resetDownloadHistory",
// 添加调试信息
pushDebugMsg = "pushDebugMsg",
updateDebuggerTabId = "updateDebuggerTabId",
// 获取热门搜索
getTopSearches = "getTopSearches"
}
/**
* 数据保存类型
*/
export enum EStorageType {
text = "TEXT",
json = "JSON"
}
/**
* 参数配置键值
*/
export enum EConfigKey {
default = "PT-Plugin-Plus-Config",
downloadHistory = "PT-Plugin-Plus-downloadHistory",
systemLogs = "PT-Plugin-Plus-systemLogs",
uiOptions = "PT-Plugin-Plus-uiOptions",
cache = "PT-Plugin-Plus-Cache-Contents",
userDatas = "PT-Plugin-Plus-User-Datas",
collection = "PT-Plugin-Plus-Collection",
searchResultSnapshot = "PT-Plugin-Plus-SearchResultSnapshot",
keepUploadTask = "PT-Plugin-Plus-KeepUploadTask"
}
/**
* 数据返回类型
*/
export enum EDataResultType {
success = "success",
error = "error",
info = "info",
warning = "warning",
unknown = "unknown"
}
/**
* 模块名称
*/
export enum EModule {
background = "background",
content = "content",
options = "options",
popup = "popup",
debugger = "debugger"
}
/**
* 日志事件
*/
export enum ELogEvent {
init = "init",
requestMessage = "requestMessage"
}
export enum EPaginationKey {
systemLogs = "systemLogs",
searchTorrent = "searchTorrent"
}
export enum EViewKey {
home = "home",
downloadPaths = "downloadPaths",
searchTorrent = "searchTorrent"
}
/**
* 用户数据范围
*/
export enum EUserDataRange {
latest = "latest",
today = "today",
all = "all"
}
/**
* 用户数据请求返回状态
*/
export enum EUserDataRequestStatus {
needLogin = "needLogin",
notSupported = "notSupported",
unknown = "unknown",
success = "success"
}
/**
* 公用的一些键值
*/
export enum ECommonKey {
allSite = "__allSite__",
all = "__all__",
noGroup = "__noGroup__"
}
/**
* 插件安装方式
*/
export enum EInstallType {
// 相当于 zip 解压方式安装
development = "development",
normal = "normal",
// crx 自定义类型,官方api中无此状态
crx = "crx"
}
// 当点击预选条目时,搜索模式
export enum EBeforeSearchingItemSearchMode {
id = "id",
name = "name"
}
// 种子当前状态
export enum ETorrentStatus {
// 正在下载
downloading = 1,
// 正在做种
sending = 2,
// 已完成,未做种
completed = 255,
// 未活动(曾经下载过,但未完成)
inactive = 3
}
/**
* 备份服务器类型
*/
export enum EBackupServerType {
OWSS = "OWSS",
WebDAV = "WebDAV"
}
/**
* 插件显示位置
*/
export enum EPluginPosition {
left = "left",
right = "right"
}
/**
* 相关Wiki链接
*/
export enum EWikiLink {
faq = "https://github.com/pt-plugins/PT-Plugin-Plus/wiki/frequently-asked-questions"
}
/**
* 需要恢复的内容
*/
export enum ERestoreContent {
all = "all",
options = "options",
userDatas = "userDatas",
collection = "collection",
cookies = "cookies",
searchResultSnapshot = "searchResultSnapshot",
keepUploadTask = "keepUploadTask",
downloadHistory = "downloadHistory"
}
export enum EBrowserType {
Chrome = "Chrome",
Firefox = "Firefox"
}
export enum EWorkingStatus {
success = "success",
error = "error",
loading = "loading"
}
export enum EResourceOrderBy {
time = "time",
name = "name",
size = "size"
}
export enum EResourceOrderMode {
desc = "desc",
asc = "asc"
}
// 加密方式
export enum EEncryptMode {
AES = "AES"
}
export enum ERestoreError {
needSecretKey = "needSecretKey",
errorSecretKey = "errorSecretKey"
}