gitverse-release 3.3.2 → 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/index.js CHANGED
@@ -42,14 +42,22 @@ var DEFAULT_CONFIG = {
42
42
  }
43
43
  },
44
44
  commitlint: {
45
+ bodyMaxLineLength: null,
45
46
  comments: true,
47
+ footerMaxLineLength: null,
46
48
  format: "ts",
47
49
  headerMaxLength: 100,
50
+ headerMinLength: null,
48
51
  output: "commitlint.config.ts",
49
52
  scopeRequired: false,
50
- scopes: ["deps", "ci", "docs"]
53
+ scopes: ["deps", "ci", "docs"],
54
+ strictMode: false,
55
+ subjectCase: null,
56
+ subjectFullStop: false,
57
+ warningRules: ["header-max-length"]
51
58
  },
52
59
  git: {
60
+ beforeCommit: "",
53
61
  commitChanges: true,
54
62
  commitMessage: "chore(release): {{package}} v{{version}} [skip ci]",
55
63
  push: true,
@@ -139,162 +147,21 @@ function validateConfig(config) {
139
147
  }
140
148
  }
141
149
 
142
- // ../sdk/dist/api/organizations.js
143
- class k {
144
- client;
145
- constructor(b) {
146
- this.client = b;
147
- }
148
- async checkMembership(b, h, j) {
149
- try {
150
- return await this.client.get(`/orgs/${b}/members/${h}`, j), true;
151
- } catch (d) {
152
- if (d instanceof Error && d.message.includes("404"))
153
- return false;
154
- throw d;
155
- }
156
- }
157
- }
158
-
159
- // ../sdk/dist/api/commits.js
160
- class j {
161
- client;
162
- constructor(b) {
163
- this.client = b;
164
- }
165
- list(b, d, f) {
166
- return this.client.get(`/repos/${b}/${d}/commits`, f);
167
- }
168
- get(b, d, f, g) {
169
- return this.client.get(`/repos/${b}/${d}/commits/${f}`, g);
170
- }
171
- create(b, d, f, g) {
172
- return this.client.post(`/repos/${b}/${d}/git/commits`, f, g);
173
- }
174
- }
175
-
176
- // ../sdk/dist/api/actions.js
177
- class x {
178
- client;
179
- constructor(b) {
180
- this.client = b;
181
- }
182
- listOrgRunners(b, h) {
183
- return this.client.get(`/orgs/${b}/actions/runners`, h);
184
- }
185
- createOrgRegistrationToken(b, h) {
186
- return this.client.post(`/orgs/${b}/actions/runners/registration-token`, {}, h);
187
- }
188
- getOrgRunner(b, h, j2) {
189
- return this.client.get(`/orgs/${b}/actions/runners/${h}`, j2);
190
- }
191
- deleteOrgRunner(b, h, j2) {
192
- return this.client.delete(`/orgs/${b}/actions/runners/${h}`, undefined, j2);
193
- }
194
- listRepoRunners(b, h, j2) {
195
- return this.client.get(`/repos/${b}/${h}/actions/runners`, j2);
196
- }
197
- createRepoRegistrationToken(b, h, j2) {
198
- return this.client.post(`/repos/${b}/${h}/actions/runners/registration-token`, {}, j2);
199
- }
200
- getRepoRunner(b, h, j2, q) {
201
- return this.client.get(`/repos/${b}/${h}/actions/runners/${j2}`, q);
202
- }
203
- deleteRepoRunner(b, h, j2, q) {
204
- return this.client.delete(`/repos/${b}/${h}/actions/runners/${j2}`, undefined, q);
205
- }
206
- listOrgSecrets(b, h) {
207
- return this.client.get(`/orgs/${b}/actions/secrets`, h);
208
- }
209
- getOrgSecret(b, h, j2) {
210
- return this.client.get(`/orgs/${b}/actions/secrets/${h}`, j2);
211
- }
212
- createOrUpdateOrgSecret(b, h, j2, q) {
213
- return this.client.put(`/orgs/${b}/actions/secrets/${h}`, j2, q);
214
- }
215
- deleteOrgSecret(b, h, j2) {
216
- return this.client.delete(`/orgs/${b}/actions/secrets/${h}`, undefined, j2);
217
- }
218
- listRepoSecrets(b, h, j2) {
219
- return this.client.get(`/repos/${b}/${h}/actions/secrets`, j2);
220
- }
221
- getRepoSecret(b, h, j2, q) {
222
- return this.client.get(`/repos/${b}/${h}/actions/secrets/${j2}`, q);
223
- }
224
- createOrUpdateRepoSecret(b, h, j2, q, v) {
225
- return this.client.put(`/repos/${b}/${h}/actions/secrets/${j2}`, q, v);
226
- }
227
- deleteRepoSecret(b, h, j2, q) {
228
- return this.client.delete(`/repos/${b}/${h}/actions/secrets/${j2}`, undefined, q);
229
- }
230
- listOrgVariables(b, h) {
231
- return this.client.get(`/orgs/${b}/actions/variables`, h);
232
- }
233
- createOrgVariable(b, h, j2) {
234
- return this.client.post(`/orgs/${b}/actions/variables`, h, j2);
235
- }
236
- getOrgVariable(b, h, j2) {
237
- return this.client.get(`/orgs/${b}/actions/variables/${h}`, j2);
238
- }
239
- deleteOrgVariable(b, h, j2) {
240
- return this.client.delete(`/orgs/${b}/actions/variables/${h}`, undefined, j2);
241
- }
242
- updateOrgVariable(b, h, j2, q) {
243
- return this.client.patch(`/orgs/${b}/actions/variables/${h}`, j2, q);
244
- }
245
- listRepoVariables(b, h, j2) {
246
- return this.client.get(`/repos/${b}/${h}/actions/variables`, j2);
247
- }
248
- createRepoVariable(b, h, j2, q) {
249
- return this.client.post(`/repos/${b}/${h}/actions/variables`, j2, q);
250
- }
251
- getRepoVariable(b, h, j2, q) {
252
- return this.client.get(`/repos/${b}/${h}/actions/variables/${j2}`, q);
253
- }
254
- deleteRepoVariable(b, h, j2, q) {
255
- return this.client.delete(`/repos/${b}/${h}/actions/variables/${j2}`, undefined, q);
256
- }
257
- updateRepoVariable(b, h, j2, q, v) {
258
- return this.client.patch(`/repos/${b}/${h}/actions/variables/${j2}`, q, v);
259
- }
260
- listArtifacts(b, h, j2) {
261
- return this.client.get(`/repos/${b}/${h}/actions/artifacts`, j2);
262
- }
263
- getArtifact(b, h, j2, q) {
264
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}`, q);
265
- }
266
- deleteArtifact(b, h, j2, q) {
267
- return this.client.delete(`/repos/${b}/${h}/actions/artifacts/${j2}`, undefined, q);
268
- }
269
- downloadArtifact(b, h, j2, q) {
270
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip`, q);
271
- }
272
- downloadArtifactRaw(b, h, j2, q) {
273
- return this.client.get(`/repos/${b}/${h}/actions/artifacts/${j2}/zip/raw`, q);
274
- }
275
- getWorkflowDispatchInputs(b, h, j2, q) {
276
- return this.client.get(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q);
277
- }
278
- dispatchWorkflow(b, h, j2, q, v) {
279
- return this.client.post(`/repos/${b}/${h}/actions/workflows/${j2}/dispatches`, q, v);
280
- }
281
- }
282
-
283
150
  // ../sdk/dist/errors.js
284
- class j2 extends Error {
151
+ class j extends Error {
285
152
  status;
286
153
  metadata;
287
154
  constructor(b, f, h) {
288
155
  super(f);
289
- this.name = "GitVerseApiError", this.status = b, this.metadata = h, Object.setPrototypeOf(this, j2.prototype);
156
+ this.name = "GitVerseApiError", this.status = b, this.metadata = h, Object.setPrototypeOf(this, j.prototype);
290
157
  }
291
158
  }
292
159
 
293
- class k2 extends j2 {
160
+ class k extends j {
294
161
  rateLimit;
295
162
  constructor(b, f, h) {
296
163
  super(429, b, h);
297
- this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this, k2.prototype);
164
+ this.name = "RateLimitError", this.rateLimit = f, Object.setPrototypeOf(this, k.prototype);
298
165
  }
299
166
  getRetryAfterSeconds() {
300
167
  return this.rateLimit.retryAfter;
@@ -319,411 +186,728 @@ class q {
319
186
  }
320
187
  }
321
188
 
322
- // ../sdk/dist/api/stars.js
323
- class k3 {
324
- client;
325
- constructor(b) {
326
- this.client = b;
327
- }
328
- list(b) {
329
- return this.client.get("/user/starred", b);
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";
330
199
  }
331
- async add(b, c, f) {
332
- await this.client.put(`/user/starred/${b}/${c}`, undefined, f);
200
+ setToken(j2) {
201
+ this.token = j2;
333
202
  }
334
- async check(b, c, f) {
335
- try {
336
- return await this.client.get(`/user/starred/${b}/${c}`, f), true;
337
- } catch (h) {
338
- if (h instanceof j2 && h.status === 404)
339
- return false;
340
- throw h;
341
- }
342
- }
343
- async remove(b, c, f) {
344
- 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 };
345
209
  }
346
- }
347
-
348
- // ../sdk/dist/api/issues.js
349
- class B {
350
- client;
351
- constructor(c) {
352
- 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 };
353
215
  }
354
- list(c, h, f, j3) {
355
- let k4 = new URLSearchParams;
356
- if (f)
357
- k4.append("state", f);
358
- let z = k4.toString(), A = `/repos/${c}/${h}/issues${z ? `?${z}` : ""}`;
359
- return this.client.get(A, j3);
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 };
360
223
  }
361
- get(c, h, f, j3) {
362
- return this.client.get(`/repos/${c}/${h}/issues/${f}`, j3);
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;
363
241
  }
364
- getComment(c, h, f, j3) {
365
- return this.client.get(`/repos/${c}/${h}/issues/comments/${f}`, j3);
242
+ get(j2, x) {
243
+ return this.request(j2, Z.GET, undefined, x);
366
244
  }
367
- getComments(c, h, f, j3) {
368
- return this.client.get(`/repos/${c}/${h}/issues/${f}/comments`, j3);
245
+ post(j2, x, q2) {
246
+ return this.request(j2, Z.POST, x, q2);
369
247
  }
370
- getLabels(c, h, f, j3) {
371
- return this.client.get(`/repos/${c}/${h}/issues/${f}/labels`, j3);
248
+ put(j2, x, q2) {
249
+ return this.request(j2, Z.PUT, x, q2);
372
250
  }
373
- getTimeline(c, h, f, j3) {
374
- return this.client.get(`/repos/${c}/${h}/issues/${f}/timeline`, j3);
251
+ delete(j2, x, q2) {
252
+ return this.request(j2, Z.DELETE, x, q2);
375
253
  }
376
- }
377
-
378
- // ../sdk/dist/api/branches.js
379
- class g {
380
- client;
381
- constructor(b) {
382
- this.client = b;
254
+ patch(j2, x, q2) {
255
+ return this.request(j2, Z.PATCH, x, q2);
383
256
  }
384
- list(b, d, f) {
385
- return this.client.get(`/repos/${b}/${d}/branches`, f);
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 _;
386
276
  }
387
277
  }
388
278
 
389
- // ../sdk/dist/utils.js
390
- var z = /^([a-z][a-z0-9+.-]*:\/\/[^/]+)\/([a-z][a-z0-9+.-]*:\/\/.+)$/i;
391
- function E(j3) {
392
- if (!j3)
393
- return j3;
394
- let k4 = j3.match(z);
395
- if (k4?.[1] && k4?.[2]) {
396
- let q2 = k4[1], v = k4[2];
397
- if (v.startsWith(q2))
398
- return v;
399
- }
400
- return j3;
401
- }
402
- function J(j3) {
403
- let k4 = ["clone_url", "html_url", "url", "git_url", "mirror_url"], q2 = { ...j3 };
404
- for (let v of k4)
405
- if (typeof q2[v] === "string")
406
- q2[v] = E(q2[v]);
407
- return q2;
408
- }
409
-
410
279
  // ../sdk/dist/api/repositories.js
411
- class A {
280
+ class E {
412
281
  client;
413
- constructor(g2) {
414
- this.client = g2;
415
- }
416
- async get(g2, k4, j3) {
417
- let q2 = await this.client.get(`/repos/${g2}/${k4}`, j3);
418
- return J(q2);
419
- }
420
- delete(g2, k4, j3) {
421
- return this.client.delete(`/repos/${g2}/${k4}`, undefined, j3);
422
- }
423
- async update(g2, k4, j3, q2) {
424
- let z2 = await this.client.patch(`/repos/${g2}/${k4}`, j3, q2);
425
- return J(z2);
426
- }
427
- compare(g2, k4, j3, q2) {
428
- return this.client.get(`/repos/${g2}/${k4}/compare/${j3}`, q2);
429
- }
430
- getLanguages(g2, k4, j3) {
431
- return this.client.get(`/repos/${g2}/${k4}/languages`, j3);
432
- }
433
- async listForAuthenticatedUser(g2) {
434
- return (await this.client.get("/user/repos", g2)).map((j3) => J(j3));
435
- }
436
- async create(g2, k4) {
437
- let j3 = await this.client.post("/user/repos", g2, k4);
438
- return J(j3);
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);
439
455
  }
440
456
  }
441
457
 
442
- // ../sdk/dist/api/collaborators.js
443
- class j3 {
458
+ // ../sdk/dist/api/teams.js
459
+ class E2 {
444
460
  client;
445
- constructor(d) {
446
- this.client = d;
447
- }
448
- list(d, f, g2) {
449
- return this.client.get(`/repos/${d}/${f}/collaborators`, g2);
450
- }
451
- add(d, f, g2, h) {
452
- return this.client.put(`/repos/${d}/${f}/collaborators/${g2}`, {}, h);
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);
453
484
  }
454
485
  }
455
486
 
456
- // ../sdk/dist/api/contents.js
457
- class k4 {
487
+ // ../sdk/dist/api/releases.js
488
+ class G {
458
489
  client;
459
- constructor(b) {
460
- this.client = b;
461
- }
462
- get(b, d, f, g2) {
463
- return this.client.get(`/repos/${b}/${d}/contents/${f}`, g2);
464
- }
465
- createFile(b, d, f, g2, j4) {
466
- return this.client.put(`/repos/${b}/${d}/contents/${f}`, g2, j4);
467
- }
468
- updateFile(b, d, f, g2, j4) {
469
- return this.client.put(`/repos/${b}/${d}/contents/${f}`, g2, j4);
470
- }
471
- deleteFile(b, d, f, g2, j4) {
472
- return this.client.delete(`/repos/${b}/${d}/contents/${f}`, g2, j4);
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);
473
542
  }
474
543
  }
475
544
 
476
- // ../sdk/dist/api/teams.js
477
- class k5 {
545
+ // ../sdk/dist/api/pulls.js
546
+ class I {
478
547
  client;
479
- constructor(b) {
480
- this.client = b;
481
- }
482
- list(b, d) {
483
- return this.client.get(`/orgs/${b}/teams`, d);
548
+ constructor(k2) {
549
+ this.client = k2;
484
550
  }
485
- getInvitations(b, d, f) {
486
- return this.client.get(`/orgs/${b}/teams/${d}/invitations`, f);
551
+ create(k2, v2, z, j2) {
552
+ return this.client.post(`/repos/${k2}/${v2}/pulls`, z, j2);
487
553
  }
488
- getMembers(b, d, f) {
489
- return this.client.get(`/orgs/${b}/teams/${d}/members`, f);
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);
490
562
  }
491
- addRepository(b, d, f, h, j4) {
492
- return this.client.put(`/orgs/${b}/teams/${d}/repos/${f}/${h}`, {}, j4);
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);
493
571
  }
494
- }
495
-
496
- // ../sdk/dist/api/git.js
497
- class j4 {
498
- client;
499
- constructor(b) {
500
- this.client = b;
501
- }
502
- createRef(b, d, f, g2) {
503
- 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);
504
574
  }
505
- createTree(b, d, f, g2) {
506
- return this.client.post(`/repos/${b}/${d}/git/trees`, f, g2);
507
- }
508
- getTree(b, d, f, g2) {
509
- 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);
510
577
  }
511
578
  }
512
579
 
513
- // ../sdk/dist/api/releases.js
514
- class q2 {
580
+ // ../sdk/dist/api/organizations.js
581
+ class F {
515
582
  client;
516
- constructor(b) {
517
- this.client = b;
518
- }
519
- list(b, f, h) {
520
- return this.client.get(`/repos/${b}/${f}/releases`, h);
583
+ constructor(w) {
584
+ this.client = w;
521
585
  }
522
- create(b, f, h, j5) {
523
- return this.client.post(`/repos/${b}/${f}/releases`, h, j5);
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);
524
594
  }
525
- getByTag(b, f, h, j5) {
526
- return this.client.get(`/repos/${b}/${f}/releases/tags/${h}`, j5);
595
+ getOrgSecret(w, j2, x) {
596
+ return this.client.get(`/orgs/${w}/actions/secrets/${j2}`, x);
527
597
  }
528
- deleteByTag(b, f, h, j5) {
529
- return this.client.delete(`/repos/${b}/${f}/releases/tags/${h}`, undefined, j5);
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);
530
604
  }
531
- get(b, f, h, j5) {
532
- return this.client.get(`/repos/${b}/${f}/releases/${h}`, j5);
605
+ deleteOrgSecret(w, j2, x) {
606
+ return this.client.delete(`/orgs/${w}/actions/secrets/${j2}`, undefined, x);
533
607
  }
534
- delete(b, f, h, j5) {
535
- return this.client.delete(`/repos/${b}/${f}/releases/${h}`, undefined, j5);
536
- }
537
- update(b, f, h, j5, k6) {
538
- return this.client.patch(`/repos/${b}/${f}/releases/${h}`, j5, k6);
539
- }
540
- getAssets(b, f, h, j5) {
541
- return this.client.get(`/repos/${b}/${f}/releases/${h}/assets`, j5);
542
- }
543
- uploadAsset(b, f, h, j5, k6) {
544
- return this.client.post(`/repos/${b}/${f}/releases/${h}/assets`, j5, k6);
545
- }
546
- deleteAsset(b, f, h, j5, k6) {
547
- 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);
548
610
  }
549
611
  }
550
612
 
551
- // ../sdk/dist/api/pulls.js
552
- class y {
613
+ // ../sdk/dist/api/actions.js
614
+ class F2 {
553
615
  client;
554
- constructor(d) {
555
- this.client = d;
556
- }
557
- create(d, f, g2, j5) {
558
- return this.client.post(`/repos/${d}/${f}/pulls`, g2, j5);
559
- }
560
- get(d, f, g2, j5) {
561
- return this.client.get(`/repos/${d}/${f}/pulls/${g2}`, j5);
562
- }
563
- list(d, f, g2, j5) {
564
- let x2 = new URLSearchParams(Object.entries(g2 ?? {})), q3 = new URL(`/repos/${d}/${f}/pulls`, "http://localhost");
565
- return q3.search = x2.toString(), this.client.get(q3.href.replace("http://localhost", ""), j5);
566
- }
567
- update(d, f, g2, j5, k6) {
568
- return this.client.patch(`/repos/${d}/${f}/pulls/${g2}`, j5, k6);
569
- }
570
- getFiles(d, f, g2, j5) {
571
- return this.client.get(`/repos/${d}/${f}/pulls/${g2}/files`, j5);
572
- }
573
- updateBranch(d, f, g2, j5) {
574
- return this.client.put(`/repos/${d}/${f}/pulls/${g2}/update-branch`, {}, j5);
575
- }
576
- getCommits(d, f, g2, j5) {
577
- return this.client.get(`/repos/${d}/${f}/pulls/${g2}/commits`, j5);
578
- }
579
- async checkIfMerged(d, f, g2, j5) {
580
- try {
581
- return await this.client.get(`/repos/${d}/${f}/pulls/${g2}/merge`, j5), true;
582
- } catch (k6) {
583
- if (k6 instanceof j2 && k6.status === 404)
584
- return false;
585
- throw k6;
586
- }
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);
587
737
  }
588
738
  }
589
739
 
590
- // ../sdk/dist/api/forks.js
591
- class q3 {
740
+ // ../sdk/dist/api/stars.js
741
+ class A {
592
742
  client;
593
743
  constructor(b) {
594
744
  this.client = b;
595
745
  }
596
- async create(b, g2, h, j5) {
597
- let k6 = await this.client.post(`/repos/${b}/${g2}/forks`, h, j5);
598
- return J(k6);
599
- }
600
- }
601
-
602
- // ../sdk/dist/client.js
603
- var J2 = { DELETE: "DELETE", GET: "GET", PATCH: "PATCH", POST: "POST", PUT: "PUT" };
604
-
605
- class $ {
606
- baseUrl;
607
- token;
608
- apiVersion;
609
- onApiVersionWarning;
610
- constructor(j5 = {}) {
611
- this.baseUrl = j5.baseUrl || "https://api.gitverse.ru", this.token = j5.token, this.apiVersion = j5.apiVersion || "1";
612
- }
613
- setToken(j5) {
614
- this.token = j5;
615
- }
616
- extractRateLimitInfo(j5) {
617
- 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");
618
- if (!(x2 && z2))
619
- return;
620
- 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;
621
- 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);
622
758
  }
623
- extractApiVersionInfo(j5) {
624
- let x2 = j5.get("Gitverse-Api-Version"), q4 = j5.get("Gitverse-Api-Latest-Version"), z2 = j5.get("Gitverse-Api-Deprecation") === "true", B2 = j5.get("Gitverse-Api-Decommissioning");
625
- if (!(x2 && q4))
626
- return;
627
- 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);
628
761
  }
629
- extractMetadata(j5) {
630
- let x2 = this.extractRateLimitInfo(j5), q4 = this.extractApiVersionInfo(j5);
631
- if (q4?.deprecated && this.onApiVersionWarning) {
632
- let z2 = new q(q4.version, q4.latestVersion, q4.decommissioning);
633
- this.onApiVersionWarning(z2);
634
- }
635
- return { apiVersion: q4, rateLimit: x2 };
762
+ star(b, k2, j2) {
763
+ return this.client.put(`/user/starred/${b}/${k2}`, j2);
636
764
  }
637
- async request(j5, x2, q4, z2) {
638
- let B2 = j5.startsWith("/") ? j5.slice(1) : j5, K = `${this.baseUrl}/${B2}`, D = new Headers;
639
- if (D.set("Content-Type", "application/json"), D.set("Accept", `application/vnd.gitverse.object+json; version=${this.apiVersion}`), this.token)
640
- D.set("Authorization", `Bearer ${this.token}`);
641
- 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;
642
- try {
643
- S = await F.json();
644
- } catch {
645
- S = undefined;
646
- }
647
- if (!F.ok) {
648
- let X = S?.message || F.statusText;
649
- if (F.status === 429 && Q.rateLimit)
650
- throw new k2(X || "Превышен лимит запросов. Попробуйте позже.", Q.rateLimit, Q);
651
- throw new j2(F.status, X, Q);
652
- }
653
- return S;
765
+ unstar(b, k2, j2) {
766
+ return this.client.delete(`/user/starred/${b}/${k2}`, undefined, j2);
654
767
  }
655
- get(j5, x2) {
656
- return this.request(j5, J2.GET, undefined, x2);
657
- }
658
- post(j5, x2, q4) {
659
- return this.request(j5, J2.POST, x2, q4);
660
- }
661
- put(j5, x2, q4) {
662
- return this.request(j5, J2.PUT, x2, q4);
663
- }
664
- delete(j5, x2, q4) {
665
- return this.request(j5, J2.DELETE, x2, q4);
666
- }
667
- patch(j5, x2, q4) {
668
- return this.request(j5, J2.PATCH, x2, q4);
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);
669
835
  }
670
836
  }
671
837
 
672
838
  // ../sdk/dist/api/users.js
673
- class f {
839
+ class z {
674
840
  client;
675
- constructor(b) {
676
- this.client = b;
677
- }
678
- getCurrent(b) {
679
- return this.client.get("/user", b);
680
- }
681
- getByUsername(b, d) {
682
- return this.client.get(`/users/${b}`, d);
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);
683
867
  }
684
868
  }
685
869
 
686
870
  // ../sdk/dist/api/emails.js
687
- class d {
871
+ class x {
688
872
  client;
689
873
  constructor(b) {
690
874
  this.client = b;
691
875
  }
692
- list(b) {
693
- return this.client.get("/user/emails", b);
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);
694
884
  }
695
- add(b, c) {
696
- return this.client.post("/user/emails", b, c);
885
+ create(b, f) {
886
+ return this.client.post("/user/emails", b, f);
697
887
  }
698
- remove(b, c) {
699
- return this.client.delete("/user/emails", b, c);
888
+ delete(b, f) {
889
+ return this.client.delete("/user/emails", b, f);
700
890
  }
701
891
  }
702
892
 
703
893
  // ../sdk/dist/index.js
704
- class Z {
894
+ class J {
705
895
  client;
706
- users;
896
+ actions;
897
+ orgs;
898
+ teams;
707
899
  repos;
708
- contents;
900
+ issues;
709
901
  pulls;
710
- forks;
902
+ releases;
903
+ users;
711
904
  emails;
712
- issues;
713
905
  stars;
714
- branches;
715
- commits;
716
- collaborators;
717
- organizations;
718
- teams;
719
- releases;
720
- git;
721
- actions;
722
- constructor(d2 = {}) {
723
- 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);
724
908
  }
725
- setToken(d2) {
726
- return this.client.setToken(d2), this;
909
+ setToken(b) {
910
+ return this.client.setToken(b), this;
727
911
  }
728
912
  }
729
913
 
@@ -733,7 +917,7 @@ class GitVerseReleaseClient {
733
917
  repoInfo;
734
918
  retryFn;
735
919
  constructor(token, repoInfo, retryFn) {
736
- this.client = new Z({ token });
920
+ this.client = new J({ token });
737
921
  this.repoInfo = repoInfo;
738
922
  this.retryFn = retryFn;
739
923
  }
@@ -1223,8 +1407,8 @@ function createRetryFunction(config) {
1223
1407
  var VERSION_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;
1224
1408
  var PRERELEASE_INCREMENT_REGEX = /^(.+)\.(\d+)$/;
1225
1409
  function parseVersion(version) {
1226
- const v = version.startsWith("v") ? version.slice(1) : version;
1227
- const match = v.match(VERSION_REGEX);
1410
+ const v2 = version.startsWith("v") ? version.slice(1) : version;
1411
+ const match = v2.match(VERSION_REGEX);
1228
1412
  if (!(match?.[1] && match[2] && match[3])) {
1229
1413
  throw new Error(`Invalid version format: ${version}`);
1230
1414
  }
@@ -1594,4 +1778,4 @@ export {
1594
1778
  createGitVerseClient
1595
1779
  };
1596
1780
 
1597
- //# debugId=C5601A67BDABD3C664756E2164756E21
1781
+ //# debugId=056CFD71B279C22664756E2164756E21