@puniyu/nipaw 1.8.0 → 1.9.0
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/dist/index.d.ts +628 -261
- package/dist/index.js +78 -53
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -18,137 +18,213 @@ export declare class CnbClient {
|
|
|
18
18
|
* 支持http,https,socks5协议
|
|
19
19
|
*/
|
|
20
20
|
setProxy(proxy: string): void
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/** 获取用户操作模块 */
|
|
22
|
+
user(): CnbUser
|
|
23
|
+
/** 获取组织操作模块 */
|
|
24
|
+
org(): CnbOrg
|
|
25
|
+
/** 获取仓库操作模块 */
|
|
26
|
+
repo(): CnbRepo
|
|
27
|
+
/** 获取提交操作模块 */
|
|
28
|
+
commit(): CnbCommit
|
|
29
|
+
/** 获取Issue操作模块 */
|
|
30
|
+
issue(): CnbIssue
|
|
31
|
+
/** 获取Release操作模块 */
|
|
32
|
+
release(): CnbRelease
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare class CnbCommit {
|
|
36
|
+
|
|
37
|
+
constructor()
|
|
38
|
+
/**
|
|
39
|
+
* 获取仓库提交信息
|
|
40
|
+
*
|
|
41
|
+
* ## 参数
|
|
42
|
+
* - `owner` 仓库所有者
|
|
43
|
+
* - `repo` 仓库名称
|
|
44
|
+
* - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
|
|
45
|
+
*/
|
|
46
|
+
info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
|
|
47
|
+
/**
|
|
48
|
+
* 获取仓库提交列表
|
|
49
|
+
*
|
|
50
|
+
* ## 参数
|
|
51
|
+
* - `owner` 仓库所有者
|
|
52
|
+
* - `repo` 仓库名称
|
|
53
|
+
* - `option` 提交列表选项
|
|
54
|
+
*/
|
|
55
|
+
list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export declare class CnbIssue {
|
|
59
|
+
|
|
60
|
+
constructor()
|
|
23
61
|
/**
|
|
24
|
-
*
|
|
62
|
+
* 创建一个issue
|
|
63
|
+
*
|
|
64
|
+
* ## 参数
|
|
65
|
+
* - `owner` 仓库所有者
|
|
66
|
+
* - `repo` 仓库名称
|
|
67
|
+
* - `title` issue标题
|
|
68
|
+
* - `body` issue内容
|
|
69
|
+
* - `option` 创建issue选项
|
|
70
|
+
*/
|
|
71
|
+
create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
72
|
+
/**
|
|
73
|
+
* 获取issue信息
|
|
74
|
+
*
|
|
75
|
+
* ## 参数
|
|
76
|
+
* - `owner` 仓库所有者
|
|
77
|
+
* - `repo` 仓库名称
|
|
78
|
+
* - `issue_number` issue编号
|
|
79
|
+
*/
|
|
80
|
+
info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
|
|
81
|
+
/**
|
|
82
|
+
* 获取仓库所有issue信息
|
|
25
83
|
*
|
|
26
84
|
* ## 参数
|
|
27
|
-
* - `
|
|
85
|
+
* - `owner` 仓库所有者
|
|
86
|
+
* - `repo` 仓库名称
|
|
87
|
+
* - `option` issue列表选项
|
|
28
88
|
*/
|
|
29
|
-
|
|
89
|
+
list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
|
|
30
90
|
/**
|
|
31
|
-
*
|
|
91
|
+
* 更新issue信息
|
|
32
92
|
*
|
|
33
93
|
* ## 参数
|
|
34
|
-
* - `
|
|
94
|
+
* - `owner` 仓库所有者
|
|
95
|
+
* - `repo` 仓库名称
|
|
96
|
+
* - `issue_number` issue编号
|
|
97
|
+
* - `options` 更新issue选项
|
|
35
98
|
*/
|
|
36
|
-
|
|
99
|
+
update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export declare class CnbOrg {
|
|
103
|
+
|
|
104
|
+
constructor()
|
|
37
105
|
/**
|
|
38
106
|
* 获取组织信息
|
|
39
107
|
*
|
|
40
108
|
* ## 参数
|
|
41
109
|
* - `org_name` 组织名称
|
|
42
110
|
*/
|
|
43
|
-
|
|
111
|
+
info(orgName: string): Promise<OrgInfo>
|
|
44
112
|
/**
|
|
45
|
-
*
|
|
113
|
+
* 获取组织头像地址
|
|
46
114
|
*
|
|
47
115
|
* ## 参数
|
|
48
116
|
* - `org_name` 组织名称
|
|
49
|
-
* - `option` 仓库列表选项
|
|
50
117
|
*/
|
|
51
|
-
|
|
52
|
-
/** 获取组织头像地址 */
|
|
53
|
-
getOrgAvatarUrl(orgName: string): Promise<string>
|
|
118
|
+
avatarUrl(orgName: string): Promise<string>
|
|
54
119
|
/**
|
|
55
|
-
*
|
|
120
|
+
* 获取组织仓库列表
|
|
56
121
|
*
|
|
57
122
|
* ## 参数
|
|
58
|
-
* - `
|
|
123
|
+
* - `org_name` 组织名称
|
|
124
|
+
* - `option` 仓库列表选项
|
|
59
125
|
*/
|
|
60
|
-
|
|
126
|
+
repoList(orgName: string, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export declare class CnbRelease {
|
|
130
|
+
|
|
131
|
+
constructor()
|
|
61
132
|
/**
|
|
62
|
-
*
|
|
133
|
+
* 创建一个Release
|
|
63
134
|
*
|
|
64
135
|
* ## 参数
|
|
65
136
|
* - `owner` 仓库所有者
|
|
66
137
|
* - `repo` 仓库名称
|
|
138
|
+
* - `tag_name` 标签名称
|
|
139
|
+
* - `name` Release名称, 可选
|
|
140
|
+
* - `body` Release内容, 可选
|
|
141
|
+
* - `target_commitish` 目标提交SHA或分支, 可选
|
|
67
142
|
*/
|
|
68
|
-
|
|
143
|
+
create(owner: string, repo: string, tagName: string, name?: string | undefined | null, body?: string | undefined | null, targetCommitish?: string | undefined | null): Promise<ReleaseInfo>
|
|
69
144
|
/**
|
|
70
|
-
*
|
|
145
|
+
* 获取Release信息
|
|
71
146
|
*
|
|
72
147
|
* ## 参数
|
|
73
|
-
* - `
|
|
74
|
-
* - `
|
|
148
|
+
* - `owner` 仓库所有者
|
|
149
|
+
* - `repo` 仓库名称
|
|
150
|
+
* - `tag_name` 标签名称, 可选, 为空时获取最新Release
|
|
75
151
|
*/
|
|
76
|
-
|
|
152
|
+
info(owner: string, repo: string, tagName?: string | undefined | null): Promise<ReleaseInfo>
|
|
77
153
|
/**
|
|
78
|
-
*
|
|
154
|
+
* 获取Release列表
|
|
79
155
|
*
|
|
80
156
|
* ## 参数
|
|
81
|
-
* - `
|
|
82
|
-
* - `
|
|
157
|
+
* - `owner` 仓库所有者
|
|
158
|
+
* - `repo` 仓库名称
|
|
83
159
|
*/
|
|
84
|
-
|
|
160
|
+
list(owner: string, repo: string): Promise<Array<ReleaseInfo>>
|
|
85
161
|
/**
|
|
86
|
-
*
|
|
162
|
+
* 更新Release
|
|
87
163
|
*
|
|
88
164
|
* ## 参数
|
|
89
165
|
* - `owner` 仓库所有者
|
|
90
166
|
* - `repo` 仓库名称
|
|
91
|
-
* - `
|
|
167
|
+
* - `tag_name` 标签名称
|
|
168
|
+
* - `option` 更新参数
|
|
92
169
|
*/
|
|
93
|
-
|
|
170
|
+
update(owner: string, repo: string, tagName: string, option: UpdateReleaseOptions): Promise<ReleaseInfo>
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export declare class CnbRepo {
|
|
174
|
+
|
|
175
|
+
constructor()
|
|
94
176
|
/**
|
|
95
|
-
*
|
|
177
|
+
* 获取仓库信息
|
|
96
178
|
*
|
|
97
179
|
* ## 参数
|
|
98
180
|
* - `owner` 仓库所有者
|
|
99
181
|
* - `repo` 仓库名称
|
|
100
|
-
* - `option` 提交列表选项
|
|
101
182
|
*/
|
|
102
|
-
|
|
183
|
+
info(owner: string, repo: string): Promise<RepoInfo>
|
|
103
184
|
/**
|
|
104
185
|
* 添加仓库协作者
|
|
105
186
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
187
|
+
* ## 参数
|
|
188
|
+
* - `owner` 仓库所有者
|
|
189
|
+
* - `repo` 仓库名称
|
|
190
|
+
* - `user_name` 协作者用户名
|
|
191
|
+
* - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
112
192
|
*/
|
|
113
|
-
|
|
193
|
+
addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare class CnbUser {
|
|
197
|
+
|
|
198
|
+
constructor()
|
|
114
199
|
/**
|
|
115
|
-
*
|
|
200
|
+
* 获取用户信息
|
|
116
201
|
*
|
|
117
202
|
* ## 参数
|
|
118
|
-
* - `
|
|
119
|
-
* - `name` - 仓库名称
|
|
120
|
-
* - `title` - issue标题
|
|
121
|
-
* - `body` - issue内容
|
|
122
|
-
* - `option` - 创建issue选项, 详见 [CreateIssueOptions]
|
|
203
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户信息
|
|
123
204
|
*/
|
|
124
|
-
|
|
205
|
+
info(userName?: string | undefined | null): Promise<UserInfo>
|
|
125
206
|
/**
|
|
126
|
-
*
|
|
207
|
+
* 获取用户头像地址
|
|
127
208
|
*
|
|
128
209
|
* ## 参数
|
|
129
|
-
* - `
|
|
130
|
-
* - `repo` - 仓库名称
|
|
131
|
-
* - `issue_number` - issue编号
|
|
210
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户头像
|
|
132
211
|
*/
|
|
133
|
-
|
|
212
|
+
avatarUrl(userName?: string | undefined | null): Promise<string>
|
|
134
213
|
/**
|
|
135
|
-
*
|
|
214
|
+
* 获取用户贡献信息
|
|
136
215
|
*
|
|
137
216
|
* ## 参数
|
|
138
|
-
* - `
|
|
139
|
-
* - `repo` - 仓库名称
|
|
217
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
|
|
140
218
|
*/
|
|
141
|
-
|
|
219
|
+
contribution(userName?: string | undefined | null): Promise<ContributionResult>
|
|
142
220
|
/**
|
|
143
|
-
*
|
|
221
|
+
* 获取用户仓库列表
|
|
144
222
|
*
|
|
145
223
|
* ## 参数
|
|
146
|
-
* - `
|
|
147
|
-
* - `
|
|
148
|
-
* - `issue_number` - issue编号
|
|
149
|
-
* - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
|
|
224
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
|
|
225
|
+
* - `option` 仓库列表选项
|
|
150
226
|
*/
|
|
151
|
-
|
|
227
|
+
repoList(userName?: string | undefined | null, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
152
228
|
}
|
|
153
229
|
|
|
154
230
|
export declare class GitCodeClient {
|
|
@@ -170,137 +246,213 @@ export declare class GitCodeClient {
|
|
|
170
246
|
* 支持http,https,socks5协议
|
|
171
247
|
*/
|
|
172
248
|
setProxy(proxy: string): void
|
|
173
|
-
/**
|
|
174
|
-
|
|
249
|
+
/** 获取用户操作模块 */
|
|
250
|
+
user(): GitCodeUser
|
|
251
|
+
/** 获取组织操作模块 */
|
|
252
|
+
org(): GitCodeOrg
|
|
253
|
+
/** 获取仓库操作模块 */
|
|
254
|
+
repo(): GitCodeRepo
|
|
255
|
+
/** 获取提交操作模块 */
|
|
256
|
+
commit(): GitCodeCommit
|
|
257
|
+
/** 获取Issue操作模块 */
|
|
258
|
+
issue(): GitCodeIssue
|
|
259
|
+
/** 获取Release操作模块 */
|
|
260
|
+
release(): GitCodeRelease
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export declare class GitCodeCommit {
|
|
264
|
+
|
|
265
|
+
constructor()
|
|
175
266
|
/**
|
|
176
|
-
*
|
|
267
|
+
* 获取仓库提交信息
|
|
177
268
|
*
|
|
178
269
|
* ## 参数
|
|
179
|
-
* - `
|
|
270
|
+
* - `owner` 仓库所有者
|
|
271
|
+
* - `repo` 仓库名称
|
|
272
|
+
* - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
|
|
180
273
|
*/
|
|
181
|
-
|
|
274
|
+
info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
|
|
182
275
|
/**
|
|
183
|
-
*
|
|
276
|
+
* 获取仓库提交列表
|
|
184
277
|
*
|
|
185
278
|
* ## 参数
|
|
186
|
-
* - `
|
|
279
|
+
* - `owner` 仓库所有者
|
|
280
|
+
* - `repo` 仓库名称
|
|
281
|
+
* - `option` 提交列表选项
|
|
282
|
+
*/
|
|
283
|
+
list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export declare class GitCodeIssue {
|
|
287
|
+
|
|
288
|
+
constructor()
|
|
289
|
+
/**
|
|
290
|
+
* 创建一个issue
|
|
291
|
+
*
|
|
292
|
+
* ## 参数
|
|
293
|
+
* - `owner` 仓库所有者
|
|
294
|
+
* - `repo` 仓库名称
|
|
295
|
+
* - `title` issue标题
|
|
296
|
+
* - `body` issue内容
|
|
297
|
+
* - `option` 创建issue选项
|
|
298
|
+
*/
|
|
299
|
+
create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
300
|
+
/**
|
|
301
|
+
* 获取issue信息
|
|
302
|
+
*
|
|
303
|
+
* ## 参数
|
|
304
|
+
* - `owner` 仓库所有者
|
|
305
|
+
* - `repo` 仓库名称
|
|
306
|
+
* - `issue_number` issue编号
|
|
187
307
|
*/
|
|
188
|
-
|
|
308
|
+
info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
|
|
309
|
+
/**
|
|
310
|
+
* 获取仓库所有issue信息
|
|
311
|
+
*
|
|
312
|
+
* ## 参数
|
|
313
|
+
* - `owner` 仓库所有者
|
|
314
|
+
* - `repo` 仓库名称
|
|
315
|
+
* - `option` issue列表选项
|
|
316
|
+
*/
|
|
317
|
+
list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
|
|
318
|
+
/**
|
|
319
|
+
* 更新issue信息
|
|
320
|
+
*
|
|
321
|
+
* ## 参数
|
|
322
|
+
* - `owner` 仓库所有者
|
|
323
|
+
* - `repo` 仓库名称
|
|
324
|
+
* - `issue_number` issue编号
|
|
325
|
+
* - `options` 更新issue选项
|
|
326
|
+
*/
|
|
327
|
+
update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export declare class GitCodeOrg {
|
|
331
|
+
|
|
332
|
+
constructor()
|
|
189
333
|
/**
|
|
190
334
|
* 获取组织信息
|
|
191
335
|
*
|
|
192
336
|
* ## 参数
|
|
193
337
|
* - `org_name` 组织名称
|
|
194
338
|
*/
|
|
195
|
-
|
|
339
|
+
info(orgName: string): Promise<OrgInfo>
|
|
196
340
|
/**
|
|
197
|
-
*
|
|
341
|
+
* 获取组织头像地址
|
|
198
342
|
*
|
|
199
343
|
* ## 参数
|
|
200
344
|
* - `org_name` 组织名称
|
|
201
|
-
* - `option` 仓库列表选项
|
|
202
345
|
*/
|
|
203
|
-
|
|
204
|
-
/** 获取组织头像地址 */
|
|
205
|
-
getOrgAvatarUrl(orgName: string): Promise<string>
|
|
346
|
+
avatarUrl(orgName: string): Promise<string>
|
|
206
347
|
/**
|
|
207
|
-
*
|
|
348
|
+
* 获取组织仓库列表
|
|
208
349
|
*
|
|
209
350
|
* ## 参数
|
|
210
|
-
* - `
|
|
351
|
+
* - `org_name` 组织名称
|
|
352
|
+
* - `option` 仓库列表选项
|
|
211
353
|
*/
|
|
212
|
-
|
|
354
|
+
repoList(orgName: string, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export declare class GitCodeRelease {
|
|
358
|
+
|
|
359
|
+
constructor()
|
|
213
360
|
/**
|
|
214
|
-
*
|
|
361
|
+
* 创建一个Release
|
|
215
362
|
*
|
|
216
363
|
* ## 参数
|
|
217
364
|
* - `owner` 仓库所有者
|
|
218
365
|
* - `repo` 仓库名称
|
|
366
|
+
* - `tag_name` 标签名称
|
|
367
|
+
* - `name` Release名称, 可选
|
|
368
|
+
* - `body` Release内容, 可选
|
|
369
|
+
* - `target_commitish` 目标提交SHA或分支, 可选
|
|
219
370
|
*/
|
|
220
|
-
|
|
371
|
+
create(owner: string, repo: string, tagName: string, name?: string | undefined | null, body?: string | undefined | null, targetCommitish?: string | undefined | null): Promise<ReleaseInfo>
|
|
221
372
|
/**
|
|
222
|
-
*
|
|
373
|
+
* 获取Release信息
|
|
223
374
|
*
|
|
224
375
|
* ## 参数
|
|
225
|
-
* - `
|
|
226
|
-
* - `
|
|
376
|
+
* - `owner` 仓库所有者
|
|
377
|
+
* - `repo` 仓库名称
|
|
378
|
+
* - `tag_name` 标签名称, 可选, 为空时获取最新Release
|
|
227
379
|
*/
|
|
228
|
-
|
|
380
|
+
info(owner: string, repo: string, tagName?: string | undefined | null): Promise<ReleaseInfo>
|
|
229
381
|
/**
|
|
230
|
-
*
|
|
382
|
+
* 获取Release列表
|
|
231
383
|
*
|
|
232
384
|
* ## 参数
|
|
233
|
-
* - `
|
|
234
|
-
* - `
|
|
385
|
+
* - `owner` 仓库所有者
|
|
386
|
+
* - `repo` 仓库名称
|
|
235
387
|
*/
|
|
236
|
-
|
|
388
|
+
list(owner: string, repo: string): Promise<Array<ReleaseInfo>>
|
|
237
389
|
/**
|
|
238
|
-
*
|
|
390
|
+
* 更新Release
|
|
239
391
|
*
|
|
240
392
|
* ## 参数
|
|
241
393
|
* - `owner` 仓库所有者
|
|
242
394
|
* - `repo` 仓库名称
|
|
243
|
-
* - `
|
|
395
|
+
* - `tag_name` 标签名称
|
|
396
|
+
* - `option` 更新参数
|
|
244
397
|
*/
|
|
245
|
-
|
|
398
|
+
update(owner: string, repo: string, tagName: string, option: UpdateReleaseOptions): Promise<ReleaseInfo>
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export declare class GitCodeRepo {
|
|
402
|
+
|
|
403
|
+
constructor()
|
|
246
404
|
/**
|
|
247
|
-
*
|
|
405
|
+
* 获取仓库信息
|
|
248
406
|
*
|
|
249
407
|
* ## 参数
|
|
250
408
|
* - `owner` 仓库所有者
|
|
251
409
|
* - `repo` 仓库名称
|
|
252
|
-
* - `option` 提交列表选项
|
|
253
410
|
*/
|
|
254
|
-
|
|
411
|
+
info(owner: string, repo: string): Promise<RepoInfo>
|
|
255
412
|
/**
|
|
256
413
|
* 添加仓库协作者
|
|
257
414
|
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
415
|
+
* ## 参数
|
|
416
|
+
* - `owner` 仓库所有者
|
|
417
|
+
* - `repo` 仓库名称
|
|
418
|
+
* - `user_name` 协作者用户名
|
|
419
|
+
* - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
264
420
|
*/
|
|
265
|
-
|
|
421
|
+
addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export declare class GitCodeUser {
|
|
425
|
+
|
|
426
|
+
constructor()
|
|
266
427
|
/**
|
|
267
|
-
*
|
|
428
|
+
* 获取用户信息
|
|
268
429
|
*
|
|
269
430
|
* ## 参数
|
|
270
|
-
* - `
|
|
271
|
-
* - `name` - 仓库名称
|
|
272
|
-
* - `title` - issue标题
|
|
273
|
-
* - `body` - issue内容
|
|
274
|
-
* - `option` - 创建issue选项, 详见 [CreateIssueOptions]
|
|
431
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户信息
|
|
275
432
|
*/
|
|
276
|
-
|
|
433
|
+
info(userName?: string | undefined | null): Promise<UserInfo>
|
|
277
434
|
/**
|
|
278
|
-
*
|
|
435
|
+
* 获取用户头像地址
|
|
279
436
|
*
|
|
280
437
|
* ## 参数
|
|
281
|
-
* - `
|
|
282
|
-
* - `repo` - 仓库名称
|
|
283
|
-
* - `issue_number` - issue编号
|
|
438
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户头像
|
|
284
439
|
*/
|
|
285
|
-
|
|
440
|
+
avatarUrl(userName?: string | undefined | null): Promise<string>
|
|
286
441
|
/**
|
|
287
|
-
*
|
|
442
|
+
* 获取用户贡献信息
|
|
288
443
|
*
|
|
289
444
|
* ## 参数
|
|
290
|
-
* - `
|
|
291
|
-
* - `repo` - 仓库名称
|
|
445
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
|
|
292
446
|
*/
|
|
293
|
-
|
|
447
|
+
contribution(userName?: string | undefined | null): Promise<ContributionResult>
|
|
294
448
|
/**
|
|
295
|
-
*
|
|
449
|
+
* 获取用户仓库列表
|
|
296
450
|
*
|
|
297
451
|
* ## 参数
|
|
298
|
-
* - `
|
|
299
|
-
* - `
|
|
300
|
-
* - `issue_number` - issue编号
|
|
301
|
-
* - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
|
|
452
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
|
|
453
|
+
* - `option` 仓库列表选项
|
|
302
454
|
*/
|
|
303
|
-
|
|
455
|
+
repoList(userName?: string | undefined | null, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
304
456
|
}
|
|
305
457
|
|
|
306
458
|
export declare class GiteeClient {
|
|
@@ -322,137 +474,213 @@ export declare class GiteeClient {
|
|
|
322
474
|
* 支持http,https,socks5协议
|
|
323
475
|
*/
|
|
324
476
|
setProxy(proxy: string): void
|
|
325
|
-
/**
|
|
326
|
-
|
|
477
|
+
/** 获取用户操作模块 */
|
|
478
|
+
user(): GiteeUser
|
|
479
|
+
/** 获取组织操作模块 */
|
|
480
|
+
org(): GiteeOrg
|
|
481
|
+
/** 获取仓库操作模块 */
|
|
482
|
+
repo(): GiteeRepo
|
|
483
|
+
/** 获取提交操作模块 */
|
|
484
|
+
commit(): GiteeCommit
|
|
485
|
+
/** 获取Issue操作模块 */
|
|
486
|
+
issue(): GiteeIssue
|
|
487
|
+
/** 获取Release操作模块 */
|
|
488
|
+
release(): GiteeRelease
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export declare class GiteeCommit {
|
|
492
|
+
|
|
493
|
+
constructor()
|
|
494
|
+
/**
|
|
495
|
+
* 获取仓库提交信息
|
|
496
|
+
*
|
|
497
|
+
* ## 参数
|
|
498
|
+
* - `owner` 仓库所有者
|
|
499
|
+
* - `repo` 仓库名称
|
|
500
|
+
* - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
|
|
501
|
+
*/
|
|
502
|
+
info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
|
|
503
|
+
/**
|
|
504
|
+
* 获取仓库提交列表
|
|
505
|
+
*
|
|
506
|
+
* ## 参数
|
|
507
|
+
* - `owner` 仓库所有者
|
|
508
|
+
* - `repo` 仓库名称
|
|
509
|
+
* - `option` 提交列表选项
|
|
510
|
+
*/
|
|
511
|
+
list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
export declare class GiteeIssue {
|
|
515
|
+
|
|
516
|
+
constructor()
|
|
517
|
+
/**
|
|
518
|
+
* 创建一个issue
|
|
519
|
+
*
|
|
520
|
+
* ## 参数
|
|
521
|
+
* - `owner` 仓库所有者
|
|
522
|
+
* - `repo` 仓库名称
|
|
523
|
+
* - `title` issue标题
|
|
524
|
+
* - `body` issue内容
|
|
525
|
+
* - `option` 创建issue选项
|
|
526
|
+
*/
|
|
527
|
+
create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
528
|
+
/**
|
|
529
|
+
* 获取issue信息
|
|
530
|
+
*
|
|
531
|
+
* ## 参数
|
|
532
|
+
* - `owner` 仓库所有者
|
|
533
|
+
* - `repo` 仓库名称
|
|
534
|
+
* - `issue_number` issue编号
|
|
535
|
+
*/
|
|
536
|
+
info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
|
|
327
537
|
/**
|
|
328
|
-
*
|
|
538
|
+
* 获取仓库所有issue信息
|
|
329
539
|
*
|
|
330
540
|
* ## 参数
|
|
331
|
-
* - `
|
|
541
|
+
* - `owner` 仓库所有者
|
|
542
|
+
* - `repo` 仓库名称
|
|
543
|
+
* - `option` issue列表选项
|
|
332
544
|
*/
|
|
333
|
-
|
|
545
|
+
list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
|
|
334
546
|
/**
|
|
335
|
-
*
|
|
547
|
+
* 更新issue信息
|
|
336
548
|
*
|
|
337
549
|
* ## 参数
|
|
338
|
-
* - `
|
|
550
|
+
* - `owner` 仓库所有者
|
|
551
|
+
* - `repo` 仓库名称
|
|
552
|
+
* - `issue_number` issue编号
|
|
553
|
+
* - `options` 更新issue选项
|
|
339
554
|
*/
|
|
340
|
-
|
|
555
|
+
update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export declare class GiteeOrg {
|
|
559
|
+
|
|
560
|
+
constructor()
|
|
341
561
|
/**
|
|
342
562
|
* 获取组织信息
|
|
343
563
|
*
|
|
344
564
|
* ## 参数
|
|
345
565
|
* - `org_name` 组织名称
|
|
346
566
|
*/
|
|
347
|
-
|
|
567
|
+
info(orgName: string): Promise<OrgInfo>
|
|
348
568
|
/**
|
|
349
|
-
*
|
|
569
|
+
* 获取组织头像地址
|
|
350
570
|
*
|
|
351
571
|
* ## 参数
|
|
352
572
|
* - `org_name` 组织名称
|
|
353
|
-
* - `option` 仓库列表选项
|
|
354
573
|
*/
|
|
355
|
-
|
|
356
|
-
/** 获取组织头像地址 */
|
|
357
|
-
getOrgAvatarUrl(orgName: string): Promise<string>
|
|
574
|
+
avatarUrl(orgName: string): Promise<string>
|
|
358
575
|
/**
|
|
359
|
-
*
|
|
576
|
+
* 获取组织仓库列表
|
|
360
577
|
*
|
|
361
578
|
* ## 参数
|
|
362
|
-
* - `
|
|
579
|
+
* - `org_name` 组织名称
|
|
580
|
+
* - `option` 仓库列表选项
|
|
363
581
|
*/
|
|
364
|
-
|
|
582
|
+
repoList(orgName: string, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export declare class GiteeRelease {
|
|
586
|
+
|
|
587
|
+
constructor()
|
|
365
588
|
/**
|
|
366
|
-
*
|
|
589
|
+
* 创建一个Release
|
|
367
590
|
*
|
|
368
591
|
* ## 参数
|
|
369
592
|
* - `owner` 仓库所有者
|
|
370
593
|
* - `repo` 仓库名称
|
|
594
|
+
* - `tag_name` 标签名称
|
|
595
|
+
* - `name` Release名称, 可选
|
|
596
|
+
* - `body` Release内容, 可选
|
|
597
|
+
* - `target_commitish` 目标提交SHA或分支, 可选
|
|
371
598
|
*/
|
|
372
|
-
|
|
599
|
+
create(owner: string, repo: string, tagName: string, name?: string | undefined | null, body?: string | undefined | null, targetCommitish?: string | undefined | null): Promise<ReleaseInfo>
|
|
373
600
|
/**
|
|
374
|
-
*
|
|
601
|
+
* 获取Release信息
|
|
375
602
|
*
|
|
376
603
|
* ## 参数
|
|
377
|
-
* - `
|
|
378
|
-
* - `
|
|
604
|
+
* - `owner` 仓库所有者
|
|
605
|
+
* - `repo` 仓库名称
|
|
606
|
+
* - `tag_name` 标签名称, 可选, 为空时获取最新Release
|
|
379
607
|
*/
|
|
380
|
-
|
|
608
|
+
info(owner: string, repo: string, tagName?: string | undefined | null): Promise<ReleaseInfo>
|
|
381
609
|
/**
|
|
382
|
-
*
|
|
610
|
+
* 获取Release列表
|
|
383
611
|
*
|
|
384
612
|
* ## 参数
|
|
385
|
-
* - `
|
|
386
|
-
* - `
|
|
613
|
+
* - `owner` 仓库所有者
|
|
614
|
+
* - `repo` 仓库名称
|
|
387
615
|
*/
|
|
388
|
-
|
|
616
|
+
list(owner: string, repo: string): Promise<Array<ReleaseInfo>>
|
|
389
617
|
/**
|
|
390
|
-
*
|
|
618
|
+
* 更新Release
|
|
391
619
|
*
|
|
392
620
|
* ## 参数
|
|
393
621
|
* - `owner` 仓库所有者
|
|
394
622
|
* - `repo` 仓库名称
|
|
395
|
-
* - `
|
|
623
|
+
* - `tag_name` 标签名称
|
|
624
|
+
* - `option` 更新参数
|
|
396
625
|
*/
|
|
397
|
-
|
|
626
|
+
update(owner: string, repo: string, tagName: string, option: UpdateReleaseOptions): Promise<ReleaseInfo>
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
export declare class GiteeRepo {
|
|
630
|
+
|
|
631
|
+
constructor()
|
|
398
632
|
/**
|
|
399
|
-
*
|
|
633
|
+
* 获取仓库信息
|
|
400
634
|
*
|
|
401
635
|
* ## 参数
|
|
402
636
|
* - `owner` 仓库所有者
|
|
403
637
|
* - `repo` 仓库名称
|
|
404
|
-
* - `option` 提交列表选项
|
|
405
638
|
*/
|
|
406
|
-
|
|
639
|
+
info(owner: string, repo: string): Promise<RepoInfo>
|
|
407
640
|
/**
|
|
408
641
|
* 添加仓库协作者
|
|
409
642
|
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
* * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
643
|
+
* ## 参数
|
|
644
|
+
* - `owner` 仓库所有者
|
|
645
|
+
* - `repo` 仓库名称
|
|
646
|
+
* - `user_name` 协作者用户名
|
|
647
|
+
* - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
416
648
|
*/
|
|
417
|
-
|
|
649
|
+
addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export declare class GiteeUser {
|
|
653
|
+
|
|
654
|
+
constructor()
|
|
418
655
|
/**
|
|
419
|
-
*
|
|
656
|
+
* 获取用户信息
|
|
420
657
|
*
|
|
421
658
|
* ## 参数
|
|
422
|
-
* - `
|
|
423
|
-
* - `name` - 仓库名称
|
|
424
|
-
* - `title` - issue标题
|
|
425
|
-
* - `body` - issue内容
|
|
426
|
-
* - `option` - 创建issue选项, 详见 [CreateIssueOptions]
|
|
659
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户信息
|
|
427
660
|
*/
|
|
428
|
-
|
|
661
|
+
info(userName?: string | undefined | null): Promise<UserInfo>
|
|
429
662
|
/**
|
|
430
|
-
*
|
|
663
|
+
* 获取用户头像地址
|
|
431
664
|
*
|
|
432
665
|
* ## 参数
|
|
433
|
-
* - `
|
|
434
|
-
* - `repo` - 仓库名称
|
|
435
|
-
* - `issue_number` - issue编号
|
|
666
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户头像
|
|
436
667
|
*/
|
|
437
|
-
|
|
668
|
+
avatarUrl(userName?: string | undefined | null): Promise<string>
|
|
438
669
|
/**
|
|
439
|
-
*
|
|
670
|
+
* 获取用户贡献信息
|
|
440
671
|
*
|
|
441
672
|
* ## 参数
|
|
442
|
-
* - `
|
|
443
|
-
* - `repo` - 仓库名称
|
|
673
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
|
|
444
674
|
*/
|
|
445
|
-
|
|
675
|
+
contribution(userName?: string | undefined | null): Promise<ContributionResult>
|
|
446
676
|
/**
|
|
447
|
-
*
|
|
677
|
+
* 获取用户仓库列表
|
|
448
678
|
*
|
|
449
679
|
* ## 参数
|
|
450
|
-
* - `
|
|
451
|
-
* - `
|
|
452
|
-
* - `issue_number` - issue编号
|
|
453
|
-
* - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
|
|
680
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
|
|
681
|
+
* - `option` 仓库列表选项
|
|
454
682
|
*/
|
|
455
|
-
|
|
683
|
+
repoList(userName?: string | undefined | null, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
456
684
|
}
|
|
457
685
|
|
|
458
686
|
export declare class GithubClient {
|
|
@@ -474,144 +702,227 @@ export declare class GithubClient {
|
|
|
474
702
|
* 支持http,https,socks5协议
|
|
475
703
|
*/
|
|
476
704
|
setProxy(proxy: string): void
|
|
477
|
-
/**
|
|
478
|
-
|
|
705
|
+
/** 获取用户操作模块 */
|
|
706
|
+
user(): GithubUser
|
|
707
|
+
/** 获取组织操作模块 */
|
|
708
|
+
org(): GithubOrg
|
|
709
|
+
/** 获取仓库操作模块 */
|
|
710
|
+
repo(): GithubRepo
|
|
711
|
+
/** 获取提交操作模块 */
|
|
712
|
+
commit(): GithubCommit
|
|
713
|
+
/** 获取Issue操作模块 */
|
|
714
|
+
issue(): GithubIssue
|
|
715
|
+
/** 获取Release操作模块 */
|
|
716
|
+
release(): GithubRelease
|
|
479
717
|
/**
|
|
480
|
-
*
|
|
718
|
+
* 设置反向代理
|
|
481
719
|
*
|
|
482
720
|
* ## 参数
|
|
483
|
-
* - `
|
|
721
|
+
* - `url` - 反向代理地址, 反代地址需要同时支持`github.com`和`api.github.com`
|
|
484
722
|
*/
|
|
485
|
-
|
|
723
|
+
setReverseProxy(url: string): Promise<void>
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export declare class GithubCommit {
|
|
727
|
+
|
|
728
|
+
constructor()
|
|
486
729
|
/**
|
|
487
|
-
*
|
|
730
|
+
* 获取仓库提交信息
|
|
488
731
|
*
|
|
489
732
|
* ## 参数
|
|
490
|
-
* - `
|
|
733
|
+
* - `owner` 仓库所有者
|
|
734
|
+
* - `repo` 仓库名称
|
|
735
|
+
* - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
|
|
491
736
|
*/
|
|
492
|
-
|
|
737
|
+
info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
|
|
493
738
|
/**
|
|
494
|
-
*
|
|
739
|
+
* 获取仓库提交列表
|
|
495
740
|
*
|
|
496
741
|
* ## 参数
|
|
497
|
-
* - `
|
|
742
|
+
* - `owner` 仓库所有者
|
|
743
|
+
* - `repo` 仓库名称
|
|
744
|
+
* - `option` 提交列表选项
|
|
498
745
|
*/
|
|
499
|
-
|
|
746
|
+
list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export declare class GithubIssue {
|
|
750
|
+
|
|
751
|
+
constructor()
|
|
500
752
|
/**
|
|
501
|
-
*
|
|
753
|
+
* 创建一个issue
|
|
502
754
|
*
|
|
503
755
|
* ## 参数
|
|
504
|
-
* - `
|
|
505
|
-
* - `
|
|
756
|
+
* - `owner` 仓库所有者
|
|
757
|
+
* - `repo` 仓库名称
|
|
758
|
+
* - `title` issue标题
|
|
759
|
+
* - `body` issue内容
|
|
760
|
+
* - `option` 创建issue选项
|
|
506
761
|
*/
|
|
507
|
-
|
|
508
|
-
/** 获取组织头像地址 */
|
|
509
|
-
getOrgAvatarUrl(orgName: string): Promise<string>
|
|
762
|
+
create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
510
763
|
/**
|
|
511
|
-
*
|
|
764
|
+
* 获取issue信息
|
|
512
765
|
*
|
|
513
766
|
* ## 参数
|
|
514
|
-
* - `
|
|
767
|
+
* - `owner` 仓库所有者
|
|
768
|
+
* - `repo` 仓库名称
|
|
769
|
+
* - `issue_number` issue编号
|
|
515
770
|
*/
|
|
516
|
-
|
|
771
|
+
info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
|
|
517
772
|
/**
|
|
518
|
-
*
|
|
773
|
+
* 获取仓库所有issue信息
|
|
519
774
|
*
|
|
520
775
|
* ## 参数
|
|
521
776
|
* - `owner` 仓库所有者
|
|
522
777
|
* - `repo` 仓库名称
|
|
778
|
+
* - `option` issue列表选项
|
|
523
779
|
*/
|
|
524
|
-
|
|
780
|
+
list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
|
|
525
781
|
/**
|
|
526
|
-
*
|
|
782
|
+
* 更新issue信息
|
|
527
783
|
*
|
|
528
784
|
* ## 参数
|
|
529
|
-
* - `
|
|
530
|
-
* - `
|
|
785
|
+
* - `owner` 仓库所有者
|
|
786
|
+
* - `repo` 仓库名称
|
|
787
|
+
* - `issue_number` issue编号
|
|
788
|
+
* - `options` 更新issue选项
|
|
789
|
+
*/
|
|
790
|
+
update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
export declare class GithubOrg {
|
|
794
|
+
|
|
795
|
+
constructor()
|
|
796
|
+
/**
|
|
797
|
+
* 获取组织信息
|
|
798
|
+
*
|
|
799
|
+
* ## 参数
|
|
800
|
+
* - `org_name` 组织名称
|
|
531
801
|
*/
|
|
532
|
-
|
|
802
|
+
info(orgName: string): Promise<OrgInfo>
|
|
533
803
|
/**
|
|
534
|
-
*
|
|
804
|
+
* 获取组织头像地址
|
|
535
805
|
*
|
|
536
806
|
* ## 参数
|
|
537
|
-
* - `
|
|
807
|
+
* - `org_name` 组织名称
|
|
808
|
+
*/
|
|
809
|
+
avatarUrl(orgName: string): Promise<string>
|
|
810
|
+
/**
|
|
811
|
+
* 获取组织仓库列表
|
|
812
|
+
*
|
|
813
|
+
* ## 参数
|
|
814
|
+
* - `org_name` 组织名称
|
|
538
815
|
* - `option` 仓库列表选项
|
|
539
816
|
*/
|
|
540
|
-
|
|
817
|
+
repoList(orgName: string, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
export declare class GithubRelease {
|
|
821
|
+
|
|
822
|
+
constructor()
|
|
541
823
|
/**
|
|
542
|
-
*
|
|
824
|
+
* 创建一个Release
|
|
543
825
|
*
|
|
544
826
|
* ## 参数
|
|
545
827
|
* - `owner` 仓库所有者
|
|
546
828
|
* - `repo` 仓库名称
|
|
547
|
-
* - `
|
|
829
|
+
* - `tag_name` 标签名称
|
|
830
|
+
* - `name` Release名称, 可选
|
|
831
|
+
* - `body` Release内容, 可选
|
|
832
|
+
* - `target_commitish` 目标提交SHA或分支, 可选
|
|
548
833
|
*/
|
|
549
|
-
|
|
834
|
+
create(owner: string, repo: string, tagName: string, name?: string | undefined | null, body?: string | undefined | null, targetCommitish?: string | undefined | null): Promise<ReleaseInfo>
|
|
550
835
|
/**
|
|
551
|
-
*
|
|
836
|
+
* 获取Release信息
|
|
552
837
|
*
|
|
553
838
|
* ## 参数
|
|
554
839
|
* - `owner` 仓库所有者
|
|
555
840
|
* - `repo` 仓库名称
|
|
556
|
-
* - `
|
|
841
|
+
* - `tag_name` 标签名称, 可选, 为空时获取最新Release
|
|
557
842
|
*/
|
|
558
|
-
|
|
843
|
+
info(owner: string, repo: string, tagName?: string | undefined | null): Promise<ReleaseInfo>
|
|
559
844
|
/**
|
|
560
|
-
*
|
|
845
|
+
* 获取Release列表
|
|
561
846
|
*
|
|
562
|
-
*
|
|
847
|
+
* ## 参数
|
|
848
|
+
* - `owner` 仓库所有者
|
|
849
|
+
* - `repo` 仓库名称
|
|
850
|
+
*/
|
|
851
|
+
list(owner: string, repo: string): Promise<Array<ReleaseInfo>>
|
|
852
|
+
/**
|
|
853
|
+
* 更新Release
|
|
854
|
+
*
|
|
855
|
+
* ## 参数
|
|
856
|
+
* - `owner` 仓库所有者
|
|
857
|
+
* - `repo` 仓库名称
|
|
858
|
+
* - `tag_name` 标签名称
|
|
859
|
+
* - `option` 更新参数
|
|
860
|
+
*/
|
|
861
|
+
update(owner: string, repo: string, tagName: string, option: UpdateReleaseOptions): Promise<ReleaseInfo>
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
export declare class GithubRepo {
|
|
865
|
+
|
|
866
|
+
constructor()
|
|
867
|
+
/**
|
|
868
|
+
* 获取仓库信息
|
|
563
869
|
*
|
|
564
|
-
*
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
* * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
870
|
+
* ## 参数
|
|
871
|
+
* - `owner` 仓库所有者
|
|
872
|
+
* - `repo` 仓库名称
|
|
568
873
|
*/
|
|
569
|
-
|
|
874
|
+
info(owner: string, repo: string): Promise<RepoInfo>
|
|
570
875
|
/**
|
|
571
|
-
*
|
|
876
|
+
* 添加仓库协作者
|
|
572
877
|
*
|
|
573
878
|
* ## 参数
|
|
574
|
-
* - `owner`
|
|
575
|
-
* - `
|
|
576
|
-
* - `
|
|
577
|
-
* - `
|
|
578
|
-
* - `option` - 创建issue选项, 详见 [CreateIssueOptions]
|
|
879
|
+
* - `owner` 仓库所有者
|
|
880
|
+
* - `repo` 仓库名称
|
|
881
|
+
* - `user_name` 协作者用户名
|
|
882
|
+
* - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
|
|
579
883
|
*/
|
|
580
|
-
|
|
884
|
+
addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
export declare class GithubUser {
|
|
888
|
+
|
|
889
|
+
constructor()
|
|
581
890
|
/**
|
|
582
|
-
*
|
|
891
|
+
* 获取用户信息
|
|
583
892
|
*
|
|
584
893
|
* ## 参数
|
|
585
|
-
* - `
|
|
586
|
-
* - `repo` - 仓库名称
|
|
587
|
-
* - `issue_number` - issue编号
|
|
894
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户信息
|
|
588
895
|
*/
|
|
589
|
-
|
|
896
|
+
info(userName?: string | undefined | null): Promise<UserInfo>
|
|
590
897
|
/**
|
|
591
|
-
*
|
|
898
|
+
* 获取用户头像地址
|
|
592
899
|
*
|
|
593
900
|
* ## 参数
|
|
594
|
-
* - `
|
|
595
|
-
* - `repo` - 仓库名称
|
|
901
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户头像
|
|
596
902
|
*/
|
|
597
|
-
|
|
903
|
+
avatarUrl(userName?: string | undefined | null): Promise<string>
|
|
598
904
|
/**
|
|
599
|
-
*
|
|
905
|
+
* 获取用户贡献信息
|
|
600
906
|
*
|
|
601
907
|
* ## 参数
|
|
602
|
-
* - `
|
|
603
|
-
* - `repo` - 仓库名称
|
|
604
|
-
* - `issue_number` - issue编号
|
|
605
|
-
* - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
|
|
908
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
|
|
606
909
|
*/
|
|
607
|
-
|
|
910
|
+
contribution(userName?: string | undefined | null): Promise<ContributionResult>
|
|
608
911
|
/**
|
|
609
|
-
*
|
|
912
|
+
* 获取用户仓库列表
|
|
610
913
|
*
|
|
611
914
|
* ## 参数
|
|
612
|
-
* - `
|
|
915
|
+
* - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
|
|
916
|
+
* - `option` 仓库列表选项
|
|
613
917
|
*/
|
|
614
|
-
|
|
918
|
+
repoList(userName?: string | undefined | null, option?: RepoListOptions | undefined | null): Promise<Array<RepoInfo>>
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
export interface AssetsInfo {
|
|
922
|
+
/** 资源文件名 */
|
|
923
|
+
name: string
|
|
924
|
+
/** 资源下载地址 */
|
|
925
|
+
url: string
|
|
615
926
|
}
|
|
616
927
|
|
|
617
928
|
export declare const enum CollaboratorPermission {
|
|
@@ -646,8 +957,8 @@ export interface CommitInfo {
|
|
|
646
957
|
commit: CommitData
|
|
647
958
|
/** 提交统计信息 */
|
|
648
959
|
stats: StatsInfo
|
|
649
|
-
/**
|
|
650
|
-
|
|
960
|
+
/** 文件差异状态 */
|
|
961
|
+
files: Array<FileInfo>
|
|
651
962
|
}
|
|
652
963
|
|
|
653
964
|
export interface CommitListOptions {
|
|
@@ -701,6 +1012,36 @@ export interface CreateIssueOptions {
|
|
|
701
1012
|
assignees?: Array<string>
|
|
702
1013
|
}
|
|
703
1014
|
|
|
1015
|
+
export interface FileInfo {
|
|
1016
|
+
/** 文件名 */
|
|
1017
|
+
fileName: string
|
|
1018
|
+
/** 文件状态 */
|
|
1019
|
+
status: FileStatus
|
|
1020
|
+
/** 新增行数 */
|
|
1021
|
+
additions: number
|
|
1022
|
+
/** 删除行数 */
|
|
1023
|
+
deletions: number
|
|
1024
|
+
/** 修改行数 */
|
|
1025
|
+
changes: number
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
export declare const enum FileStatus {
|
|
1029
|
+
/** 新增文件 */
|
|
1030
|
+
Added = 'Added',
|
|
1031
|
+
/** 修改文件 */
|
|
1032
|
+
Modified = 'Modified',
|
|
1033
|
+
/** 删除文件 */
|
|
1034
|
+
Deleted = 'Deleted',
|
|
1035
|
+
/** 重命名文件 */
|
|
1036
|
+
Renamed = 'Renamed',
|
|
1037
|
+
/** 复制文件 */
|
|
1038
|
+
Copied = 'Copied',
|
|
1039
|
+
/** 文件已变更 */
|
|
1040
|
+
Changed = 'Changed',
|
|
1041
|
+
/** 文件未变更 */
|
|
1042
|
+
UnChanged = 'UnChanged'
|
|
1043
|
+
}
|
|
1044
|
+
|
|
704
1045
|
export interface IssueInfo {
|
|
705
1046
|
/** 议题编号 */
|
|
706
1047
|
number: string
|
|
@@ -768,11 +1109,30 @@ export interface OrgInfo {
|
|
|
768
1109
|
followCount: number
|
|
769
1110
|
}
|
|
770
1111
|
|
|
771
|
-
export interface
|
|
772
|
-
/**
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
|
|
1112
|
+
export interface ReleaseAuthorInfo {
|
|
1113
|
+
/** 用户登录名 */
|
|
1114
|
+
login: string
|
|
1115
|
+
/** 用户头像地址 */
|
|
1116
|
+
avatarUrl: string
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
export interface ReleaseInfo {
|
|
1120
|
+
/** 标签名 */
|
|
1121
|
+
tagName: string
|
|
1122
|
+
/** 目标提交分支或 SHA */
|
|
1123
|
+
targetCommitish: string
|
|
1124
|
+
/** 是否为预发布版本 */
|
|
1125
|
+
prerelease: boolean
|
|
1126
|
+
/** 发布名称 */
|
|
1127
|
+
name: string
|
|
1128
|
+
/** 发布说明内容 */
|
|
1129
|
+
body?: string
|
|
1130
|
+
/** 发布作者信息 */
|
|
1131
|
+
author: ReleaseAuthorInfo
|
|
1132
|
+
/** 创建时间 */
|
|
1133
|
+
createdAt: Date
|
|
1134
|
+
/** 附件资源列表 */
|
|
1135
|
+
assets: Array<AssetsInfo>
|
|
776
1136
|
}
|
|
777
1137
|
|
|
778
1138
|
export interface RepoInfo {
|
|
@@ -804,7 +1164,7 @@ export interface RepoInfo {
|
|
|
804
1164
|
pushedAt: Date
|
|
805
1165
|
}
|
|
806
1166
|
|
|
807
|
-
export interface
|
|
1167
|
+
export interface RepoListOptions {
|
|
808
1168
|
/** 每页数量,默认 30,最大 100 */
|
|
809
1169
|
perPage?: number
|
|
810
1170
|
/** 页码,默认 1 */
|
|
@@ -843,6 +1203,13 @@ export interface UpdateIssueOptions {
|
|
|
843
1203
|
state?: StateType
|
|
844
1204
|
}
|
|
845
1205
|
|
|
1206
|
+
export interface UpdateReleaseOptions {
|
|
1207
|
+
/** 发行名称 */
|
|
1208
|
+
name?: string
|
|
1209
|
+
/** 发行正文 */
|
|
1210
|
+
body?: string
|
|
1211
|
+
}
|
|
1212
|
+
|
|
846
1213
|
export interface UserInfo {
|
|
847
1214
|
/** 登录用户名 */
|
|
848
1215
|
login: string
|