gitverse-release 3.4.0 → 3.5.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/dist/cli.js +656 -472
- package/dist/cli.js.map +17 -24
- package/dist/index.js +648 -472
- package/dist/index.js.map +16 -23
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -147,162 +147,21 @@ function validateConfig(config) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
// ../sdk/dist/api/organizations.js
|
|
151
|
-
class k {
|
|
152
|
-
client;
|
|
153
|
-
constructor(b) {
|
|
154
|
-
this.client = b;
|
|
155
|
-
}
|
|
156
|
-
async checkMembership(b, h, j) {
|
|
157
|
-
try {
|
|
158
|
-
return await this.client.get(`/orgs/${b}/members/${h}`, j), true;
|
|
159
|
-
} catch (d) {
|
|
160
|
-
if (d instanceof Error && d.message.includes("404"))
|
|
161
|
-
return false;
|
|
162
|
-
throw d;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// ../sdk/dist/api/commits.js
|
|
168
|
-
class j {
|
|
169
|
-
client;
|
|
170
|
-
constructor(b) {
|
|
171
|
-
this.client = b;
|
|
172
|
-
}
|
|
173
|
-
list(b, d, f) {
|
|
174
|
-
return this.client.get(`/repos/${b}/${d}/commits`, f);
|
|
175
|
-
}
|
|
176
|
-
get(b, d, f, g) {
|
|
177
|
-
return this.client.get(`/repos/${b}/${d}/commits/${f}`, g);
|
|
178
|
-
}
|
|
179
|
-
create(b, d, f, g) {
|
|
180
|
-
return this.client.post(`/repos/${b}/${d}/git/commits`, f, g);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// ../sdk/dist/api/actions.js
|
|
185
|
-
class x {
|
|
186
|
-
client;
|
|
187
|
-
constructor(b) {
|
|
188
|
-
this.client = b;
|
|
189
|
-
}
|
|
190
|
-
listOrgRunners(b, h) {
|
|
191
|
-
return this.client.get(`/orgs/${b}/actions/runners`, h);
|
|
192
|
-
}
|
|
193
|
-
createOrgRegistrationToken(b, h) {
|
|
194
|
-
return this.client.post(`/orgs/${b}/actions/runners/registration-token`, {}, h);
|
|
195
|
-
}
|
|
196
|
-
getOrgRunner(b, h, j2) {
|
|
197
|
-
return this.client.get(`/orgs/${b}/actions/runners/${h}`, j2);
|
|
198
|
-
}
|
|
199
|
-
deleteOrgRunner(b, h, j2) {
|
|
200
|
-
return this.client.delete(`/orgs/${b}/actions/runners/${h}`, undefined, j2);
|
|
201
|
-
}
|
|
202
|
-
listRepoRunners(b, h, j2) {
|
|
203
|
-
return this.client.get(`/repos/${b}/${h}/actions/runners`, j2);
|
|
204
|
-
}
|
|
205
|
-
createRepoRegistrationToken(b, h, j2) {
|
|
206
|
-
return this.client.post(`/repos/${b}/${h}/actions/runners/registration-token`, {}, j2);
|
|
207
|
-
}
|
|
208
|
-
getRepoRunner(b, h, j2, q) {
|
|
209
|
-
return this.client.get(`/repos/${b}/${h}/actions/runners/${j2}`, q);
|
|
210
|
-
}
|
|
211
|
-
deleteRepoRunner(b, h, j2, q) {
|
|
212
|
-
return this.client.delete(`/repos/${b}/${h}/actions/runners/${j2}`, undefined, q);
|
|
213
|
-
}
|
|
214
|
-
listOrgSecrets(b, h) {
|
|
215
|
-
return this.client.get(`/orgs/${b}/actions/secrets`, h);
|
|
216
|
-
}
|
|
217
|
-
getOrgSecret(b, h, j2) {
|
|
218
|
-
return this.client.get(`/orgs/${b}/actions/secrets/${h}`, j2);
|
|
219
|
-
}
|
|
220
|
-
createOrUpdateOrgSecret(b, h, j2, q) {
|
|
221
|
-
return this.client.put(`/orgs/${b}/actions/secrets/${h}`, j2, q);
|
|
222
|
-
}
|
|
223
|
-
deleteOrgSecret(b, h, j2) {
|
|
224
|
-
return this.client.delete(`/orgs/${b}/actions/secrets/${h}`, undefined, j2);
|
|
225
|
-
}
|
|
226
|
-
listRepoSecrets(b, h, j2) {
|
|
227
|
-
return this.client.get(`/repos/${b}/${h}/actions/secrets`, j2);
|
|
228
|
-
}
|
|
229
|
-
getRepoSecret(b, h, j2, q) {
|
|
230
|
-
return this.client.get(`/repos/${b}/${h}/actions/secrets/${j2}`, q);
|
|
231
|
-
}
|
|
232
|
-
createOrUpdateRepoSecret(b, h, j2, q, v) {
|
|
233
|
-
return this.client.put(`/repos/${b}/${h}/actions/secrets/${j2}`, q, v);
|
|
234
|
-
}
|
|
235
|
-
deleteRepoSecret(b, h, j2, q) {
|
|
236
|
-
return this.client.delete(`/repos/${b}/${h}/actions/secrets/${j2}`, undefined, q);
|
|
237
|
-
}
|
|
238
|
-
listOrgVariables(b, h) {
|
|
239
|
-
return this.client.get(`/orgs/${b}/actions/variables`, h);
|
|
240
|
-
}
|
|
241
|
-
createOrgVariable(b, h, j2) {
|
|
242
|
-
return this.client.post(`/orgs/${b}/actions/variables`, h, j2);
|
|
243
|
-
}
|
|
244
|
-
getOrgVariable(b, h, j2) {
|
|
245
|
-
return this.client.get(`/orgs/${b}/actions/variables/${h}`, j2);
|
|
246
|
-
}
|
|
247
|
-
deleteOrgVariable(b, h, j2) {
|
|
248
|
-
return this.client.delete(`/orgs/${b}/actions/variables/${h}`, undefined, j2);
|
|
249
|
-
}
|
|
250
|
-
updateOrgVariable(b, h, j2, q) {
|
|
251
|
-
return this.client.patch(`/orgs/${b}/actions/variables/${h}`, j2, q);
|
|
252
|
-
}
|
|
253
|
-
listRepoVariables(b, h, j2) {
|
|
254
|
-
return this.client.get(`/repos/${b}/${h}/actions/variables`, j2);
|
|
255
|
-
}
|
|
256
|
-
createRepoVariable(b, h, j2, q) {
|
|
257
|
-
return this.client.post(`/repos/${b}/${h}/actions/variables`, j2, q);
|
|
258
|
-
}
|
|
259
|
-
getRepoVariable(b, h, j2, q) {
|
|
260
|
-
return this.client.get(`/repos/${b}/${h}/actions/variables/${j2}`, q);
|
|
261
|
-
}
|
|
262
|
-
deleteRepoVariable(b, h, j2, q) {
|
|
263
|
-
return this.client.delete(`/repos/${b}/${h}/actions/variables/${j2}`, undefined, q);
|
|
264
|
-
}
|
|
265
|
-
updateRepoVariable(b, h, j2, q, v) {
|
|
266
|
-
return this.client.patch(`/repos/${b}/${h}/actions/variables/${j2}`, q, v);
|
|
267
|
-
}
|
|
268
|
-
listArtifacts(b, h, j2) {
|
|
269
|
-
return this.client.get(`/repos/${b}/${h}/actions/artifacts`, j2);
|
|
270
|
-
}
|
|
271
|
-
getArtifact(b, h, j2, q) {
|
|
272
|
-
return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}`, q);
|
|
273
|
-
}
|
|
274
|
-
deleteArtifact(b, h, j2, q) {
|
|
275
|
-
return this.client.delete(`/repos/${b}/${h}/actions/artifacts/${j2}`, undefined, q);
|
|
276
|
-
}
|
|
277
|
-
downloadArtifact(b, h, j2, q) {
|
|
278
|
-
return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip`, q);
|
|
279
|
-
}
|
|
280
|
-
downloadArtifactRaw(b, h, j2, q) {
|
|
281
|
-
return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip/raw`, q);
|
|
282
|
-
}
|
|
283
|
-
getWorkflowDispatchInputs(b, h, j2, q) {
|
|
284
|
-
return this.client.get(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q);
|
|
285
|
-
}
|
|
286
|
-
dispatchWorkflow(b, h, j2, q, v) {
|
|
287
|
-
return this.client.post(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q, v);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
150
|
// ../sdk/dist/errors.js
|
|
292
|
-
class
|
|
151
|
+
class j extends Error {
|
|
293
152
|
status;
|
|
294
153
|
metadata;
|
|
295
154
|
constructor(b, f, h) {
|
|
296
155
|
super(f);
|
|
297
|
-
this.name = "GitVerseApiError", this.status = b, this.metadata = h, Object.setPrototypeOf(this,
|
|
156
|
+
this.name = "GitVerseApiError", this.status = b, this.metadata = h, Object.setPrototypeOf(this, j.prototype);
|
|
298
157
|
}
|
|
299
158
|
}
|
|
300
159
|
|
|
301
|
-
class
|
|
160
|
+
class k extends j {
|
|
302
161
|
rateLimit;
|
|
303
162
|
constructor(b, f, h) {
|
|
304
163
|
super(429, b, h);
|
|
305
|
-
this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this,
|
|
164
|
+
this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this, k.prototype);
|
|
306
165
|
}
|
|
307
166
|
getRetryAfterSeconds() {
|
|
308
167
|
return this.rateLimit.retryAfter;
|
|
@@ -327,411 +186,728 @@ class q {
|
|
|
327
186
|
}
|
|
328
187
|
}
|
|
329
188
|
|
|
330
|
-
// ../sdk/dist/
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
189
|
+
// ../sdk/dist/client.js
|
|
190
|
+
var Z = { DELETE: "DELETE", GET: "GET", PATCH: "PATCH", POST: "POST", PUT: "PUT" };
|
|
191
|
+
|
|
192
|
+
class v {
|
|
193
|
+
baseUrl;
|
|
194
|
+
token;
|
|
195
|
+
apiVersion;
|
|
196
|
+
onApiVersionWarning;
|
|
197
|
+
constructor(j2 = {}) {
|
|
198
|
+
this.baseUrl = j2.baseUrl || "https://api.gitverse.ru", this.token = j2.token, this.apiVersion = j2.apiVersion || "1";
|
|
338
199
|
}
|
|
339
|
-
|
|
340
|
-
|
|
200
|
+
setToken(j2) {
|
|
201
|
+
this.token = j2;
|
|
341
202
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
throw h;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
async remove(b, c, f) {
|
|
352
|
-
await this.client.delete(`/user/starred/${b}/${c}`, undefined, f);
|
|
203
|
+
extractRateLimitInfo(j2) {
|
|
204
|
+
let x = j2.get("GitVerse-RateLimit-Limit"), q2 = j2.get("GitVerse-RateLimit-User-Remaining") || j2.get("GitVerse-RateLimit-Remaining"), z = j2.get("GitVerse-RateLimit-Retry-After"), F = j2.get("Gitverse-Ratelimit-Reset");
|
|
205
|
+
if (!(x && z))
|
|
206
|
+
return;
|
|
207
|
+
let U = Number.parseInt(z, 10), J = F ? Number.parseInt(F, 10) : Math.floor(Date.now() / 1000) + U, K = q2 ? Number.parseInt(q2, 10) : 0;
|
|
208
|
+
return { limit: Number.parseInt(x, 10), remaining: K, reset: J, retryAfter: U };
|
|
353
209
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
constructor(c) {
|
|
360
|
-
this.client = c;
|
|
210
|
+
extractApiVersionInfo(j2) {
|
|
211
|
+
let x = j2.get("Gitverse-Api-Version"), q2 = j2.get("Gitverse-Api-Latest-Version"), z = j2.get("Gitverse-Api-Deprecation") === "true", F = j2.get("Gitverse-Api-Decommissioning");
|
|
212
|
+
if (!(x && q2))
|
|
213
|
+
return;
|
|
214
|
+
return { decommissioning: F || undefined, deprecated: z, latestVersion: q2, version: x };
|
|
361
215
|
}
|
|
362
|
-
|
|
363
|
-
let
|
|
364
|
-
if (
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
216
|
+
extractMetadata(j2) {
|
|
217
|
+
let x = this.extractRateLimitInfo(j2), q2 = this.extractApiVersionInfo(j2);
|
|
218
|
+
if (q2?.deprecated && this.onApiVersionWarning) {
|
|
219
|
+
let z = new q(q2.version, q2.latestVersion, q2.decommissioning);
|
|
220
|
+
this.onApiVersionWarning(z);
|
|
221
|
+
}
|
|
222
|
+
return { apiVersion: q2, rateLimit: x };
|
|
368
223
|
}
|
|
369
|
-
|
|
370
|
-
|
|
224
|
+
async request(j2, x, q2, z) {
|
|
225
|
+
let F = j2.startsWith("/") ? j2.slice(1) : j2, U = `${this.baseUrl}/${F}`, J = new Headers;
|
|
226
|
+
if (J.set("Content-Type", "application/json"), J.set("Accept", `application/vnd.gitverse.object+json; version=${this.apiVersion}`), this.token)
|
|
227
|
+
J.set("Authorization", `Bearer ${this.token}`);
|
|
228
|
+
let K = { body: q2 ? JSON.stringify(q2) : undefined, headers: J, method: x, signal: z?.signal }, C = await fetch(U, K), X = this.extractMetadata(C.headers), Y;
|
|
229
|
+
try {
|
|
230
|
+
Y = await C.json();
|
|
231
|
+
} catch {
|
|
232
|
+
Y = undefined;
|
|
233
|
+
}
|
|
234
|
+
if (!C.ok) {
|
|
235
|
+
let S = Y?.message || C.statusText;
|
|
236
|
+
if (C.status === 429 && X.rateLimit)
|
|
237
|
+
throw new k(S || "Превышен лимит запросов. Попробуйте позже.", X.rateLimit, X);
|
|
238
|
+
throw new j(C.status, S, X);
|
|
239
|
+
}
|
|
240
|
+
return Y;
|
|
371
241
|
}
|
|
372
|
-
|
|
373
|
-
return this.
|
|
242
|
+
get(j2, x) {
|
|
243
|
+
return this.request(j2, Z.GET, undefined, x);
|
|
374
244
|
}
|
|
375
|
-
|
|
376
|
-
return this.
|
|
245
|
+
post(j2, x, q2) {
|
|
246
|
+
return this.request(j2, Z.POST, x, q2);
|
|
377
247
|
}
|
|
378
|
-
|
|
379
|
-
return this.
|
|
248
|
+
put(j2, x, q2) {
|
|
249
|
+
return this.request(j2, Z.PUT, x, q2);
|
|
380
250
|
}
|
|
381
|
-
|
|
382
|
-
return this.
|
|
251
|
+
delete(j2, x, q2) {
|
|
252
|
+
return this.request(j2, Z.DELETE, x, q2);
|
|
383
253
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
// ../sdk/dist/api/branches.js
|
|
387
|
-
class g {
|
|
388
|
-
client;
|
|
389
|
-
constructor(b) {
|
|
390
|
-
this.client = b;
|
|
254
|
+
patch(j2, x, q2) {
|
|
255
|
+
return this.request(j2, Z.PATCH, x, q2);
|
|
391
256
|
}
|
|
392
|
-
|
|
393
|
-
|
|
257
|
+
async uploadFile(j2, x, q2, z, F) {
|
|
258
|
+
let U = j2.startsWith("/") ? j2.slice(1) : j2, J = `${this.baseUrl}/${U}`, K = new Headers;
|
|
259
|
+
if (K.set("Accept", `application/vnd.gitverse.object+json; version=${this.apiVersion}`), this.token)
|
|
260
|
+
K.set("Authorization", `Bearer ${this.token}`);
|
|
261
|
+
let C = new FormData, X = q2 instanceof ArrayBuffer ? new Blob([q2]) : q2;
|
|
262
|
+
C.append(x, X, z);
|
|
263
|
+
let Y = { body: C, headers: K, method: Z.POST, signal: F?.signal }, Q = await fetch(J, Y), S = this.extractMetadata(Q.headers), _;
|
|
264
|
+
try {
|
|
265
|
+
_ = await Q.json();
|
|
266
|
+
} catch {
|
|
267
|
+
_ = undefined;
|
|
268
|
+
}
|
|
269
|
+
if (!Q.ok) {
|
|
270
|
+
let W = _?.message || Q.statusText;
|
|
271
|
+
if (Q.status === 429 && S.rateLimit)
|
|
272
|
+
throw new k(W || "Превышен лимит запросов. Попробуйте позже.", S.rateLimit, S);
|
|
273
|
+
throw new j(Q.status, W, S);
|
|
274
|
+
}
|
|
275
|
+
return _;
|
|
394
276
|
}
|
|
395
277
|
}
|
|
396
278
|
|
|
397
|
-
// ../sdk/dist/utils.js
|
|
398
|
-
var z = /^([a-z][a-z0-9+.-]*:\/\/[^/]+)\/([a-z][a-z0-9+.-]*:\/\/.+)$/i;
|
|
399
|
-
function E(j3) {
|
|
400
|
-
if (!j3)
|
|
401
|
-
return j3;
|
|
402
|
-
let k4 = j3.match(z);
|
|
403
|
-
if (k4?.[1] && k4?.[2]) {
|
|
404
|
-
let q2 = k4[1], v = k4[2];
|
|
405
|
-
if (v.startsWith(q2))
|
|
406
|
-
return v;
|
|
407
|
-
}
|
|
408
|
-
return j3;
|
|
409
|
-
}
|
|
410
|
-
function J(j3) {
|
|
411
|
-
let k4 = ["clone_url", "html_url", "url", "git_url", "mirror_url"], q2 = { ...j3 };
|
|
412
|
-
for (let v of k4)
|
|
413
|
-
if (typeof q2[v] === "string")
|
|
414
|
-
q2[v] = E(q2[v]);
|
|
415
|
-
return q2;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
279
|
// ../sdk/dist/api/repositories.js
|
|
419
|
-
class
|
|
280
|
+
class E {
|
|
420
281
|
client;
|
|
421
|
-
constructor(
|
|
422
|
-
this.client =
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
282
|
+
constructor(k2) {
|
|
283
|
+
this.client = k2;
|
|
284
|
+
}
|
|
285
|
+
get(k2, x, j2) {
|
|
286
|
+
return this.client.get(`/repos/${k2}/${x}`, j2);
|
|
287
|
+
}
|
|
288
|
+
update(k2, x, j2, v2) {
|
|
289
|
+
return this.client.patch(`/repos/${k2}/${x}`, j2, v2);
|
|
290
|
+
}
|
|
291
|
+
delete(k2, x, j2) {
|
|
292
|
+
return this.client.delete(`/repos/${k2}/${x}`, undefined, j2);
|
|
293
|
+
}
|
|
294
|
+
listRepoSecrets(k2, x, j2, v2) {
|
|
295
|
+
let z = new URLSearchParams;
|
|
296
|
+
if (j2?.per_page !== undefined)
|
|
297
|
+
z.append("per_page", j2.per_page);
|
|
298
|
+
if (j2?.page !== undefined)
|
|
299
|
+
z.append("page", j2.page);
|
|
300
|
+
let A = z.toString(), B = `/repos/${k2}/${x}/actions/secrets${A ? `?${A}` : ""}`;
|
|
301
|
+
return this.client.get(B, v2);
|
|
302
|
+
}
|
|
303
|
+
getRepoSecret(k2, x, j2, v2) {
|
|
304
|
+
return this.client.get(`/repos/${k2}/${x}/actions/secrets/${j2}`, v2);
|
|
305
|
+
}
|
|
306
|
+
createOrUpdateRepoSecret(k2, x, j2, v2, z) {
|
|
307
|
+
let A = new URLSearchParams;
|
|
308
|
+
if (v2?.encrypted_value !== undefined)
|
|
309
|
+
A.append("encrypted_value", v2.encrypted_value);
|
|
310
|
+
let B = A.toString(), D = `/repos/${k2}/${x}/actions/secrets/${j2}${B ? `?${B}` : ""}`;
|
|
311
|
+
return this.client.put(D, z);
|
|
312
|
+
}
|
|
313
|
+
deleteRepoSecret(k2, x, j2, v2) {
|
|
314
|
+
return this.client.delete(`/repos/${k2}/${x}/actions/secrets/${j2}`, undefined, v2);
|
|
315
|
+
}
|
|
316
|
+
listBranches(k2, x, j2, v2) {
|
|
317
|
+
let z = new URLSearchParams;
|
|
318
|
+
if (j2?.page !== undefined)
|
|
319
|
+
z.append("page", String(j2.page));
|
|
320
|
+
if (j2?.per_page !== undefined)
|
|
321
|
+
z.append("per_page", String(j2.per_page));
|
|
322
|
+
if (j2?.q !== undefined)
|
|
323
|
+
z.append("q", j2.q);
|
|
324
|
+
let A = z.toString(), B = `/repos/${k2}/${x}/branches${A ? `?${A}` : ""}`;
|
|
325
|
+
return this.client.get(B, v2);
|
|
326
|
+
}
|
|
327
|
+
listCollaborators(k2, x, j2, v2) {
|
|
328
|
+
let z = new URLSearchParams;
|
|
329
|
+
if (j2?.affiliation !== undefined)
|
|
330
|
+
z.append("affiliation", j2.affiliation);
|
|
331
|
+
if (j2?.permission !== undefined)
|
|
332
|
+
z.append("permission", j2.permission);
|
|
333
|
+
if (j2?.page !== undefined)
|
|
334
|
+
z.append("page", String(j2.page));
|
|
335
|
+
if (j2?.per_page !== undefined)
|
|
336
|
+
z.append("per_page", String(j2.per_page));
|
|
337
|
+
let A = z.toString(), B = `/repos/${k2}/${x}/collaborators${A ? `?${A}` : ""}`;
|
|
338
|
+
return this.client.get(B, v2);
|
|
339
|
+
}
|
|
340
|
+
addCollaborator(k2, x, j2, v2, z) {
|
|
341
|
+
return this.client.put(`/repos/${k2}/${x}/collaborators/${j2}`, v2, z);
|
|
342
|
+
}
|
|
343
|
+
listCommits(k2, x, j2, v2) {
|
|
344
|
+
let z = new URLSearchParams;
|
|
345
|
+
if (j2?.page !== undefined)
|
|
346
|
+
z.append("page", String(j2.page));
|
|
347
|
+
if (j2?.per_page !== undefined)
|
|
348
|
+
z.append("per_page", String(j2.per_page));
|
|
349
|
+
if (j2?.sha !== undefined)
|
|
350
|
+
z.append("sha", j2.sha);
|
|
351
|
+
if (j2?.path !== undefined)
|
|
352
|
+
z.append("path", j2.path);
|
|
353
|
+
if (j2?.not !== undefined)
|
|
354
|
+
z.append("not", j2.not);
|
|
355
|
+
if (j2?.author !== undefined)
|
|
356
|
+
z.append("author", j2.author);
|
|
357
|
+
if (j2?.committer !== undefined)
|
|
358
|
+
z.append("committer", j2.committer);
|
|
359
|
+
if (j2?.since !== undefined)
|
|
360
|
+
z.append("since", j2.since);
|
|
361
|
+
if (j2?.until !== undefined)
|
|
362
|
+
z.append("until", j2.until);
|
|
363
|
+
let A = z.toString(), B = `/repos/${k2}/${x}/commits${A ? `?${A}` : ""}`;
|
|
364
|
+
return this.client.get(B, v2);
|
|
365
|
+
}
|
|
366
|
+
getCommit(k2, x, j2, v2) {
|
|
367
|
+
return this.client.get(`/repos/${k2}/${x}/commits/${j2}`, v2);
|
|
368
|
+
}
|
|
369
|
+
compareCommits(k2, x, j2, v2, z) {
|
|
370
|
+
let A = new URLSearchParams;
|
|
371
|
+
if (v2?.page !== undefined)
|
|
372
|
+
A.append("page", String(v2.page));
|
|
373
|
+
if (v2?.per_page !== undefined)
|
|
374
|
+
A.append("per_page", String(v2.per_page));
|
|
375
|
+
let B = A.toString(), D = `/repos/${k2}/${x}/compare/${j2}${B ? `?${B}` : ""}`;
|
|
376
|
+
return this.client.get(D, z);
|
|
377
|
+
}
|
|
378
|
+
getContent(k2, x, j2, v2, z) {
|
|
379
|
+
let A = new URLSearchParams;
|
|
380
|
+
if (v2?.ref !== undefined)
|
|
381
|
+
A.append("ref", v2.ref);
|
|
382
|
+
if (v2?.scope !== undefined)
|
|
383
|
+
A.append("scope", v2.scope);
|
|
384
|
+
let B = A.toString(), D = `/repos/${k2}/${x}/contents/${j2}${B ? `?${B}` : ""}`;
|
|
385
|
+
return this.client.get(D, z);
|
|
386
|
+
}
|
|
387
|
+
createOrUpdateFile(k2, x, j2, v2, z) {
|
|
388
|
+
return this.client.put(`/repos/${k2}/${x}/contents/${j2}`, v2, z);
|
|
389
|
+
}
|
|
390
|
+
deleteFile(k2, x, j2, v2, z) {
|
|
391
|
+
return this.client.delete(`/repos/${k2}/${x}/contents/${j2}`, v2, z);
|
|
392
|
+
}
|
|
393
|
+
createFork(k2, x, j2, v2) {
|
|
394
|
+
return this.client.post(`/repos/${k2}/${x}/forks`, j2, v2);
|
|
395
|
+
}
|
|
396
|
+
createCommit(k2, x, j2, v2) {
|
|
397
|
+
return this.client.post(`/repos/${k2}/${x}/git/commits`, j2, v2);
|
|
398
|
+
}
|
|
399
|
+
createRef(k2, x, j2, v2) {
|
|
400
|
+
return this.client.post(`/repos/${k2}/${x}/git/refs`, j2, v2);
|
|
401
|
+
}
|
|
402
|
+
createTree(k2, x, j2, v2) {
|
|
403
|
+
return this.client.post(`/repos/${k2}/${x}/git/trees`, j2, v2);
|
|
404
|
+
}
|
|
405
|
+
getTree(k2, x, j2, v2, z) {
|
|
406
|
+
let A = new URLSearchParams;
|
|
407
|
+
if (v2?.page !== undefined)
|
|
408
|
+
A.append("page", String(v2.page));
|
|
409
|
+
if (v2?.per_page !== undefined)
|
|
410
|
+
A.append("per_page", String(v2.per_page));
|
|
411
|
+
if (v2?.recursive !== undefined)
|
|
412
|
+
A.append("recursive", String(v2.recursive));
|
|
413
|
+
let B = A.toString(), D = `/repos/${k2}/${x}/git/trees/${j2}${B ? `?${B}` : ""}`;
|
|
414
|
+
return this.client.get(D, z);
|
|
415
|
+
}
|
|
416
|
+
listLanguages(k2, x, j2) {
|
|
417
|
+
return this.client.get(`/repos/${k2}/${x}/languages`, j2);
|
|
418
|
+
}
|
|
419
|
+
listPulls(k2, x, j2, v2) {
|
|
420
|
+
let z = new URLSearchParams;
|
|
421
|
+
if (j2?.state !== undefined)
|
|
422
|
+
z.append("state", j2.state);
|
|
423
|
+
if (j2?.head !== undefined)
|
|
424
|
+
z.append("head", j2.head);
|
|
425
|
+
if (j2?.base !== undefined)
|
|
426
|
+
z.append("base", j2.base);
|
|
427
|
+
if (j2?.sort !== undefined)
|
|
428
|
+
z.append("sort", j2.sort);
|
|
429
|
+
if (j2?.direction !== undefined)
|
|
430
|
+
z.append("direction", j2.direction);
|
|
431
|
+
if (j2?.page !== undefined)
|
|
432
|
+
z.append("page", String(j2.page));
|
|
433
|
+
if (j2?.per_page !== undefined)
|
|
434
|
+
z.append("per_page", String(j2.per_page));
|
|
435
|
+
let A = z.toString(), B = `/repos/${k2}/${x}/pulls${A ? `?${A}` : ""}`;
|
|
436
|
+
return this.client.get(B, v2);
|
|
437
|
+
}
|
|
438
|
+
getPull(k2, x, j2, v2) {
|
|
439
|
+
return this.client.get(`/repos/${k2}/${x}/pulls/${j2}`, v2);
|
|
440
|
+
}
|
|
441
|
+
updatePull(k2, x, j2, v2, z) {
|
|
442
|
+
return this.client.patch(`/repos/${k2}/${x}/pulls/${j2}`, v2, z);
|
|
443
|
+
}
|
|
444
|
+
listForAuthenticatedUser(k2, x) {
|
|
445
|
+
let j2 = new URLSearchParams;
|
|
446
|
+
if (k2?.page !== undefined)
|
|
447
|
+
j2.append("page", String(k2.page));
|
|
448
|
+
if (k2?.per_page !== undefined)
|
|
449
|
+
j2.append("per_page", String(k2.per_page));
|
|
450
|
+
let v2 = j2.toString(), z = `/user/repos${v2 ? `?${v2}` : ""}`;
|
|
451
|
+
return this.client.get(z, x);
|
|
452
|
+
}
|
|
453
|
+
createForAuthenticatedUser(k2, x) {
|
|
454
|
+
return this.client.post("/user/repos", k2, x);
|
|
447
455
|
}
|
|
448
456
|
}
|
|
449
457
|
|
|
450
|
-
// ../sdk/dist/api/
|
|
451
|
-
class
|
|
458
|
+
// ../sdk/dist/api/teams.js
|
|
459
|
+
class E2 {
|
|
452
460
|
client;
|
|
453
|
-
constructor(
|
|
454
|
-
this.client =
|
|
455
|
-
}
|
|
456
|
-
list(
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
+
constructor(x) {
|
|
462
|
+
this.client = x;
|
|
463
|
+
}
|
|
464
|
+
list(x, b, j2) {
|
|
465
|
+
let B = new URLSearchParams;
|
|
466
|
+
if (b?.page !== undefined)
|
|
467
|
+
B.append("page", String(b.page));
|
|
468
|
+
if (b?.per_page !== undefined)
|
|
469
|
+
B.append("per_page", String(b.per_page));
|
|
470
|
+
let k2 = B.toString(), C = `/orgs/${x}/teams${k2 ? `?${k2}` : ""}`;
|
|
471
|
+
return this.client.get(C, j2);
|
|
472
|
+
}
|
|
473
|
+
listMembers(x, b, j2, B) {
|
|
474
|
+
let k2 = new URLSearchParams;
|
|
475
|
+
if (j2?.page !== undefined)
|
|
476
|
+
k2.append("page", String(j2.page));
|
|
477
|
+
if (j2?.per_page !== undefined)
|
|
478
|
+
k2.append("per_page", String(j2.per_page));
|
|
479
|
+
let C = k2.toString(), D = `/orgs/${x}/teams/${b}/members${C ? `?${C}` : ""}`;
|
|
480
|
+
return this.client.get(D, B);
|
|
481
|
+
}
|
|
482
|
+
updateRepo(x, b, j2, B, k2, C) {
|
|
483
|
+
return this.client.put(`/orgs/${x}/teams/${b}/repos/${j2}/${B}`, k2, C);
|
|
461
484
|
}
|
|
462
485
|
}
|
|
463
486
|
|
|
464
|
-
// ../sdk/dist/api/
|
|
465
|
-
class
|
|
487
|
+
// ../sdk/dist/api/releases.js
|
|
488
|
+
class G {
|
|
466
489
|
client;
|
|
467
|
-
constructor(
|
|
468
|
-
this.client =
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
490
|
+
constructor(k2) {
|
|
491
|
+
this.client = k2;
|
|
492
|
+
}
|
|
493
|
+
list(k2, A, b, j2) {
|
|
494
|
+
let B = new URLSearchParams;
|
|
495
|
+
if (b?.page !== undefined)
|
|
496
|
+
B.append("page", String(b.page));
|
|
497
|
+
if (b?.per_page !== undefined)
|
|
498
|
+
B.append("per_page", String(b.per_page));
|
|
499
|
+
if (b?.draft !== undefined)
|
|
500
|
+
B.append("draft", String(b.draft));
|
|
501
|
+
if (b?.pre_release !== undefined)
|
|
502
|
+
B.append("pre_release", String(b.pre_release));
|
|
503
|
+
let C = B.toString(), E3 = `/repos/${k2}/${A}/releases${C ? `?${C}` : ""}`;
|
|
504
|
+
return this.client.get(E3, j2);
|
|
505
|
+
}
|
|
506
|
+
create(k2, A, b, j2) {
|
|
507
|
+
return this.client.post(`/repos/${k2}/${A}/releases`, b, j2);
|
|
508
|
+
}
|
|
509
|
+
getByTag(k2, A, b, j2) {
|
|
510
|
+
return this.client.get(`/repos/${k2}/${A}/releases/tags/${b}`, j2);
|
|
511
|
+
}
|
|
512
|
+
deleteByTag(k2, A, b, j2) {
|
|
513
|
+
return this.client.delete(`/repos/${k2}/${A}/releases/tags/${b}`, undefined, j2);
|
|
514
|
+
}
|
|
515
|
+
get(k2, A, b, j2) {
|
|
516
|
+
return this.client.get(`/repos/${k2}/${A}/releases/${b}`, j2);
|
|
517
|
+
}
|
|
518
|
+
update(k2, A, b, j2, B) {
|
|
519
|
+
return this.client.patch(`/repos/${k2}/${A}/releases/${b}`, j2, B);
|
|
520
|
+
}
|
|
521
|
+
delete(k2, A, b, j2) {
|
|
522
|
+
return this.client.delete(`/repos/${k2}/${A}/releases/${b}`, undefined, j2);
|
|
523
|
+
}
|
|
524
|
+
listAssets(k2, A, b, j2, B) {
|
|
525
|
+
let C = new URLSearchParams;
|
|
526
|
+
if (j2?.page !== undefined)
|
|
527
|
+
C.append("page", String(j2.page));
|
|
528
|
+
if (j2?.per_page !== undefined)
|
|
529
|
+
C.append("per_page", String(j2.per_page));
|
|
530
|
+
let E3 = C.toString(), F = `/repos/${k2}/${A}/releases/${b}/assets${E3 ? `?${E3}` : ""}`;
|
|
531
|
+
return this.client.get(F, B);
|
|
532
|
+
}
|
|
533
|
+
uploadAsset(k2, A, b, j2, B) {
|
|
534
|
+
let C = new URLSearchParams;
|
|
535
|
+
if (j2?.name !== undefined)
|
|
536
|
+
C.append("name", j2.name);
|
|
537
|
+
let E3 = C.toString(), F = `/repos/${k2}/${A}/releases/${b}/assets${E3 ? `?${E3}` : ""}`;
|
|
538
|
+
return this.client.post(F, B);
|
|
539
|
+
}
|
|
540
|
+
deleteAsset(k2, A, b, j2, B) {
|
|
541
|
+
return this.client.delete(`/repos/${k2}/${A}/releases/${b}/assets/${j2}`, undefined, B);
|
|
481
542
|
}
|
|
482
543
|
}
|
|
483
544
|
|
|
484
|
-
// ../sdk/dist/api/
|
|
485
|
-
class
|
|
545
|
+
// ../sdk/dist/api/pulls.js
|
|
546
|
+
class I {
|
|
486
547
|
client;
|
|
487
|
-
constructor(
|
|
488
|
-
this.client =
|
|
489
|
-
}
|
|
490
|
-
list(b, d) {
|
|
491
|
-
return this.client.get(`/orgs/${b}/teams`, d);
|
|
548
|
+
constructor(k2) {
|
|
549
|
+
this.client = k2;
|
|
492
550
|
}
|
|
493
|
-
|
|
494
|
-
return this.client.
|
|
551
|
+
create(k2, v2, z, j2) {
|
|
552
|
+
return this.client.post(`/repos/${k2}/${v2}/pulls`, z, j2);
|
|
495
553
|
}
|
|
496
|
-
|
|
497
|
-
|
|
554
|
+
listCommits(k2, v2, z, j2, D) {
|
|
555
|
+
let C = new URLSearchParams;
|
|
556
|
+
if (j2?.page !== undefined)
|
|
557
|
+
C.append("page", String(j2.page));
|
|
558
|
+
if (j2?.per_page !== undefined)
|
|
559
|
+
C.append("per_page", String(j2.per_page));
|
|
560
|
+
let F = C.toString(), G2 = `/repos/${k2}/${v2}/pulls/${z}/commits${F ? `?${F}` : ""}`;
|
|
561
|
+
return this.client.get(G2, D);
|
|
498
562
|
}
|
|
499
|
-
|
|
500
|
-
|
|
563
|
+
listFiles(k2, v2, z, j2, D) {
|
|
564
|
+
let C = new URLSearchParams;
|
|
565
|
+
if (j2?.page !== undefined)
|
|
566
|
+
C.append("page", String(j2.page));
|
|
567
|
+
if (j2?.per_page !== undefined)
|
|
568
|
+
C.append("per_page", String(j2.per_page));
|
|
569
|
+
let F = C.toString(), G2 = `/repos/${k2}/${v2}/pulls/${z}/files${F ? `?${F}` : ""}`;
|
|
570
|
+
return this.client.get(G2, D);
|
|
501
571
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
// ../sdk/dist/api/git.js
|
|
505
|
-
class j4 {
|
|
506
|
-
client;
|
|
507
|
-
constructor(b) {
|
|
508
|
-
this.client = b;
|
|
509
|
-
}
|
|
510
|
-
createRef(b, d, f, g2) {
|
|
511
|
-
return this.client.post(`/repos/${b}/${d}/git/refs`, f, g2);
|
|
572
|
+
isMerged(k2, v2, z, j2) {
|
|
573
|
+
return this.client.get(`/repos/${k2}/${v2}/pulls/${z}/merge`, j2);
|
|
512
574
|
}
|
|
513
|
-
|
|
514
|
-
return this.client.
|
|
515
|
-
}
|
|
516
|
-
getTree(b, d, f, g2) {
|
|
517
|
-
return this.client.get(`/repos/${b}/${d}/git/trees/${f}`, g2);
|
|
575
|
+
updateBranch(k2, v2, z, j2, D) {
|
|
576
|
+
return this.client.put(`/repos/${k2}/${v2}/pulls/${z}/update-branch`, j2, D);
|
|
518
577
|
}
|
|
519
578
|
}
|
|
520
579
|
|
|
521
|
-
// ../sdk/dist/api/
|
|
522
|
-
class
|
|
580
|
+
// ../sdk/dist/api/organizations.js
|
|
581
|
+
class F {
|
|
523
582
|
client;
|
|
524
|
-
constructor(
|
|
525
|
-
this.client =
|
|
526
|
-
}
|
|
527
|
-
list(b, f, h) {
|
|
528
|
-
return this.client.get(`/repos/${b}/${f}/releases`, h);
|
|
583
|
+
constructor(w) {
|
|
584
|
+
this.client = w;
|
|
529
585
|
}
|
|
530
|
-
|
|
531
|
-
|
|
586
|
+
listOrgSecrets(w, j2, x) {
|
|
587
|
+
let A = new URLSearchParams;
|
|
588
|
+
if (j2?.per_page !== undefined)
|
|
589
|
+
A.append("per_page", j2.per_page);
|
|
590
|
+
if (j2?.page !== undefined)
|
|
591
|
+
A.append("page", j2.page);
|
|
592
|
+
let B = A.toString(), D = `/orgs/${w}/actions/secrets${B ? `?${B}` : ""}`;
|
|
593
|
+
return this.client.get(D, x);
|
|
532
594
|
}
|
|
533
|
-
|
|
534
|
-
return this.client.get(`/
|
|
595
|
+
getOrgSecret(w, j2, x) {
|
|
596
|
+
return this.client.get(`/orgs/${w}/actions/secrets/${j2}`, x);
|
|
535
597
|
}
|
|
536
|
-
|
|
537
|
-
|
|
598
|
+
createOrUpdateOrgSecret(w, j2, x, A) {
|
|
599
|
+
let B = new URLSearchParams;
|
|
600
|
+
if (x?.encrypted_value !== undefined)
|
|
601
|
+
B.append("encrypted_value", x.encrypted_value);
|
|
602
|
+
let D = B.toString(), E3 = `/orgs/${w}/actions/secrets/${j2}${D ? `?${D}` : ""}`;
|
|
603
|
+
return this.client.put(E3, A);
|
|
538
604
|
}
|
|
539
|
-
|
|
540
|
-
return this.client.
|
|
605
|
+
deleteOrgSecret(w, j2, x) {
|
|
606
|
+
return this.client.delete(`/orgs/${w}/actions/secrets/${j2}`, undefined, x);
|
|
541
607
|
}
|
|
542
|
-
|
|
543
|
-
return this.client.
|
|
544
|
-
}
|
|
545
|
-
update(b, f, h, j5, k6) {
|
|
546
|
-
return this.client.patch(`/repos/${b}/${f}/releases/${h}`, j5, k6);
|
|
547
|
-
}
|
|
548
|
-
getAssets(b, f, h, j5) {
|
|
549
|
-
return this.client.get(`/repos/${b}/${f}/releases/${h}/assets`, j5);
|
|
550
|
-
}
|
|
551
|
-
uploadAsset(b, f, h, j5, k6) {
|
|
552
|
-
return this.client.post(`/repos/${b}/${f}/releases/${h}/assets`, j5, k6);
|
|
553
|
-
}
|
|
554
|
-
deleteAsset(b, f, h, j5, k6) {
|
|
555
|
-
return this.client.delete(`/repos/${b}/${f}/releases/${h}/assets/${j5}`, undefined, k6);
|
|
608
|
+
isMember(w, j2, x) {
|
|
609
|
+
return this.client.get(`/orgs/${w}/members/${j2}`, x);
|
|
556
610
|
}
|
|
557
611
|
}
|
|
558
612
|
|
|
559
|
-
// ../sdk/dist/api/
|
|
560
|
-
class
|
|
613
|
+
// ../sdk/dist/api/actions.js
|
|
614
|
+
class F2 {
|
|
561
615
|
client;
|
|
562
|
-
constructor(
|
|
563
|
-
this.client =
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
616
|
+
constructor(x) {
|
|
617
|
+
this.client = x;
|
|
618
|
+
}
|
|
619
|
+
listOrgRunners(x, j2, b) {
|
|
620
|
+
let z = new URLSearchParams;
|
|
621
|
+
if (j2?.page !== undefined)
|
|
622
|
+
z.append("page", String(j2.page));
|
|
623
|
+
if (j2?.per_page !== undefined)
|
|
624
|
+
z.append("per_page", String(j2.per_page));
|
|
625
|
+
let A = z.toString(), B = `/orgs/${x}/actions/runners${A ? `?${A}` : ""}`;
|
|
626
|
+
return this.client.get(B, b);
|
|
627
|
+
}
|
|
628
|
+
createOrgRunnerRegistrationToken(x, j2) {
|
|
629
|
+
return this.client.post(`/orgs/${x}/actions/runners/registration-token`, j2);
|
|
630
|
+
}
|
|
631
|
+
getOrgRunner(x, j2, b) {
|
|
632
|
+
return this.client.get(`/orgs/${x}/actions/runners/${j2}`, b);
|
|
633
|
+
}
|
|
634
|
+
deleteOrgRunner(x, j2, b) {
|
|
635
|
+
return this.client.delete(`/orgs/${x}/actions/runners/${j2}`, undefined, b);
|
|
636
|
+
}
|
|
637
|
+
listOrgVariables(x, j2, b) {
|
|
638
|
+
let z = new URLSearchParams;
|
|
639
|
+
if (j2?.per_page !== undefined)
|
|
640
|
+
z.append("per_page", String(j2.per_page));
|
|
641
|
+
if (j2?.page !== undefined)
|
|
642
|
+
z.append("page", String(j2.page));
|
|
643
|
+
let A = z.toString(), B = `/orgs/${x}/actions/variables${A ? `?${A}` : ""}`;
|
|
644
|
+
return this.client.get(B, b);
|
|
645
|
+
}
|
|
646
|
+
createOrgVariable(x, j2, b) {
|
|
647
|
+
return this.client.post(`/orgs/${x}/actions/variables`, j2, b);
|
|
648
|
+
}
|
|
649
|
+
getOrgVariable(x, j2, b) {
|
|
650
|
+
return this.client.get(`/orgs/${x}/actions/variables/${j2}`, b);
|
|
651
|
+
}
|
|
652
|
+
updateOrgVariable(x, j2, b, z) {
|
|
653
|
+
return this.client.patch(`/orgs/${x}/actions/variables/${j2}`, b, z);
|
|
654
|
+
}
|
|
655
|
+
deleteOrgVariable(x, j2, b) {
|
|
656
|
+
return this.client.delete(`/orgs/${x}/actions/variables/${j2}`, undefined, b);
|
|
657
|
+
}
|
|
658
|
+
listArtifacts(x, j2, b, z) {
|
|
659
|
+
let A = new URLSearchParams;
|
|
660
|
+
if (b?.page !== undefined)
|
|
661
|
+
A.append("page", String(b.page));
|
|
662
|
+
if (b?.per_page !== undefined)
|
|
663
|
+
A.append("per_page", String(b.per_page));
|
|
664
|
+
if (b?.name !== undefined)
|
|
665
|
+
A.append("name", b.name);
|
|
666
|
+
let B = A.toString(), C = `/repos/${x}/${j2}/actions/artifacts${B ? `?${B}` : ""}`;
|
|
667
|
+
return this.client.get(C, z);
|
|
668
|
+
}
|
|
669
|
+
getArtifact(x, j2, b, z) {
|
|
670
|
+
return this.client.get(`/repos/${x}/${j2}/actions/artifacts/${b}`, z);
|
|
671
|
+
}
|
|
672
|
+
deleteArtifact(x, j2, b, z) {
|
|
673
|
+
return this.client.delete(`/repos/${x}/${j2}/actions/artifacts/${b}`, undefined, z);
|
|
674
|
+
}
|
|
675
|
+
downloadArtifact(x, j2, b, z) {
|
|
676
|
+
return this.client.get(`/repos/${x}/${j2}/actions/artifacts/${b}/zip`, z);
|
|
677
|
+
}
|
|
678
|
+
downloadArtifactRaw(x, j2, b, z) {
|
|
679
|
+
return this.client.get(`/repos/${x}/${j2}/actions/artifacts/${b}/zip/raw`, z);
|
|
680
|
+
}
|
|
681
|
+
listRepoRunners(x, j2, b, z) {
|
|
682
|
+
let A = new URLSearchParams;
|
|
683
|
+
if (b?.page !== undefined)
|
|
684
|
+
A.append("page", String(b.page));
|
|
685
|
+
if (b?.per_page !== undefined)
|
|
686
|
+
A.append("per_page", String(b.per_page));
|
|
687
|
+
let B = A.toString(), C = `/repos/${x}/${j2}/actions/runners${B ? `?${B}` : ""}`;
|
|
688
|
+
return this.client.get(C, z);
|
|
689
|
+
}
|
|
690
|
+
createRepoRunnerRegistrationToken(x, j2, b) {
|
|
691
|
+
return this.client.post(`/repos/${x}/${j2}/actions/runners/registration-token`, b);
|
|
692
|
+
}
|
|
693
|
+
getRepoRunner(x, j2, b, z) {
|
|
694
|
+
return this.client.get(`/repos/${x}/${j2}/actions/runners/${b}`, z);
|
|
695
|
+
}
|
|
696
|
+
deleteRepoRunner(x, j2, b, z) {
|
|
697
|
+
return this.client.delete(`/repos/${x}/${j2}/actions/runners/${b}`, undefined, z);
|
|
698
|
+
}
|
|
699
|
+
listRepoVariables(x, j2, b, z) {
|
|
700
|
+
let A = new URLSearchParams;
|
|
701
|
+
if (b?.per_page !== undefined)
|
|
702
|
+
A.append("per_page", String(b.per_page));
|
|
703
|
+
if (b?.page !== undefined)
|
|
704
|
+
A.append("page", String(b.page));
|
|
705
|
+
let B = A.toString(), C = `/repos/${x}/${j2}/actions/variables${B ? `?${B}` : ""}`;
|
|
706
|
+
return this.client.get(C, z);
|
|
707
|
+
}
|
|
708
|
+
createRepoVariable(x, j2, b, z) {
|
|
709
|
+
return this.client.post(`/repos/${x}/${j2}/actions/variables`, b, z);
|
|
710
|
+
}
|
|
711
|
+
getRepoVariable(x, j2, b, z) {
|
|
712
|
+
return this.client.get(`/repos/${x}/${j2}/actions/variables/${b}`, z);
|
|
713
|
+
}
|
|
714
|
+
updateRepoVariable(x, j2, b, z, A) {
|
|
715
|
+
return this.client.patch(`/repos/${x}/${j2}/actions/variables/${b}`, z, A);
|
|
716
|
+
}
|
|
717
|
+
deleteRepoVariable(x, j2, b, z) {
|
|
718
|
+
return this.client.delete(`/repos/${x}/${j2}/actions/variables/${b}`, undefined, z);
|
|
719
|
+
}
|
|
720
|
+
getWorkflowDispatchInputs(x, j2, b, z, A) {
|
|
721
|
+
let B = new URLSearchParams;
|
|
722
|
+
if (z?.branch !== undefined)
|
|
723
|
+
B.append("branch", z.branch);
|
|
724
|
+
if (z?.tag !== undefined)
|
|
725
|
+
B.append("tag", z.tag);
|
|
726
|
+
let C = B.toString(), D = `/repos/${x}/${j2}/actions/workflows/${b}/dispatches${C ? `?${C}` : ""}`;
|
|
727
|
+
return this.client.get(D, A);
|
|
728
|
+
}
|
|
729
|
+
dispatchWorkflow(x, j2, b, z, A, B) {
|
|
730
|
+
let C = new URLSearchParams;
|
|
731
|
+
if (A?.branch !== undefined)
|
|
732
|
+
C.append("branch", A.branch);
|
|
733
|
+
if (A?.tag !== undefined)
|
|
734
|
+
C.append("tag", A.tag);
|
|
735
|
+
let D = C.toString(), E3 = `/repos/${x}/${j2}/actions/workflows/${b}/dispatches${D ? `?${D}` : ""}`;
|
|
736
|
+
return this.client.post(E3, z, B);
|
|
595
737
|
}
|
|
596
738
|
}
|
|
597
739
|
|
|
598
|
-
// ../sdk/dist/api/
|
|
599
|
-
class
|
|
740
|
+
// ../sdk/dist/api/stars.js
|
|
741
|
+
class A {
|
|
600
742
|
client;
|
|
601
743
|
constructor(b) {
|
|
602
744
|
this.client = b;
|
|
603
745
|
}
|
|
604
|
-
|
|
605
|
-
let
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
apiVersion;
|
|
617
|
-
onApiVersionWarning;
|
|
618
|
-
constructor(j5 = {}) {
|
|
619
|
-
this.baseUrl = j5.baseUrl || "https://api.gitverse.ru", this.token = j5.token, this.apiVersion = j5.apiVersion || "1";
|
|
620
|
-
}
|
|
621
|
-
setToken(j5) {
|
|
622
|
-
this.token = j5;
|
|
623
|
-
}
|
|
624
|
-
extractRateLimitInfo(j5) {
|
|
625
|
-
let x2 = j5.get("GitVerse-RateLimit-Limit"), q4 = j5.get("GitVerse-RateLimit-User-Remaining") || j5.get("GitVerse-RateLimit-Remaining"), z2 = j5.get("GitVerse-RateLimit-Retry-After"), B2 = j5.get("Gitverse-Ratelimit-Reset");
|
|
626
|
-
if (!(x2 && z2))
|
|
627
|
-
return;
|
|
628
|
-
let K = Number.parseInt(z2, 10), D = B2 ? Number.parseInt(B2, 10) : Math.floor(Date.now() / 1000) + K, U = q4 ? Number.parseInt(q4, 10) : 0;
|
|
629
|
-
return { limit: Number.parseInt(x2, 10), remaining: U, reset: D, retryAfter: K };
|
|
746
|
+
list(b, k2) {
|
|
747
|
+
let j2 = new URLSearchParams;
|
|
748
|
+
if (b?.page !== undefined)
|
|
749
|
+
j2.append("page", String(b.page));
|
|
750
|
+
if (b?.per_page !== undefined)
|
|
751
|
+
j2.append("per_page", String(b.per_page));
|
|
752
|
+
if (b?.sort !== undefined)
|
|
753
|
+
j2.append("sort", b.sort);
|
|
754
|
+
if (b?.direction !== undefined)
|
|
755
|
+
j2.append("direction", b.direction);
|
|
756
|
+
let x = j2.toString(), z = `/user/starred${x ? `?${x}` : ""}`;
|
|
757
|
+
return this.client.get(z, k2);
|
|
630
758
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
if (!(x2 && q4))
|
|
634
|
-
return;
|
|
635
|
-
return { decommissioning: B2 || undefined, deprecated: z2, latestVersion: q4, version: x2 };
|
|
759
|
+
isStarred(b, k2, j2) {
|
|
760
|
+
return this.client.get(`/user/starred/${b}/${k2}`, j2);
|
|
636
761
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
if (q4?.deprecated && this.onApiVersionWarning) {
|
|
640
|
-
let z2 = new q(q4.version, q4.latestVersion, q4.decommissioning);
|
|
641
|
-
this.onApiVersionWarning(z2);
|
|
642
|
-
}
|
|
643
|
-
return { apiVersion: q4, rateLimit: x2 };
|
|
762
|
+
star(b, k2, j2) {
|
|
763
|
+
return this.client.put(`/user/starred/${b}/${k2}`, j2);
|
|
644
764
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
if (D.set("Content-Type", "application/json"), D.set("Accept", `application/vnd.gitverse.object+json; version=${this.apiVersion}`), this.token)
|
|
648
|
-
D.set("Authorization", `Bearer ${this.token}`);
|
|
649
|
-
let U = { body: q4 ? JSON.stringify(q4) : undefined, headers: D, method: x2, signal: z2?.signal }, F = await fetch(K, U), Q = this.extractMetadata(F.headers), S;
|
|
650
|
-
try {
|
|
651
|
-
S = await F.json();
|
|
652
|
-
} catch {
|
|
653
|
-
S = undefined;
|
|
654
|
-
}
|
|
655
|
-
if (!F.ok) {
|
|
656
|
-
let X = S?.message || F.statusText;
|
|
657
|
-
if (F.status === 429 && Q.rateLimit)
|
|
658
|
-
throw new k2(X || "Превышен лимит запросов. Попробуйте позже.", Q.rateLimit, Q);
|
|
659
|
-
throw new j2(F.status, X, Q);
|
|
660
|
-
}
|
|
661
|
-
return S;
|
|
765
|
+
unstar(b, k2, j2) {
|
|
766
|
+
return this.client.delete(`/user/starred/${b}/${k2}`, undefined, j2);
|
|
662
767
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// ../sdk/dist/api/issues.js
|
|
771
|
+
class E3 {
|
|
772
|
+
client;
|
|
773
|
+
constructor(k2) {
|
|
774
|
+
this.client = k2;
|
|
775
|
+
}
|
|
776
|
+
list(k2, A2, b, f) {
|
|
777
|
+
let j2 = new URLSearchParams;
|
|
778
|
+
if (b?.state !== undefined)
|
|
779
|
+
j2.append("state", b.state);
|
|
780
|
+
if (b?.q !== undefined)
|
|
781
|
+
j2.append("q", b.q);
|
|
782
|
+
if (b?.labels !== undefined)
|
|
783
|
+
j2.append("labels", b.labels);
|
|
784
|
+
if (b?.milestones !== undefined)
|
|
785
|
+
j2.append("milestones", b.milestones);
|
|
786
|
+
if (b?.created_by !== undefined)
|
|
787
|
+
j2.append("created_by", b.created_by);
|
|
788
|
+
if (b?.assigned_by !== undefined)
|
|
789
|
+
j2.append("assigned_by", b.assigned_by);
|
|
790
|
+
if (b?.mentioned_by !== undefined)
|
|
791
|
+
j2.append("mentioned_by", b.mentioned_by);
|
|
792
|
+
if (b?.type !== undefined)
|
|
793
|
+
j2.append("type", b.type);
|
|
794
|
+
if (b?.since !== undefined)
|
|
795
|
+
j2.append("since", b.since);
|
|
796
|
+
if (b?.before !== undefined)
|
|
797
|
+
j2.append("before", b.before);
|
|
798
|
+
if (b?.page !== undefined)
|
|
799
|
+
j2.append("page", String(b.page));
|
|
800
|
+
if (b?.per_page !== undefined)
|
|
801
|
+
j2.append("per_page", String(b.per_page));
|
|
802
|
+
let z = j2.toString(), B = `/repos/${k2}/${A2}/issues${z ? `?${z}` : ""}`;
|
|
803
|
+
return this.client.get(B, f);
|
|
804
|
+
}
|
|
805
|
+
getComment(k2, A2, b, f) {
|
|
806
|
+
return this.client.get(`/repos/${k2}/${A2}/issues/comments/${b}`, f);
|
|
807
|
+
}
|
|
808
|
+
get(k2, A2, b, f) {
|
|
809
|
+
return this.client.get(`/repos/${k2}/${A2}/issues/${b}`, f);
|
|
810
|
+
}
|
|
811
|
+
listComments(k2, A2, b, f, j2) {
|
|
812
|
+
let z = new URLSearchParams;
|
|
813
|
+
if (f?.since !== undefined)
|
|
814
|
+
z.append("since", f.since);
|
|
815
|
+
if (f?.before !== undefined)
|
|
816
|
+
z.append("before", f.before);
|
|
817
|
+
let B = z.toString(), D = `/repos/${k2}/${A2}/issues/${b}/comments${B ? `?${B}` : ""}`;
|
|
818
|
+
return this.client.get(D, j2);
|
|
819
|
+
}
|
|
820
|
+
listLabels(k2, A2, b, f) {
|
|
821
|
+
return this.client.get(`/repos/${k2}/${A2}/issues/${b}/labels`, f);
|
|
822
|
+
}
|
|
823
|
+
listTimeline(k2, A2, b, f, j2) {
|
|
824
|
+
let z = new URLSearchParams;
|
|
825
|
+
if (f?.page !== undefined)
|
|
826
|
+
z.append("page", String(f.page));
|
|
827
|
+
if (f?.per_page !== undefined)
|
|
828
|
+
z.append("per_page", String(f.per_page));
|
|
829
|
+
if (f?.since !== undefined)
|
|
830
|
+
z.append("since", f.since);
|
|
831
|
+
if (f?.before !== undefined)
|
|
832
|
+
z.append("before", f.before);
|
|
833
|
+
let B = z.toString(), D = `/repos/${k2}/${A2}/issues/${b}/timeline${B ? `?${B}` : ""}`;
|
|
834
|
+
return this.client.get(D, j2);
|
|
677
835
|
}
|
|
678
836
|
}
|
|
679
837
|
|
|
680
838
|
// ../sdk/dist/api/users.js
|
|
681
|
-
class
|
|
839
|
+
class z {
|
|
682
840
|
client;
|
|
683
|
-
constructor(
|
|
684
|
-
this.client =
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
841
|
+
constructor(j2) {
|
|
842
|
+
this.client = j2;
|
|
843
|
+
}
|
|
844
|
+
list(j2, v2) {
|
|
845
|
+
let k2 = new URLSearchParams;
|
|
846
|
+
if (j2?.q !== undefined)
|
|
847
|
+
k2.append("q", j2.q);
|
|
848
|
+
if (j2?.sort !== undefined)
|
|
849
|
+
k2.append("sort", j2.sort);
|
|
850
|
+
if (j2?.order !== undefined)
|
|
851
|
+
k2.append("order", j2.order);
|
|
852
|
+
if (j2?.page !== undefined)
|
|
853
|
+
k2.append("page", String(j2.page));
|
|
854
|
+
if (j2?.per_page !== undefined)
|
|
855
|
+
k2.append("per_page", String(j2.per_page));
|
|
856
|
+
let w = k2.toString(), x = `/search/users${w ? `?${w}` : ""}`;
|
|
857
|
+
return this.client.get(x, v2);
|
|
858
|
+
}
|
|
859
|
+
getAuthenticated(j2) {
|
|
860
|
+
return this.client.get("/user", j2);
|
|
861
|
+
}
|
|
862
|
+
get(j2, v2) {
|
|
863
|
+
return this.client.get(`/user/${j2}`, v2);
|
|
864
|
+
}
|
|
865
|
+
getByUsername(j2, v2) {
|
|
866
|
+
return this.client.get(`/users/${j2}`, v2);
|
|
691
867
|
}
|
|
692
868
|
}
|
|
693
869
|
|
|
694
870
|
// ../sdk/dist/api/emails.js
|
|
695
|
-
class
|
|
871
|
+
class x {
|
|
696
872
|
client;
|
|
697
873
|
constructor(b) {
|
|
698
874
|
this.client = b;
|
|
699
875
|
}
|
|
700
|
-
list(b) {
|
|
701
|
-
|
|
876
|
+
list(b, f) {
|
|
877
|
+
let j2 = new URLSearchParams;
|
|
878
|
+
if (b?.page !== undefined)
|
|
879
|
+
j2.append("page", String(b.page));
|
|
880
|
+
if (b?.per_page !== undefined)
|
|
881
|
+
j2.append("per_page", String(b.per_page));
|
|
882
|
+
let k2 = j2.toString(), w = `/user/emails${k2 ? `?${k2}` : ""}`;
|
|
883
|
+
return this.client.get(w, f);
|
|
702
884
|
}
|
|
703
|
-
|
|
704
|
-
return this.client.post("/user/emails", b,
|
|
885
|
+
create(b, f) {
|
|
886
|
+
return this.client.post("/user/emails", b, f);
|
|
705
887
|
}
|
|
706
|
-
|
|
707
|
-
return this.client.delete("/user/emails", b,
|
|
888
|
+
delete(b, f) {
|
|
889
|
+
return this.client.delete("/user/emails", b, f);
|
|
708
890
|
}
|
|
709
891
|
}
|
|
710
892
|
|
|
711
893
|
// ../sdk/dist/index.js
|
|
712
|
-
class
|
|
894
|
+
class J {
|
|
713
895
|
client;
|
|
714
|
-
|
|
896
|
+
actions;
|
|
897
|
+
orgs;
|
|
898
|
+
teams;
|
|
715
899
|
repos;
|
|
716
|
-
|
|
900
|
+
issues;
|
|
717
901
|
pulls;
|
|
718
|
-
|
|
902
|
+
releases;
|
|
903
|
+
users;
|
|
719
904
|
emails;
|
|
720
|
-
issues;
|
|
721
905
|
stars;
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
collaborators;
|
|
725
|
-
organizations;
|
|
726
|
-
teams;
|
|
727
|
-
releases;
|
|
728
|
-
git;
|
|
729
|
-
actions;
|
|
730
|
-
constructor(d2 = {}) {
|
|
731
|
-
this.client = new $(d2), this.users = new f(this.client), this.repos = new A(this.client), this.contents = new k4(this.client), this.pulls = new y(this.client), this.forks = new q3(this.client), this.emails = new d(this.client), this.issues = new B(this.client), this.stars = new k3(this.client), this.branches = new g(this.client), this.commits = new j(this.client), this.collaborators = new j3(this.client), this.organizations = new k(this.client), this.teams = new k5(this.client), this.releases = new q2(this.client), this.git = new j4(this.client), this.actions = new x(this.client);
|
|
906
|
+
constructor(b = {}) {
|
|
907
|
+
this.client = new v(b), this.actions = new F2(this.client), this.orgs = new F(this.client), this.teams = new E2(this.client), this.repos = new E(this.client), this.issues = new E3(this.client), this.pulls = new I(this.client), this.releases = new G(this.client), this.users = new z(this.client), this.emails = new x(this.client), this.stars = new A(this.client);
|
|
732
908
|
}
|
|
733
|
-
setToken(
|
|
734
|
-
return this.client.setToken(
|
|
909
|
+
setToken(b) {
|
|
910
|
+
return this.client.setToken(b), this;
|
|
735
911
|
}
|
|
736
912
|
}
|
|
737
913
|
|
|
@@ -741,7 +917,7 @@ class GitVerseReleaseClient {
|
|
|
741
917
|
repoInfo;
|
|
742
918
|
retryFn;
|
|
743
919
|
constructor(token, repoInfo, retryFn) {
|
|
744
|
-
this.client = new
|
|
920
|
+
this.client = new J({ token });
|
|
745
921
|
this.repoInfo = repoInfo;
|
|
746
922
|
this.retryFn = retryFn;
|
|
747
923
|
}
|
|
@@ -1231,8 +1407,8 @@ function createRetryFunction(config) {
|
|
|
1231
1407
|
var VERSION_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;
|
|
1232
1408
|
var PRERELEASE_INCREMENT_REGEX = /^(.+)\.(\d+)$/;
|
|
1233
1409
|
function parseVersion(version) {
|
|
1234
|
-
const
|
|
1235
|
-
const match =
|
|
1410
|
+
const v2 = version.startsWith("v") ? version.slice(1) : version;
|
|
1411
|
+
const match = v2.match(VERSION_REGEX);
|
|
1236
1412
|
if (!(match?.[1] && match[2] && match[3])) {
|
|
1237
1413
|
throw new Error(`Invalid version format: ${version}`);
|
|
1238
1414
|
}
|
|
@@ -1602,4 +1778,4 @@ export {
|
|
|
1602
1778
|
createGitVerseClient
|
|
1603
1779
|
};
|
|
1604
1780
|
|
|
1605
|
-
//# debugId=
|
|
1781
|
+
//# debugId=056CFD71B279C22664756E2164756E21
|