@skuba-lib/api 0.0.0 → 0.1.0-skuba-lib-api-20250925042128

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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -0
  3. package/buildkite/package.json +5 -0
  4. package/git/package.json +5 -0
  5. package/github/package.json +5 -0
  6. package/lib/buildkite/index.d.mts +2 -0
  7. package/lib/buildkite/index.d.ts +2 -0
  8. package/lib/buildkite/index.js +6 -0
  9. package/lib/buildkite/index.mjs +5 -0
  10. package/lib/buildkite-BXHjSY0I.js +67 -0
  11. package/lib/buildkite-DSHpKA4z.mjs +50 -0
  12. package/lib/chunk-CZCtuq8p.mjs +37 -0
  13. package/lib/chunk-odGzh3W-.js +58 -0
  14. package/lib/dist-bundle-BkNGUkdg.mjs +605 -0
  15. package/lib/dist-bundle-CxOlSeP_.js +3 -0
  16. package/lib/dist-bundle-UkllqMvc.js +634 -0
  17. package/lib/dist-bundle-gKOTWu3Q.mjs +3 -0
  18. package/lib/dist-src-BKvnTEY-.mjs +1682 -0
  19. package/lib/dist-src-rS3tAoM_.js +1682 -0
  20. package/lib/exec-B2akdw0z.js +17597 -0
  21. package/lib/exec-p0gJ30UO.mjs +17580 -0
  22. package/lib/git/index.d.mts +2 -0
  23. package/lib/git/index.d.ts +2 -0
  24. package/lib/git/index.js +14 -0
  25. package/lib/git/index.mjs +3 -0
  26. package/lib/git-DDfcZdbm.mjs +379 -0
  27. package/lib/git-DVG_dHiI.js +474 -0
  28. package/lib/github/index.d.mts +3 -0
  29. package/lib/github/index.d.ts +3 -0
  30. package/lib/github/index.js +12 -0
  31. package/lib/github/index.mjs +5 -0
  32. package/lib/github-BWsCQaQZ.mjs +269 -0
  33. package/lib/github-vzi1TtFz.js +314 -0
  34. package/lib/index-BvCkQobA.d.ts +255 -0
  35. package/lib/index-C7YqSKJ_.d.mts +38 -0
  36. package/lib/index-CGaQd8jr.d.mts +278 -0
  37. package/lib/index-CfnlMf_4.d.ts +39 -0
  38. package/lib/index-DO8cP0ap.d.ts +278 -0
  39. package/lib/index-DXcVXJbA.d.mts +39 -0
  40. package/lib/index-MmnRaakr.d.ts +38 -0
  41. package/lib/index-sp5770Na.d.mts +255 -0
  42. package/lib/index.d.mts +5 -0
  43. package/lib/index.d.ts +5 -0
  44. package/lib/index.js +31 -0
  45. package/lib/index.mjs +8 -0
  46. package/lib/logging-6TTEX4U4.js +2217 -0
  47. package/lib/logging-Dr8kuQ_p.mjs +2194 -0
  48. package/lib/net/index.d.mts +2 -0
  49. package/lib/net/index.d.ts +2 -0
  50. package/lib/net/index.js +5 -0
  51. package/lib/net/index.mjs +5 -0
  52. package/lib/net-BteSPzmU.js +86 -0
  53. package/lib/net-ByUFe0qv.mjs +75 -0
  54. package/net/package.json +5 -0
  55. package/package.json +55 -8
@@ -0,0 +1,605 @@
1
+ import { __commonJS, __toESM } from "./chunk-CZCtuq8p.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.js
4
+ function getUserAgent() {
5
+ if (typeof navigator === "object" && "userAgent" in navigator) return navigator.userAgent;
6
+ if (typeof process === "object" && process.version !== void 0) return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
7
+ return "<environment undetectable>";
8
+ }
9
+
10
+ //#endregion
11
+ //#region ../../node_modules/.pnpm/@octokit+endpoint@11.0.0/node_modules/@octokit/endpoint/dist-bundle/index.js
12
+ var VERSION$2 = "0.0.0-development";
13
+ var userAgent = `octokit-endpoint.js/${VERSION$2} ${getUserAgent()}`;
14
+ var DEFAULTS = {
15
+ method: "GET",
16
+ baseUrl: "https://api.github.com",
17
+ headers: {
18
+ accept: "application/vnd.github.v3+json",
19
+ "user-agent": userAgent
20
+ },
21
+ mediaType: { format: "" }
22
+ };
23
+ function lowercaseKeys(object) {
24
+ if (!object) return {};
25
+ return Object.keys(object).reduce((newObj, key) => {
26
+ newObj[key.toLowerCase()] = object[key];
27
+ return newObj;
28
+ }, {});
29
+ }
30
+ function isPlainObject$1(value) {
31
+ if (typeof value !== "object" || value === null) return false;
32
+ if (Object.prototype.toString.call(value) !== "[object Object]") return false;
33
+ const proto = Object.getPrototypeOf(value);
34
+ if (proto === null) return true;
35
+ const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
36
+ return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
37
+ }
38
+ function mergeDeep(defaults, options) {
39
+ const result = Object.assign({}, defaults);
40
+ Object.keys(options).forEach((key) => {
41
+ if (isPlainObject$1(options[key])) if (!(key in defaults)) Object.assign(result, { [key]: options[key] });
42
+ else result[key] = mergeDeep(defaults[key], options[key]);
43
+ else Object.assign(result, { [key]: options[key] });
44
+ });
45
+ return result;
46
+ }
47
+ function removeUndefinedProperties(obj) {
48
+ for (const key in obj) if (obj[key] === void 0) delete obj[key];
49
+ return obj;
50
+ }
51
+ function merge(defaults, route, options) {
52
+ if (typeof route === "string") {
53
+ let [method, url] = route.split(" ");
54
+ options = Object.assign(url ? {
55
+ method,
56
+ url
57
+ } : { url: method }, options);
58
+ } else options = Object.assign({}, route);
59
+ options.headers = lowercaseKeys(options.headers);
60
+ removeUndefinedProperties(options);
61
+ removeUndefinedProperties(options.headers);
62
+ const mergedOptions = mergeDeep(defaults || {}, options);
63
+ if (options.url === "/graphql") {
64
+ if (defaults && defaults.mediaType.previews?.length) mergedOptions.mediaType.previews = defaults.mediaType.previews.filter((preview) => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
65
+ mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
66
+ }
67
+ return mergedOptions;
68
+ }
69
+ function addQueryParameters(url, parameters) {
70
+ const separator = /\?/.test(url) ? "&" : "?";
71
+ const names = Object.keys(parameters);
72
+ if (names.length === 0) return url;
73
+ return url + separator + names.map((name) => {
74
+ if (name === "q") return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
75
+ return `${name}=${encodeURIComponent(parameters[name])}`;
76
+ }).join("&");
77
+ }
78
+ var urlVariableRegex = /\{[^{}}]+\}/g;
79
+ function removeNonChars(variableName) {
80
+ return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
81
+ }
82
+ function extractUrlVariableNames(url) {
83
+ const matches = url.match(urlVariableRegex);
84
+ if (!matches) return [];
85
+ return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
86
+ }
87
+ function omit(object, keysToOmit) {
88
+ const result = { __proto__: null };
89
+ for (const key of Object.keys(object)) if (keysToOmit.indexOf(key) === -1) result[key] = object[key];
90
+ return result;
91
+ }
92
+ function encodeReserved(str) {
93
+ return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
94
+ if (!/%[0-9A-Fa-f]/.test(part)) part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
95
+ return part;
96
+ }).join("");
97
+ }
98
+ function encodeUnreserved(str) {
99
+ return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
100
+ return "%" + c.charCodeAt(0).toString(16).toUpperCase();
101
+ });
102
+ }
103
+ function encodeValue(operator, value, key) {
104
+ value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
105
+ if (key) return encodeUnreserved(key) + "=" + value;
106
+ else return value;
107
+ }
108
+ function isDefined(value) {
109
+ return value !== void 0 && value !== null;
110
+ }
111
+ function isKeyOperator(operator) {
112
+ return operator === ";" || operator === "&" || operator === "?";
113
+ }
114
+ function getValues(context, operator, key, modifier) {
115
+ var value = context[key], result = [];
116
+ if (isDefined(value) && value !== "") if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
117
+ value = value.toString();
118
+ if (modifier && modifier !== "*") value = value.substring(0, parseInt(modifier, 10));
119
+ result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
120
+ } else if (modifier === "*") if (Array.isArray(value)) value.filter(isDefined).forEach(function(value2) {
121
+ result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : ""));
122
+ });
123
+ else Object.keys(value).forEach(function(k) {
124
+ if (isDefined(value[k])) result.push(encodeValue(operator, value[k], k));
125
+ });
126
+ else {
127
+ const tmp = [];
128
+ if (Array.isArray(value)) value.filter(isDefined).forEach(function(value2) {
129
+ tmp.push(encodeValue(operator, value2));
130
+ });
131
+ else Object.keys(value).forEach(function(k) {
132
+ if (isDefined(value[k])) {
133
+ tmp.push(encodeUnreserved(k));
134
+ tmp.push(encodeValue(operator, value[k].toString()));
135
+ }
136
+ });
137
+ if (isKeyOperator(operator)) result.push(encodeUnreserved(key) + "=" + tmp.join(","));
138
+ else if (tmp.length !== 0) result.push(tmp.join(","));
139
+ }
140
+ else if (operator === ";") {
141
+ if (isDefined(value)) result.push(encodeUnreserved(key));
142
+ } else if (value === "" && (operator === "&" || operator === "?")) result.push(encodeUnreserved(key) + "=");
143
+ else if (value === "") result.push("");
144
+ return result;
145
+ }
146
+ function parseUrl(template) {
147
+ return { expand: expand.bind(null, template) };
148
+ }
149
+ function expand(template, context) {
150
+ var operators = [
151
+ "+",
152
+ "#",
153
+ ".",
154
+ "/",
155
+ ";",
156
+ "?",
157
+ "&"
158
+ ];
159
+ template = template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) {
160
+ if (expression) {
161
+ let operator = "";
162
+ const values = [];
163
+ if (operators.indexOf(expression.charAt(0)) !== -1) {
164
+ operator = expression.charAt(0);
165
+ expression = expression.substr(1);
166
+ }
167
+ expression.split(/,/g).forEach(function(variable) {
168
+ var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
169
+ values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
170
+ });
171
+ if (operator && operator !== "+") {
172
+ var separator = ",";
173
+ if (operator === "?") separator = "&";
174
+ else if (operator !== "#") separator = operator;
175
+ return (values.length !== 0 ? operator : "") + values.join(separator);
176
+ } else return values.join(",");
177
+ } else return encodeReserved(literal);
178
+ });
179
+ if (template === "/") return template;
180
+ else return template.replace(/\/$/, "");
181
+ }
182
+ function parse$1(options) {
183
+ let method = options.method.toUpperCase();
184
+ let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
185
+ let headers = Object.assign({}, options.headers);
186
+ let body;
187
+ let parameters = omit(options, [
188
+ "method",
189
+ "baseUrl",
190
+ "url",
191
+ "headers",
192
+ "request",
193
+ "mediaType"
194
+ ]);
195
+ const urlVariableNames = extractUrlVariableNames(url);
196
+ url = parseUrl(url).expand(parameters);
197
+ if (!/^http/.test(url)) url = options.baseUrl + url;
198
+ const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
199
+ const remainingParameters = omit(parameters, omittedParameters);
200
+ const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
201
+ if (!isBinaryRequest) {
202
+ if (options.mediaType.format) headers.accept = headers.accept.split(/,/).map((format) => format.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
203
+ if (url.endsWith("/graphql")) {
204
+ if (options.mediaType.previews?.length) {
205
+ const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
206
+ headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
207
+ const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
208
+ return `application/vnd.github.${preview}-preview${format}`;
209
+ }).join(",");
210
+ }
211
+ }
212
+ }
213
+ if (["GET", "HEAD"].includes(method)) url = addQueryParameters(url, remainingParameters);
214
+ else if ("data" in remainingParameters) body = remainingParameters.data;
215
+ else if (Object.keys(remainingParameters).length) body = remainingParameters;
216
+ if (!headers["content-type"] && typeof body !== "undefined") headers["content-type"] = "application/json; charset=utf-8";
217
+ if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") body = "";
218
+ return Object.assign({
219
+ method,
220
+ url,
221
+ headers
222
+ }, typeof body !== "undefined" ? { body } : null, options.request ? { request: options.request } : null);
223
+ }
224
+ function endpointWithDefaults(defaults, route, options) {
225
+ return parse$1(merge(defaults, route, options));
226
+ }
227
+ function withDefaults$2(oldDefaults, newDefaults) {
228
+ const DEFAULTS2 = merge(oldDefaults, newDefaults);
229
+ const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
230
+ return Object.assign(endpoint2, {
231
+ DEFAULTS: DEFAULTS2,
232
+ defaults: withDefaults$2.bind(null, DEFAULTS2),
233
+ merge: merge.bind(null, DEFAULTS2),
234
+ parse: parse$1
235
+ });
236
+ }
237
+ var endpoint = withDefaults$2(null, DEFAULTS);
238
+
239
+ //#endregion
240
+ //#region ../../node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.js
241
+ var require_fast_content_type_parse = __commonJS({ "../../node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.js"(exports, module) {
242
+ const NullObject = function NullObject$1() {};
243
+ NullObject.prototype = Object.create(null);
244
+ /**
245
+ * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
246
+ *
247
+ * parameter = token "=" ( token / quoted-string )
248
+ * token = 1*tchar
249
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
250
+ * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
251
+ * / DIGIT / ALPHA
252
+ * ; any VCHAR, except delimiters
253
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
254
+ * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
255
+ * obs-text = %x80-FF
256
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
257
+ */
258
+ const paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
259
+ /**
260
+ * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
261
+ *
262
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
263
+ * obs-text = %x80-FF
264
+ */
265
+ const quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
266
+ /**
267
+ * RegExp to match type in RFC 7231 sec 3.1.1.1
268
+ *
269
+ * media-type = type "/" subtype
270
+ * type = token
271
+ * subtype = token
272
+ */
273
+ const mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
274
+ const defaultContentType = {
275
+ type: "",
276
+ parameters: new NullObject()
277
+ };
278
+ Object.freeze(defaultContentType.parameters);
279
+ Object.freeze(defaultContentType);
280
+ /**
281
+ * Parse media type to object.
282
+ *
283
+ * @param {string|object} header
284
+ * @return {Object}
285
+ * @public
286
+ */
287
+ function parse(header) {
288
+ if (typeof header !== "string") throw new TypeError("argument header is required and must be a string");
289
+ let index = header.indexOf(";");
290
+ const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
291
+ if (mediaTypeRE.test(type) === false) throw new TypeError("invalid media type");
292
+ const result = {
293
+ type: type.toLowerCase(),
294
+ parameters: new NullObject()
295
+ };
296
+ if (index === -1) return result;
297
+ let key;
298
+ let match;
299
+ let value;
300
+ paramRE.lastIndex = index;
301
+ while (match = paramRE.exec(header)) {
302
+ if (match.index !== index) throw new TypeError("invalid parameter format");
303
+ index += match[0].length;
304
+ key = match[1].toLowerCase();
305
+ value = match[2];
306
+ if (value[0] === "\"") {
307
+ value = value.slice(1, value.length - 1);
308
+ quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
309
+ }
310
+ result.parameters[key] = value;
311
+ }
312
+ if (index !== header.length) throw new TypeError("invalid parameter format");
313
+ return result;
314
+ }
315
+ function safeParse$1(header) {
316
+ if (typeof header !== "string") return defaultContentType;
317
+ let index = header.indexOf(";");
318
+ const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
319
+ if (mediaTypeRE.test(type) === false) return defaultContentType;
320
+ const result = {
321
+ type: type.toLowerCase(),
322
+ parameters: new NullObject()
323
+ };
324
+ if (index === -1) return result;
325
+ let key;
326
+ let match;
327
+ let value;
328
+ paramRE.lastIndex = index;
329
+ while (match = paramRE.exec(header)) {
330
+ if (match.index !== index) return defaultContentType;
331
+ index += match[0].length;
332
+ key = match[1].toLowerCase();
333
+ value = match[2];
334
+ if (value[0] === "\"") {
335
+ value = value.slice(1, value.length - 1);
336
+ quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
337
+ }
338
+ result.parameters[key] = value;
339
+ }
340
+ if (index !== header.length) return defaultContentType;
341
+ return result;
342
+ }
343
+ module.exports.default = {
344
+ parse,
345
+ safeParse: safeParse$1
346
+ };
347
+ module.exports.parse = parse;
348
+ module.exports.safeParse = safeParse$1;
349
+ module.exports.defaultContentType = defaultContentType;
350
+ } });
351
+
352
+ //#endregion
353
+ //#region ../../node_modules/.pnpm/@octokit+request-error@7.0.0/node_modules/@octokit/request-error/dist-src/index.js
354
+ var RequestError = class extends Error {
355
+ name;
356
+ /**
357
+ * http status code
358
+ */
359
+ status;
360
+ /**
361
+ * Request options that lead to the error.
362
+ */
363
+ request;
364
+ /**
365
+ * Response object if a response was received
366
+ */
367
+ response;
368
+ constructor(message, statusCode, options) {
369
+ super(message);
370
+ this.name = "HttpError";
371
+ this.status = Number.parseInt(statusCode);
372
+ if (Number.isNaN(this.status)) this.status = 0;
373
+ if ("response" in options) this.response = options.response;
374
+ const requestCopy = Object.assign({}, options.request);
375
+ if (options.request.headers.authorization) requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace(/(?<! ) .*$/, " [REDACTED]") });
376
+ requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
377
+ this.request = requestCopy;
378
+ }
379
+ };
380
+
381
+ //#endregion
382
+ //#region ../../node_modules/.pnpm/@octokit+request@10.0.3/node_modules/@octokit/request/dist-bundle/index.js
383
+ var import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);
384
+ var VERSION$1 = "10.0.3";
385
+ var defaults_default = { headers: { "user-agent": `octokit-request.js/${VERSION$1} ${getUserAgent()}` } };
386
+ function isPlainObject(value) {
387
+ if (typeof value !== "object" || value === null) return false;
388
+ if (Object.prototype.toString.call(value) !== "[object Object]") return false;
389
+ const proto = Object.getPrototypeOf(value);
390
+ if (proto === null) return true;
391
+ const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
392
+ return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
393
+ }
394
+ async function fetchWrapper(requestOptions) {
395
+ const fetch = requestOptions.request?.fetch || globalThis.fetch;
396
+ if (!fetch) throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");
397
+ const log = requestOptions.request?.log || console;
398
+ const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
399
+ const body = isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
400
+ const requestHeaders = Object.fromEntries(Object.entries(requestOptions.headers).map(([name, value]) => [name, String(value)]));
401
+ let fetchResponse;
402
+ try {
403
+ fetchResponse = await fetch(requestOptions.url, {
404
+ method: requestOptions.method,
405
+ body,
406
+ redirect: requestOptions.request?.redirect,
407
+ headers: requestHeaders,
408
+ signal: requestOptions.request?.signal,
409
+ ...requestOptions.body && { duplex: "half" }
410
+ });
411
+ } catch (error) {
412
+ let message = "Unknown Error";
413
+ if (error instanceof Error) {
414
+ if (error.name === "AbortError") {
415
+ error.status = 500;
416
+ throw error;
417
+ }
418
+ message = error.message;
419
+ if (error.name === "TypeError" && "cause" in error) {
420
+ if (error.cause instanceof Error) message = error.cause.message;
421
+ else if (typeof error.cause === "string") message = error.cause;
422
+ }
423
+ }
424
+ const requestError = new RequestError(message, 500, { request: requestOptions });
425
+ requestError.cause = error;
426
+ throw requestError;
427
+ }
428
+ const status = fetchResponse.status;
429
+ const url = fetchResponse.url;
430
+ const responseHeaders = {};
431
+ for (const [key, value] of fetchResponse.headers) responseHeaders[key] = value;
432
+ const octokitResponse = {
433
+ url,
434
+ status,
435
+ headers: responseHeaders,
436
+ data: ""
437
+ };
438
+ if ("deprecation" in responseHeaders) {
439
+ const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
440
+ const deprecationLink = matches && matches.pop();
441
+ log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`);
442
+ }
443
+ if (status === 204 || status === 205) return octokitResponse;
444
+ if (requestOptions.method === "HEAD") {
445
+ if (status < 400) return octokitResponse;
446
+ throw new RequestError(fetchResponse.statusText, status, {
447
+ response: octokitResponse,
448
+ request: requestOptions
449
+ });
450
+ }
451
+ if (status === 304) {
452
+ octokitResponse.data = await getResponseData(fetchResponse);
453
+ throw new RequestError("Not modified", status, {
454
+ response: octokitResponse,
455
+ request: requestOptions
456
+ });
457
+ }
458
+ if (status >= 400) {
459
+ octokitResponse.data = await getResponseData(fetchResponse);
460
+ throw new RequestError(toErrorMessage(octokitResponse.data), status, {
461
+ response: octokitResponse,
462
+ request: requestOptions
463
+ });
464
+ }
465
+ octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
466
+ return octokitResponse;
467
+ }
468
+ async function getResponseData(response) {
469
+ const contentType = response.headers.get("content-type");
470
+ if (!contentType) return response.text().catch(() => "");
471
+ const mimetype = (0, import_fast_content_type_parse.safeParse)(contentType);
472
+ if (isJSONResponse(mimetype)) {
473
+ let text = "";
474
+ try {
475
+ text = await response.text();
476
+ return JSON.parse(text);
477
+ } catch (err) {
478
+ return text;
479
+ }
480
+ } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") return response.text().catch(() => "");
481
+ else return response.arrayBuffer().catch(() => new ArrayBuffer(0));
482
+ }
483
+ function isJSONResponse(mimetype) {
484
+ return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
485
+ }
486
+ function toErrorMessage(data) {
487
+ if (typeof data === "string") return data;
488
+ if (data instanceof ArrayBuffer) return "Unknown error";
489
+ if ("message" in data) {
490
+ const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : "";
491
+ return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`;
492
+ }
493
+ return `Unknown error: ${JSON.stringify(data)}`;
494
+ }
495
+ function withDefaults$1(oldEndpoint, newDefaults) {
496
+ const endpoint2 = oldEndpoint.defaults(newDefaults);
497
+ const newApi = function(route, parameters) {
498
+ const endpointOptions = endpoint2.merge(route, parameters);
499
+ if (!endpointOptions.request || !endpointOptions.request.hook) return fetchWrapper(endpoint2.parse(endpointOptions));
500
+ const request2 = (route2, parameters2) => {
501
+ return fetchWrapper(endpoint2.parse(endpoint2.merge(route2, parameters2)));
502
+ };
503
+ Object.assign(request2, {
504
+ endpoint: endpoint2,
505
+ defaults: withDefaults$1.bind(null, endpoint2)
506
+ });
507
+ return endpointOptions.request.hook(request2, endpointOptions);
508
+ };
509
+ return Object.assign(newApi, {
510
+ endpoint: endpoint2,
511
+ defaults: withDefaults$1.bind(null, endpoint2)
512
+ });
513
+ }
514
+ var request = withDefaults$1(endpoint, defaults_default);
515
+
516
+ //#endregion
517
+ //#region ../../node_modules/.pnpm/@octokit+graphql@9.0.1/node_modules/@octokit/graphql/dist-bundle/index.js
518
+ var VERSION = "0.0.0-development";
519
+ function _buildMessageForResponseErrors(data) {
520
+ return `Request failed due to following response errors:
521
+ ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
522
+ }
523
+ var GraphqlResponseError = class extends Error {
524
+ constructor(request2, headers, response) {
525
+ super(_buildMessageForResponseErrors(response));
526
+ this.request = request2;
527
+ this.headers = headers;
528
+ this.response = response;
529
+ this.errors = response.errors;
530
+ this.data = response.data;
531
+ if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
532
+ }
533
+ name = "GraphqlResponseError";
534
+ errors;
535
+ data;
536
+ };
537
+ var NON_VARIABLE_OPTIONS = [
538
+ "method",
539
+ "baseUrl",
540
+ "url",
541
+ "headers",
542
+ "request",
543
+ "query",
544
+ "mediaType",
545
+ "operationName"
546
+ ];
547
+ var FORBIDDEN_VARIABLE_OPTIONS = [
548
+ "query",
549
+ "method",
550
+ "url"
551
+ ];
552
+ var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
553
+ function graphql(request2, query, options) {
554
+ if (options) {
555
+ if (typeof query === "string" && "query" in options) return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
556
+ for (const key in options) {
557
+ if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
558
+ return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`));
559
+ }
560
+ }
561
+ const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
562
+ const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {
563
+ if (NON_VARIABLE_OPTIONS.includes(key)) {
564
+ result[key] = parsedOptions[key];
565
+ return result;
566
+ }
567
+ if (!result.variables) result.variables = {};
568
+ result.variables[key] = parsedOptions[key];
569
+ return result;
570
+ }, {});
571
+ const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
572
+ if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
573
+ return request2(requestOptions).then((response) => {
574
+ if (response.data.errors) {
575
+ const headers = {};
576
+ for (const key of Object.keys(response.headers)) headers[key] = response.headers[key];
577
+ throw new GraphqlResponseError(requestOptions, headers, response.data);
578
+ }
579
+ return response.data.data;
580
+ });
581
+ }
582
+ function withDefaults(request2, newDefaults) {
583
+ const newRequest = request2.defaults(newDefaults);
584
+ const newApi = (query, options) => {
585
+ return graphql(newRequest, query, options);
586
+ };
587
+ return Object.assign(newApi, {
588
+ defaults: withDefaults.bind(null, newRequest),
589
+ endpoint: newRequest.endpoint
590
+ });
591
+ }
592
+ var graphql2 = withDefaults(request, {
593
+ headers: { "user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}` },
594
+ method: "POST",
595
+ url: "/graphql"
596
+ });
597
+ function withCustomRequest(customRequest) {
598
+ return withDefaults(customRequest, {
599
+ method: "POST",
600
+ url: "/graphql"
601
+ });
602
+ }
603
+
604
+ //#endregion
605
+ export { GraphqlResponseError, getUserAgent, graphql2, request, withCustomRequest };
@@ -0,0 +1,3 @@
1
+ const require_dist_bundle = require('./dist-bundle-UkllqMvc.js');
2
+
3
+ exports.graphql = require_dist_bundle.graphql2;