@gitbeaker/core 40.0.3 → 40.1.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/README.md +1 -0
- package/dist/index.d.mts +239 -179
- package/dist/index.d.ts +239 -179
- package/dist/index.js +138 -152
- package/dist/index.mjs +138 -153
- package/dist/map.json +51 -0
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -12,12 +12,9 @@ var QS__default = /*#__PURE__*/_interopDefault(QS);
|
|
|
12
12
|
function appendFormFromObject(object) {
|
|
13
13
|
const form = new FormData();
|
|
14
14
|
Object.entries(object).forEach(([k, v]) => {
|
|
15
|
-
if (!v)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
form.append(k, v[0], v[1]);
|
|
19
|
-
else
|
|
20
|
-
form.append(k, v);
|
|
15
|
+
if (!v) return;
|
|
16
|
+
if (Array.isArray(v)) form.append(k, v[0], v[1]);
|
|
17
|
+
else form.append(k, v);
|
|
21
18
|
});
|
|
22
19
|
return form;
|
|
23
20
|
}
|
|
@@ -40,7 +37,7 @@ function parseLinkHeader(linkString) {
|
|
|
40
37
|
function reformatObjectOptions(obj, prefixKey, decamelizeValues = false) {
|
|
41
38
|
const formatted = decamelizeValues ? xcase.decamelizeKeys(obj) : obj;
|
|
42
39
|
return QS__default.default.stringify({ [prefixKey]: formatted }, { encode: false }).split("&").reduce((acc, cur) => {
|
|
43
|
-
const [key, val] = cur.split(
|
|
40
|
+
const [key, val] = cur.split(/=(.*)/);
|
|
44
41
|
acc[key] = val;
|
|
45
42
|
return acc;
|
|
46
43
|
}, {});
|
|
@@ -58,14 +55,12 @@ function getStream(response, showExpanded) {
|
|
|
58
55
|
function getSingle(camelize, response, showExpanded) {
|
|
59
56
|
const { status, headers } = response;
|
|
60
57
|
let { body } = response;
|
|
61
|
-
if (camelize)
|
|
62
|
-
body = xcase.camelizeKeys(body);
|
|
58
|
+
if (camelize) body = xcase.camelizeKeys(body);
|
|
63
59
|
return packageResponse({ body, status, headers }, showExpanded);
|
|
64
60
|
}
|
|
65
61
|
async function getManyMore(camelize, getFn, endpoint2, response, requestOptions, acc) {
|
|
66
62
|
const { sudo, showExpanded, maxPages, pagination, page, perPage, idAfter, orderBy, sort } = requestOptions;
|
|
67
|
-
if (camelize)
|
|
68
|
-
response.body = xcase.camelizeKeys(response?.body);
|
|
63
|
+
if (camelize) response.body = xcase.camelizeKeys(response?.body);
|
|
69
64
|
const newAcc = [...acc || [], ...response.body];
|
|
70
65
|
const withinBounds = maxPages && perPage ? newAcc.length / +perPage < maxPages : true;
|
|
71
66
|
const { next = "" } = parseLinkHeader(response.headers.link);
|
|
@@ -84,8 +79,7 @@ async function getManyMore(camelize, getFn, endpoint2, response, requestOptions,
|
|
|
84
79
|
});
|
|
85
80
|
return getManyMore(camelize, getFn, endpoint2, nextResponse, newOpts, newAcc);
|
|
86
81
|
}
|
|
87
|
-
if (!showExpanded)
|
|
88
|
-
return newAcc;
|
|
82
|
+
if (!showExpanded) return newAcc;
|
|
89
83
|
const paginationInfo = pagination === "keyset" ? {
|
|
90
84
|
idAfter: idAfter ? +idAfter : null,
|
|
91
85
|
perPage: perPage ? +perPage : null,
|
|
@@ -115,8 +109,7 @@ function get() {
|
|
|
115
109
|
signal
|
|
116
110
|
});
|
|
117
111
|
const camelizeResponseBody = service.camelize || false;
|
|
118
|
-
if (asStream)
|
|
119
|
-
return getStream(response, showExpanded);
|
|
112
|
+
if (asStream) return getStream(response, showExpanded);
|
|
120
113
|
if (!Array.isArray(response.body))
|
|
121
114
|
return getSingle(
|
|
122
115
|
camelizeResponseBody,
|
|
@@ -147,8 +140,7 @@ function post() {
|
|
|
147
140
|
sudo,
|
|
148
141
|
signal: service.queryTimeout ? AbortSignal.timeout(service.queryTimeout) : void 0
|
|
149
142
|
});
|
|
150
|
-
if (service.camelize)
|
|
151
|
-
response.body = xcase.camelizeKeys(response.body);
|
|
143
|
+
if (service.camelize) response.body = xcase.camelizeKeys(response.body);
|
|
152
144
|
return packageResponse(response, showExpanded);
|
|
153
145
|
};
|
|
154
146
|
}
|
|
@@ -161,8 +153,7 @@ function put() {
|
|
|
161
153
|
sudo,
|
|
162
154
|
signal: service.queryTimeout ? AbortSignal.timeout(service.queryTimeout) : void 0
|
|
163
155
|
});
|
|
164
|
-
if (service.camelize)
|
|
165
|
-
response.body = xcase.camelizeKeys(response.body);
|
|
156
|
+
if (service.camelize) response.body = xcase.camelizeKeys(response.body);
|
|
166
157
|
return packageResponse(response, showExpanded);
|
|
167
158
|
};
|
|
168
159
|
}
|
|
@@ -175,8 +166,7 @@ function patch() {
|
|
|
175
166
|
sudo,
|
|
176
167
|
signal: service.queryTimeout ? AbortSignal.timeout(service.queryTimeout) : void 0
|
|
177
168
|
});
|
|
178
|
-
if (service.camelize)
|
|
179
|
-
response.body = xcase.camelizeKeys(response.body);
|
|
169
|
+
if (service.camelize) response.body = xcase.camelizeKeys(response.body);
|
|
180
170
|
return packageResponse(response, showExpanded);
|
|
181
171
|
};
|
|
182
172
|
}
|
|
@@ -316,10 +306,8 @@ var ApplicationAppearance = class extends requesterUtils.BaseResource {
|
|
|
316
306
|
...options,
|
|
317
307
|
isForm: true
|
|
318
308
|
};
|
|
319
|
-
if (logo)
|
|
320
|
-
|
|
321
|
-
if (pwaIcon)
|
|
322
|
-
opts.pwaIcon = [pwaIcon.content, pwaIcon.filename];
|
|
309
|
+
if (logo) opts.logo = [logo.content, logo.filename];
|
|
310
|
+
if (pwaIcon) opts.pwaIcon = [pwaIcon.content, pwaIcon.filename];
|
|
323
311
|
return RequestHelper.put()(this, "application/appearence", opts);
|
|
324
312
|
}
|
|
325
313
|
return RequestHelper.put()(
|
|
@@ -417,10 +405,8 @@ function url({
|
|
|
417
405
|
groupId
|
|
418
406
|
} = {}) {
|
|
419
407
|
let prefix = "";
|
|
420
|
-
if (projectId)
|
|
421
|
-
|
|
422
|
-
else if (groupId)
|
|
423
|
-
prefix = endpoint`groups/${groupId}/`;
|
|
408
|
+
if (projectId) prefix = endpoint`projects/${projectId}/`;
|
|
409
|
+
else if (groupId) prefix = endpoint`groups/${groupId}/`;
|
|
424
410
|
return `${prefix}audit_events`;
|
|
425
411
|
}
|
|
426
412
|
var AuditEvents = class extends requesterUtils.BaseResource {
|
|
@@ -683,10 +669,8 @@ var DashboardAnnotations = class extends requesterUtils.BaseResource {
|
|
|
683
669
|
...options
|
|
684
670
|
} = {}) {
|
|
685
671
|
let url12;
|
|
686
|
-
if (environmentId)
|
|
687
|
-
|
|
688
|
-
else if (clusterId)
|
|
689
|
-
url12 = endpoint`clusters/${clusterId}/metrics_dashboard/annotations`;
|
|
672
|
+
if (environmentId) url12 = endpoint`environments/${environmentId}/metrics_dashboard/annotations`;
|
|
673
|
+
else if (clusterId) url12 = endpoint`clusters/${clusterId}/metrics_dashboard/annotations`;
|
|
690
674
|
else
|
|
691
675
|
throw new Error(
|
|
692
676
|
"Missing required argument. Please supply a environmentId or a cluserId in the options parameter."
|
|
@@ -703,10 +687,8 @@ function url3({
|
|
|
703
687
|
projectId,
|
|
704
688
|
groupId
|
|
705
689
|
} = {}) {
|
|
706
|
-
if (projectId)
|
|
707
|
-
|
|
708
|
-
if (groupId)
|
|
709
|
-
return endpoint`/groups/${groupId}/-/packages/debian`;
|
|
690
|
+
if (projectId) return endpoint`/projects/${projectId}/packages/debian`;
|
|
691
|
+
if (groupId) return endpoint`/groups/${groupId}/-/packages/debian`;
|
|
710
692
|
throw new Error(
|
|
711
693
|
"Missing required argument. Please supply a projectId or a groupId in the options parameter"
|
|
712
694
|
);
|
|
@@ -855,12 +837,9 @@ var DeployTokens = class extends requesterUtils.BaseResource {
|
|
|
855
837
|
...options
|
|
856
838
|
} = {}) {
|
|
857
839
|
let url12;
|
|
858
|
-
if (projectId)
|
|
859
|
-
|
|
860
|
-
else
|
|
861
|
-
url12 = endpoint`groups/${groupId}/deploy_tokens`;
|
|
862
|
-
else
|
|
863
|
-
url12 = "deploy_tokens";
|
|
840
|
+
if (projectId) url12 = endpoint`projects/${projectId}/deploy_tokens`;
|
|
841
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/deploy_tokens`;
|
|
842
|
+
else url12 = "deploy_tokens";
|
|
864
843
|
return RequestHelper.get()(this, url12, options);
|
|
865
844
|
}
|
|
866
845
|
create(name, scopes, {
|
|
@@ -869,10 +848,8 @@ var DeployTokens = class extends requesterUtils.BaseResource {
|
|
|
869
848
|
...options
|
|
870
849
|
} = {}) {
|
|
871
850
|
let url12;
|
|
872
|
-
if (projectId)
|
|
873
|
-
|
|
874
|
-
else if (groupId)
|
|
875
|
-
url12 = endpoint`groups/${groupId}/deploy_tokens`;
|
|
851
|
+
if (projectId) url12 = endpoint`projects/${projectId}/deploy_tokens`;
|
|
852
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/deploy_tokens`;
|
|
876
853
|
else {
|
|
877
854
|
throw new Error(
|
|
878
855
|
"Missing required argument. Please supply a projectId or a groupId in the options parameter."
|
|
@@ -890,10 +867,8 @@ var DeployTokens = class extends requesterUtils.BaseResource {
|
|
|
890
867
|
...options
|
|
891
868
|
} = {}) {
|
|
892
869
|
let url12;
|
|
893
|
-
if (projectId)
|
|
894
|
-
|
|
895
|
-
else if (groupId)
|
|
896
|
-
url12 = endpoint`groups/${groupId}/deploy_tokens/${tokenId}`;
|
|
870
|
+
if (projectId) url12 = endpoint`projects/${projectId}/deploy_tokens/${tokenId}`;
|
|
871
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/deploy_tokens/${tokenId}`;
|
|
897
872
|
else {
|
|
898
873
|
throw new Error(
|
|
899
874
|
"Missing required argument. Please supply a projectId or a groupId in the options parameter."
|
|
@@ -907,10 +882,8 @@ var DeployTokens = class extends requesterUtils.BaseResource {
|
|
|
907
882
|
...options
|
|
908
883
|
} = {}) {
|
|
909
884
|
let url12;
|
|
910
|
-
if (projectId)
|
|
911
|
-
|
|
912
|
-
else if (groupId)
|
|
913
|
-
url12 = endpoint`groups/${groupId}/deploy_tokens/${tokenId}`;
|
|
885
|
+
if (projectId) url12 = endpoint`projects/${projectId}/deploy_tokens/${tokenId}`;
|
|
886
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/deploy_tokens/${tokenId}`;
|
|
914
887
|
else {
|
|
915
888
|
throw new Error(
|
|
916
889
|
"Missing required argument. Please supply a projectId or a groupId in the options parameter."
|
|
@@ -997,8 +970,7 @@ function url4(resourceId, resourceType2, resourceId2, awardId) {
|
|
|
997
970
|
const [rId, rId2] = [resourceId, resourceId2].map(encodeURIComponent);
|
|
998
971
|
const output = [rId, resourceType2, rId2];
|
|
999
972
|
output.push("award_emoji");
|
|
1000
|
-
if (awardId)
|
|
1001
|
-
output.push(awardId);
|
|
973
|
+
if (awardId) output.push(awardId);
|
|
1002
974
|
return output.join("/");
|
|
1003
975
|
}
|
|
1004
976
|
var ResourceAwardEmojis = class extends requesterUtils.BaseResource {
|
|
@@ -1045,8 +1017,7 @@ function url5(resourceId, resourceType2, resourceId2, noteId, awardId) {
|
|
|
1045
1017
|
output.push("notes");
|
|
1046
1018
|
output.push(noteId);
|
|
1047
1019
|
output.push("award_emoji");
|
|
1048
|
-
if (awardId)
|
|
1049
|
-
output.push(awardId);
|
|
1020
|
+
if (awardId) output.push(awardId);
|
|
1050
1021
|
return output.join("/");
|
|
1051
1022
|
}
|
|
1052
1023
|
var ResourceNoteAwardEmojis = class extends requesterUtils.BaseResource {
|
|
@@ -1372,8 +1343,7 @@ var ResourceMembers = class extends requesterUtils.BaseResource {
|
|
|
1372
1343
|
...options
|
|
1373
1344
|
} = {}) {
|
|
1374
1345
|
let url12 = endpoint`${resourceId}/members`;
|
|
1375
|
-
if (includeInherited)
|
|
1376
|
-
url12 += "/all";
|
|
1346
|
+
if (includeInherited) url12 += "/all";
|
|
1377
1347
|
return RequestHelper.get()(this, url12, options);
|
|
1378
1348
|
}
|
|
1379
1349
|
edit(resourceId, userId, accessLevel, options) {
|
|
@@ -1385,8 +1355,7 @@ var ResourceMembers = class extends requesterUtils.BaseResource {
|
|
|
1385
1355
|
show(resourceId, userId, { includeInherited, ...options } = {}) {
|
|
1386
1356
|
const [rId, uId] = [resourceId, userId].map(encodeURIComponent);
|
|
1387
1357
|
const url12 = [rId, "members"];
|
|
1388
|
-
if (includeInherited)
|
|
1389
|
-
url12.push("all");
|
|
1358
|
+
if (includeInherited) url12.push("all");
|
|
1390
1359
|
url12.push(uId);
|
|
1391
1360
|
return RequestHelper.get()(this, url12.join("/"), options);
|
|
1392
1361
|
}
|
|
@@ -1844,12 +1813,9 @@ var Events = class extends requesterUtils.BaseResource {
|
|
|
1844
1813
|
...options
|
|
1845
1814
|
} = {}) {
|
|
1846
1815
|
let url12;
|
|
1847
|
-
if (projectId)
|
|
1848
|
-
|
|
1849
|
-
else
|
|
1850
|
-
url12 = endpoint`users/${userId}/events`;
|
|
1851
|
-
else
|
|
1852
|
-
url12 = "events";
|
|
1816
|
+
if (projectId) url12 = endpoint`projects/${projectId}/events`;
|
|
1817
|
+
else if (userId) url12 = endpoint`users/${userId}/events`;
|
|
1818
|
+
else url12 = "events";
|
|
1853
1819
|
return RequestHelper.get()(this, url12, options);
|
|
1854
1820
|
}
|
|
1855
1821
|
};
|
|
@@ -1997,10 +1963,8 @@ var Keys = class extends requesterUtils.BaseResource {
|
|
|
1997
1963
|
...options
|
|
1998
1964
|
} = {}) {
|
|
1999
1965
|
let url12;
|
|
2000
|
-
if (keyId)
|
|
2001
|
-
|
|
2002
|
-
else if (fingerprint)
|
|
2003
|
-
url12 = `keys?fingerprint=${fingerprint}`;
|
|
1966
|
+
if (keyId) url12 = `keys/${keyId}`;
|
|
1967
|
+
else if (fingerprint) url12 = `keys?fingerprint=${fingerprint}`;
|
|
2004
1968
|
else {
|
|
2005
1969
|
throw new Error(
|
|
2006
1970
|
"Missing required argument. Please supply a fingerprint or a keyId in the options parameter"
|
|
@@ -2063,10 +2027,8 @@ var Maven = class extends requesterUtils.BaseResource {
|
|
|
2063
2027
|
...options
|
|
2064
2028
|
}) {
|
|
2065
2029
|
let url12 = endpoint`packages/maven/${path}/${filename}`;
|
|
2066
|
-
if (projectId)
|
|
2067
|
-
|
|
2068
|
-
else if (groupId)
|
|
2069
|
-
url12 = endpoint`groups/${groupId}/-/${url12}`;
|
|
2030
|
+
if (projectId) url12 = endpoint`projects/${projectId}/${url12}`;
|
|
2031
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/-/${url12}`;
|
|
2070
2032
|
return RequestHelper.get()(this, url12, options);
|
|
2071
2033
|
}
|
|
2072
2034
|
uploadPackageFile(projectId, path, packageFile, options) {
|
|
@@ -2190,10 +2152,8 @@ function url7({
|
|
|
2190
2152
|
groupId
|
|
2191
2153
|
} = {}) {
|
|
2192
2154
|
let prefix = "";
|
|
2193
|
-
if (projectId)
|
|
2194
|
-
|
|
2195
|
-
if (groupId)
|
|
2196
|
-
prefix = endpoint`groups/${groupId}/`;
|
|
2155
|
+
if (projectId) prefix = endpoint`projects/${projectId}/`;
|
|
2156
|
+
if (groupId) prefix = endpoint`groups/${groupId}/`;
|
|
2197
2157
|
return `${prefix}notification_settings`;
|
|
2198
2158
|
}
|
|
2199
2159
|
var NotificationSettings = class extends requesterUtils.BaseResource {
|
|
@@ -2218,10 +2178,8 @@ function url8({
|
|
|
2218
2178
|
projectId,
|
|
2219
2179
|
groupId
|
|
2220
2180
|
} = {}) {
|
|
2221
|
-
if (projectId)
|
|
2222
|
-
|
|
2223
|
-
if (groupId)
|
|
2224
|
-
return endpoint`/groups/${groupId}/-/packages/nuget`;
|
|
2181
|
+
if (projectId) return endpoint`/projects/${projectId}/packages/nuget`;
|
|
2182
|
+
if (groupId) return endpoint`/groups/${groupId}/-/packages/nuget`;
|
|
2225
2183
|
throw new Error(
|
|
2226
2184
|
"Missing required argument. Please supply a projectId or a groupId in the options parameter"
|
|
2227
2185
|
);
|
|
@@ -2420,12 +2378,9 @@ var Search = class extends requesterUtils.BaseResource {
|
|
|
2420
2378
|
all(scope, search, options) {
|
|
2421
2379
|
const { projectId, groupId, ...opts } = options || {};
|
|
2422
2380
|
let url12;
|
|
2423
|
-
if (projectId)
|
|
2424
|
-
|
|
2425
|
-
else
|
|
2426
|
-
url12 = endpoint`groups/${groupId}/`;
|
|
2427
|
-
else
|
|
2428
|
-
url12 = "";
|
|
2381
|
+
if (projectId) url12 = endpoint`projects/${projectId}/`;
|
|
2382
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/`;
|
|
2383
|
+
else url12 = "";
|
|
2429
2384
|
return RequestHelper.get()(this, `${url12}search`, {
|
|
2430
2385
|
scope,
|
|
2431
2386
|
search,
|
|
@@ -2584,8 +2539,7 @@ var TodoLists = class extends requesterUtils.BaseResource {
|
|
|
2584
2539
|
...options
|
|
2585
2540
|
} = {}) {
|
|
2586
2541
|
let prefix = "todos";
|
|
2587
|
-
if (todoId)
|
|
2588
|
-
prefix += `/${todoId}`;
|
|
2542
|
+
if (todoId) prefix += `/${todoId}`;
|
|
2589
2543
|
return RequestHelper.post()(
|
|
2590
2544
|
this,
|
|
2591
2545
|
`${prefix}/mark_as_done`,
|
|
@@ -2808,10 +2762,8 @@ var ContainerRegistry = class extends requesterUtils.BaseResource {
|
|
|
2808
2762
|
...options
|
|
2809
2763
|
} = {}) {
|
|
2810
2764
|
let url12;
|
|
2811
|
-
if (groupId)
|
|
2812
|
-
|
|
2813
|
-
else if (projectId)
|
|
2814
|
-
url12 = endpoint`projects/${projectId}/registry/repositories`;
|
|
2765
|
+
if (groupId) url12 = endpoint`groups/${groupId}/registry/repositories`;
|
|
2766
|
+
else if (projectId) url12 = endpoint`projects/${projectId}/registry/repositories`;
|
|
2815
2767
|
else
|
|
2816
2768
|
throw new Error(
|
|
2817
2769
|
"Missing required argument. Please supply a groupId or a projectId in the options parameter."
|
|
@@ -3439,12 +3391,9 @@ var Issues = class extends requesterUtils.BaseResource {
|
|
|
3439
3391
|
...options
|
|
3440
3392
|
} = {}) {
|
|
3441
3393
|
let url12;
|
|
3442
|
-
if (projectId)
|
|
3443
|
-
|
|
3444
|
-
else
|
|
3445
|
-
url12 = endpoint`groups/${groupId}/issues`;
|
|
3446
|
-
else
|
|
3447
|
-
url12 = "issues";
|
|
3394
|
+
if (projectId) url12 = endpoint`projects/${projectId}/issues`;
|
|
3395
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/issues`;
|
|
3396
|
+
else url12 = "issues";
|
|
3448
3397
|
return RequestHelper.get()(this, url12, options);
|
|
3449
3398
|
}
|
|
3450
3399
|
allMetricImages(projectId, issueIId, options) {
|
|
@@ -3618,19 +3567,15 @@ var IssuesStatistics = class extends requesterUtils.BaseResource {
|
|
|
3618
3567
|
...options
|
|
3619
3568
|
} = {}) {
|
|
3620
3569
|
let url12;
|
|
3621
|
-
if (projectId)
|
|
3622
|
-
|
|
3623
|
-
else
|
|
3624
|
-
url12 = endpoint`groups/${groupId}/issues_statistics`;
|
|
3625
|
-
else
|
|
3626
|
-
url12 = "issues_statistics";
|
|
3570
|
+
if (projectId) url12 = endpoint`projects/${projectId}/issues_statistics`;
|
|
3571
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/issues_statistics`;
|
|
3572
|
+
else url12 = "issues_statistics";
|
|
3627
3573
|
return RequestHelper.get()(this, url12, options);
|
|
3628
3574
|
}
|
|
3629
3575
|
};
|
|
3630
3576
|
function generateDownloadPathForJob(projectId, jobId, artifactPath) {
|
|
3631
3577
|
let url12 = endpoint`projects/${projectId}/jobs/${jobId}/artifacts`;
|
|
3632
|
-
if (artifactPath)
|
|
3633
|
-
url12 += `/${artifactPath}`;
|
|
3578
|
+
if (artifactPath) url12 += `/${artifactPath}`;
|
|
3634
3579
|
return url12;
|
|
3635
3580
|
}
|
|
3636
3581
|
function generateDownloadPath(projectId, ref, artifactPath) {
|
|
@@ -3650,10 +3595,8 @@ var JobArtifacts = class extends requesterUtils.BaseResource {
|
|
|
3650
3595
|
...options
|
|
3651
3596
|
} = {}) {
|
|
3652
3597
|
let url12;
|
|
3653
|
-
if (jobId)
|
|
3654
|
-
|
|
3655
|
-
else if (options?.job && ref)
|
|
3656
|
-
url12 = generateDownloadPath(projectId, ref, artifactPath);
|
|
3598
|
+
if (jobId) url12 = generateDownloadPathForJob(projectId, jobId, artifactPath);
|
|
3599
|
+
else if (options?.job && ref) url12 = generateDownloadPath(projectId, ref, artifactPath);
|
|
3657
3600
|
else
|
|
3658
3601
|
throw new Error(
|
|
3659
3602
|
"Missing one of the required parameters. See typing documentation for available arguments."
|
|
@@ -3728,13 +3671,11 @@ var Jobs = class extends requesterUtils.BaseResource {
|
|
|
3728
3671
|
);
|
|
3729
3672
|
}
|
|
3730
3673
|
showConnectedJob(options) {
|
|
3731
|
-
if (!this.headers["job-token"])
|
|
3732
|
-
throw new Error('Missing required header "job-token"');
|
|
3674
|
+
if (!this.headers["job-token"]) throw new Error('Missing required header "job-token"');
|
|
3733
3675
|
return RequestHelper.get()(this, "job", options);
|
|
3734
3676
|
}
|
|
3735
3677
|
showConnectedJobK8Agents(options) {
|
|
3736
|
-
if (!this.headers["job-token"])
|
|
3737
|
-
throw new Error('Missing required header "job-token"');
|
|
3678
|
+
if (!this.headers["job-token"]) throw new Error('Missing required header "job-token"');
|
|
3738
3679
|
return RequestHelper.get()(this, "job/allowed_agents", options);
|
|
3739
3680
|
}
|
|
3740
3681
|
showLog(projectId, jobId, options) {
|
|
@@ -3745,6 +3686,43 @@ var Jobs = class extends requesterUtils.BaseResource {
|
|
|
3745
3686
|
);
|
|
3746
3687
|
}
|
|
3747
3688
|
};
|
|
3689
|
+
var JobTokenScopes = class extends requesterUtils.BaseResource {
|
|
3690
|
+
show(projectId, options) {
|
|
3691
|
+
return RequestHelper.get()(
|
|
3692
|
+
this,
|
|
3693
|
+
endpoint`projects/${projectId}/job_token_scope`,
|
|
3694
|
+
options
|
|
3695
|
+
);
|
|
3696
|
+
}
|
|
3697
|
+
edit(projectId, enabled, options) {
|
|
3698
|
+
return RequestHelper.patch()(
|
|
3699
|
+
this,
|
|
3700
|
+
endpoint`projects/${projectId}/job_token_scope`,
|
|
3701
|
+
{ ...options, enabled }
|
|
3702
|
+
);
|
|
3703
|
+
}
|
|
3704
|
+
showInboundAllowList(projectId, options) {
|
|
3705
|
+
return RequestHelper.get()(
|
|
3706
|
+
this,
|
|
3707
|
+
endpoint`projects/${projectId}/job_token_scope/allowlist`,
|
|
3708
|
+
options
|
|
3709
|
+
);
|
|
3710
|
+
}
|
|
3711
|
+
addToInboundAllowList(projectId, targetProjectId, options) {
|
|
3712
|
+
return RequestHelper.post()(
|
|
3713
|
+
this,
|
|
3714
|
+
endpoint`projects/${projectId}/job_token_scope/allowlist/${targetProjectId}`,
|
|
3715
|
+
options
|
|
3716
|
+
);
|
|
3717
|
+
}
|
|
3718
|
+
removeFromInboundAllowList(projectId, targetProjectId, options) {
|
|
3719
|
+
return RequestHelper.del()(
|
|
3720
|
+
this,
|
|
3721
|
+
endpoint`projects/${projectId}/job_token_scope/allowlist/${targetProjectId}`,
|
|
3722
|
+
options
|
|
3723
|
+
);
|
|
3724
|
+
}
|
|
3725
|
+
};
|
|
3748
3726
|
var MergeRequestApprovals = class extends requesterUtils.BaseResource {
|
|
3749
3727
|
allApprovalRules(projectId, { mergerequestIId, ...options } = {}) {
|
|
3750
3728
|
let url12;
|
|
@@ -4231,10 +4209,8 @@ var Packages = class extends requesterUtils.BaseResource {
|
|
|
4231
4209
|
...options
|
|
4232
4210
|
} = {}) {
|
|
4233
4211
|
let url12;
|
|
4234
|
-
if (projectId)
|
|
4235
|
-
|
|
4236
|
-
else if (groupId)
|
|
4237
|
-
url12 = endpoint`groups/${groupId}/packages`;
|
|
4212
|
+
if (projectId) url12 = endpoint`projects/${projectId}/packages`;
|
|
4213
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/packages`;
|
|
4238
4214
|
else {
|
|
4239
4215
|
throw new Error(
|
|
4240
4216
|
"Missing required argument. Please supply a projectId or a groupId in the options parameter."
|
|
@@ -5047,12 +5023,9 @@ var Projects = class extends requesterUtils.BaseResource {
|
|
|
5047
5023
|
...options
|
|
5048
5024
|
} = {}) {
|
|
5049
5025
|
let uri;
|
|
5050
|
-
if (userId && starredOnly)
|
|
5051
|
-
|
|
5052
|
-
else
|
|
5053
|
-
uri = endpoint`users/${userId}/projects`;
|
|
5054
|
-
else
|
|
5055
|
-
uri = "projects";
|
|
5026
|
+
if (userId && starredOnly) uri = endpoint`users/${userId}/starred_projects`;
|
|
5027
|
+
else if (userId) uri = endpoint`users/${userId}/projects`;
|
|
5028
|
+
else uri = "projects";
|
|
5056
5029
|
return RequestHelper.get()(this, uri, options);
|
|
5057
5030
|
}
|
|
5058
5031
|
allTransferLocations(projectId, options) {
|
|
@@ -5594,14 +5567,10 @@ var Runners = class extends requesterUtils.BaseResource {
|
|
|
5594
5567
|
...options
|
|
5595
5568
|
} = {}) {
|
|
5596
5569
|
let url12;
|
|
5597
|
-
if (projectId)
|
|
5598
|
-
|
|
5599
|
-
else if (
|
|
5600
|
-
|
|
5601
|
-
else if (owned)
|
|
5602
|
-
url12 = "runners";
|
|
5603
|
-
else
|
|
5604
|
-
url12 = "runners/all";
|
|
5570
|
+
if (projectId) url12 = endpoint`projects/${projectId}/runners`;
|
|
5571
|
+
else if (groupId) url12 = endpoint`groups/${groupId}/runners`;
|
|
5572
|
+
else if (owned) url12 = "runners";
|
|
5573
|
+
else url12 = "runners/all";
|
|
5605
5574
|
return RequestHelper.get()(this, url12, options);
|
|
5606
5575
|
}
|
|
5607
5576
|
allJobs(runnerId, options) {
|
|
@@ -5636,8 +5605,7 @@ var Runners = class extends requesterUtils.BaseResource {
|
|
|
5636
5605
|
...options
|
|
5637
5606
|
}) {
|
|
5638
5607
|
let url12;
|
|
5639
|
-
if (runnerId)
|
|
5640
|
-
url12 = `runners/${runnerId}`;
|
|
5608
|
+
if (runnerId) url12 = `runners/${runnerId}`;
|
|
5641
5609
|
else if (token) {
|
|
5642
5610
|
url12 = "runners";
|
|
5643
5611
|
} else
|
|
@@ -5655,10 +5623,8 @@ var Runners = class extends requesterUtils.BaseResource {
|
|
|
5655
5623
|
...options
|
|
5656
5624
|
} = {}) {
|
|
5657
5625
|
let url12;
|
|
5658
|
-
if (runnerId)
|
|
5659
|
-
|
|
5660
|
-
else if (token)
|
|
5661
|
-
url12 = "runners/reset_registration_token";
|
|
5626
|
+
if (runnerId) url12 = endpoint`runners/${runnerId}/reset_registration_token`;
|
|
5627
|
+
else if (token) url12 = "runners/reset_registration_token";
|
|
5662
5628
|
else {
|
|
5663
5629
|
throw new Error("Missing either runnerId or token parameters");
|
|
5664
5630
|
}
|
|
@@ -5818,7 +5784,7 @@ var EpicIssues = class extends requesterUtils.BaseResource {
|
|
|
5818
5784
|
// src/resources/EpicLabelEvents.ts
|
|
5819
5785
|
var EpicLabelEvents = class extends ResourceLabelEvents {
|
|
5820
5786
|
constructor(options) {
|
|
5821
|
-
super("groups", "
|
|
5787
|
+
super("groups", "epics", options);
|
|
5822
5788
|
}
|
|
5823
5789
|
};
|
|
5824
5790
|
var EpicLinks = class extends requesterUtils.BaseResource {
|
|
@@ -6304,7 +6270,11 @@ var GroupServiceAccounts = class extends requesterUtils.BaseResource {
|
|
|
6304
6270
|
options
|
|
6305
6271
|
);
|
|
6306
6272
|
}
|
|
6273
|
+
// @deprecated In favor of `createPersonalAccessToken`
|
|
6307
6274
|
addPersonalAccessToken(groupId, serviceAccountId, options) {
|
|
6275
|
+
return this.createPersonalAccessToken(groupId, serviceAccountId, options);
|
|
6276
|
+
}
|
|
6277
|
+
createPersonalAccessToken(groupId, serviceAccountId, options) {
|
|
6308
6278
|
return RequestHelper.post()(
|
|
6309
6279
|
this,
|
|
6310
6280
|
endpoint`groups/${groupId}/service_accounts/${serviceAccountId}`,
|
|
@@ -6622,7 +6592,11 @@ var Users = class extends requesterUtils.BaseResource {
|
|
|
6622
6592
|
return RequestHelper.post()(this, endpoint`users/${userId}/activate`, options);
|
|
6623
6593
|
}
|
|
6624
6594
|
all(options) {
|
|
6625
|
-
return RequestHelper.get()(
|
|
6595
|
+
return RequestHelper.get()(
|
|
6596
|
+
this,
|
|
6597
|
+
"users",
|
|
6598
|
+
options
|
|
6599
|
+
);
|
|
6626
6600
|
}
|
|
6627
6601
|
allActivities(options) {
|
|
6628
6602
|
return RequestHelper.get()(this, "user/activities", options);
|
|
@@ -6631,10 +6605,18 @@ var Users = class extends requesterUtils.BaseResource {
|
|
|
6631
6605
|
return RequestHelper.get()(this, endpoint`users/${userId}/events`, options);
|
|
6632
6606
|
}
|
|
6633
6607
|
allFollowers(userId, options) {
|
|
6634
|
-
return RequestHelper.get()(
|
|
6608
|
+
return RequestHelper.get()(
|
|
6609
|
+
this,
|
|
6610
|
+
endpoint`users/${userId}/followers`,
|
|
6611
|
+
options
|
|
6612
|
+
);
|
|
6635
6613
|
}
|
|
6636
6614
|
allFollowing(userId, options) {
|
|
6637
|
-
return RequestHelper.get()(
|
|
6615
|
+
return RequestHelper.get()(
|
|
6616
|
+
this,
|
|
6617
|
+
endpoint`users/${userId}/following`,
|
|
6618
|
+
options
|
|
6619
|
+
);
|
|
6638
6620
|
}
|
|
6639
6621
|
allMemberships(userId, options) {
|
|
6640
6622
|
return RequestHelper.get()(
|
|
@@ -6740,7 +6722,11 @@ var Users = class extends requesterUtils.BaseResource {
|
|
|
6740
6722
|
);
|
|
6741
6723
|
}
|
|
6742
6724
|
showCurrentUser(options) {
|
|
6743
|
-
return RequestHelper.get()(
|
|
6725
|
+
return RequestHelper.get()(
|
|
6726
|
+
this,
|
|
6727
|
+
"user",
|
|
6728
|
+
options
|
|
6729
|
+
);
|
|
6744
6730
|
}
|
|
6745
6731
|
showCurrentUserPreferences(options) {
|
|
6746
6732
|
return RequestHelper.get()(this, "user/preferences", options);
|
|
@@ -6750,10 +6736,8 @@ var Users = class extends requesterUtils.BaseResource {
|
|
|
6750
6736
|
...options
|
|
6751
6737
|
} = {}) {
|
|
6752
6738
|
let url12;
|
|
6753
|
-
if (iDOrUsername)
|
|
6754
|
-
|
|
6755
|
-
else
|
|
6756
|
-
url12 = "user/status";
|
|
6739
|
+
if (iDOrUsername) url12 = `users/${iDOrUsername}/status`;
|
|
6740
|
+
else url12 = "user/status";
|
|
6757
6741
|
return RequestHelper.get()(this, url12, options);
|
|
6758
6742
|
}
|
|
6759
6743
|
remove(userId, options) {
|
|
@@ -6857,6 +6841,7 @@ var resources = {
|
|
|
6857
6841
|
IssueWeightEvents,
|
|
6858
6842
|
JobArtifacts,
|
|
6859
6843
|
Jobs,
|
|
6844
|
+
JobTokenScopes,
|
|
6860
6845
|
MergeRequestApprovals,
|
|
6861
6846
|
MergeRequestAwardEmojis,
|
|
6862
6847
|
MergeRequestContextCommits,
|
|
@@ -7077,6 +7062,7 @@ exports.IssueWeightEvents = IssueWeightEvents;
|
|
|
7077
7062
|
exports.Issues = Issues;
|
|
7078
7063
|
exports.IssuesStatistics = IssuesStatistics;
|
|
7079
7064
|
exports.JobArtifacts = JobArtifacts;
|
|
7065
|
+
exports.JobTokenScopes = JobTokenScopes;
|
|
7080
7066
|
exports.Jobs = Jobs;
|
|
7081
7067
|
exports.Keys = Keys;
|
|
7082
7068
|
exports.License = License;
|