@gitbeaker/requester-utils 36.0.0-rc.0 → 36.0.1-next.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/LICENSE.md +22 -0
- package/README.md +92 -97
- package/package.json +8 -4
- package/dist/index.d.ts +0 -74
- package/dist/index.js +0 -117
- package/dist/index.mjs +0 -111
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
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<br>
|
|
3
|
-
<img alt="gitbeaker" src="
|
|
3
|
+
<img alt="gitbeaker" src="https://github.com/jdalrymple/gitbeaker/blob/main/.github/ASSETS/header.svg">
|
|
4
4
|
</div>
|
|
5
5
|
<br>
|
|
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/requester-utils">
|
|
13
|
+
<img src="https://img.shields.io/librariesio/release/npm/@gitbeaker/requester-utils" 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">
|
|
@@ -90,101 +85,101 @@ import { RequesterUtils, BaseResource } from '@gitbeaker/requester-utils';
|
|
|
90
85
|
<!-- markdownlint-disable -->
|
|
91
86
|
<p>
|
|
92
87
|
<tr>
|
|
93
|
-
<td align="center" valign="top" width="3.
|
|
94
|
-
<td align="center" valign="top" width="3.
|
|
95
|
-
<td align="center" valign="top" width="3.
|
|
96
|
-
<td align="center" valign="top" width="3.
|
|
97
|
-
<td align="center" valign="top" width="3.
|
|
98
|
-
<td align="center" valign="top" width="3.
|
|
99
|
-
<td align="center" valign="top" width="3.
|
|
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.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>
|
|
88
|
+
<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>
|
|
89
|
+
<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>
|
|
90
|
+
<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>
|
|
91
|
+
<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>
|
|
92
|
+
<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>
|
|
93
|
+
<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>
|
|
94
|
+
<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>
|
|
95
|
+
<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>
|
|
96
|
+
<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>
|
|
97
|
+
<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>
|
|
98
|
+
<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>
|
|
99
|
+
<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>
|
|
100
|
+
<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>
|
|
101
|
+
<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>
|
|
102
|
+
<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>
|
|
103
|
+
<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>
|
|
104
|
+
<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>
|
|
105
|
+
<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>
|
|
106
|
+
<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>
|
|
107
|
+
<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>
|
|
108
|
+
<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>
|
|
109
|
+
<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>
|
|
110
|
+
<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>
|
|
111
|
+
<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>
|
|
112
|
+
<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>
|
|
113
|
+
<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>
|
|
120
114
|
</tr><br />
|
|
121
115
|
<tr>
|
|
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.
|
|
127
|
-
<td align="center" valign="top" width="3.
|
|
128
|
-
<td align="center" valign="top" width="3.
|
|
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.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>
|
|
116
|
+
<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>
|
|
117
|
+
<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>
|
|
118
|
+
<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>
|
|
119
|
+
<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>
|
|
120
|
+
<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>
|
|
121
|
+
<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>
|
|
122
|
+
<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>
|
|
123
|
+
<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>
|
|
124
|
+
<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>
|
|
125
|
+
<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>
|
|
126
|
+
<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>
|
|
127
|
+
<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>
|
|
128
|
+
<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>
|
|
129
|
+
<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>
|
|
130
|
+
<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>
|
|
131
|
+
<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>
|
|
132
|
+
<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>
|
|
133
|
+
<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>
|
|
134
|
+
<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>
|
|
135
|
+
<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>
|
|
136
|
+
<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>
|
|
137
|
+
<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>
|
|
138
|
+
<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>
|
|
139
|
+
<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>
|
|
140
|
+
<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>
|
|
141
|
+
<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>
|
|
149
142
|
</tr><br />
|
|
150
143
|
<tr>
|
|
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.
|
|
156
|
-
<td align="center" valign="top" width="3.
|
|
157
|
-
<td align="center" valign="top" width="3.
|
|
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.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>
|
|
144
|
+
<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>
|
|
145
|
+
<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>
|
|
146
|
+
<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>
|
|
147
|
+
<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>
|
|
148
|
+
<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>
|
|
149
|
+
<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>
|
|
150
|
+
<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>
|
|
151
|
+
<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>
|
|
152
|
+
<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>
|
|
153
|
+
<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>
|
|
154
|
+
<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>
|
|
155
|
+
<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>
|
|
156
|
+
<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>
|
|
157
|
+
<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>
|
|
158
|
+
<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>
|
|
159
|
+
<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>
|
|
160
|
+
<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>
|
|
161
|
+
<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>
|
|
162
|
+
<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>
|
|
163
|
+
<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>
|
|
164
|
+
<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>
|
|
165
|
+
<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>
|
|
166
|
+
<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>
|
|
167
|
+
<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>
|
|
168
|
+
<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>
|
|
169
|
+
<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>
|
|
178
170
|
</tr><br />
|
|
179
171
|
<tr>
|
|
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.
|
|
185
|
-
<td align="center" valign="top" width="3.
|
|
186
|
-
<td align="center" valign="top" width="3.
|
|
187
|
-
<td align="center" valign="top" width="3.
|
|
172
|
+
<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>
|
|
173
|
+
<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>
|
|
174
|
+
<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>
|
|
175
|
+
<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>
|
|
176
|
+
<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>
|
|
177
|
+
<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>
|
|
178
|
+
<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>
|
|
179
|
+
<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>
|
|
180
|
+
<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>
|
|
181
|
+
<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>
|
|
182
|
+
<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>
|
|
188
183
|
</tr>
|
|
189
184
|
</p>
|
|
190
185
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitbeaker/requester-utils",
|
|
3
|
-
"version": "36.0.
|
|
3
|
+
"version": "36.0.1-next.0",
|
|
4
4
|
"description": "Utility functions for requester implementatons used in @gitbeaker",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -45,15 +45,19 @@
|
|
|
45
45
|
"format": "yarn format:src && yarn format:docs",
|
|
46
46
|
"format:fix": "yarn format:src:fix && yarn format:docs:fix",
|
|
47
47
|
"lint": "eslint '{src,test}/**/*.ts'",
|
|
48
|
-
"lint:fix": "yarn lint --fix"
|
|
48
|
+
"lint:fix": "yarn lint --fix",
|
|
49
|
+
"release:rc": "auto next",
|
|
50
|
+
"release:canary": "auto canary",
|
|
51
|
+
"release": "auto shipit"
|
|
49
52
|
},
|
|
50
53
|
"dependencies": {
|
|
51
54
|
"qs": "^6.11.1",
|
|
52
55
|
"xcase": "^2.0.1"
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^18.15.
|
|
58
|
+
"@types/node": "^18.15.3",
|
|
56
59
|
"tsup": "^6.6.3",
|
|
57
60
|
"typescript": "^4.9.5"
|
|
58
|
-
}
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "d50be2d750cf2515419849b400494adcb887c46c"
|
|
59
63
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
type ResponseBodyTypes = Record<string, unknown> | Record<string, unknown>[] | ReadableStream | Blob | string | string[] | number | void;
|
|
2
|
-
interface FormattedResponse<T extends ResponseBodyTypes = ResponseBodyTypes> {
|
|
3
|
-
body: T;
|
|
4
|
-
headers: Record<string, string>;
|
|
5
|
-
status: number;
|
|
6
|
-
}
|
|
7
|
-
interface RequesterType {
|
|
8
|
-
get<T extends ResponseBodyTypes>(endpoint: string, options?: Record<string, unknown>): Promise<FormattedResponse<T>>;
|
|
9
|
-
post<T extends ResponseBodyTypes>(endpoint: string, options?: Record<string, unknown>): Promise<FormattedResponse<T>>;
|
|
10
|
-
put<T extends ResponseBodyTypes>(endpoint: string, options?: Record<string, unknown>): Promise<FormattedResponse<T>>;
|
|
11
|
-
patch<T extends ResponseBodyTypes>(endpoint: string, options?: Record<string, unknown>): Promise<FormattedResponse<T>>;
|
|
12
|
-
delete<T extends ResponseBodyTypes>(endpoint: string, options?: Record<string, unknown>): Promise<FormattedResponse<T>>;
|
|
13
|
-
}
|
|
14
|
-
interface Constructable<T = any> {
|
|
15
|
-
new (...args: any[]): T;
|
|
16
|
-
}
|
|
17
|
-
type DefaultResourceOptions = {
|
|
18
|
-
headers: {
|
|
19
|
-
[header: string]: string;
|
|
20
|
-
};
|
|
21
|
-
requestTimeout: number;
|
|
22
|
-
url: string;
|
|
23
|
-
rejectUnauthorized: boolean;
|
|
24
|
-
};
|
|
25
|
-
type DefaultRequestOptions = {
|
|
26
|
-
body?: FormData | Record<string, unknown>;
|
|
27
|
-
searchParams?: Record<string, unknown>;
|
|
28
|
-
sudo?: string;
|
|
29
|
-
method?: string;
|
|
30
|
-
asStream?: boolean;
|
|
31
|
-
};
|
|
32
|
-
type RequestOptions = {
|
|
33
|
-
headers: Record<string, string>;
|
|
34
|
-
timeout?: number;
|
|
35
|
-
method: string;
|
|
36
|
-
searchParams?: string;
|
|
37
|
-
prefixUrl: string;
|
|
38
|
-
body?: string | FormData;
|
|
39
|
-
asStream?: boolean;
|
|
40
|
-
};
|
|
41
|
-
declare function formatQuery(params?: Record<string, unknown>): string;
|
|
42
|
-
type OptionsHandlerFn = (serviceOptions: DefaultResourceOptions, requestOptions: DefaultRequestOptions) => Promise<RequestOptions>;
|
|
43
|
-
declare function defaultOptionsHandler(resourceOptions: DefaultResourceOptions, { body, searchParams, sudo, asStream, method }?: DefaultRequestOptions): Promise<RequestOptions>;
|
|
44
|
-
type RequestHandlerFn<T extends ResponseBodyTypes = ResponseBodyTypes> = (endpoint: string, options?: Record<string, unknown>) => Promise<FormattedResponse<T>>;
|
|
45
|
-
declare function createRequesterFn(optionsHandler: OptionsHandlerFn, requestHandler: RequestHandlerFn): (serviceOptions: DefaultResourceOptions) => RequesterType;
|
|
46
|
-
declare function presetResourceArguments<T extends Record<string, Constructable>>(resources: T, customConfig?: Record<string, unknown>): T;
|
|
47
|
-
|
|
48
|
-
interface BaseResourceOptions<C> {
|
|
49
|
-
oauthToken?: string;
|
|
50
|
-
token?: string;
|
|
51
|
-
jobToken?: string;
|
|
52
|
-
host?: string;
|
|
53
|
-
prefixUrl?: string;
|
|
54
|
-
rejectUnauthorized?: boolean;
|
|
55
|
-
camelize?: C;
|
|
56
|
-
requesterFn?: (resourceOptions: DefaultResourceOptions) => RequesterType;
|
|
57
|
-
requestTimeout?: number;
|
|
58
|
-
profileToken?: string;
|
|
59
|
-
sudo?: string | number;
|
|
60
|
-
profileMode?: 'execution' | 'memory';
|
|
61
|
-
}
|
|
62
|
-
declare class BaseResource<C extends boolean = false> {
|
|
63
|
-
readonly url: string;
|
|
64
|
-
readonly requester: RequesterType;
|
|
65
|
-
readonly requestTimeout: number;
|
|
66
|
-
readonly headers: {
|
|
67
|
-
[header: string]: string;
|
|
68
|
-
};
|
|
69
|
-
readonly camelize: C | undefined;
|
|
70
|
-
readonly rejectUnauthorized: boolean;
|
|
71
|
-
constructor({ token, jobToken, oauthToken, sudo, profileToken, requesterFn, camelize, profileMode, host, prefixUrl, rejectUnauthorized, requestTimeout, }?: BaseResourceOptions<C>);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { BaseResource, BaseResourceOptions, Constructable, DefaultRequestOptions, DefaultResourceOptions, FormattedResponse, OptionsHandlerFn, RequestHandlerFn, RequestOptions, RequesterType, ResponseBodyTypes, createRequesterFn, defaultOptionsHandler, formatQuery, presetResourceArguments };
|
package/dist/index.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var xcase = require('xcase');
|
|
4
|
-
var qs = require('qs');
|
|
5
|
-
|
|
6
|
-
// src/RequesterUtils.ts
|
|
7
|
-
function formatQuery(params = {}) {
|
|
8
|
-
const decamelized = xcase.decamelizeKeys(params);
|
|
9
|
-
return qs.stringify(decamelized, { arrayFormat: "brackets" });
|
|
10
|
-
}
|
|
11
|
-
function isFormData(object) {
|
|
12
|
-
return typeof object === "object" && object.constructor.name === "FormData";
|
|
13
|
-
}
|
|
14
|
-
function defaultOptionsHandler(resourceOptions, { body, searchParams, sudo, asStream = false, method = "get" } = {}) {
|
|
15
|
-
const { headers: preconfiguredHeaders, requestTimeout, url } = resourceOptions;
|
|
16
|
-
const headers = { ...preconfiguredHeaders };
|
|
17
|
-
const defaultOptions = {
|
|
18
|
-
headers,
|
|
19
|
-
timeout: requestTimeout,
|
|
20
|
-
method,
|
|
21
|
-
asStream,
|
|
22
|
-
prefixUrl: url
|
|
23
|
-
};
|
|
24
|
-
if (sudo)
|
|
25
|
-
defaultOptions.headers.sudo = sudo;
|
|
26
|
-
if (body) {
|
|
27
|
-
if (isFormData(body)) {
|
|
28
|
-
defaultOptions.body = body;
|
|
29
|
-
} else {
|
|
30
|
-
defaultOptions.body = JSON.stringify(xcase.decamelizeKeys(body));
|
|
31
|
-
headers["content-type"] = "application/json";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const q = formatQuery(searchParams);
|
|
35
|
-
if (q)
|
|
36
|
-
defaultOptions.searchParams = q;
|
|
37
|
-
return Promise.resolve(defaultOptions);
|
|
38
|
-
}
|
|
39
|
-
function createRequesterFn(optionsHandler, requestHandler) {
|
|
40
|
-
const methods = ["get", "post", "put", "patch", "delete"];
|
|
41
|
-
return (serviceOptions) => {
|
|
42
|
-
const requester = {};
|
|
43
|
-
methods.forEach((m) => {
|
|
44
|
-
requester[m] = async (endpoint, options) => {
|
|
45
|
-
const requestOptions = await optionsHandler(serviceOptions, { ...options, method: m });
|
|
46
|
-
return requestHandler(endpoint, requestOptions);
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
return requester;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function extendClass(Base, customConfig = {}) {
|
|
53
|
-
return class extends Base {
|
|
54
|
-
constructor(...options) {
|
|
55
|
-
const [config, ...opts] = options;
|
|
56
|
-
super({ ...customConfig, ...config }, ...opts);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function presetResourceArguments(resources, customConfig = {}) {
|
|
61
|
-
const updated = {};
|
|
62
|
-
Object.entries(resources).filter(([, s]) => typeof s === "function").forEach(([k, r]) => {
|
|
63
|
-
updated[k] = extendClass(r, customConfig);
|
|
64
|
-
});
|
|
65
|
-
return updated;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// src/BaseResource.ts
|
|
69
|
-
var BaseResource = class {
|
|
70
|
-
url;
|
|
71
|
-
requester;
|
|
72
|
-
requestTimeout;
|
|
73
|
-
headers;
|
|
74
|
-
camelize;
|
|
75
|
-
rejectUnauthorized;
|
|
76
|
-
constructor({
|
|
77
|
-
token,
|
|
78
|
-
jobToken,
|
|
79
|
-
oauthToken,
|
|
80
|
-
sudo,
|
|
81
|
-
profileToken,
|
|
82
|
-
requesterFn,
|
|
83
|
-
camelize,
|
|
84
|
-
profileMode = "execution",
|
|
85
|
-
host = "https://gitlab.com",
|
|
86
|
-
prefixUrl = "",
|
|
87
|
-
rejectUnauthorized = true,
|
|
88
|
-
requestTimeout = 3e5
|
|
89
|
-
} = {}) {
|
|
90
|
-
if (!requesterFn)
|
|
91
|
-
throw new ReferenceError("requesterFn must be passed");
|
|
92
|
-
this.url = [host, "api", "v4", prefixUrl].join("/");
|
|
93
|
-
this.headers = {};
|
|
94
|
-
this.rejectUnauthorized = rejectUnauthorized;
|
|
95
|
-
this.camelize = camelize;
|
|
96
|
-
this.requestTimeout = requestTimeout;
|
|
97
|
-
if (oauthToken)
|
|
98
|
-
this.headers.authorization = `Bearer ${oauthToken}`;
|
|
99
|
-
else if (jobToken)
|
|
100
|
-
this.headers["job-token"] = jobToken;
|
|
101
|
-
else if (token)
|
|
102
|
-
this.headers["private-token"] = token;
|
|
103
|
-
if (profileToken) {
|
|
104
|
-
this.headers["X-Profile-Token"] = profileToken;
|
|
105
|
-
this.headers["X-Profile-Mode"] = profileMode;
|
|
106
|
-
}
|
|
107
|
-
if (sudo)
|
|
108
|
-
this.headers.Sudo = `${sudo}`;
|
|
109
|
-
this.requester = requesterFn({ ...this });
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
exports.BaseResource = BaseResource;
|
|
114
|
-
exports.createRequesterFn = createRequesterFn;
|
|
115
|
-
exports.defaultOptionsHandler = defaultOptionsHandler;
|
|
116
|
-
exports.formatQuery = formatQuery;
|
|
117
|
-
exports.presetResourceArguments = presetResourceArguments;
|
package/dist/index.mjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { decamelizeKeys } from 'xcase';
|
|
2
|
-
import { stringify } from 'qs';
|
|
3
|
-
|
|
4
|
-
// src/RequesterUtils.ts
|
|
5
|
-
function formatQuery(params = {}) {
|
|
6
|
-
const decamelized = decamelizeKeys(params);
|
|
7
|
-
return stringify(decamelized, { arrayFormat: "brackets" });
|
|
8
|
-
}
|
|
9
|
-
function isFormData(object) {
|
|
10
|
-
return typeof object === "object" && object.constructor.name === "FormData";
|
|
11
|
-
}
|
|
12
|
-
function defaultOptionsHandler(resourceOptions, { body, searchParams, sudo, asStream = false, method = "get" } = {}) {
|
|
13
|
-
const { headers: preconfiguredHeaders, requestTimeout, url } = resourceOptions;
|
|
14
|
-
const headers = { ...preconfiguredHeaders };
|
|
15
|
-
const defaultOptions = {
|
|
16
|
-
headers,
|
|
17
|
-
timeout: requestTimeout,
|
|
18
|
-
method,
|
|
19
|
-
asStream,
|
|
20
|
-
prefixUrl: url
|
|
21
|
-
};
|
|
22
|
-
if (sudo)
|
|
23
|
-
defaultOptions.headers.sudo = sudo;
|
|
24
|
-
if (body) {
|
|
25
|
-
if (isFormData(body)) {
|
|
26
|
-
defaultOptions.body = body;
|
|
27
|
-
} else {
|
|
28
|
-
defaultOptions.body = JSON.stringify(decamelizeKeys(body));
|
|
29
|
-
headers["content-type"] = "application/json";
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const q = formatQuery(searchParams);
|
|
33
|
-
if (q)
|
|
34
|
-
defaultOptions.searchParams = q;
|
|
35
|
-
return Promise.resolve(defaultOptions);
|
|
36
|
-
}
|
|
37
|
-
function createRequesterFn(optionsHandler, requestHandler) {
|
|
38
|
-
const methods = ["get", "post", "put", "patch", "delete"];
|
|
39
|
-
return (serviceOptions) => {
|
|
40
|
-
const requester = {};
|
|
41
|
-
methods.forEach((m) => {
|
|
42
|
-
requester[m] = async (endpoint, options) => {
|
|
43
|
-
const requestOptions = await optionsHandler(serviceOptions, { ...options, method: m });
|
|
44
|
-
return requestHandler(endpoint, requestOptions);
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
return requester;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function extendClass(Base, customConfig = {}) {
|
|
51
|
-
return class extends Base {
|
|
52
|
-
constructor(...options) {
|
|
53
|
-
const [config, ...opts] = options;
|
|
54
|
-
super({ ...customConfig, ...config }, ...opts);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function presetResourceArguments(resources, customConfig = {}) {
|
|
59
|
-
const updated = {};
|
|
60
|
-
Object.entries(resources).filter(([, s]) => typeof s === "function").forEach(([k, r]) => {
|
|
61
|
-
updated[k] = extendClass(r, customConfig);
|
|
62
|
-
});
|
|
63
|
-
return updated;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// src/BaseResource.ts
|
|
67
|
-
var BaseResource = class {
|
|
68
|
-
url;
|
|
69
|
-
requester;
|
|
70
|
-
requestTimeout;
|
|
71
|
-
headers;
|
|
72
|
-
camelize;
|
|
73
|
-
rejectUnauthorized;
|
|
74
|
-
constructor({
|
|
75
|
-
token,
|
|
76
|
-
jobToken,
|
|
77
|
-
oauthToken,
|
|
78
|
-
sudo,
|
|
79
|
-
profileToken,
|
|
80
|
-
requesterFn,
|
|
81
|
-
camelize,
|
|
82
|
-
profileMode = "execution",
|
|
83
|
-
host = "https://gitlab.com",
|
|
84
|
-
prefixUrl = "",
|
|
85
|
-
rejectUnauthorized = true,
|
|
86
|
-
requestTimeout = 3e5
|
|
87
|
-
} = {}) {
|
|
88
|
-
if (!requesterFn)
|
|
89
|
-
throw new ReferenceError("requesterFn must be passed");
|
|
90
|
-
this.url = [host, "api", "v4", prefixUrl].join("/");
|
|
91
|
-
this.headers = {};
|
|
92
|
-
this.rejectUnauthorized = rejectUnauthorized;
|
|
93
|
-
this.camelize = camelize;
|
|
94
|
-
this.requestTimeout = requestTimeout;
|
|
95
|
-
if (oauthToken)
|
|
96
|
-
this.headers.authorization = `Bearer ${oauthToken}`;
|
|
97
|
-
else if (jobToken)
|
|
98
|
-
this.headers["job-token"] = jobToken;
|
|
99
|
-
else if (token)
|
|
100
|
-
this.headers["private-token"] = token;
|
|
101
|
-
if (profileToken) {
|
|
102
|
-
this.headers["X-Profile-Token"] = profileToken;
|
|
103
|
-
this.headers["X-Profile-Mode"] = profileMode;
|
|
104
|
-
}
|
|
105
|
-
if (sudo)
|
|
106
|
-
this.headers.Sudo = `${sudo}`;
|
|
107
|
-
this.requester = requesterFn({ ...this });
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export { BaseResource, createRequesterFn, defaultOptionsHandler, formatQuery, presetResourceArguments };
|