@puniyu/nipaw 1.8.0 → 1.8.1

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +394 -274
  2. package/dist/index.js +73 -53
  3. package/package.json +7 -7
package/dist/index.d.ts CHANGED
@@ -18,137 +18,167 @@ export declare class CnbClient {
18
18
  * 支持http,https,socks5协议
19
19
  */
20
20
  setProxy(proxy: string): void
21
- /** 获取当前登录用户信息 */
22
- getUserInfo(): Promise<UserInfo>
21
+ /** 获取用户操作模块 */
22
+ user(): CnbUser
23
+ /** 获取组织操作模块 */
24
+ org(): CnbOrg
25
+ /** 获取仓库操作模块 */
26
+ repo(): CnbRepo
27
+ /** 获取提交操作模块 */
28
+ commit(): CnbCommit
29
+ /** 获取Issue操作模块 */
30
+ issue(): CnbIssue
31
+ }
32
+
33
+ export declare class CnbCommit {
34
+
35
+ constructor()
23
36
  /**
24
- * 获取指定用户信息
37
+ * 获取仓库提交信息
25
38
  *
26
39
  * ## 参数
27
- * - `user_name` 用户名称
40
+ * - `owner` 仓库所有者
41
+ * - `repo` 仓库名称
42
+ * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
28
43
  */
29
- getUserInfoWithName(name: string): Promise<UserInfo>
44
+ info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
30
45
  /**
31
- * 获取指定用户贡献信息
46
+ * 获取仓库提交列表
32
47
  *
33
48
  * ## 参数
34
- * - `user_name` 用户名称
49
+ * - `owner` 仓库所有者
50
+ * - `repo` 仓库名称
51
+ * - `option` 提交列表选项
35
52
  */
36
- getUserContribution(userName: string): Promise<ContributionResult>
53
+ list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
54
+ }
55
+
56
+ export declare class CnbIssue {
57
+
58
+ constructor()
37
59
  /**
38
- * 获取组织信息
60
+ * 创建一个issue
39
61
  *
40
62
  * ## 参数
41
- * - `org_name` 组织名称
63
+ * - `owner` 仓库所有者
64
+ * - `repo` 仓库名称
65
+ * - `title` issue标题
66
+ * - `body` issue内容
67
+ * - `option` 创建issue选项
42
68
  */
43
- getOrgInfo(orgName: string): Promise<OrgInfo>
69
+ create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
44
70
  /**
45
- * 获取组织仓库列表
71
+ * 获取issue信息
46
72
  *
47
73
  * ## 参数
48
- * - `org_name` 组织名称
49
- * - `option` 仓库列表选项
74
+ * - `owner` 仓库所有者
75
+ * - `repo` 仓库名称
76
+ * - `issue_number` issue编号
50
77
  */
51
- getOrgRepos(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
52
- /** 获取组织头像地址 */
53
- getOrgAvatarUrl(orgName: string): Promise<string>
78
+ info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
54
79
  /**
55
- * 获取指定用户头像地址
80
+ * 获取仓库所有issue信息
56
81
  *
57
82
  * ## 参数
58
- * - `user_name` 用户名称
83
+ * - `owner` 仓库所有者
84
+ * - `repo` 仓库名称
85
+ * - `option` issue列表选项
59
86
  */
60
- getUserAvatarUrl(userName: string): Promise<string>
87
+ list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
61
88
  /**
62
- * 获取仓库信息
89
+ * 更新issue信息
63
90
  *
64
91
  * ## 参数
65
92
  * - `owner` 仓库所有者
66
93
  * - `repo` 仓库名称
94
+ * - `issue_number` issue编号
95
+ * - `options` 更新issue选项
67
96
  */
68
- getRepoInfo(owner: string, repo: string): Promise<RepoInfo>
97
+ update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
98
+ }
99
+
100
+ export declare class CnbOrg {
101
+
102
+ constructor()
69
103
  /**
70
- * 获取指定用户仓库列表
104
+ * 获取组织信息
71
105
  *
72
106
  * ## 参数
73
- * - `user_name` 用户名称
74
- * - `option` 仓库列表选项
107
+ * - `org_name` 组织名称
75
108
  */
76
- getUserRepos(option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
109
+ info(orgName: string): Promise<OrgInfo>
77
110
  /**
78
- * 获取指定用户仓库列表
111
+ * 获取组织头像地址
79
112
  *
80
113
  * ## 参数
81
- * - `user_name` 用户名称
82
- * - `option` 仓库列表选项
114
+ * - `org_name` 组织名称
83
115
  */
84
- getUserReposWithName(userName: string, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
116
+ avatarUrl(orgName: string): Promise<string>
85
117
  /**
86
- * 获取仓库提交信息
118
+ * 获取组织仓库列表
87
119
  *
88
120
  * ## 参数
89
- * - `owner` 仓库所有者
90
- * - `repo` 仓库名称
91
- * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
121
+ * - `org_name` 组织名称
122
+ * - `option` 仓库列表选项
92
123
  */
93
- getCommitInfo(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
124
+ repoList(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
125
+ }
126
+
127
+ export declare class CnbRepo {
128
+
129
+ constructor()
94
130
  /**
95
- * 获取仓库提交列表
131
+ * 获取仓库信息
96
132
  *
97
133
  * ## 参数
98
134
  * - `owner` 仓库所有者
99
135
  * - `repo` 仓库名称
100
- * - `option` 提交列表选项
101
136
  */
102
- getCommitInfos(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
137
+ info(owner: string, repo: string): Promise<RepoInfo>
103
138
  /**
104
139
  * 添加仓库协作者
105
140
  *
106
- * # 参数
107
- *
108
- * * `owner` - 仓库所有者
109
- * * `repo` - 仓库名称
110
- * * `user_name` - 协作者用户名
111
- * * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
141
+ * ## 参数
142
+ * - `owner` 仓库所有者
143
+ * - `repo` 仓库名称
144
+ * - `user_name` 协作者用户名
145
+ * - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
112
146
  */
113
- addRepoCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
147
+ addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
148
+ }
149
+
150
+ export declare class CnbUser {
151
+
152
+ constructor()
114
153
  /**
115
- * 创建一个issue
154
+ * 获取用户信息
116
155
  *
117
156
  * ## 参数
118
- * - `owner` - 仓库所有者
119
- * - `name` - 仓库名称
120
- * - `title` - issue标题
121
- * - `body` - issue内容
122
- * - `option` - 创建issue选项, 详见 [CreateIssueOptions]
157
+ * - `user_name` 用户名称, 为空时获取当前登录用户信息
123
158
  */
124
- createIssue(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
159
+ info(userName?: string | undefined | null): Promise<UserInfo>
125
160
  /**
126
- * 获取issue信息
161
+ * 获取用户头像地址
127
162
  *
128
163
  * ## 参数
129
- * - `owner` - 仓库所有者
130
- * - `repo` - 仓库名称
131
- * - `issue_number` - issue编号
164
+ * - `user_name` 用户名称, 为空时获取当前登录用户头像
132
165
  */
133
- getIssueInfo(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
166
+ avatarUrl(userName?: string | undefined | null): Promise<string>
134
167
  /**
135
- * 获取仓库所有issue信息
168
+ * 获取用户贡献信息
136
169
  *
137
170
  * ## 参数
138
- * - `owner` - 仓库所有者
139
- * - `repo` - 仓库名称
171
+ * - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
140
172
  */
141
- getIssueList(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
173
+ contribution(userName?: string | undefined | null): Promise<ContributionResult>
142
174
  /**
143
- * 更新issue信息
175
+ * 获取用户仓库列表
144
176
  *
145
177
  * ## 参数
146
- * - `owner` - 仓库所有者
147
- * - `repo` - 仓库名称
148
- * - `issue_number` - issue编号
149
- * - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
178
+ * - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
179
+ * - `option` 仓库列表选项
150
180
  */
151
- updateIssue(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
181
+ repoList(userName?: string | undefined | null, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
152
182
  }
153
183
 
154
184
  export declare class GitCodeClient {
@@ -170,137 +200,167 @@ export declare class GitCodeClient {
170
200
  * 支持http,https,socks5协议
171
201
  */
172
202
  setProxy(proxy: string): void
173
- /** 获取当前登录用户信息 */
174
- getUserInfo(): Promise<UserInfo>
203
+ /** 获取用户操作模块 */
204
+ user(): GitCodeUser
205
+ /** 获取组织操作模块 */
206
+ org(): GitCodeOrg
207
+ /** 获取仓库操作模块 */
208
+ repo(): GitCodeRepo
209
+ /** 获取提交操作模块 */
210
+ commit(): GitCodeCommit
211
+ /** 获取Issue操作模块 */
212
+ issue(): GitCodeIssue
213
+ }
214
+
215
+ export declare class GitCodeCommit {
216
+
217
+ constructor()
175
218
  /**
176
- * 获取指定用户信息
219
+ * 获取仓库提交信息
177
220
  *
178
221
  * ## 参数
179
- * - `user_name` 用户名称
222
+ * - `owner` 仓库所有者
223
+ * - `repo` 仓库名称
224
+ * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
180
225
  */
181
- getUserInfoWithName(name: string): Promise<UserInfo>
226
+ info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
182
227
  /**
183
- * 获取指定用户贡献信息
228
+ * 获取仓库提交列表
184
229
  *
185
230
  * ## 参数
186
- * - `user_name` 用户名称
231
+ * - `owner` 仓库所有者
232
+ * - `repo` 仓库名称
233
+ * - `option` 提交列表选项
187
234
  */
188
- getUserContribution(userName: string): Promise<ContributionResult>
235
+ list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
236
+ }
237
+
238
+ export declare class GitCodeIssue {
239
+
240
+ constructor()
189
241
  /**
190
- * 获取组织信息
242
+ * 创建一个issue
191
243
  *
192
244
  * ## 参数
193
- * - `org_name` 组织名称
245
+ * - `owner` 仓库所有者
246
+ * - `repo` 仓库名称
247
+ * - `title` issue标题
248
+ * - `body` issue内容
249
+ * - `option` 创建issue选项
194
250
  */
195
- getOrgInfo(orgName: string): Promise<OrgInfo>
251
+ create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
196
252
  /**
197
- * 获取组织仓库列表
253
+ * 获取issue信息
198
254
  *
199
255
  * ## 参数
200
- * - `org_name` 组织名称
201
- * - `option` 仓库列表选项
256
+ * - `owner` 仓库所有者
257
+ * - `repo` 仓库名称
258
+ * - `issue_number` issue编号
202
259
  */
203
- getOrgRepos(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
204
- /** 获取组织头像地址 */
205
- getOrgAvatarUrl(orgName: string): Promise<string>
260
+ info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
206
261
  /**
207
- * 获取指定用户头像地址
262
+ * 获取仓库所有issue信息
208
263
  *
209
264
  * ## 参数
210
- * - `user_name` 用户名称
265
+ * - `owner` 仓库所有者
266
+ * - `repo` 仓库名称
267
+ * - `option` issue列表选项
211
268
  */
212
- getUserAvatarUrl(userName: string): Promise<string>
269
+ list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
213
270
  /**
214
- * 获取仓库信息
271
+ * 更新issue信息
215
272
  *
216
273
  * ## 参数
217
274
  * - `owner` 仓库所有者
218
275
  * - `repo` 仓库名称
276
+ * - `issue_number` issue编号
277
+ * - `options` 更新issue选项
219
278
  */
220
- getRepoInfo(owner: string, repo: string): Promise<RepoInfo>
279
+ update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
280
+ }
281
+
282
+ export declare class GitCodeOrg {
283
+
284
+ constructor()
221
285
  /**
222
- * 获取指定用户仓库列表
286
+ * 获取组织信息
223
287
  *
224
288
  * ## 参数
225
- * - `user_name` 用户名称
226
- * - `option` 仓库列表选项
289
+ * - `org_name` 组织名称
227
290
  */
228
- getUserRepos(option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
291
+ info(orgName: string): Promise<OrgInfo>
229
292
  /**
230
- * 获取指定用户仓库列表
293
+ * 获取组织头像地址
231
294
  *
232
295
  * ## 参数
233
- * - `user_name` 用户名称
234
- * - `option` 仓库列表选项
296
+ * - `org_name` 组织名称
235
297
  */
236
- getUserReposWithName(userName: string, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
298
+ avatarUrl(orgName: string): Promise<string>
237
299
  /**
238
- * 获取仓库提交信息
300
+ * 获取组织仓库列表
239
301
  *
240
302
  * ## 参数
241
- * - `owner` 仓库所有者
242
- * - `repo` 仓库名称
243
- * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
303
+ * - `org_name` 组织名称
304
+ * - `option` 仓库列表选项
244
305
  */
245
- getCommitInfo(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
306
+ repoList(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
307
+ }
308
+
309
+ export declare class GitCodeRepo {
310
+
311
+ constructor()
246
312
  /**
247
- * 获取仓库提交列表
313
+ * 获取仓库信息
248
314
  *
249
315
  * ## 参数
250
316
  * - `owner` 仓库所有者
251
317
  * - `repo` 仓库名称
252
- * - `option` 提交列表选项
253
318
  */
254
- getCommitInfos(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
319
+ info(owner: string, repo: string): Promise<RepoInfo>
255
320
  /**
256
321
  * 添加仓库协作者
257
322
  *
258
- * # 参数
259
- *
260
- * * `owner` - 仓库所有者
261
- * * `repo` - 仓库名称
262
- * * `user_name` - 协作者用户名
263
- * * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
323
+ * ## 参数
324
+ * - `owner` 仓库所有者
325
+ * - `repo` 仓库名称
326
+ * - `user_name` 协作者用户名
327
+ * - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
264
328
  */
265
- addRepoCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
329
+ addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
330
+ }
331
+
332
+ export declare class GitCodeUser {
333
+
334
+ constructor()
266
335
  /**
267
- * 创建一个issue
336
+ * 获取用户信息
268
337
  *
269
338
  * ## 参数
270
- * - `owner` - 仓库所有者
271
- * - `name` - 仓库名称
272
- * - `title` - issue标题
273
- * - `body` - issue内容
274
- * - `option` - 创建issue选项, 详见 [CreateIssueOptions]
339
+ * - `user_name` 用户名称, 为空时获取当前登录用户信息
275
340
  */
276
- createIssue(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
341
+ info(userName?: string | undefined | null): Promise<UserInfo>
277
342
  /**
278
- * 获取issue信息
343
+ * 获取用户头像地址
279
344
  *
280
345
  * ## 参数
281
- * - `owner` - 仓库所有者
282
- * - `repo` - 仓库名称
283
- * - `issue_number` - issue编号
346
+ * - `user_name` 用户名称, 为空时获取当前登录用户头像
284
347
  */
285
- getIssueInfo(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
348
+ avatarUrl(userName?: string | undefined | null): Promise<string>
286
349
  /**
287
- * 获取仓库所有issue信息
350
+ * 获取用户贡献信息
288
351
  *
289
352
  * ## 参数
290
- * - `owner` - 仓库所有者
291
- * - `repo` - 仓库名称
353
+ * - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
292
354
  */
293
- getIssueList(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
355
+ contribution(userName?: string | undefined | null): Promise<ContributionResult>
294
356
  /**
295
- * 更新issue信息
357
+ * 获取用户仓库列表
296
358
  *
297
359
  * ## 参数
298
- * - `owner` - 仓库所有者
299
- * - `repo` - 仓库名称
300
- * - `issue_number` - issue编号
301
- * - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
360
+ * - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
361
+ * - `option` 仓库列表选项
302
362
  */
303
- updateIssue(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
363
+ repoList(userName?: string | undefined | null, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
304
364
  }
305
365
 
306
366
  export declare class GiteeClient {
@@ -322,137 +382,167 @@ export declare class GiteeClient {
322
382
  * 支持http,https,socks5协议
323
383
  */
324
384
  setProxy(proxy: string): void
325
- /** 获取当前登录用户信息 */
326
- getUserInfo(): Promise<UserInfo>
385
+ /** 获取用户操作模块 */
386
+ user(): GiteeUser
387
+ /** 获取组织操作模块 */
388
+ org(): GiteeOrg
389
+ /** 获取仓库操作模块 */
390
+ repo(): GiteeRepo
391
+ /** 获取提交操作模块 */
392
+ commit(): GiteeCommit
393
+ /** 获取Issue操作模块 */
394
+ issue(): GiteeIssue
395
+ }
396
+
397
+ export declare class GiteeCommit {
398
+
399
+ constructor()
327
400
  /**
328
- * 获取指定用户信息
401
+ * 获取仓库提交信息
329
402
  *
330
403
  * ## 参数
331
- * - `user_name` 用户名称
404
+ * - `owner` 仓库所有者
405
+ * - `repo` 仓库名称
406
+ * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
332
407
  */
333
- getUserInfoWithName(name: string): Promise<UserInfo>
408
+ info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
334
409
  /**
335
- * 获取指定用户贡献信息
410
+ * 获取仓库提交列表
336
411
  *
337
412
  * ## 参数
338
- * - `user_name` 用户名称
413
+ * - `owner` 仓库所有者
414
+ * - `repo` 仓库名称
415
+ * - `option` 提交列表选项
339
416
  */
340
- getUserContribution(userName: string): Promise<ContributionResult>
417
+ list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
418
+ }
419
+
420
+ export declare class GiteeIssue {
421
+
422
+ constructor()
341
423
  /**
342
- * 获取组织信息
424
+ * 创建一个issue
343
425
  *
344
426
  * ## 参数
345
- * - `org_name` 组织名称
427
+ * - `owner` 仓库所有者
428
+ * - `repo` 仓库名称
429
+ * - `title` issue标题
430
+ * - `body` issue内容
431
+ * - `option` 创建issue选项
346
432
  */
347
- getOrgInfo(orgName: string): Promise<OrgInfo>
433
+ create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
348
434
  /**
349
- * 获取组织仓库列表
435
+ * 获取issue信息
350
436
  *
351
437
  * ## 参数
352
- * - `org_name` 组织名称
353
- * - `option` 仓库列表选项
438
+ * - `owner` 仓库所有者
439
+ * - `repo` 仓库名称
440
+ * - `issue_number` issue编号
354
441
  */
355
- getOrgRepos(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
356
- /** 获取组织头像地址 */
357
- getOrgAvatarUrl(orgName: string): Promise<string>
442
+ info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
358
443
  /**
359
- * 获取指定用户头像地址
444
+ * 获取仓库所有issue信息
360
445
  *
361
446
  * ## 参数
362
- * - `user_name` 用户名称
447
+ * - `owner` 仓库所有者
448
+ * - `repo` 仓库名称
449
+ * - `option` issue列表选项
363
450
  */
364
- getUserAvatarUrl(userName: string): Promise<string>
451
+ list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
365
452
  /**
366
- * 获取仓库信息
453
+ * 更新issue信息
367
454
  *
368
455
  * ## 参数
369
456
  * - `owner` 仓库所有者
370
457
  * - `repo` 仓库名称
458
+ * - `issue_number` issue编号
459
+ * - `options` 更新issue选项
371
460
  */
372
- getRepoInfo(owner: string, repo: string): Promise<RepoInfo>
461
+ update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
462
+ }
463
+
464
+ export declare class GiteeOrg {
465
+
466
+ constructor()
373
467
  /**
374
- * 获取指定用户仓库列表
468
+ * 获取组织信息
375
469
  *
376
470
  * ## 参数
377
- * - `user_name` 用户名称
378
- * - `option` 仓库列表选项
471
+ * - `org_name` 组织名称
379
472
  */
380
- getUserRepos(option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
473
+ info(orgName: string): Promise<OrgInfo>
381
474
  /**
382
- * 获取指定用户仓库列表
475
+ * 获取组织头像地址
383
476
  *
384
477
  * ## 参数
385
- * - `user_name` 用户名称
386
- * - `option` 仓库列表选项
478
+ * - `org_name` 组织名称
387
479
  */
388
- getUserReposWithName(userName: string, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
480
+ avatarUrl(orgName: string): Promise<string>
389
481
  /**
390
- * 获取仓库提交信息
482
+ * 获取组织仓库列表
391
483
  *
392
484
  * ## 参数
393
- * - `owner` 仓库所有者
394
- * - `repo` 仓库名称
395
- * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
485
+ * - `org_name` 组织名称
486
+ * - `option` 仓库列表选项
396
487
  */
397
- getCommitInfo(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
488
+ repoList(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
489
+ }
490
+
491
+ export declare class GiteeRepo {
492
+
493
+ constructor()
398
494
  /**
399
- * 获取仓库提交列表
495
+ * 获取仓库信息
400
496
  *
401
497
  * ## 参数
402
498
  * - `owner` 仓库所有者
403
499
  * - `repo` 仓库名称
404
- * - `option` 提交列表选项
405
500
  */
406
- getCommitInfos(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
501
+ info(owner: string, repo: string): Promise<RepoInfo>
407
502
  /**
408
503
  * 添加仓库协作者
409
504
  *
410
- * # 参数
411
- *
412
- * * `owner` - 仓库所有者
413
- * * `repo` - 仓库名称
414
- * * `user_name` - 协作者用户名
415
- * * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
505
+ * ## 参数
506
+ * - `owner` 仓库所有者
507
+ * - `repo` 仓库名称
508
+ * - `user_name` 协作者用户名
509
+ * - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
416
510
  */
417
- addRepoCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
511
+ addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
512
+ }
513
+
514
+ export declare class GiteeUser {
515
+
516
+ constructor()
418
517
  /**
419
- * 创建一个issue
518
+ * 获取用户信息
420
519
  *
421
520
  * ## 参数
422
- * - `owner` - 仓库所有者
423
- * - `name` - 仓库名称
424
- * - `title` - issue标题
425
- * - `body` - issue内容
426
- * - `option` - 创建issue选项, 详见 [CreateIssueOptions]
521
+ * - `user_name` 用户名称, 为空时获取当前登录用户信息
427
522
  */
428
- createIssue(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
523
+ info(userName?: string | undefined | null): Promise<UserInfo>
429
524
  /**
430
- * 获取issue信息
525
+ * 获取用户头像地址
431
526
  *
432
527
  * ## 参数
433
- * - `owner` - 仓库所有者
434
- * - `repo` - 仓库名称
435
- * - `issue_number` - issue编号
528
+ * - `user_name` 用户名称, 为空时获取当前登录用户头像
436
529
  */
437
- getIssueInfo(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
530
+ avatarUrl(userName?: string | undefined | null): Promise<string>
438
531
  /**
439
- * 获取仓库所有issue信息
532
+ * 获取用户贡献信息
440
533
  *
441
534
  * ## 参数
442
- * - `owner` - 仓库所有者
443
- * - `repo` - 仓库名称
535
+ * - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
444
536
  */
445
- getIssueList(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
537
+ contribution(userName?: string | undefined | null): Promise<ContributionResult>
446
538
  /**
447
- * 更新issue信息
539
+ * 获取用户仓库列表
448
540
  *
449
541
  * ## 参数
450
- * - `owner` - 仓库所有者
451
- * - `repo` - 仓库名称
452
- * - `issue_number` - issue编号
453
- * - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
542
+ * - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
543
+ * - `option` 仓库列表选项
454
544
  */
455
- updateIssue(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
545
+ repoList(userName?: string | undefined | null, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
456
546
  }
457
547
 
458
548
  export declare class GithubClient {
@@ -474,144 +564,174 @@ export declare class GithubClient {
474
564
  * 支持http,https,socks5协议
475
565
  */
476
566
  setProxy(proxy: string): void
477
- /** 获取当前登录用户信息 */
478
- getUserInfo(): Promise<UserInfo>
567
+ /** 获取用户操作模块 */
568
+ user(): GithubUser
569
+ /** 获取组织操作模块 */
570
+ org(): GithubOrg
571
+ /** 获取仓库操作模块 */
572
+ repo(): GithubRepo
573
+ /** 获取提交操作模块 */
574
+ commit(): GithubCommit
575
+ /** 获取Issue操作模块 */
576
+ issue(): GithubIssue
577
+ /**
578
+ * 设置反向代理
579
+ *
580
+ * ## 参数
581
+ * - `url` - 反向代理地址, 反代地址需要同时支持`github.com`和`api.github.com`
582
+ */
583
+ setReverseProxy(url: string): Promise<void>
584
+ }
585
+
586
+ export declare class GithubCommit {
587
+
588
+ constructor()
479
589
  /**
480
- * 获取指定用户信息
590
+ * 获取仓库提交信息
481
591
  *
482
592
  * ## 参数
483
- * - `user_name` 用户名称
593
+ * - `owner` 仓库所有者
594
+ * - `repo` 仓库名称
595
+ * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
484
596
  */
485
- getUserInfoWithName(name: string): Promise<UserInfo>
597
+ info(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
486
598
  /**
487
- * 获取指定用户贡献信息
599
+ * 获取仓库提交列表
488
600
  *
489
601
  * ## 参数
490
- * - `user_name` 用户名称
602
+ * - `owner` 仓库所有者
603
+ * - `repo` 仓库名称
604
+ * - `option` 提交列表选项
491
605
  */
492
- getUserContribution(userName: string): Promise<ContributionResult>
606
+ list(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
607
+ }
608
+
609
+ export declare class GithubIssue {
610
+
611
+ constructor()
493
612
  /**
494
- * 获取组织信息
613
+ * 创建一个issue
495
614
  *
496
615
  * ## 参数
497
- * - `org_name` 组织名称
616
+ * - `owner` 仓库所有者
617
+ * - `repo` 仓库名称
618
+ * - `title` issue标题
619
+ * - `body` issue内容
620
+ * - `option` 创建issue选项
498
621
  */
499
- getOrgInfo(orgName: string): Promise<OrgInfo>
622
+ create(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
500
623
  /**
501
- * 获取组织仓库列表
624
+ * 获取issue信息
502
625
  *
503
626
  * ## 参数
504
- * - `org_name` 组织名称
505
- * - `option` 仓库列表选项
627
+ * - `owner` 仓库所有者
628
+ * - `repo` 仓库名称
629
+ * - `issue_number` issue编号
506
630
  */
507
- getOrgRepos(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
508
- /** 获取组织头像地址 */
509
- getOrgAvatarUrl(orgName: string): Promise<string>
631
+ info(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
510
632
  /**
511
- * 获取指定用户头像地址
633
+ * 获取仓库所有issue信息
512
634
  *
513
635
  * ## 参数
514
- * - `user_name` 用户名称
636
+ * - `owner` 仓库所有者
637
+ * - `repo` 仓库名称
638
+ * - `option` issue列表选项
515
639
  */
516
- getUserAvatarUrl(userName: string): Promise<string>
640
+ list(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
517
641
  /**
518
- * 获取仓库信息
642
+ * 更新issue信息
519
643
  *
520
644
  * ## 参数
521
645
  * - `owner` 仓库所有者
522
646
  * - `repo` 仓库名称
647
+ * - `issue_number` issue编号
648
+ * - `options` 更新issue选项
523
649
  */
524
- getRepoInfo(owner: string, repo: string): Promise<RepoInfo>
650
+ update(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
651
+ }
652
+
653
+ export declare class GithubOrg {
654
+
655
+ constructor()
525
656
  /**
526
- * 获取指定用户仓库列表
657
+ * 获取组织信息
527
658
  *
528
659
  * ## 参数
529
- * - `user_name` 用户名称
530
- * - `option` 仓库列表选项
660
+ * - `org_name` 组织名称
531
661
  */
532
- getUserRepos(option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
662
+ info(orgName: string): Promise<OrgInfo>
533
663
  /**
534
- * 获取指定用户仓库列表
664
+ * 获取组织头像地址
535
665
  *
536
666
  * ## 参数
537
- * - `user_name` 用户名称
538
- * - `option` 仓库列表选项
667
+ * - `org_name` 组织名称
539
668
  */
540
- getUserReposWithName(userName: string, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
669
+ avatarUrl(orgName: string): Promise<string>
541
670
  /**
542
- * 获取仓库提交信息
671
+ * 获取组织仓库列表
543
672
  *
544
673
  * ## 参数
545
- * - `owner` 仓库所有者
546
- * - `repo` 仓库名称
547
- * - `sha` 提交SHA, 如果不设置则会获取默认分支的最新提交
674
+ * - `org_name` 组织名称
675
+ * - `option` 仓库列表选项
548
676
  */
549
- getCommitInfo(owner: string, repo: string, sha?: string | undefined | null): Promise<CommitInfo>
677
+ repoList(orgName: string, option?: OrgRepoListOptions | undefined | null): Promise<Array<RepoInfo>>
678
+ }
679
+
680
+ export declare class GithubRepo {
681
+
682
+ constructor()
550
683
  /**
551
- * 获取仓库提交列表
684
+ * 获取仓库信息
552
685
  *
553
686
  * ## 参数
554
687
  * - `owner` 仓库所有者
555
688
  * - `repo` 仓库名称
556
- * - `option` 提交列表选项
557
689
  */
558
- getCommitInfos(owner: string, repo: string, option?: CommitListOptions | undefined | null): Promise<Array<CommitInfo>>
690
+ info(owner: string, repo: string): Promise<RepoInfo>
559
691
  /**
560
692
  * 添加仓库协作者
561
693
  *
562
- * # 参数
563
- *
564
- * * `owner` - 仓库所有者
565
- * * `repo` - 仓库名称
566
- * * `user_name` - 协作者用户名
567
- * * `permission` - 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
568
- */
569
- addRepoCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
570
- /**
571
- * 创建一个issue
572
- *
573
694
  * ## 参数
574
- * - `owner` - 仓库所有者
575
- * - `name` - 仓库名称
576
- * - `title` - issue标题
577
- * - `body` - issue内容
578
- * - `option` - 创建issue选项, 详见 [CreateIssueOptions]
695
+ * - `owner` 仓库所有者
696
+ * - `repo` 仓库名称
697
+ * - `user_name` 协作者用户名
698
+ * - `permission` 协作者权限, 默认为 `Pull`, 可选值为 `Admin`, `Push`, `Pull`
579
699
  */
580
- createIssue(owner: string, repo: string, title: string, body?: string | undefined | null, option?: CreateIssueOptions | undefined | null): Promise<IssueInfo>
700
+ addCollaborator(owner: string, repo: string, userName: string, permission?: CollaboratorPermission | undefined | null): Promise<CollaboratorResult>
701
+ }
702
+
703
+ export declare class GithubUser {
704
+
705
+ constructor()
581
706
  /**
582
- * 获取issue信息
707
+ * 获取用户信息
583
708
  *
584
709
  * ## 参数
585
- * - `owner` - 仓库所有者
586
- * - `repo` - 仓库名称
587
- * - `issue_number` - issue编号
710
+ * - `user_name` 用户名称, 为空时获取当前登录用户信息
588
711
  */
589
- getIssueInfo(owner: string, repo: string, issueNumber: string): Promise<IssueInfo>
712
+ info(userName?: string | undefined | null): Promise<UserInfo>
590
713
  /**
591
- * 获取仓库所有issue信息
714
+ * 获取用户头像地址
592
715
  *
593
716
  * ## 参数
594
- * - `owner` - 仓库所有者
595
- * - `repo` - 仓库名称
717
+ * - `user_name` 用户名称, 为空时获取当前登录用户头像
596
718
  */
597
- getIssueList(owner: string, repo: string, option?: IssueListOptions | undefined | null): Promise<Array<IssueInfo>>
719
+ avatarUrl(userName?: string | undefined | null): Promise<string>
598
720
  /**
599
- * 更新issue信息
721
+ * 获取用户贡献信息
600
722
  *
601
723
  * ## 参数
602
- * - `owner` - 仓库所有者
603
- * - `repo` - 仓库名称
604
- * - `issue_number` - issue编号
605
- * - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
724
+ * - `user_name` 用户名称, 为空时获取当前登录用户贡献信息
606
725
  */
607
- updateIssue(owner: string, repo: string, issueNumber: string, options?: UpdateIssueOptions | undefined | null): Promise<IssueInfo>
726
+ contribution(userName?: string | undefined | null): Promise<ContributionResult>
608
727
  /**
609
- * 设置反向代理
728
+ * 获取用户仓库列表
610
729
  *
611
730
  * ## 参数
612
- * - `url` - 反向代理地址, 反代地址需要同时支持`github.com`和`api.github.com`
731
+ * - `user_name` 用户名称, 为空时获取当前登录用户仓库列表
732
+ * - `option` 仓库列表选项
613
733
  */
614
- setReverseProxy(url: string): Promise<void>
734
+ repoList(userName?: string | undefined | null, option?: ReposListOptions | undefined | null): Promise<Array<RepoInfo>>
615
735
  }
616
736
 
617
737
  export declare const enum CollaboratorPermission {
package/dist/index.js CHANGED
@@ -81,8 +81,8 @@ function requireNative() {
81
81
  try {
82
82
  const binding = require('@puniyu/nipaw-android-arm64')
83
83
  const bindingPackageVersion = require('@puniyu/nipaw-android-arm64/package.json').version
84
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
84
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
86
86
  }
87
87
  return binding
88
88
  } catch (e) {
@@ -97,8 +97,8 @@ function requireNative() {
97
97
  try {
98
98
  const binding = require('@puniyu/nipaw-android-arm-eabi')
99
99
  const bindingPackageVersion = require('@puniyu/nipaw-android-arm-eabi/package.json').version
100
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
100
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
102
102
  }
103
103
  return binding
104
104
  } catch (e) {
@@ -118,8 +118,8 @@ function requireNative() {
118
118
  try {
119
119
  const binding = require('@puniyu/nipaw-win32-x64-gnu')
120
120
  const bindingPackageVersion = require('@puniyu/nipaw-win32-x64-gnu/package.json').version
121
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
122
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
121
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
122
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
123
123
  }
124
124
  return binding
125
125
  } catch (e) {
@@ -134,8 +134,8 @@ function requireNative() {
134
134
  try {
135
135
  const binding = require('@puniyu/nipaw-win32-x64-msvc')
136
136
  const bindingPackageVersion = require('@puniyu/nipaw-win32-x64-msvc/package.json').version
137
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
138
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
137
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
138
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
139
139
  }
140
140
  return binding
141
141
  } catch (e) {
@@ -151,8 +151,8 @@ function requireNative() {
151
151
  try {
152
152
  const binding = require('@puniyu/nipaw-win32-ia32-msvc')
153
153
  const bindingPackageVersion = require('@puniyu/nipaw-win32-ia32-msvc/package.json').version
154
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
155
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
154
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
155
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
156
156
  }
157
157
  return binding
158
158
  } catch (e) {
@@ -167,8 +167,8 @@ function requireNative() {
167
167
  try {
168
168
  const binding = require('@puniyu/nipaw-win32-arm64-msvc')
169
169
  const bindingPackageVersion = require('@puniyu/nipaw-win32-arm64-msvc/package.json').version
170
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
170
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
172
  }
173
173
  return binding
174
174
  } catch (e) {
@@ -186,8 +186,8 @@ function requireNative() {
186
186
  try {
187
187
  const binding = require('@puniyu/nipaw-darwin-universal')
188
188
  const bindingPackageVersion = require('@puniyu/nipaw-darwin-universal/package.json').version
189
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
190
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
189
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
190
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
191
191
  }
192
192
  return binding
193
193
  } catch (e) {
@@ -202,8 +202,8 @@ function requireNative() {
202
202
  try {
203
203
  const binding = require('@puniyu/nipaw-darwin-x64')
204
204
  const bindingPackageVersion = require('@puniyu/nipaw-darwin-x64/package.json').version
205
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
206
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
205
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
206
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
207
207
  }
208
208
  return binding
209
209
  } catch (e) {
@@ -218,8 +218,8 @@ function requireNative() {
218
218
  try {
219
219
  const binding = require('@puniyu/nipaw-darwin-arm64')
220
220
  const bindingPackageVersion = require('@puniyu/nipaw-darwin-arm64/package.json').version
221
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
221
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
223
223
  }
224
224
  return binding
225
225
  } catch (e) {
@@ -238,8 +238,8 @@ function requireNative() {
238
238
  try {
239
239
  const binding = require('@puniyu/nipaw-freebsd-x64')
240
240
  const bindingPackageVersion = require('@puniyu/nipaw-freebsd-x64/package.json').version
241
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
241
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
243
243
  }
244
244
  return binding
245
245
  } catch (e) {
@@ -254,8 +254,8 @@ function requireNative() {
254
254
  try {
255
255
  const binding = require('@puniyu/nipaw-freebsd-arm64')
256
256
  const bindingPackageVersion = require('@puniyu/nipaw-freebsd-arm64/package.json').version
257
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
258
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
257
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
258
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
259
  }
260
260
  return binding
261
261
  } catch (e) {
@@ -275,8 +275,8 @@ function requireNative() {
275
275
  try {
276
276
  const binding = require('@puniyu/nipaw-linux-x64-musl')
277
277
  const bindingPackageVersion = require('@puniyu/nipaw-linux-x64-musl/package.json').version
278
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
279
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
278
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
279
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
280
280
  }
281
281
  return binding
282
282
  } catch (e) {
@@ -291,8 +291,8 @@ function requireNative() {
291
291
  try {
292
292
  const binding = require('@puniyu/nipaw-linux-x64-gnu')
293
293
  const bindingPackageVersion = require('@puniyu/nipaw-linux-x64-gnu/package.json').version
294
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
294
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
296
296
  }
297
297
  return binding
298
298
  } catch (e) {
@@ -309,8 +309,8 @@ function requireNative() {
309
309
  try {
310
310
  const binding = require('@puniyu/nipaw-linux-arm64-musl')
311
311
  const bindingPackageVersion = require('@puniyu/nipaw-linux-arm64-musl/package.json').version
312
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
313
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
312
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
313
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
314
314
  }
315
315
  return binding
316
316
  } catch (e) {
@@ -325,8 +325,8 @@ function requireNative() {
325
325
  try {
326
326
  const binding = require('@puniyu/nipaw-linux-arm64-gnu')
327
327
  const bindingPackageVersion = require('@puniyu/nipaw-linux-arm64-gnu/package.json').version
328
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
328
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
330
330
  }
331
331
  return binding
332
332
  } catch (e) {
@@ -343,8 +343,8 @@ function requireNative() {
343
343
  try {
344
344
  const binding = require('@puniyu/nipaw-linux-arm-musleabihf')
345
345
  const bindingPackageVersion = require('@puniyu/nipaw-linux-arm-musleabihf/package.json').version
346
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
346
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
348
348
  }
349
349
  return binding
350
350
  } catch (e) {
@@ -359,8 +359,8 @@ function requireNative() {
359
359
  try {
360
360
  const binding = require('@puniyu/nipaw-linux-arm-gnueabihf')
361
361
  const bindingPackageVersion = require('@puniyu/nipaw-linux-arm-gnueabihf/package.json').version
362
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
362
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
364
364
  }
365
365
  return binding
366
366
  } catch (e) {
@@ -377,8 +377,8 @@ function requireNative() {
377
377
  try {
378
378
  const binding = require('@puniyu/nipaw-linux-loong64-musl')
379
379
  const bindingPackageVersion = require('@puniyu/nipaw-linux-loong64-musl/package.json').version
380
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
381
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
380
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
381
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
382
382
  }
383
383
  return binding
384
384
  } catch (e) {
@@ -393,8 +393,8 @@ function requireNative() {
393
393
  try {
394
394
  const binding = require('@puniyu/nipaw-linux-loong64-gnu')
395
395
  const bindingPackageVersion = require('@puniyu/nipaw-linux-loong64-gnu/package.json').version
396
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
396
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
398
398
  }
399
399
  return binding
400
400
  } catch (e) {
@@ -411,8 +411,8 @@ function requireNative() {
411
411
  try {
412
412
  const binding = require('@puniyu/nipaw-linux-riscv64-musl')
413
413
  const bindingPackageVersion = require('@puniyu/nipaw-linux-riscv64-musl/package.json').version
414
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
414
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
416
416
  }
417
417
  return binding
418
418
  } catch (e) {
@@ -427,8 +427,8 @@ function requireNative() {
427
427
  try {
428
428
  const binding = require('@puniyu/nipaw-linux-riscv64-gnu')
429
429
  const bindingPackageVersion = require('@puniyu/nipaw-linux-riscv64-gnu/package.json').version
430
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
430
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
432
432
  }
433
433
  return binding
434
434
  } catch (e) {
@@ -444,8 +444,8 @@ function requireNative() {
444
444
  try {
445
445
  const binding = require('@puniyu/nipaw-linux-ppc64-gnu')
446
446
  const bindingPackageVersion = require('@puniyu/nipaw-linux-ppc64-gnu/package.json').version
447
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
448
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
447
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
448
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
449
449
  }
450
450
  return binding
451
451
  } catch (e) {
@@ -460,8 +460,8 @@ function requireNative() {
460
460
  try {
461
461
  const binding = require('@puniyu/nipaw-linux-s390x-gnu')
462
462
  const bindingPackageVersion = require('@puniyu/nipaw-linux-s390x-gnu/package.json').version
463
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
464
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
463
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
464
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
465
465
  }
466
466
  return binding
467
467
  } catch (e) {
@@ -480,8 +480,8 @@ function requireNative() {
480
480
  try {
481
481
  const binding = require('@puniyu/nipaw-openharmony-arm64')
482
482
  const bindingPackageVersion = require('@puniyu/nipaw-openharmony-arm64/package.json').version
483
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
484
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
483
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
484
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
485
485
  }
486
486
  return binding
487
487
  } catch (e) {
@@ -496,8 +496,8 @@ function requireNative() {
496
496
  try {
497
497
  const binding = require('@puniyu/nipaw-openharmony-x64')
498
498
  const bindingPackageVersion = require('@puniyu/nipaw-openharmony-x64/package.json').version
499
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
500
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
499
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
500
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
501
501
  }
502
502
  return binding
503
503
  } catch (e) {
@@ -512,8 +512,8 @@ function requireNative() {
512
512
  try {
513
513
  const binding = require('@puniyu/nipaw-openharmony-arm')
514
514
  const bindingPackageVersion = require('@puniyu/nipaw-openharmony-arm/package.json').version
515
- if (bindingPackageVersion !== '1.8.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
516
- throw new Error(`Native binding package version mismatch, expected 1.8.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
515
+ if (bindingPackageVersion !== '1.8.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
516
+ throw new Error(`Native binding package version mismatch, expected 1.8.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
517
517
  }
518
518
  return binding
519
519
  } catch (e) {
@@ -575,11 +575,31 @@ if (!nativeBinding) {
575
575
  throw new Error(`Failed to load native binding`)
576
576
  }
577
577
 
578
- const { CnbClient, GitCodeClient, GiteeClient, GithubClient, CollaboratorPermission, RepoVisibility, StateType } = nativeBinding
578
+ const { CnbClient, CnbCommit, CnbIssue, CnbOrg, CnbRepo, CnbUser, GitCodeClient, GitCodeCommit, GitCodeIssue, GitCodeOrg, GitCodeRepo, GitCodeUser, GiteeClient, GiteeCommit, GiteeIssue, GiteeOrg, GiteeRepo, GiteeUser, GithubClient, GithubCommit, GithubIssue, GithubOrg, GithubRepo, GithubUser, CollaboratorPermission, RepoVisibility, StateType } = nativeBinding
579
579
  export { CnbClient }
580
+ export { CnbCommit }
581
+ export { CnbIssue }
582
+ export { CnbOrg }
583
+ export { CnbRepo }
584
+ export { CnbUser }
580
585
  export { GitCodeClient }
586
+ export { GitCodeCommit }
587
+ export { GitCodeIssue }
588
+ export { GitCodeOrg }
589
+ export { GitCodeRepo }
590
+ export { GitCodeUser }
581
591
  export { GiteeClient }
592
+ export { GiteeCommit }
593
+ export { GiteeIssue }
594
+ export { GiteeOrg }
595
+ export { GiteeRepo }
596
+ export { GiteeUser }
582
597
  export { GithubClient }
598
+ export { GithubCommit }
599
+ export { GithubIssue }
600
+ export { GithubOrg }
601
+ export { GithubRepo }
602
+ export { GithubUser }
583
603
  export { CollaboratorPermission }
584
604
  export { RepoVisibility }
585
605
  export { StateType }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puniyu/nipaw",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "一个git平台封装库",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -34,17 +34,17 @@
34
34
  "dtsHeader": "// powered by nipaw_core\n"
35
35
  },
36
36
  "engines": {
37
- "node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
37
+ "node": "^20.19.0 || >=22.12.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@napi-rs/cli": "^3.4.1"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@puniyu/nipaw-win32-x64-msvc": "1.8.0",
44
- "@puniyu/nipaw-darwin-x64": "1.8.0",
45
- "@puniyu/nipaw-linux-x64-gnu": "1.8.0",
46
- "@puniyu/nipaw-linux-arm64-gnu": "1.8.0",
47
- "@puniyu/nipaw-darwin-arm64": "1.8.0"
43
+ "@puniyu/nipaw-win32-x64-msvc": "1.8.1",
44
+ "@puniyu/nipaw-darwin-x64": "1.8.1",
45
+ "@puniyu/nipaw-linux-x64-gnu": "1.8.1",
46
+ "@puniyu/nipaw-linux-arm64-gnu": "1.8.1",
47
+ "@puniyu/nipaw-darwin-arm64": "1.8.1"
48
48
  },
49
49
  "scripts": {
50
50
  "artifacts": "napi artifacts",