@cnbcool/cnb-cli 1.1.1 → 1.2.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/package.json +4 -2
- package/skills/cnb-api/scripts/core/flat-options.json +8909 -0
- package/skills/cnb-api/scripts/core/index.js +33 -455
- package/skills/cnb-api/scripts/core/key-mapping.json +538 -0
- package/skills/cnb-api/scripts/core/lib/execute-action.js +97 -0
- package/skills/cnb-api/scripts/core/lib/extra-help.js +20 -0
- package/skills/cnb-api/scripts/core/lib/flat-options-data.js +16 -0
- package/skills/cnb-api/scripts/core/lib/format-output.js +85 -0
- package/skills/cnb-api/scripts/core/lib/format-params.js +211 -0
- package/skills/cnb-api/scripts/core/lib/help-data.js +15 -0
- package/skills/cnb-api/scripts/core/lib/key-mapping-data.js +16 -0
- package/skills/cnb-api/scripts/core/lib/parsers.js +126 -0
- package/skills/cnb-api/scripts/core/lib/print-json.js +15 -0
- package/skills/cnb-api/scripts/core/lib/register-fallback.js +15 -0
- package/skills/cnb-api/scripts/core/lib/register-modules.js +91 -0
- package/skills/cnb-api/scripts/core/lib/summary-extractors.js +181 -0
- package/skills/cnb-api/scripts/core/lib/trim-summary.js +17 -0
- package/skills/cnb-api/scripts/core/shortcuts.js +10 -186
- package/skills/cnb-api/scripts/core/utils/build-nested-field-map.js +35 -0
- package/skills/cnb-api/scripts/core/utils/flat-key-from-segments.js +14 -0
- package/skills/cnb-api/scripts/core/utils/match-array-object-field.js +25 -0
- package/skills/cnb-api/scripts/core/utils/restore-original-keys.js +24 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
{
|
|
2
|
+
"event": {},
|
|
3
|
+
"organizations": {
|
|
4
|
+
"create-organization": {
|
|
5
|
+
"bindDomain": "bind_domain"
|
|
6
|
+
},
|
|
7
|
+
"list-top-groups": {
|
|
8
|
+
"pageSize": "page_size"
|
|
9
|
+
},
|
|
10
|
+
"list-groups": {
|
|
11
|
+
"pageSize": "page_size"
|
|
12
|
+
},
|
|
13
|
+
"get-groups-by-user-id": {
|
|
14
|
+
"pageSize": "page_size"
|
|
15
|
+
},
|
|
16
|
+
"update-organization": {
|
|
17
|
+
"readmeRepoId": "readme_repo_id",
|
|
18
|
+
"readmeRepoPath": "readme_repo_path",
|
|
19
|
+
"wechatMp": "wechat_mp"
|
|
20
|
+
},
|
|
21
|
+
"upload-logos": {
|
|
22
|
+
"extType": "ext@type",
|
|
23
|
+
"extAdditionalProperties": "ext@additionalProperties"
|
|
24
|
+
},
|
|
25
|
+
"update-group-setting": {
|
|
26
|
+
"emailVerification": "email_verification",
|
|
27
|
+
"groupProtection": "group_protection",
|
|
28
|
+
"hideMembers": "hide_members",
|
|
29
|
+
"hideSubGroups": "hide_sub_groups",
|
|
30
|
+
"showPrivateRepoWatermark": "show_private_repo_watermark"
|
|
31
|
+
},
|
|
32
|
+
"list-subgroups": {
|
|
33
|
+
"pageSize": "page_size"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"rank": {},
|
|
37
|
+
"knowledge-base": {
|
|
38
|
+
"search-npc": {
|
|
39
|
+
"topN": "top_n"
|
|
40
|
+
},
|
|
41
|
+
"query-knowledge-base": {
|
|
42
|
+
"metadataFilteringConditionsConditionsComparisonOperator": "metadata_filtering_conditions@conditions@comparison_operator",
|
|
43
|
+
"metadataFilteringConditionsConditionsName": "metadata_filtering_conditions@conditions@name",
|
|
44
|
+
"metadataFilteringConditionsConditionsValue": "metadata_filtering_conditions@conditions@value",
|
|
45
|
+
"metadataFilteringConditionsLogicalOperator": "metadata_filtering_conditions@logical_operator",
|
|
46
|
+
"scoreThreshold": "score_threshold",
|
|
47
|
+
"topK": "top_k"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"search": {
|
|
51
|
+
"list-public-repos": {
|
|
52
|
+
"flagsMatch": "flags_match",
|
|
53
|
+
"orderBy": "order_by"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"users": {
|
|
57
|
+
"update-user-info": {
|
|
58
|
+
"readmeRepoId": "readme_repo_id",
|
|
59
|
+
"readmeRepoPath": "readme_repo_path",
|
|
60
|
+
"wechatMp": "wechat_mp",
|
|
61
|
+
"wechatMpQrcode": "wechat_mp_qrcode"
|
|
62
|
+
},
|
|
63
|
+
"auto-complete-source": {
|
|
64
|
+
"sourceType": "source_type",
|
|
65
|
+
"pageSize": "page_size",
|
|
66
|
+
"orderBy": "order_by"
|
|
67
|
+
},
|
|
68
|
+
"list-gpg-keys": {
|
|
69
|
+
"pageSize": "page_size"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"issues": {
|
|
73
|
+
"list-user-issues": {
|
|
74
|
+
"pageSize": "page_size",
|
|
75
|
+
"labelsOperator": "labels_operator",
|
|
76
|
+
"updatedTimeBegin": "updated_time_begin",
|
|
77
|
+
"updatedTimeEnd": "updated_time_end",
|
|
78
|
+
"closeTimeBegin": "close_time_begin",
|
|
79
|
+
"closeTimeEnd": "close_time_end",
|
|
80
|
+
"orderBy": "order_by"
|
|
81
|
+
},
|
|
82
|
+
"list-issues": {
|
|
83
|
+
"pageSize": "page_size",
|
|
84
|
+
"labelsOperator": "labels_operator",
|
|
85
|
+
"updatedTimeBegin": "updated_time_begin",
|
|
86
|
+
"updatedTimeEnd": "updated_time_end",
|
|
87
|
+
"closeTimeBegin": "close_time_begin",
|
|
88
|
+
"closeTimeEnd": "close_time_end",
|
|
89
|
+
"orderBy": "order_by"
|
|
90
|
+
},
|
|
91
|
+
"create-issue": {
|
|
92
|
+
"endDate": "end_date",
|
|
93
|
+
"startDate": "start_date",
|
|
94
|
+
"workMode": "work_mode"
|
|
95
|
+
},
|
|
96
|
+
"update-issue": {
|
|
97
|
+
"endDate": "end_date",
|
|
98
|
+
"startDate": "start_date",
|
|
99
|
+
"stateReason": "state_reason"
|
|
100
|
+
},
|
|
101
|
+
"list-issue-activities": {
|
|
102
|
+
"pageSize": "page_size"
|
|
103
|
+
},
|
|
104
|
+
"post-issue-file-asset-upload-url": {
|
|
105
|
+
"contentType": "content_type"
|
|
106
|
+
},
|
|
107
|
+
"post-issue-image-asset-upload-url": {
|
|
108
|
+
"contentType": "content_type"
|
|
109
|
+
},
|
|
110
|
+
"list-issue-comments": {
|
|
111
|
+
"pageSize": "page_size"
|
|
112
|
+
},
|
|
113
|
+
"post-issue-comment": {
|
|
114
|
+
"workMode": "work_mode"
|
|
115
|
+
},
|
|
116
|
+
"get-issue-comment": {
|
|
117
|
+
"commentId": "comment_id"
|
|
118
|
+
},
|
|
119
|
+
"patch-issue-comment": {
|
|
120
|
+
"commentId": "comment_id"
|
|
121
|
+
},
|
|
122
|
+
"list-issue-labels": {
|
|
123
|
+
"pageSize": "page_size"
|
|
124
|
+
},
|
|
125
|
+
"update-issue-properties": {
|
|
126
|
+
"propertiesKey": "properties@key",
|
|
127
|
+
"propertiesValue": "properties@value"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"repositories": {
|
|
131
|
+
"get-repos": {
|
|
132
|
+
"pageSize": "page_size",
|
|
133
|
+
"filterType": "filter_type",
|
|
134
|
+
"flagsMatch": "flags_match",
|
|
135
|
+
"orderBy": "order_by"
|
|
136
|
+
},
|
|
137
|
+
"get-repos-by-user-name": {
|
|
138
|
+
"filterType": "filter_type",
|
|
139
|
+
"flagsMatch": "flags_match",
|
|
140
|
+
"pageSize": "page_size",
|
|
141
|
+
"orderBy": "order_by"
|
|
142
|
+
},
|
|
143
|
+
"list-forks-repos": {
|
|
144
|
+
"startFromRoot": "start_from_root",
|
|
145
|
+
"pageSize": "page_size"
|
|
146
|
+
},
|
|
147
|
+
"get-group-sub-repos": {
|
|
148
|
+
"pageSize": "page_size",
|
|
149
|
+
"filterType": "filter_type",
|
|
150
|
+
"flagsMatch": "flags_match",
|
|
151
|
+
"orderBy": "order_by"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"starring": {
|
|
155
|
+
"get-user-all-stared-repos": {
|
|
156
|
+
"pageSize": "page_size",
|
|
157
|
+
"flagsMatch": "flags_match",
|
|
158
|
+
"orderBy": "order_by"
|
|
159
|
+
},
|
|
160
|
+
"get-user-stared-repos": {
|
|
161
|
+
"flagsMatch": "flags_match",
|
|
162
|
+
"pageSize": "page_size",
|
|
163
|
+
"orderBy": "order_by"
|
|
164
|
+
},
|
|
165
|
+
"list-star-users": {
|
|
166
|
+
"filterType": "filter_type",
|
|
167
|
+
"pageSize": "page_size"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"activities": {},
|
|
171
|
+
"followers": {
|
|
172
|
+
"get-followers-by-user-id": {
|
|
173
|
+
"pageSize": "page_size"
|
|
174
|
+
},
|
|
175
|
+
"get-following-by-user-id": {
|
|
176
|
+
"pageSize": "page_size"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"workspace": {
|
|
180
|
+
"list-workspaces": {
|
|
181
|
+
"pageSize": "page_size"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"members": {
|
|
185
|
+
"list-inherit-members-of-group": {
|
|
186
|
+
"pageSize": "page_size"
|
|
187
|
+
},
|
|
188
|
+
"list-members-of-group": {
|
|
189
|
+
"pageSize": "page_size"
|
|
190
|
+
},
|
|
191
|
+
"get-member-access-level-of-group": {
|
|
192
|
+
"includeInherit": "include_inherit"
|
|
193
|
+
},
|
|
194
|
+
"update-members-of-group": {
|
|
195
|
+
"accessLevel": "access_level",
|
|
196
|
+
"isOutsideCollaborator": "is_outside_collaborator"
|
|
197
|
+
},
|
|
198
|
+
"add-members-of-group": {
|
|
199
|
+
"accessLevel": "access_level",
|
|
200
|
+
"isOutsideCollaborator": "is_outside_collaborator"
|
|
201
|
+
},
|
|
202
|
+
"add-members-of-mission": {
|
|
203
|
+
"accessLevel": "access_level",
|
|
204
|
+
"isOutsideCollaborator": "is_outside_collaborator"
|
|
205
|
+
},
|
|
206
|
+
"add-members-of-registry": {
|
|
207
|
+
"accessLevel": "access_level",
|
|
208
|
+
"isOutsideCollaborator": "is_outside_collaborator"
|
|
209
|
+
},
|
|
210
|
+
"list-inherit-members-of-repo": {
|
|
211
|
+
"pageSize": "page_size"
|
|
212
|
+
},
|
|
213
|
+
"list-members-of-repo": {
|
|
214
|
+
"pageSize": "page_size"
|
|
215
|
+
},
|
|
216
|
+
"get-member-access-level-of-repo": {
|
|
217
|
+
"includeInherit": "include_inherit"
|
|
218
|
+
},
|
|
219
|
+
"update-members-of-repo": {
|
|
220
|
+
"accessLevel": "access_level",
|
|
221
|
+
"isOutsideCollaborator": "is_outside_collaborator"
|
|
222
|
+
},
|
|
223
|
+
"add-members-of-repo": {
|
|
224
|
+
"accessLevel": "access_level",
|
|
225
|
+
"isOutsideCollaborator": "is_outside_collaborator"
|
|
226
|
+
},
|
|
227
|
+
"list-all-members": {
|
|
228
|
+
"pageSize": "page_size",
|
|
229
|
+
"orderBy": "order_by"
|
|
230
|
+
},
|
|
231
|
+
"list-outside-collaborators": {
|
|
232
|
+
"pageSize": "page_size"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"missions": {
|
|
236
|
+
"post-mission-view-config": {
|
|
237
|
+
"fieldsField": "fields@field",
|
|
238
|
+
"fieldsWidth": "fields@width",
|
|
239
|
+
"groupCustomOrdersField": "group@customOrders@field",
|
|
240
|
+
"groupCustomOrdersValue": "group@customOrders@value",
|
|
241
|
+
"groupCustomVisibleField": "group@customVisible@field",
|
|
242
|
+
"groupCustomVisibleValue": "group@customVisible@value",
|
|
243
|
+
"groupExpendedList": "group@expendedList",
|
|
244
|
+
"groupField": "group@field",
|
|
245
|
+
"groupOrder": "group@order",
|
|
246
|
+
"selectorsField": "selectors@field",
|
|
247
|
+
"selectorsOperator": "selectors@operator",
|
|
248
|
+
"selectorsValue": "selectors@value",
|
|
249
|
+
"sortsField": "sorts@field",
|
|
250
|
+
"sortsOrder": "sorts@order"
|
|
251
|
+
},
|
|
252
|
+
"get-group-sub-missions": {
|
|
253
|
+
"pageSize": "page_size",
|
|
254
|
+
"filterType": "filter_type",
|
|
255
|
+
"orderBy": "order_by"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"registries": {
|
|
259
|
+
"list-packages": {
|
|
260
|
+
"pageSize": "page_size"
|
|
261
|
+
},
|
|
262
|
+
"list-package-tags": {
|
|
263
|
+
"pageSize": "page_size",
|
|
264
|
+
"tagName": "tag_name"
|
|
265
|
+
},
|
|
266
|
+
"get-group-sub-registries": {
|
|
267
|
+
"pageSize": "page_size",
|
|
268
|
+
"registryType": "registry_type",
|
|
269
|
+
"filterType": "filter_type",
|
|
270
|
+
"orderBy": "order_by"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"ai": {
|
|
274
|
+
"ai-chat-completions": {
|
|
275
|
+
"messagesContent": "messages@content",
|
|
276
|
+
"messagesRole": "messages@role"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"assets": {
|
|
280
|
+
"list-assets": {
|
|
281
|
+
"pageSize": "page_size"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"badge": {},
|
|
285
|
+
"build": {
|
|
286
|
+
"get-build-logs": {
|
|
287
|
+
"pageSize": "page_size"
|
|
288
|
+
},
|
|
289
|
+
"start-build": {
|
|
290
|
+
"envType": "env@type",
|
|
291
|
+
"envAdditionalProperties": "env@additionalProperties"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"git": {
|
|
295
|
+
"get-commit-assets": {
|
|
296
|
+
"commitId": "commit_id"
|
|
297
|
+
},
|
|
298
|
+
"get-archive-compare-changed-files": {
|
|
299
|
+
"baseHead": "base_head"
|
|
300
|
+
},
|
|
301
|
+
"get-archive": {
|
|
302
|
+
"refWithPath": "ref_with_path"
|
|
303
|
+
},
|
|
304
|
+
"list-branches": {
|
|
305
|
+
"pageSize": "page_size"
|
|
306
|
+
},
|
|
307
|
+
"create-branch": {
|
|
308
|
+
"startPoint": "start_point"
|
|
309
|
+
},
|
|
310
|
+
"get-commit-annotations-in-batch": {
|
|
311
|
+
"commitHashes": "commit_hashes"
|
|
312
|
+
},
|
|
313
|
+
"put-commit-annotations": {
|
|
314
|
+
"annotationsKey": "annotations@key",
|
|
315
|
+
"annotationsValue": "annotations@value"
|
|
316
|
+
},
|
|
317
|
+
"post-commit-asset-upload-confirmation": {
|
|
318
|
+
"uploadToken": "upload_token",
|
|
319
|
+
"assetPath": "asset_path"
|
|
320
|
+
},
|
|
321
|
+
"post-commit-asset-upload-url": {
|
|
322
|
+
"assetName": "asset_name"
|
|
323
|
+
},
|
|
324
|
+
"delete-commit-asset": {
|
|
325
|
+
"assetId": "asset_id"
|
|
326
|
+
},
|
|
327
|
+
"list-commits": {
|
|
328
|
+
"pageSize": "page_size"
|
|
329
|
+
},
|
|
330
|
+
"get-compare-commits": {
|
|
331
|
+
"baseHead": "base_head"
|
|
332
|
+
},
|
|
333
|
+
"get-content": {
|
|
334
|
+
"filePath": "file_path"
|
|
335
|
+
},
|
|
336
|
+
"get-raw": {
|
|
337
|
+
"refWithPath": "ref_with_path",
|
|
338
|
+
"maxInByte": "max_in_byte"
|
|
339
|
+
},
|
|
340
|
+
"delete-tag-annotation": {
|
|
341
|
+
"tagWithKey": "tag_with_key"
|
|
342
|
+
},
|
|
343
|
+
"put-tag-annotations": {
|
|
344
|
+
"annotationsKey": "annotations@key",
|
|
345
|
+
"annotationsValue": "annotations@value"
|
|
346
|
+
},
|
|
347
|
+
"list-tags": {
|
|
348
|
+
"pageSize": "page_size"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"pulls": {
|
|
352
|
+
"list-pulls": {
|
|
353
|
+
"pageSize": "page_size",
|
|
354
|
+
"reviewersOperator": "reviewers_operator",
|
|
355
|
+
"assigneesOperator": "assignees_operator",
|
|
356
|
+
"labelsOperator": "labels_operator",
|
|
357
|
+
"baseRef": "base_ref",
|
|
358
|
+
"updatedTimeBegin": "updated_time_begin",
|
|
359
|
+
"updatedTimeEnd": "updated_time_end",
|
|
360
|
+
"orderBy": "order_by"
|
|
361
|
+
},
|
|
362
|
+
"post-pull": {
|
|
363
|
+
"headRepo": "head_repo"
|
|
364
|
+
},
|
|
365
|
+
"list-pull-comments": {
|
|
366
|
+
"pageSize": "page_size"
|
|
367
|
+
},
|
|
368
|
+
"get-pull-comment": {
|
|
369
|
+
"commentId": "comment_id"
|
|
370
|
+
},
|
|
371
|
+
"patch-pull-comment": {
|
|
372
|
+
"commentId": "comment_id"
|
|
373
|
+
},
|
|
374
|
+
"list-pull-commits": {
|
|
375
|
+
"pageSize": "page_size"
|
|
376
|
+
},
|
|
377
|
+
"list-pull-labels": {
|
|
378
|
+
"pageSize": "page_size"
|
|
379
|
+
},
|
|
380
|
+
"merge-pull": {
|
|
381
|
+
"commitMessage": "commit_message",
|
|
382
|
+
"commitTitle": "commit_title",
|
|
383
|
+
"mergeStyle": "merge_style"
|
|
384
|
+
},
|
|
385
|
+
"list-pull-reviews": {
|
|
386
|
+
"pageSize": "page_size"
|
|
387
|
+
},
|
|
388
|
+
"post-pull-review": {
|
|
389
|
+
"commentsBody": "comments@body",
|
|
390
|
+
"commentsEndLine": "comments@end_line",
|
|
391
|
+
"commentsEndSide": "comments@end_side",
|
|
392
|
+
"commentsPath": "comments@path",
|
|
393
|
+
"commentsStartLine": "comments@start_line",
|
|
394
|
+
"commentsStartSide": "comments@start_side",
|
|
395
|
+
"commentsSubjectType": "comments@subject_type"
|
|
396
|
+
},
|
|
397
|
+
"list-pull-review-comments": {
|
|
398
|
+
"reviewId": "review_id",
|
|
399
|
+
"pageSize": "page_size"
|
|
400
|
+
},
|
|
401
|
+
"post-pull-request-review-reply": {
|
|
402
|
+
"reviewId": "review_id",
|
|
403
|
+
"replyToCommentId": "reply_to_comment_id"
|
|
404
|
+
},
|
|
405
|
+
"upload-files": {
|
|
406
|
+
"extType": "ext@type",
|
|
407
|
+
"extAdditionalProperties": "ext@additionalProperties"
|
|
408
|
+
},
|
|
409
|
+
"upload-imgs": {
|
|
410
|
+
"extType": "ext@type",
|
|
411
|
+
"extAdditionalProperties": "ext@additionalProperties"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"repo-labels": {
|
|
415
|
+
"list-labels": {
|
|
416
|
+
"pageSize": "page_size"
|
|
417
|
+
},
|
|
418
|
+
"patch-label": {
|
|
419
|
+
"newName": "new_name"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"releases": {
|
|
423
|
+
"list-releases": {
|
|
424
|
+
"pageSize": "page_size"
|
|
425
|
+
},
|
|
426
|
+
"post-release": {
|
|
427
|
+
"makeLatest": "make_latest",
|
|
428
|
+
"tagName": "tag_name",
|
|
429
|
+
"targetCommitish": "target_commitish"
|
|
430
|
+
},
|
|
431
|
+
"get-release-by-id": {
|
|
432
|
+
"releaseId": "release_id"
|
|
433
|
+
},
|
|
434
|
+
"delete-release": {
|
|
435
|
+
"releaseId": "release_id"
|
|
436
|
+
},
|
|
437
|
+
"patch-release": {
|
|
438
|
+
"releaseId": "release_id",
|
|
439
|
+
"makeLatest": "make_latest"
|
|
440
|
+
},
|
|
441
|
+
"post-release-asset-upload-confirmation": {
|
|
442
|
+
"releaseId": "release_id",
|
|
443
|
+
"uploadToken": "upload_token",
|
|
444
|
+
"assetPath": "asset_path"
|
|
445
|
+
},
|
|
446
|
+
"post-release-asset-upload-url": {
|
|
447
|
+
"releaseId": "release_id",
|
|
448
|
+
"assetName": "asset_name"
|
|
449
|
+
},
|
|
450
|
+
"get-release-asset": {
|
|
451
|
+
"releaseId": "release_id",
|
|
452
|
+
"assetId": "asset_id"
|
|
453
|
+
},
|
|
454
|
+
"delete-release-asset": {
|
|
455
|
+
"releaseId": "release_id",
|
|
456
|
+
"assetId": "asset_id"
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"security": {},
|
|
460
|
+
"git-settings": {
|
|
461
|
+
"post-branch-protection": {
|
|
462
|
+
"allowCreation": "allow_creation",
|
|
463
|
+
"allowDeletions": "allow_deletions",
|
|
464
|
+
"allowForcePushes": "allow_force_pushes",
|
|
465
|
+
"allowMasterCreation": "allow_master_creation",
|
|
466
|
+
"allowMasterDeletions": "allow_master_deletions",
|
|
467
|
+
"allowMasterForcePushes": "allow_master_force_pushes",
|
|
468
|
+
"allowMasterManualMerge": "allow_master_manual_merge",
|
|
469
|
+
"allowMasterPushes": "allow_master_pushes",
|
|
470
|
+
"allowPushes": "allow_pushes",
|
|
471
|
+
"forbidApprovePullCreatedByOwnNpc": "forbid_approve_pull_created_by_own_npc",
|
|
472
|
+
"requiredApprovedReviewCount": "required_approved_review_count",
|
|
473
|
+
"requiredApprovedReviewRatio": "required_approved_review_ratio",
|
|
474
|
+
"requiredLinearHistory": "required_linear_history",
|
|
475
|
+
"requiredMasterApprove": "required_master_approve",
|
|
476
|
+
"requiredMustAutoMerge": "required_must_auto_merge",
|
|
477
|
+
"requiredMustPushViaPullRequest": "required_must_push_via_pull_request",
|
|
478
|
+
"requiredPullRequestReviews": "required_pull_request_reviews",
|
|
479
|
+
"requiredStatusChecks": "required_status_checks"
|
|
480
|
+
},
|
|
481
|
+
"patch-branch-protection": {
|
|
482
|
+
"allowCreation": "allow_creation",
|
|
483
|
+
"allowDeletions": "allow_deletions",
|
|
484
|
+
"allowForcePushes": "allow_force_pushes",
|
|
485
|
+
"allowMasterCreation": "allow_master_creation",
|
|
486
|
+
"allowMasterDeletions": "allow_master_deletions",
|
|
487
|
+
"allowMasterForcePushes": "allow_master_force_pushes",
|
|
488
|
+
"allowMasterManualMerge": "allow_master_manual_merge",
|
|
489
|
+
"allowMasterPushes": "allow_master_pushes",
|
|
490
|
+
"allowPushes": "allow_pushes",
|
|
491
|
+
"forbidApprovePullCreatedByOwnNpc": "forbid_approve_pull_created_by_own_npc",
|
|
492
|
+
"dId": "d-id",
|
|
493
|
+
"requiredApprovedReviewCount": "required_approved_review_count",
|
|
494
|
+
"requiredApprovedReviewRatio": "required_approved_review_ratio",
|
|
495
|
+
"requiredLinearHistory": "required_linear_history",
|
|
496
|
+
"requiredMasterApprove": "required_master_approve",
|
|
497
|
+
"requiredMustAutoMerge": "required_must_auto_merge",
|
|
498
|
+
"requiredMustPushViaPullRequest": "required_must_push_via_pull_request",
|
|
499
|
+
"requiredPullRequestReviews": "required_pull_request_reviews",
|
|
500
|
+
"requiredStatusChecks": "required_status_checks"
|
|
501
|
+
},
|
|
502
|
+
"put-pipeline-settings": {
|
|
503
|
+
"autoTrigger": "auto_trigger",
|
|
504
|
+
"forkedRepoAutoTrigger": "forked_repo_auto_trigger"
|
|
505
|
+
},
|
|
506
|
+
"put-pull-request-settings": {
|
|
507
|
+
"allowMergeCommitMerge": "allow_merge_commit_merge",
|
|
508
|
+
"allowRebaseMerge": "allow_rebase_merge",
|
|
509
|
+
"allowSquashMerge": "allow_squash_merge",
|
|
510
|
+
"masterAutoAsReviewer": "master_auto_as_reviewer",
|
|
511
|
+
"mergeCommitMessageStyle": "merge_commit_message_style",
|
|
512
|
+
"squashCommitMessageStyle": "squash_commit_message_style"
|
|
513
|
+
},
|
|
514
|
+
"put-push-limit-settings": {
|
|
515
|
+
"allowSinglePushNumber": "allow_single_push_number",
|
|
516
|
+
"checkSinglePushNumber": "check_single_push_number",
|
|
517
|
+
"commitMustBeSignatured": "commit_must_be_signatured",
|
|
518
|
+
"onlyMasterCanPushTag": "only_master_can_push_tag",
|
|
519
|
+
"pushCommitMustBe": "push_commit_must_be"
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
"charge": {},
|
|
523
|
+
"repo-code-issue": {
|
|
524
|
+
"list-code-issue-open-api": {
|
|
525
|
+
"issueRule": "issue_rule",
|
|
526
|
+
"riskLevel": "risk_level",
|
|
527
|
+
"pageSize": "page_size"
|
|
528
|
+
},
|
|
529
|
+
"get-code-issue-detail-open-api": {
|
|
530
|
+
"recordId": "record_id"
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
"repo-contributor": {
|
|
534
|
+
"get-repo-contributor-trend": {
|
|
535
|
+
"excludeExternalUsers": "exclude_external_users"
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.executeAction = executeAction;
|
|
7
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
var _shortcuts = require("../shortcuts");
|
|
10
|
+
var _upload = require("../utils/upload");
|
|
11
|
+
var _formatParams = require("./format-params");
|
|
12
|
+
var _formatOutput = require("./format-output");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
async function executeAction(moduleArg, toolArg, opts, parentCmd) {
|
|
15
|
+
// Commander 已解析好所有 option,直接构建 params
|
|
16
|
+
const params = {};
|
|
17
|
+
if (moduleArg) params.module = moduleArg;
|
|
18
|
+
if (toolArg) params.tool = toolArg;
|
|
19
|
+
|
|
20
|
+
// 从 Commander 解析好的 opts 中取出所有参数
|
|
21
|
+
const reservedKeys = new Set(['help', 'h']);
|
|
22
|
+
for (const [key, value] of Object.entries(opts)) {
|
|
23
|
+
if (reservedKeys.has(key)) continue;
|
|
24
|
+
if (value !== undefined) {
|
|
25
|
+
params[key] = value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (params.short) {
|
|
29
|
+
(0, _shortcuts.showShort)();
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
const shortcut = (0, _shortcuts.resolveShortcut)(params.module, params.tool);
|
|
33
|
+
if (shortcut) {
|
|
34
|
+
params.module = shortcut.module;
|
|
35
|
+
params.tool = shortcut.tool;
|
|
36
|
+
for (const [key, value] of Object.entries(shortcut.autoPath)) {
|
|
37
|
+
if (!params[key]) {
|
|
38
|
+
params[key] = value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (shortcut.autoData) {
|
|
42
|
+
for (const [key, value] of Object.entries(shortcut.autoData)) {
|
|
43
|
+
if (params[key] === undefined) {
|
|
44
|
+
params[key] = value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!params.tool) {
|
|
50
|
+
parentCmd.help();
|
|
51
|
+
}
|
|
52
|
+
const formattedParams = (0, _formatParams.formatParams)(params);
|
|
53
|
+
const toolPath = _path.default.join(__dirname, '../../modules', `${formattedParams.module}/${formattedParams.tool}.js`);
|
|
54
|
+
if (!_fs.default.existsSync(toolPath)) {
|
|
55
|
+
console.error(`工具文件不存在: ${toolPath}`);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
const toolModule = require(toolPath);
|
|
59
|
+
const toolFunction = toolModule.default;
|
|
60
|
+
if (!toolFunction) {
|
|
61
|
+
console.error(`工具函数不存在`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
const toolsParam = [];
|
|
65
|
+
let pathAndQueryParams = null;
|
|
66
|
+
if (formattedParams.path && Object.keys(formattedParams.path).length === 1 && !formattedParams.query) {
|
|
67
|
+
pathAndQueryParams = formattedParams.path[Object.keys(formattedParams.path)[0]];
|
|
68
|
+
} else {
|
|
69
|
+
if (formattedParams.path) {
|
|
70
|
+
pathAndQueryParams = {
|
|
71
|
+
...formattedParams.path
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (formattedParams.query) {
|
|
75
|
+
pathAndQueryParams = {
|
|
76
|
+
...(pathAndQueryParams && typeof pathAndQueryParams === 'object' ? pathAndQueryParams : {}),
|
|
77
|
+
...formattedParams.query
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (pathAndQueryParams) {
|
|
82
|
+
toolsParam.push(pathAndQueryParams);
|
|
83
|
+
}
|
|
84
|
+
let data;
|
|
85
|
+
if (shortcut?.upload) {
|
|
86
|
+
data = await (0, _upload.handleUpload)(shortcut, formattedParams.data?.file, toolFunction, pathAndQueryParams);
|
|
87
|
+
} else {
|
|
88
|
+
if (formattedParams.data) {
|
|
89
|
+
toolsParam.push(formattedParams.data);
|
|
90
|
+
}
|
|
91
|
+
data = await toolFunction(...toolsParam);
|
|
92
|
+
}
|
|
93
|
+
const toolKey = `${formattedParams.module}/${formattedParams.tool}`;
|
|
94
|
+
const isVerbose = !!formattedParams.verbose;
|
|
95
|
+
const isSummary = shortcut ? !isVerbose : false;
|
|
96
|
+
console.log((0, _formatOutput.formatOutput)(data, isVerbose, isSummary, toolKey));
|
|
97
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getExtraHelpText = getExtraHelpText;
|
|
7
|
+
/**
|
|
8
|
+
* 生成额外的帮助提示字符串
|
|
9
|
+
* 包含模块列表和用法示例,供 commander .addHelpText() 使用
|
|
10
|
+
*/
|
|
11
|
+
function getExtraHelpText() {
|
|
12
|
+
const cliCmd = "cnb" || 'cnb';
|
|
13
|
+
return `
|
|
14
|
+
|
|
15
|
+
用法: ${cliCmd} issues list-issues --repo my-org/my-repo --page 1 --pageSize 10
|
|
16
|
+
${cliCmd} issues create-issue --repo my-org/my-repo --title Bug
|
|
17
|
+
帮助: ${cliCmd} <module> --help
|
|
18
|
+
${cliCmd} <module> <tool> --help
|
|
19
|
+
快捷: ${cliCmd} --short`;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.flatOptionsData = void 0;
|
|
7
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const flatOptionsFilePath = _path.default.join(__dirname, '../flat-options.json');
|
|
11
|
+
let data = {};
|
|
12
|
+
if (_fs.default.existsSync(flatOptionsFilePath)) {
|
|
13
|
+
const content = _fs.default.readFileSync(flatOptionsFilePath, 'utf8');
|
|
14
|
+
data = JSON.parse(content);
|
|
15
|
+
}
|
|
16
|
+
const flatOptionsData = exports.flatOptionsData = data;
|