forked from mdsb100/cli-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.js
More file actions
503 lines (499 loc) · 14.3 KB
/
Copy pathmap.js
File metadata and controls
503 lines (499 loc) · 14.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
// Generated by CoffeeScript 1.7.1
var groupCustomHelp, stringify, stringifyFormat;
stringify = require("json-stable-stringify");
stringifyFormat = function(data) {
if (data != null) {
return console.log(stringify(data, {
space: 2
}));
}
};
groupCustomHelp = function() {
console.log(" access_levels");
console.log(" GUEST: 10");
console.log(" REPORTER: 20");
console.log(" DEVELOPER: 30");
console.log(" MASTER: 40");
return console.log(" OWNER: 50");
};
module.exports = {
"groups": {
options: {
per_page: {
param: "[per_page]",
alias: "e",
desc: "(optional) - The limit of list.",
type: true,
index: 0
},
page: {
param: "[page]",
alias: "p",
desc: "(optional) - The offset of list.",
type: true,
index: 0
}
},
desc: "Get retrive groups from gitlab.",
nameSpaces: "groups.all",
callback: stringifyFormat
},
"showGroup": {
param: ["<group_id>"],
desc: "Get retrive group of a given group.",
nameSpaces: "groups.show",
callback: stringifyFormat
},
"showGroupProjects": {
filter: true,
size: true,
param: ["<group_id>"],
desc: "Get retrive projects of a given group.",
nameSpaces: "groups.listProjects",
callback: stringifyFormat
},
"showGroupMembers": {
filter: true,
size: true,
param: ["<group_id>"],
help: groupCustomHelp,
desc: "Get retrive memebers of a given group.",
nameSpaces: "groups.listMembers",
callback: stringifyFormat
},
"addGroupMember": {
param: ["<group_id>", "<user_id>", "<access_level>"],
desc: "Adds a user to the list of group members.",
help: groupCustomHelp,
nameSpaces: "groups.addMember",
callback: stringifyFormat
},
"issues": {
filter: true,
assigned_to_me: "assignee.id",
created_by_me: "author.id",
size: true,
options: {
state: {
param: "[state]",
alias: "s",
type: true,
index: 0,
desc: "(optional) - Return all issues or just those that are opened or closed"
},
labels: {
param: "[labels]",
alias: "l",
type: true,
index: 0,
desc: "(optional) - Comma-separated list of label names"
},
order_by: {
param: "[order_by]",
alias: "o",
type: true,
index: 0,
desc: "(optional) - Return requests ordered by created_at or updated_at fields. Default is created_at"
},
sort: {
param: "[sort]",
alias: "d",
type: true,
index: 0,
desc: "(optional) - Return requests sorted in asc or desc order. Default is desc"
},
per_page: {
param: "[per_page]",
alias: "e",
desc: "(optional) - The limit of list.",
type: true,
index: 0
},
page: {
param: "[page]",
alias: "p",
desc: "(optional) - The offset of list.",
type: true,
index: 0
}
},
desc: "Get all issues created by authenticated user. This function takes pagination parameters page and per_page to restrict the list of issues.",
nameSpaces: "issues.all",
callback: stringifyFormat
},
"showIssue": {
param: ["<projectId>", "<issueId>"],
desc: "Get retrive issue of a given project and a given issue.",
nameSpaces: "issues.show",
callback: stringifyFormat
},
"createIssue": {
param: ["<projectId>"],
options: {
"title": {
param: "<title>",
alias: "t",
desc: "(required) - The title of an issue.",
type: true,
index: 1
},
"description": {
param: "[desc]",
alias: "d",
desc: "(optional) - The description of an issue.",
type: true,
index: 1
},
"assignee_id": {
param: "[assignee_id]",
alias: "a",
desc: "(optional) - The ID of a user to assign issue.",
type: true,
index: 1
},
"milestone_id": {
param: "[milestone_id]",
alias: "m",
desc: "(optional) - The ID of a milestone to assign issue.",
type: true,
index: 1
},
"labels": {
param: "[labels]",
alias: "l",
desc: "(optional) - Comma-separated label names for an issue.",
type: true,
index: 1
}
},
desc: "Creates a new project issue.If the operation is successful, 200 and the newly created issue is returned. If an error occurs, an error number and a message explaining the reason is returned.",
nameSpaces: "issues.create",
callback: stringifyFormat
},
"editIssue": {
param: ["<projectId>", "<issueId>"],
options: {
"title": {
param: "[title]",
alias: "t",
desc: "(optional) - The title of an issue.",
type: true,
index: 2
},
"description": {
param: "[desc]",
alias: "d",
desc: "(optional) - The description of an issue.",
type: true,
index: 2
},
"assignee_id": {
param: "[assignee_id]",
alias: "a",
desc: "(optional) - The ID of a user to assign issue.",
type: true,
index: 2
},
"milestone_id": {
param: "[milestone_id]",
alias: "m",
desc: "(optional) - The ID of a milestone to assign issue.",
type: true,
index: 2
},
"labels": {
param: "[labels]",
alias: "l",
desc: "(optional) - Comma-separated label names for an issue.",
type: true,
index: 2
},
"state_event": {
param: "[state_event]",
alias: "s",
desc: "(optional) - The state event of an issue ('close' to close issue and 'reopen' to reopen it).",
type: true,
index: 2
}
},
desc: "Updates an existing project issue. This function is also used to mark an issue as closed.If the operation is successful, 200 and the updated issue is returned. If an error occurs, an error number and a message explaining the reason is returned.",
nameSpaces: "issues.edit",
callback: stringifyFormat
},
"keys": {
param: ["<projectId>"],
desc: "Get retrive keys of a given project.",
nameSpaces: "projects.deploy_keys.listKeys",
callback: stringifyFormat
},
"getKey": {
param: ["<projectId>", "<keyId>"],
desc: "Get retrive keys of a given project and a give key.",
nameSpaces: "projects.deploy_keys.getKey",
callback: stringifyFormat
},
"hooks": {
param: ["<projectId>"],
desc: "Get retrive hooks of a given project.",
nameSpaces: "projects.hooks.list",
callback: stringifyFormat
},
"showHook": {
param: ["<projectId>", "<hookId>"],
desc: "Get retrive hook of a given project and a give hook.",
nameSpaces: "projects.hooks.show",
callback: stringifyFormat
},
"addHook": {
param: ["<projectId>", "<url>"],
desc: "Add hook by a given porject id and url.",
nameSpaces: "projects.hooks.add",
callback: stringifyFormat
},
"updateHook": {
param: ["<projectId>", "<hookId>", "<url>"],
desc: "Update hook by a given porject id, a given hook id and url.",
nameSpaces: "projects.hooks.update",
callback: stringifyFormat
},
"removeHook": {
param: ["<projectId>", "<hookId>"],
desc: "Remove hook by a given porject id abd a given hook id.",
nameSpaces: "projects.hooks.remove",
callback: stringifyFormat
},
"projectIssues": {
filter: true,
size: true,
assigned_to_me: "assignee.id",
created_by_me: "author.id",
param: ["<projectId>"],
options: {
state: {
param: "[state]",
alias: "s",
type: true,
index: 1,
desc: "(optional) - Return all issues or just those that are opened or closed"
},
labels: {
param: "[labels]",
alias: "l",
type: true,
index: 1,
desc: "(optional) - Comma-separated list of label names"
},
milestone: {
param: "[milestone]",
alias: "m",
type: true,
index: 1,
desc: "milestone (optional) - Milestone title"
},
order_by: {
param: "[order_by]",
alias: "o",
type: true,
index: 1,
desc: "(optional) - Return requests ordered by created_at or updated_at fields. Default is created_at"
},
sort: {
param: "[sort]",
alias: "d",
type: true,
index: 1,
desc: "(optional) - Return requests sorted in asc or desc order. Default is desc"
},
per_page: {
param: "[per_page]",
alias: "e",
desc: "(optional) - The limit of list.",
type: true,
index: 1
},
page: {
param: "[page]",
alias: "p",
desc: "(optional) - The offset of list.",
type: true,
index: 1
}
},
desc: "Get a list of project issues. This function accepts pagination parameters page and per_page to return the list of project issues.",
nameSpaces: "projects.issues.list",
callback: stringifyFormat
},
"members": {
param: ["<projectId>"],
desc: "Get retrive members of a given project.",
nameSpaces: "projects.members.list",
callback: stringifyFormat
},
"showMember": {
param: ["<projectId>", "<userId>"],
desc: "Get retrive member of a given project and a give user.",
nameSpaces: "projects.members.show",
callback: stringifyFormat
},
"addMember": {
param: ["<projectId>", "<userId>", "[accessLevel]"],
desc: "Add member by a given porject id and user id. Default of access level is 30.",
nameSpaces: "projects.members.add",
callback: stringifyFormat
},
"removeMember": {
param: ["<projectId>", "<userId>"],
desc: "Remove member by a given porject id and user id.",
nameSpaces: "projects.members.remove",
callback: stringifyFormat
},
"mergeRequests": {
param: ["<projectId>"],
options: {
per_page: {
param: "[per_page]",
alias: "e",
desc: "(optional) - The limit of list.",
type: true,
index: 1
},
page: {
param: "[page]",
alias: "p",
desc: "(optional) - The offset of list.",
type: true,
index: 1
}
},
desc: "Get retrive merge requests of a given project.",
nameSpaces: "projects.merge_requests.list",
callback: stringifyFormat
},
"showMergeRequest": {
param: ["<projectId>", "<mergeRequestId>"],
desc: "Get retrive merge request of a given project and a merge request.",
nameSpaces: "projects.merge_requests.show",
callback: stringifyFormat
},
"addMergeRequest": {
param: ["<projectId>", "<sourceBranch>", "<targetBranch>", "<assigneeId>", "<title>"],
desc: "Add merge request by list of parameters.",
nameSpaces: "projects.merge_requests.add",
callback: stringifyFormat
},
"updateMergeRequest": {
param: ["<projectId>", "<mergeRequestId>", "[accessLevel]"],
desc: "Update merge request of a given project and a merge request. Default of access level is 30.",
nameSpaces: "projects.merge_requests.update",
callback: stringifyFormat
},
"commentMergeRequest": {
param: ["<projectId>", "<mergeRequestId>", "<note>"],
desc: "Comment merge request by a given porject id, note and a merge request.",
nameSpaces: "projects.merge_requests.comment",
callback: stringifyFormat
},
"milestones": {
param: ["<projectId>"],
desc: "Get retrive milestones of a given project.",
nameSpaces: "projects.milestones.list",
callback: stringifyFormat
},
"showMilestones": {
param: ["<projectId>", "<milestoneId>"],
desc: "Get retrive merge request of a given project and a milestone.",
nameSpaces: "projects.milestones.show",
callback: stringifyFormat
},
"addMilestones": {
param: ["<projectId>", "<title>", "<description>", "<due_date>"],
desc: "Add milestones by list of parameters.",
nameSpaces: "projects.milestones.add",
callback: stringifyFormat
},
"updateMilestones": {
param: ["<projectId>", "<milestoneId>", "<title>", "<description>", "<due_date>", "state_event"],
desc: "Update milestones by list of parameters.",
nameSpaces: "projects.milestones.update",
callback: stringifyFormat
},
"listBranches": {
param: ["<projectId>"],
desc: "Get retrive branches of a given project.",
nameSpaces: "projects.repository.listBranches",
callback: stringifyFormat
},
"showBranch": {
param: ["<projectId>", "<branchId>"],
desc: "Get retrive branche of a given project and a branch id.",
nameSpaces: "projects.repository.showBranch",
callback: stringifyFormat
},
"listTags": {
param: ["<projectId>"],
desc: "Get retrive list tags of a given project.",
nameSpaces: "projects.repository.listTags",
callback: stringifyFormat
},
"listCommits": {
param: ["<projectId>"],
desc: "Get retrive list commits of a given project.",
nameSpaces: "projects.repository.listCommits",
callback: stringifyFormat
},
"showCommit": {
param: ["<projectId>", "<commitId>"],
desc: "Get retrive commit of a given project and a commit id.",
nameSpaces: "projects.repository.showCommit",
callback: stringifyFormat
},
"diffCommit": {
param: ["<projectId>", "<sha>"],
desc: "Diff commit of a given project and sha.",
nameSpaces: "projects.repository.diffCommit",
callback: stringifyFormat
},
"projects": {
options: {
per_page: {
param: "[per_page]",
alias: "e",
desc: "(optional) - The limit of list.",
type: true,
index: 0
},
page: {
param: "[page]",
alias: "p",
desc: "(optional) - The offset of list.",
type: true,
index: 0
}
},
desc: "Get retrive projects.",
nameSpaces: "projects.all",
callback: stringifyFormat
},
"users": {
desc: "Get retrive users from gitlab.",
nameSpaces: "users.all",
callback: stringifyFormat
},
"me": {
desc: "About me.",
nameSpaces: "users.current",
callback: stringifyFormat
},
"showUser": {
param: ["<userId>"],
desc: "Show users by user id.",
nameSpaces: "users.show",
callback: stringifyFormat
},
"session": {
param: ["<email>", "<password>"],
desc: "Get session by email and password.",
nameSpaces: "users.session",
callback: stringifyFormat
}
};