This repository was archived by the owner on Apr 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
178 lines (169 loc) · 3.67 KB
/
types.ts
File metadata and controls
178 lines (169 loc) · 3.67 KB
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
export interface PluginMetaInput {
/**
* Unique plugin ID (must match directory name)
* e.g., [email protected]
*/
id: string
/**
* Plugin display name
*/
name?: string
/**
* Short description
*/
description?: string
/**
* Homepage or documentation URL
*/
homepage?: string
/**
* Source code repository URL (GitHub/Gitee)
*/
repoUrl?: string
/**
* (Deprecated, use updateUrl) The URL of `update.json`
*/
update_json?: string
/**
* The URL of Zotero standard `update.json`
*/
updateUrl: string
/**
* Plugin classification tags
*/
tags?: TagType[]
/**
* Manually maintained versions list for patching
* Follows Zotero Update Manifest format
*/
patchedVersions?: Version[]
}
/**
* 插件标签
*/
export type TagType
// 推荐列表
= | 'favorite'
// 条目元数据维护
| 'metadata'
// UI相关
| 'interface'
// 附件管理相关
| 'attachment'
// 笔记增强
| 'notes'
// 阅读器增强
| 'reader'
// 效率增强、生产力工具
| 'productivity'
// 可视化、文库分析
| 'visualization'
// 第三方软件集成
| 'integration'
// AI 集成
| 'ai'
// 字处理软件集成或增强
| 'writing'
// 开发者工具
| 'developer'
// 其他
| 'others'
// internal
/**
* Update json
* @see https://extensionworkshop.com/documentation/manage/updating-your-extension/
* @lnik https://github.com/zotero-plugin-dev/zotero-plugin-scaffold/blob/main/src/types/update-json.ts
*/
export interface UpdateJSON {
addons: {
[addonID: string]: {
updates: Array<{
version: string
update_link?: string
/**
* A cryptographic hash of the file pointed to by `update_link`.
* This must be provided if `update_link` is not a secure URL.
* If present, this must be a string beginning with either `sha256:` or `sha512:`,
* followed by the hexadecimal-encoded hash of the matching type.
*/
update_hash?: string
applications: {
/**
* For Zotero 7 or newer
*
* strict_*_version is begin with Zotero version
*/
zotero: {
strict_min_version?: string
strict_max_version?: string
}
/**
* For Zotero 6 or older
*
* strict_*_version is begin with firefox version (60)
*/
gecko?: {
strict_min_version?: string
strict_max_version?: string
}
}
}>
}
}
}
export interface Version {
version: string
update_link: string
update_hash?: string
strict_min_version?: string
strict_max_version?: string
}
/**
* Repository statistics (fetched from GitHub API)
*/
export interface RepoStats {
stars?: number
forks?: number
lastPush?: string
description?: string
}
/**
* Generated metadata output combining base info + versions + stats
*/
export interface GeneratedMeta extends PluginMetaInput {
versions: Version[]
stats?: RepoStats
latestVersion?: string
compatibleApps?: {
zotero?: {
min?: string
max?: string
}
}
}
/**
* Latest version info for quick indexing
*/
export interface LatestVersionInfo {
pluginId: string
version: string
update_link: string
update_hash?: string
strict_min_version?: string
strict_max_version?: string
}
/**
* Plugin processing error
*/
export interface PluginError {
pluginId: string
stage: 'schema' | 'fetch' | 'xpi' | 'merge' | 'validation'
message: string
}
/**
* Overall processing result
*/
export interface ProcessResult {
success: string[]
errors: PluginError[]
}