@gitbeaker/cli 36.0.0-rc.2 → 36.0.1-next.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.
- package/LICENSE.md +22 -0
- package/README.md +92 -97
- package/package.json +9 -5
- package/dist/index.mjs +0 -200
package/LICENSE.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c)
|
|
4
|
+
**2023 Justin Dalrymple**
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,16 +6,11 @@
|
|
|
6
6
|
<p align="center">
|
|
7
7
|
<a href="https://gitlab.com/jdalrymple/gitbeaker/-/commits/main"><img alt="pipeline status" src="https://gitlab.com/jdalrymple/gitbeaker/badges/main/pipeline.svg" /></a>
|
|
8
8
|
<a href="https://gitlab.com/jdalrymple/gitbeaker/-/commits/main"><img alt="coverage report" src="https://gitlab.com/jdalrymple/gitbeaker/badges/main/coverage.svg" /></a>
|
|
9
|
-
|
|
10
9
|
<a href="https://codeclimate.com/github/jdalrymple/gitbeaker">
|
|
11
10
|
<img src="https://codeclimate.com/github/jdalrymple/gitbeaker/badges/gpa.svg" alt="Code Climate maintainability">
|
|
12
11
|
</a>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<img src="https://status.david-dm.org/gh/jdalrymple/gitbeaker.svg" alt="Dependency Status" />
|
|
16
|
-
</a>
|
|
17
|
-
<a href="https://david-dm.org/jdalrymple/gitbeaker?type=dev">
|
|
18
|
-
<img src="https://status.david-dm.org/gh/jdalrymple/gitbeaker.svg?type=dev" alt="Dev Dependency Status" />
|
|
12
|
+
<a href="https://img.shields.io/librariesio/release/npm/@gitbeaker/cli">
|
|
13
|
+
<img src="https://img.shields.io/librariesio/release/npm/@gitbeaker/cli" alt="Dependency Status" />
|
|
19
14
|
</a>
|
|
20
15
|
<a href="https://github.com/intuit/auto">
|
|
21
16
|
<img src="https://img.shields.io/badge/release-auto.svg?colorA=888888&colorB=9B065A&label=auto" alt="Auto">
|
|
@@ -61,7 +56,7 @@ Where:
|
|
|
61
56
|
|
|
62
57
|
- `service name` is any of the supported API names of the [@gitbeaker/rest](https://github.com/jdalrymple/gitbeaker/blob/main/packages/rest/README.md) sdk
|
|
63
58
|
- `method name` is any of the supported commands on that API service (See source for exceptions, but generally all, show, remove, update)
|
|
64
|
-
- `--config_args` is any of general configuration arguments such as your personal token. These are outlined in
|
|
59
|
+
- `--config_args` is any of general configuration arguments such as your personal token. These are outlined in this [table](https://github.com/jdalrymple/gitbeaker/blob/main/README.md?#api-client) and can also be found by looking at the cli help menu. These arguments must also include a `gb` or `gl` prefix. ie.
|
|
65
60
|
|
|
66
61
|
```bash
|
|
67
62
|
# To get all the projects
|
|
@@ -97,101 +92,101 @@ This could be set globally or using a [.env](https://github.com/motdotla/dotenv#
|
|
|
97
92
|
<!-- markdownlint-disable -->
|
|
98
93
|
<p>
|
|
99
94
|
<tr>
|
|
100
|
-
<td align="center" valign="top" width="3.
|
|
101
|
-
<td align="center" valign="top" width="3.
|
|
102
|
-
<td align="center" valign="top" width="3.
|
|
103
|
-
<td align="center" valign="top" width="3.
|
|
104
|
-
<td align="center" valign="top" width="3.
|
|
105
|
-
<td align="center" valign="top" width="3.
|
|
106
|
-
<td align="center" valign="top" width="3.
|
|
107
|
-
<td align="center" valign="top" width="3.
|
|
108
|
-
<td align="center" valign="top" width="3.
|
|
109
|
-
<td align="center" valign="top" width="3.
|
|
110
|
-
<td align="center" valign="top" width="3.
|
|
111
|
-
<td align="center" valign="top" width="3.
|
|
112
|
-
<td align="center" valign="top" width="3.
|
|
113
|
-
<td align="center" valign="top" width="3.
|
|
114
|
-
<td align="center" valign="top" width="3.
|
|
115
|
-
<td align="center" valign="top" width="3.
|
|
116
|
-
<td align="center" valign="top" width="3.
|
|
117
|
-
<td align="center" valign="top" width="3.
|
|
118
|
-
<td align="center" valign="top" width="3.
|
|
119
|
-
<td align="center" valign="top" width="3.
|
|
120
|
-
<td align="center" valign="top" width="3.
|
|
121
|
-
<td align="center" valign="top" width="3.
|
|
122
|
-
<td align="center" valign="top" width="3.
|
|
123
|
-
<td align="center" valign="top" width="3.
|
|
124
|
-
<td align="center" valign="top" width="3.
|
|
125
|
-
<td align="center" valign="top" width="3.
|
|
126
|
-
<td align="center" valign="top" width="3.7%"><a href="https://github.com/s-kazuki"><img src="https://images.weserv.nl/?url=https://avatars2.githubusercontent.com/u/9253374?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="s-kazuki"/></td>
|
|
95
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/jdalrymple"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/3743662?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Justin Dalrymple"/></td>
|
|
96
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/dylandesrosier"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/13701258?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Dylan DesRosier"/></td>
|
|
97
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/mikew"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/4729?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Mike Wyatt"/></td>
|
|
98
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/coryzibell"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/7986014?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Cory Zibeill"/></td>
|
|
99
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/shadygrove"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/5209850?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Martin Bour"/></td>
|
|
100
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/akira345"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/655764?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="akira345"/></td>
|
|
101
|
+
<td align="center" valign="top" width="3.84%"><a href="https://birukov.me"><img src="https://images.weserv.nl/?url=https://avatars2.githubusercontent.com/u/1861546?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Pavel Birukov "/></td>
|
|
102
|
+
<td align="center" valign="top" width="3.84%"><a href="http://jetersen.dev"><img src="https://images.weserv.nl/?url=https://avatars2.githubusercontent.com/u/1661688?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Joseph Petersen"/></td>
|
|
103
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Musinux"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/563373?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Louis Cherel"/></td>
|
|
104
|
+
<td align="center" valign="top" width="3.84%"><a href="http://www.arsdehnel.net"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/1697162?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Adam Dehnel"/></td>
|
|
105
|
+
<td align="center" valign="top" width="3.84%"><a href="http://www.haus.gg/"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/226640?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Ev Haus"/></td>
|
|
106
|
+
<td align="center" valign="top" width="3.84%"><a href="http://iGLOO.be"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/900947?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Loïc Mahieu"/></td>
|
|
107
|
+
<td align="center" valign="top" width="3.84%"><a href="http://www.giuseppeangri.com"><img src="https://images.weserv.nl/?url=https://avatars2.githubusercontent.com/u/9075163?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Giuseppe Angri"/></td>
|
|
108
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/jennparise"><img src="https://images.weserv.nl/?url=https://avatars1.githubusercontent.com/u/4134086?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="jennparise"/></td>
|
|
109
|
+
<td align="center" valign="top" width="3.84%"><a href="http://obartra.github.io"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/3877773?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Oscar"/></td>
|
|
110
|
+
<td align="center" valign="top" width="3.84%"><a href="https://daniel-ruf.de"><img src="https://images.weserv.nl/?url=https://avatars1.githubusercontent.com/u/827205?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Daniel Ruf"/></td>
|
|
111
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/schindld"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/1659632?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="schindld"/></td>
|
|
112
|
+
<td align="center" valign="top" width="3.84%"><a href="https://alvarobg.com"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/12004383?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Alvaro"/></td>
|
|
113
|
+
<td align="center" valign="top" width="3.84%"><a href="http://northhorizon.net"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/616152?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Daniel Moore"/></td>
|
|
114
|
+
<td align="center" valign="top" width="3.84%"><a href="https://dylanmtaylor.com"><img src="https://images.weserv.nl/?url=https://avatars2.githubusercontent.com/u/277927?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Dylan M. Taylor"/></td>
|
|
115
|
+
<td align="center" valign="top" width="3.84%"><a href="https://pixelswap.fr/"><img src="https://images.weserv.nl/?url=https://avatars1.githubusercontent.com/u/4266283?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Corentin Mors"/></td>
|
|
116
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/xatavian"><img src="https://images.weserv.nl/?url=https://avatars1.githubusercontent.com/u/17217965?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="xatavian"/></td>
|
|
117
|
+
<td align="center" valign="top" width="3.84%"><a href="https://stackoverflow.com/story/yepninja"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/11796206?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Yevgeny Petukhov"/></td>
|
|
118
|
+
<td align="center" valign="top" width="3.84%"><a href="https://about.me/mickaeltr"><img src="https://images.weserv.nl/?url=https://avatars2.githubusercontent.com/u/378910?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Mickaël Tricot"/></td>
|
|
119
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/andreasciamanna"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/181780?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Andrea"/></td>
|
|
120
|
+
<td align="center" valign="top" width="3.84%"><a href="http://www.ircad.fr/"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/8638653?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Flavien Bridault"/></td>
|
|
127
121
|
</tr><br />
|
|
128
122
|
<tr>
|
|
129
|
-
<td align="center" valign="top" width="3.
|
|
130
|
-
<td align="center" valign="top" width="3.
|
|
131
|
-
<td align="center" valign="top" width="3.
|
|
132
|
-
<td align="center" valign="top" width="3.
|
|
133
|
-
<td align="center" valign="top" width="3.
|
|
134
|
-
<td align="center" valign="top" width="3.
|
|
135
|
-
<td align="center" valign="top" width="3.
|
|
136
|
-
<td align="center" valign="top" width="3.
|
|
137
|
-
<td align="center" valign="top" width="3.
|
|
138
|
-
<td align="center" valign="top" width="3.
|
|
139
|
-
<td align="center" valign="top" width="3.
|
|
140
|
-
<td align="center" valign="top" width="3.
|
|
141
|
-
<td align="center" valign="top" width="3.
|
|
142
|
-
<td align="center" valign="top" width="3.
|
|
143
|
-
<td align="center" valign="top" width="3.
|
|
144
|
-
<td align="center" valign="top" width="3.
|
|
145
|
-
<td align="center" valign="top" width="3.
|
|
146
|
-
<td align="center" valign="top" width="3.
|
|
147
|
-
<td align="center" valign="top" width="3.
|
|
148
|
-
<td align="center" valign="top" width="3.
|
|
149
|
-
<td align="center" valign="top" width="3.
|
|
150
|
-
<td align="center" valign="top" width="3.
|
|
151
|
-
<td align="center" valign="top" width="3.
|
|
152
|
-
<td align="center" valign="top" width="3.
|
|
153
|
-
<td align="center" valign="top" width="3.
|
|
154
|
-
<td align="center" valign="top" width="3.
|
|
155
|
-
<td align="center" valign="top" width="3.7%"><a href="https://github.com/Salimlou"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/357286?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Salim Benabbou"/></td>
|
|
123
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/s-kazuki"><img src="https://images.weserv.nl/?url=https://avatars2.githubusercontent.com/u/9253374?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="s-kazuki"/></td>
|
|
124
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/kiprasmel"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/29430509?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Kipras Melnikovas"/></td>
|
|
125
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Gkxie"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/27680715?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="xieyu"/></td>
|
|
126
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/st1gok"><img src="https://images.weserv.nl/?url=https://avatars1.githubusercontent.com/u/13641693?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="st1gok"/></td>
|
|
127
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/max-wittig"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/6639323?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Max Wittig"/></td>
|
|
128
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/nlochschmidt"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/759624?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Niklas Lochschmidt"/></td>
|
|
129
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/illyaMs"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/26578665?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Ilya Dus"/></td>
|
|
130
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/wamry"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/32439651?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Omar Awamry"/></td>
|
|
131
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Sumragen"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/15640910?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Hennadii Varava"/></td>
|
|
132
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/xiezht"><img src="https://images.weserv.nl/?url=https://avatars1.githubusercontent.com/u/18051618?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="xiezht"/></td>
|
|
133
|
+
<td align="center" valign="top" width="3.84%"><a href="http://www.martin-helmich.de/en"><img src="https://images.weserv.nl/?url=https://avatars3.githubusercontent.com/u/2538958?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Martin Helmich"/></td>
|
|
134
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/smcgivern"><img src="https://images.weserv.nl/?url=https://avatars0.githubusercontent.com/u/1120328?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Sean McGivern"/></td>
|
|
135
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Vogel612"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/7288995?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Clemens Lieb"/></td>
|
|
136
|
+
<td align="center" valign="top" width="3.84%"><a href="https://sajdl.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/5222912?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Vojtěch Sajdl"/></td>
|
|
137
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/divido"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/4614626?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="divido"/></td>
|
|
138
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/vboulaye"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/652767?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Vincent Boulaye"/></td>
|
|
139
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Aliyss"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/33941859?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Aliyss Snow"/></td>
|
|
140
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/saada"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/1087987?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Mahmoud Saada"/></td>
|
|
141
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/F3n67u"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/12343178?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Feng Yu"/></td>
|
|
142
|
+
<td align="center" valign="top" width="3.84%"><a href="https://datatra.sh/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/173822?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Roy Jacobs"/></td>
|
|
143
|
+
<td align="center" valign="top" width="3.84%"><a href="http://www.paullemke.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/976010?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Paul Lemke"/></td>
|
|
144
|
+
<td align="center" valign="top" width="3.84%"><a href="http://jenko.me/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/131355?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Ian Jenkins"/></td>
|
|
145
|
+
<td align="center" valign="top" width="3.84%"><a href="https://www.nilennoct.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/4055220?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="nilennoct"/></td>
|
|
146
|
+
<td align="center" valign="top" width="3.84%"><a href="http://michael.laffargue.fr/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/503129?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Laffargue Michael"/></td>
|
|
147
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/MartinHowarth"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/7187425?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Martin Howarth"/></td>
|
|
148
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/christophlehmann"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/4953689?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Christoph Lehmann"/></td>
|
|
156
149
|
</tr><br />
|
|
157
150
|
<tr>
|
|
158
|
-
<td align="center" valign="top" width="3.
|
|
159
|
-
<td align="center" valign="top" width="3.
|
|
160
|
-
<td align="center" valign="top" width="3.
|
|
161
|
-
<td align="center" valign="top" width="3.
|
|
162
|
-
<td align="center" valign="top" width="3.
|
|
163
|
-
<td align="center" valign="top" width="3.
|
|
164
|
-
<td align="center" valign="top" width="3.
|
|
165
|
-
<td align="center" valign="top" width="3.
|
|
166
|
-
<td align="center" valign="top" width="3.
|
|
167
|
-
<td align="center" valign="top" width="3.
|
|
168
|
-
<td align="center" valign="top" width="3.
|
|
169
|
-
<td align="center" valign="top" width="3.
|
|
170
|
-
<td align="center" valign="top" width="3.
|
|
171
|
-
<td align="center" valign="top" width="3.
|
|
172
|
-
<td align="center" valign="top" width="3.
|
|
173
|
-
<td align="center" valign="top" width="3.
|
|
174
|
-
<td align="center" valign="top" width="3.
|
|
175
|
-
<td align="center" valign="top" width="3.
|
|
176
|
-
<td align="center" valign="top" width="3.
|
|
177
|
-
<td align="center" valign="top" width="3.
|
|
178
|
-
<td align="center" valign="top" width="3.
|
|
179
|
-
<td align="center" valign="top" width="3.
|
|
180
|
-
<td align="center" valign="top" width="3.
|
|
181
|
-
<td align="center" valign="top" width="3.
|
|
182
|
-
<td align="center" valign="top" width="3.
|
|
183
|
-
<td align="center" valign="top" width="3.
|
|
184
|
-
<td align="center" valign="top" width="3.7%"><a href="https://eng.evolution.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/15799569?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Evolution Engineering"/></td>
|
|
151
|
+
<td align="center" valign="top" width="3.84%"><a href="https://theopensourceu.org/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/253471?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Frank V"/></td>
|
|
152
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Salimlou"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/357286?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Salim Benabbou"/></td>
|
|
153
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/tvtamas"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/1945260?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Tamás Török-Vistai"/></td>
|
|
154
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/MartinBenninger"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/20296116?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Martin Benninger"/></td>
|
|
155
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/fewieden"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/9334168?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="fewieden"/></td>
|
|
156
|
+
<td align="center" valign="top" width="3.84%"><a href="https://www.jeffpelton.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/36627?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Jeff Pelton"/></td>
|
|
157
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/claude-abounegm"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/11809881?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Claude Abounegm"/></td>
|
|
158
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Marethyu1"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/17978203?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Stefan Hall"/></td>
|
|
159
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Mr-Wallet"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/799000?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Jordan Wallet"/></td>
|
|
160
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/zhao0"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/7556666?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="zhao0"/></td>
|
|
161
|
+
<td align="center" valign="top" width="3.84%"><a href="https://www.linkedin.com/in/joshuagrosso"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/4530584?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Joshua Grosso"/></td>
|
|
162
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/yonguelink"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/9469187?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Isaac Ouellet Therrien"/></td>
|
|
163
|
+
<td align="center" valign="top" width="3.84%"><a href="https://wearecws.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/24895138?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Rajat Sharma"/></td>
|
|
164
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Casz"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/65105345?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Cesar B."/></td>
|
|
165
|
+
<td align="center" valign="top" width="3.84%"><a href="https://blog.katsuba.dev/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/10637135?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Igor Katsuba"/></td>
|
|
166
|
+
<td align="center" valign="top" width="3.84%"><a href="http://www.doublespeakgames.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/4884483?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Michael Townsend"/></td>
|
|
167
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/bodtx"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/1039550?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="bodtx"/></td>
|
|
168
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/arthot"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/1815294?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Artem"/></td>
|
|
169
|
+
<td align="center" valign="top" width="3.84%"><a href="https://muniftanjim.dev/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/8050659?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Munif Tanjim"/></td>
|
|
170
|
+
<td align="center" valign="top" width="3.84%"><a href="https://www.qkdreyer.dev/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/717869?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Quentin Dreyer"/></td>
|
|
171
|
+
<td align="center" valign="top" width="3.84%"><a href="https://iwritethe.codes/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/192728?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Norm MacLennan"/></td>
|
|
172
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/jnovick"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/7881319?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="jnovick"/></td>
|
|
173
|
+
<td align="center" valign="top" width="3.84%"><a href="https://www.fabianaussems.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/57530?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Fabian Aussems"/></td>
|
|
174
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/mima0815"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/14311597?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Michael Matzka"/></td>
|
|
175
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/CraigAllardyce"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/9052289?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="CraigAllardyce"/></td>
|
|
176
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/brunobastosg"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/320122?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Bruno Guimarães"/></td>
|
|
185
177
|
</tr><br />
|
|
186
178
|
<tr>
|
|
187
|
-
<td align="center" valign="top" width="3.
|
|
188
|
-
<td align="center" valign="top" width="3.
|
|
189
|
-
<td align="center" valign="top" width="3.
|
|
190
|
-
<td align="center" valign="top" width="3.
|
|
191
|
-
<td align="center" valign="top" width="3.
|
|
192
|
-
<td align="center" valign="top" width="3.
|
|
193
|
-
<td align="center" valign="top" width="3.
|
|
194
|
-
<td align="center" valign="top" width="3.
|
|
179
|
+
<td align="center" valign="top" width="3.84%"><a href="http://leipert.io/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/2906107?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Lukas Eipert"/></td>
|
|
180
|
+
<td align="center" valign="top" width="3.84%"><a href="https://max.krauss.io/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/914671?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Maximilian Krauß"/></td>
|
|
181
|
+
<td align="center" valign="top" width="3.84%"><a href="https://eng.evolution.com/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/15799569?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Evolution Engineering"/></td>
|
|
182
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/Neonox31"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/1135958?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="WEBER Logan"/></td>
|
|
183
|
+
<td align="center" valign="top" width="3.84%"><a href="https://t.me/mister_cheater"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/5055654?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Anton Zhukov"/></td>
|
|
184
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/beaverusiv"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/4149031?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Nicholas Loomans"/></td>
|
|
185
|
+
<td align="center" valign="top" width="3.84%"><a href="https://icedream.pw/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/807772?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Carl Kittelberger"/></td>
|
|
186
|
+
<td align="center" valign="top" width="3.84%"><a href="https://patrik.votocek.cz/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/112567?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Patrik Votoček"/></td>
|
|
187
|
+
<td align="center" valign="top" width="3.84%"><a href="https://kyr.github.io/CV/"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/426462?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Kyrylo Fedorov"/></td>
|
|
188
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/claudio-vellage"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/28930612?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Claudio Vellage"/></td>
|
|
189
|
+
<td align="center" valign="top" width="3.84%"><a href="https://github.com/seb0uil"><img src="https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/5122626?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt="Seb0uil"/></td>
|
|
195
190
|
</tr>
|
|
196
191
|
</p>
|
|
197
192
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitbeaker/cli",
|
|
3
|
-
"version": "36.0.
|
|
3
|
+
"version": "36.0.1-next.1",
|
|
4
4
|
"description": "CLI implementation of the GitLab API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -41,11 +41,14 @@
|
|
|
41
41
|
"format": "yarn format:src && yarn format:docs",
|
|
42
42
|
"format:fix": "yarn format:src:fix && yarn format:docs:fix",
|
|
43
43
|
"lint": "eslint '{src,test}/**/*.ts'",
|
|
44
|
-
"lint:fix": "yarn lint --fix"
|
|
44
|
+
"lint:fix": "yarn lint --fix",
|
|
45
|
+
"release:rc": "auto next",
|
|
46
|
+
"release:canary": "auto canary",
|
|
47
|
+
"release": "auto shipit"
|
|
45
48
|
},
|
|
46
49
|
"dependencies": {
|
|
47
|
-
"@gitbeaker/core": "36.0.
|
|
48
|
-
"@gitbeaker/rest": "36.0.
|
|
50
|
+
"@gitbeaker/core": "36.0.1-next.1",
|
|
51
|
+
"@gitbeaker/rest": "36.0.1-next.1",
|
|
49
52
|
"chalk": "4.1.2",
|
|
50
53
|
"sywac": "^1.3.0",
|
|
51
54
|
"xcase": "^2.0.1"
|
|
@@ -53,5 +56,6 @@
|
|
|
53
56
|
"devDependencies": {
|
|
54
57
|
"tsup": "^6.6.3",
|
|
55
58
|
"typescript": "^4.9.5"
|
|
56
|
-
}
|
|
59
|
+
},
|
|
60
|
+
"gitHead": "e81f1526478739ad493a95dff65d4043cc9158b6"
|
|
57
61
|
}
|
package/dist/index.mjs
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import Chalk from 'chalk';
|
|
3
|
-
import Sywac from 'sywac';
|
|
4
|
-
import { decamelize, depascalize, camelize } from 'xcase';
|
|
5
|
-
import * as Gitbeaker from '@gitbeaker/rest';
|
|
6
|
-
import API_MAP from '@gitbeaker/core/map.json' assert { type: 'json' };
|
|
7
|
-
|
|
8
|
-
var commandStyle = Chalk.hex("#e34329").bold;
|
|
9
|
-
var groupStyle = Chalk.hex("#fca325").bold;
|
|
10
|
-
var usageStyle = Chalk.hex("#fc6e26").bold;
|
|
11
|
-
var optionStyle = Chalk.white.bold;
|
|
12
|
-
var descriptionStyle = Chalk.hex("#848484");
|
|
13
|
-
var hintStyle = Chalk.hex("#6a5f88");
|
|
14
|
-
function normalizeEnviromentVariables(env) {
|
|
15
|
-
const normalized = { ...env };
|
|
16
|
-
const suffixes = [
|
|
17
|
-
"TOKEN",
|
|
18
|
-
"OAUTH_TOKEN",
|
|
19
|
-
"JOB_TOKEN",
|
|
20
|
-
"HOST",
|
|
21
|
-
"SUDO",
|
|
22
|
-
"CAMELIZE",
|
|
23
|
-
"REQUEST_TIMEOUT",
|
|
24
|
-
"PROFILE_TOKEN",
|
|
25
|
-
"PROFILE_MODE"
|
|
26
|
-
];
|
|
27
|
-
suffixes.forEach((s) => {
|
|
28
|
-
if (normalized[`GITLAB_${s}`] && !normalized[`GITBEAKER_${s}`]) {
|
|
29
|
-
normalized[`GITBEAKER_${s}`] = normalized[`GITLAB_${s}`];
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return normalized;
|
|
33
|
-
}
|
|
34
|
-
function globalConfig(env = process.env) {
|
|
35
|
-
const normalEnv = normalizeEnviromentVariables(env);
|
|
36
|
-
return {
|
|
37
|
-
"gb-token": {
|
|
38
|
-
alias: "gl-token",
|
|
39
|
-
desc: "Your Gitlab Personal Token",
|
|
40
|
-
type: "string",
|
|
41
|
-
defaultValue: normalEnv.GITBEAKER_TOKEN
|
|
42
|
-
},
|
|
43
|
-
"gb-oauth-token": {
|
|
44
|
-
alias: "gl-oauth-token",
|
|
45
|
-
desc: "Your Gitlab OAuth Token",
|
|
46
|
-
type: "string",
|
|
47
|
-
defaultValue: normalEnv.GITBEAKER_OAUTH_TOKEN
|
|
48
|
-
},
|
|
49
|
-
"gb-job-token": {
|
|
50
|
-
alias: "gl-job-token",
|
|
51
|
-
desc: "Your Gitlab Job Token",
|
|
52
|
-
type: "string",
|
|
53
|
-
defaultValue: normalEnv.GITBEAKER_JOB_TOKEN
|
|
54
|
-
},
|
|
55
|
-
"gb-host": {
|
|
56
|
-
alias: "gl-host",
|
|
57
|
-
desc: "Your Gitlab API host (Defaults to https://www.gitlab.com)",
|
|
58
|
-
type: "string",
|
|
59
|
-
defaultValue: normalEnv.GITBEAKER_HOST
|
|
60
|
-
},
|
|
61
|
-
"gb-sudo": {
|
|
62
|
-
alias: "gl-sudo",
|
|
63
|
-
desc: "[Sudo](https://docs.gitlab.com/ee/api/#sudo) query parameter",
|
|
64
|
-
type: "string",
|
|
65
|
-
defaultValue: normalEnv.GITBEAKER_SUDO
|
|
66
|
-
},
|
|
67
|
-
"gb-camelize": {
|
|
68
|
-
alias: "gl-camelize",
|
|
69
|
-
desc: "Camelizes all response body keys",
|
|
70
|
-
type: "boolean",
|
|
71
|
-
defaultValue: normalEnv.GITBEAKER_CAMELIZE
|
|
72
|
-
},
|
|
73
|
-
"gb-request-timeout": {
|
|
74
|
-
alias: "gl-request-timeout",
|
|
75
|
-
desc: "Timeout for API requests. Measured in ms",
|
|
76
|
-
type: "number",
|
|
77
|
-
defaultValue: normalEnv.GITBEAKER_REQUEST_TIMEOUT && parseInt(normalEnv.GITBEAKER_REQUEST_TIMEOUT, 10)
|
|
78
|
-
},
|
|
79
|
-
"gb-profile-token": {
|
|
80
|
-
alias: "gl-profile-token",
|
|
81
|
-
desc: "[Requests Profiles Token](https://docs.gitlab.com/ee/administration/monitoring/performance/request_profiling.html)",
|
|
82
|
-
type: "string",
|
|
83
|
-
defaultValue: normalEnv.GITBEAKER_PROFILE_TOKEN
|
|
84
|
-
},
|
|
85
|
-
"gb-profile-mode": {
|
|
86
|
-
alias: "gl-profile-mode",
|
|
87
|
-
desc: "[Requests Profiles Token](https://docs.gitlab.com/ee/administration/monitoring/performance/request_profiling.html)",
|
|
88
|
-
type: "string",
|
|
89
|
-
defaultValue: normalEnv.GITBEAKER_PROFILE_MODE
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
var ignoreOptions = ["_", "$0", "v", "version", "h", "help", "g", "global-args"];
|
|
94
|
-
function param(value) {
|
|
95
|
-
let cleaned = value;
|
|
96
|
-
const exceptions = [
|
|
97
|
-
"GitLabCI",
|
|
98
|
-
"YML",
|
|
99
|
-
"GPG",
|
|
100
|
-
"SSH",
|
|
101
|
-
"IId",
|
|
102
|
-
"NPM",
|
|
103
|
-
"NuGet",
|
|
104
|
-
"DORA4",
|
|
105
|
-
"LDAP",
|
|
106
|
-
"CICD"
|
|
107
|
-
];
|
|
108
|
-
const ex = exceptions.find((e) => value.includes(e));
|
|
109
|
-
if (ex)
|
|
110
|
-
cleaned = cleaned.replace(ex, ex.charAt(0).toUpperCase() + ex.slice(1).toLowerCase());
|
|
111
|
-
const decamelized = decamelize(cleaned, "-");
|
|
112
|
-
return decamelized !== cleaned ? decamelized : depascalize(cleaned, "-");
|
|
113
|
-
}
|
|
114
|
-
function setupAPIMethods(setupArgs, methodArgs) {
|
|
115
|
-
methodArgs.forEach((name) => {
|
|
116
|
-
if (typeof name !== "string")
|
|
117
|
-
return;
|
|
118
|
-
setupArgs.positional(`[--${param(name)}] <${param(name)}>`, {
|
|
119
|
-
group: "Required Options",
|
|
120
|
-
type: "string"
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
return setupArgs;
|
|
124
|
-
}
|
|
125
|
-
function runAPIMethod(ctx, args, apiName, method) {
|
|
126
|
-
const coreArgs = {};
|
|
127
|
-
const optionalArgs = {};
|
|
128
|
-
const initArgs = {};
|
|
129
|
-
Object.entries(args).forEach(([argName, value]) => {
|
|
130
|
-
if (ignoreOptions.includes(argName) || value == null)
|
|
131
|
-
return;
|
|
132
|
-
const camelCased = camelize(argName.replace("gb-", "").replace("gl-", ""), "-");
|
|
133
|
-
if (globalConfig()[argName.replace("gl-", "gb-")]) {
|
|
134
|
-
initArgs[camelCased] = value;
|
|
135
|
-
} else if (method.args.includes(camelCased))
|
|
136
|
-
coreArgs[camelCased] = value;
|
|
137
|
-
else
|
|
138
|
-
optionalArgs[camelCased] = value;
|
|
139
|
-
});
|
|
140
|
-
const s = new Gitbeaker[apiName](initArgs);
|
|
141
|
-
return s[method.name](...Object.values(coreArgs), optionalArgs).then((r) => {
|
|
142
|
-
ctx.output = JSON.stringify(r, null, 3);
|
|
143
|
-
}).catch((e) => {
|
|
144
|
-
ctx.output = e;
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
function setupAPIs(setupArgs, apiName, methods) {
|
|
148
|
-
Object.entries(globalConfig()).forEach(([k, v]) => {
|
|
149
|
-
setupArgs.option(`${k} <value>`, {
|
|
150
|
-
group: "Base Options",
|
|
151
|
-
...v
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
for (let i = 1; i < methods.length; i += 1) {
|
|
155
|
-
const method = methods[i];
|
|
156
|
-
setupArgs.command(param(method.name), {
|
|
157
|
-
setup: (setupMethodArgs) => setupAPIMethods(setupMethodArgs, method.args),
|
|
158
|
-
run: (args, ctx) => runAPIMethod(ctx, args, apiName, method)
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return setupArgs;
|
|
162
|
-
}
|
|
163
|
-
var cli = Sywac.version("-v, --version").help("-h, --help").showHelpByDefault().epilogue("Copyright 2023").style({
|
|
164
|
-
usagePrefix: (s) => usageStyle(s),
|
|
165
|
-
group: (s) => groupStyle(s),
|
|
166
|
-
flags: (s) => optionStyle(s),
|
|
167
|
-
usageCommandPlaceholder: (s) => commandStyle(s),
|
|
168
|
-
usageOptionsPlaceholder: (s) => optionStyle(s),
|
|
169
|
-
desc: (s) => descriptionStyle(s),
|
|
170
|
-
hints: (s) => hintStyle(s)
|
|
171
|
-
});
|
|
172
|
-
cli.boolean("-g --global-args", {
|
|
173
|
-
desc: "Show global arguments currently set in the environment variables"
|
|
174
|
-
});
|
|
175
|
-
cli.command("*", (argv, ctx) => {
|
|
176
|
-
if (!argv.g)
|
|
177
|
-
return;
|
|
178
|
-
const display = {};
|
|
179
|
-
Object.entries(globalConfig()).forEach(([k, v]) => {
|
|
180
|
-
if (v.defaultValue == null)
|
|
181
|
-
return;
|
|
182
|
-
display[k] = {
|
|
183
|
-
alias: v.alias,
|
|
184
|
-
description: v.desc,
|
|
185
|
-
value: v.defaultValue
|
|
186
|
-
};
|
|
187
|
-
});
|
|
188
|
-
ctx.output = Object.keys(display).length === 0 ? "No global variables have been set!" : JSON.stringify(display, null, 3);
|
|
189
|
-
});
|
|
190
|
-
Object.entries(API_MAP).forEach(([apiName, methods]) => {
|
|
191
|
-
if (apiName === "Gitlab")
|
|
192
|
-
return;
|
|
193
|
-
cli.command(param(apiName), {
|
|
194
|
-
desc: `The ${apiName} API`,
|
|
195
|
-
setup: (setupArgs) => setupAPIs(setupArgs, apiName, methods)
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
// src/index.ts
|
|
200
|
-
cli.parseAndExit();
|