mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit fixes that the angular.dev deployment is subject to GitHub API rate limiting due to lack of an access token. This commit fixes this, similar to how we fixed it in `angular/components`. The token is pure read-only. PR Close #56929
13099 lines
492 KiB
JavaScript
13099 lines
492 KiB
JavaScript
|
|
import {createRequire as __cjsCompatRequire} from 'module';
|
|
const require = __cjsCompatRequire(import.meta.url);
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
}) : x)(function(x) {
|
|
if (typeof require !== "undefined")
|
|
return require.apply(this, arguments);
|
|
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
});
|
|
var __commonJS = (cb, mod) => function __require2() {
|
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
mod
|
|
));
|
|
|
|
//
|
|
var require_utils = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.toCommandProperties = exports.toCommandValue = void 0;
|
|
function toCommandValue(input) {
|
|
if (input === null || input === void 0) {
|
|
return "";
|
|
} else if (typeof input === "string" || input instanceof String) {
|
|
return input;
|
|
}
|
|
return JSON.stringify(input);
|
|
}
|
|
exports.toCommandValue = toCommandValue;
|
|
function toCommandProperties(annotationProperties) {
|
|
if (!Object.keys(annotationProperties).length) {
|
|
return {};
|
|
}
|
|
return {
|
|
title: annotationProperties.title,
|
|
file: annotationProperties.file,
|
|
line: annotationProperties.startLine,
|
|
endLine: annotationProperties.endLine,
|
|
col: annotationProperties.startColumn,
|
|
endColumn: annotationProperties.endColumn
|
|
};
|
|
}
|
|
exports.toCommandProperties = toCommandProperties;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_command = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
return m[k];
|
|
} });
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.issue = exports.issueCommand = void 0;
|
|
var os3 = __importStar(__require("os"));
|
|
var utils_1 = require_utils();
|
|
function issueCommand(command, properties, message) {
|
|
const cmd = new Command(command, properties, message);
|
|
process.stdout.write(cmd.toString() + os3.EOL);
|
|
}
|
|
exports.issueCommand = issueCommand;
|
|
function issue(name, message = "") {
|
|
issueCommand(name, {}, message);
|
|
}
|
|
exports.issue = issue;
|
|
var CMD_STRING = "::";
|
|
var Command = class {
|
|
constructor(command, properties, message) {
|
|
if (!command) {
|
|
command = "missing.command";
|
|
}
|
|
this.command = command;
|
|
this.properties = properties;
|
|
this.message = message;
|
|
}
|
|
toString() {
|
|
let cmdStr = CMD_STRING + this.command;
|
|
if (this.properties && Object.keys(this.properties).length > 0) {
|
|
cmdStr += " ";
|
|
let first = true;
|
|
for (const key in this.properties) {
|
|
if (this.properties.hasOwnProperty(key)) {
|
|
const val = this.properties[key];
|
|
if (val) {
|
|
if (first) {
|
|
first = false;
|
|
} else {
|
|
cmdStr += ",";
|
|
}
|
|
cmdStr += `${key}=${escapeProperty(val)}`;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
|
|
return cmdStr;
|
|
}
|
|
};
|
|
function escapeData(s) {
|
|
return utils_1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
|
|
}
|
|
function escapeProperty(s) {
|
|
return utils_1.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C");
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_rng = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = rng;
|
|
var _crypto = _interopRequireDefault(__require("crypto"));
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var rnds8Pool = new Uint8Array(256);
|
|
var poolPtr = rnds8Pool.length;
|
|
function rng() {
|
|
if (poolPtr > rnds8Pool.length - 16) {
|
|
_crypto.default.randomFillSync(rnds8Pool);
|
|
poolPtr = 0;
|
|
}
|
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_regex = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_validate = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _regex = _interopRequireDefault(require_regex());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function validate(uuid) {
|
|
return typeof uuid === "string" && _regex.default.test(uuid);
|
|
}
|
|
var _default = validate;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_stringify = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _validate = _interopRequireDefault(require_validate());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var byteToHex = [];
|
|
for (let i = 0; i < 256; ++i) {
|
|
byteToHex.push((i + 256).toString(16).substr(1));
|
|
}
|
|
function stringify(arr, offset = 0) {
|
|
const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
if (!(0, _validate.default)(uuid)) {
|
|
throw TypeError("Stringified UUID is invalid");
|
|
}
|
|
return uuid;
|
|
}
|
|
var _default = stringify;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_v1 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _rng = _interopRequireDefault(require_rng());
|
|
var _stringify = _interopRequireDefault(require_stringify());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var _nodeId;
|
|
var _clockseq;
|
|
var _lastMSecs = 0;
|
|
var _lastNSecs = 0;
|
|
function v1(options, buf, offset) {
|
|
let i = buf && offset || 0;
|
|
const b = buf || new Array(16);
|
|
options = options || {};
|
|
let node = options.node || _nodeId;
|
|
let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
|
|
if (node == null || clockseq == null) {
|
|
const seedBytes = options.random || (options.rng || _rng.default)();
|
|
if (node == null) {
|
|
node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
}
|
|
if (clockseq == null) {
|
|
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383;
|
|
}
|
|
}
|
|
let msecs = options.msecs !== void 0 ? options.msecs : Date.now();
|
|
let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1;
|
|
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
|
|
if (dt < 0 && options.clockseq === void 0) {
|
|
clockseq = clockseq + 1 & 16383;
|
|
}
|
|
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) {
|
|
nsecs = 0;
|
|
}
|
|
if (nsecs >= 1e4) {
|
|
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
}
|
|
_lastMSecs = msecs;
|
|
_lastNSecs = nsecs;
|
|
_clockseq = clockseq;
|
|
msecs += 122192928e5;
|
|
const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
|
|
b[i++] = tl >>> 24 & 255;
|
|
b[i++] = tl >>> 16 & 255;
|
|
b[i++] = tl >>> 8 & 255;
|
|
b[i++] = tl & 255;
|
|
const tmh = msecs / 4294967296 * 1e4 & 268435455;
|
|
b[i++] = tmh >>> 8 & 255;
|
|
b[i++] = tmh & 255;
|
|
b[i++] = tmh >>> 24 & 15 | 16;
|
|
b[i++] = tmh >>> 16 & 255;
|
|
b[i++] = clockseq >>> 8 | 128;
|
|
b[i++] = clockseq & 255;
|
|
for (let n = 0; n < 6; ++n) {
|
|
b[i + n] = node[n];
|
|
}
|
|
return buf || (0, _stringify.default)(b);
|
|
}
|
|
var _default = v1;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_parse = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _validate = _interopRequireDefault(require_validate());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function parse(uuid) {
|
|
if (!(0, _validate.default)(uuid)) {
|
|
throw TypeError("Invalid UUID");
|
|
}
|
|
let v;
|
|
const arr = new Uint8Array(16);
|
|
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
arr[1] = v >>> 16 & 255;
|
|
arr[2] = v >>> 8 & 255;
|
|
arr[3] = v & 255;
|
|
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
arr[5] = v & 255;
|
|
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
arr[7] = v & 255;
|
|
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
arr[9] = v & 255;
|
|
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255;
|
|
arr[11] = v / 4294967296 & 255;
|
|
arr[12] = v >>> 24 & 255;
|
|
arr[13] = v >>> 16 & 255;
|
|
arr[14] = v >>> 8 & 255;
|
|
arr[15] = v & 255;
|
|
return arr;
|
|
}
|
|
var _default = parse;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_v35 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = _default;
|
|
exports.URL = exports.DNS = void 0;
|
|
var _stringify = _interopRequireDefault(require_stringify());
|
|
var _parse = _interopRequireDefault(require_parse());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function stringToBytes(str) {
|
|
str = unescape(encodeURIComponent(str));
|
|
const bytes = [];
|
|
for (let i = 0; i < str.length; ++i) {
|
|
bytes.push(str.charCodeAt(i));
|
|
}
|
|
return bytes;
|
|
}
|
|
var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
|
|
exports.DNS = DNS;
|
|
var URL3 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
exports.URL = URL3;
|
|
function _default(name, version, hashfunc) {
|
|
function generateUUID(value, namespace, buf, offset) {
|
|
if (typeof value === "string") {
|
|
value = stringToBytes(value);
|
|
}
|
|
if (typeof namespace === "string") {
|
|
namespace = (0, _parse.default)(namespace);
|
|
}
|
|
if (namespace.length !== 16) {
|
|
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
|
|
}
|
|
let bytes = new Uint8Array(16 + value.length);
|
|
bytes.set(namespace);
|
|
bytes.set(value, namespace.length);
|
|
bytes = hashfunc(bytes);
|
|
bytes[6] = bytes[6] & 15 | version;
|
|
bytes[8] = bytes[8] & 63 | 128;
|
|
if (buf) {
|
|
offset = offset || 0;
|
|
for (let i = 0; i < 16; ++i) {
|
|
buf[offset + i] = bytes[i];
|
|
}
|
|
return buf;
|
|
}
|
|
return (0, _stringify.default)(bytes);
|
|
}
|
|
try {
|
|
generateUUID.name = name;
|
|
} catch (err) {
|
|
}
|
|
generateUUID.DNS = DNS;
|
|
generateUUID.URL = URL3;
|
|
return generateUUID;
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_md5 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _crypto = _interopRequireDefault(__require("crypto"));
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function md5(bytes) {
|
|
if (Array.isArray(bytes)) {
|
|
bytes = Buffer.from(bytes);
|
|
} else if (typeof bytes === "string") {
|
|
bytes = Buffer.from(bytes, "utf8");
|
|
}
|
|
return _crypto.default.createHash("md5").update(bytes).digest();
|
|
}
|
|
var _default = md5;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_v3 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _v = _interopRequireDefault(require_v35());
|
|
var _md = _interopRequireDefault(require_md5());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var v3 = (0, _v.default)("v3", 48, _md.default);
|
|
var _default = v3;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_v4 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _rng = _interopRequireDefault(require_rng());
|
|
var _stringify = _interopRequireDefault(require_stringify());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function v4(options, buf, offset) {
|
|
options = options || {};
|
|
const rnds = options.random || (options.rng || _rng.default)();
|
|
rnds[6] = rnds[6] & 15 | 64;
|
|
rnds[8] = rnds[8] & 63 | 128;
|
|
if (buf) {
|
|
offset = offset || 0;
|
|
for (let i = 0; i < 16; ++i) {
|
|
buf[offset + i] = rnds[i];
|
|
}
|
|
return buf;
|
|
}
|
|
return (0, _stringify.default)(rnds);
|
|
}
|
|
var _default = v4;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_sha1 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _crypto = _interopRequireDefault(__require("crypto"));
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function sha1(bytes) {
|
|
if (Array.isArray(bytes)) {
|
|
bytes = Buffer.from(bytes);
|
|
} else if (typeof bytes === "string") {
|
|
bytes = Buffer.from(bytes, "utf8");
|
|
}
|
|
return _crypto.default.createHash("sha1").update(bytes).digest();
|
|
}
|
|
var _default = sha1;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_v5 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _v = _interopRequireDefault(require_v35());
|
|
var _sha = _interopRequireDefault(require_sha1());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var v5 = (0, _v.default)("v5", 80, _sha.default);
|
|
var _default = v5;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_nil = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _default = "00000000-0000-0000-0000-000000000000";
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_version = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _validate = _interopRequireDefault(require_validate());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function version(uuid) {
|
|
if (!(0, _validate.default)(uuid)) {
|
|
throw TypeError("Invalid UUID");
|
|
}
|
|
return parseInt(uuid.substr(14, 1), 16);
|
|
}
|
|
var _default = version;
|
|
exports.default = _default;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "v1", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _v.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "v3", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _v2.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "v4", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _v3.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "v5", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _v4.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "NIL", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _nil.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "version", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _version.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "validate", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _validate.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "stringify", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _stringify.default;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "parse", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return _parse.default;
|
|
}
|
|
});
|
|
var _v = _interopRequireDefault(require_v1());
|
|
var _v2 = _interopRequireDefault(require_v3());
|
|
var _v3 = _interopRequireDefault(require_v4());
|
|
var _v4 = _interopRequireDefault(require_v5());
|
|
var _nil = _interopRequireDefault(require_nil());
|
|
var _version = _interopRequireDefault(require_version());
|
|
var _validate = _interopRequireDefault(require_validate());
|
|
var _stringify = _interopRequireDefault(require_stringify());
|
|
var _parse = _interopRequireDefault(require_parse());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_file_command = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
return m[k];
|
|
} });
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
|
var fs = __importStar(__require("fs"));
|
|
var os3 = __importStar(__require("os"));
|
|
var uuid_1 = require_dist();
|
|
var utils_1 = require_utils();
|
|
function issueFileCommand(command, message) {
|
|
const filePath = process.env[`GITHUB_${command}`];
|
|
if (!filePath) {
|
|
throw new Error(`Unable to find environment variable for file command ${command}`);
|
|
}
|
|
if (!fs.existsSync(filePath)) {
|
|
throw new Error(`Missing file at path: ${filePath}`);
|
|
}
|
|
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os3.EOL}`, {
|
|
encoding: "utf8"
|
|
});
|
|
}
|
|
exports.issueFileCommand = issueFileCommand;
|
|
function prepareKeyValueMessage(key, value) {
|
|
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
|
|
const convertedValue = utils_1.toCommandValue(value);
|
|
if (key.includes(delimiter)) {
|
|
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
|
|
}
|
|
if (convertedValue.includes(delimiter)) {
|
|
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
|
|
}
|
|
return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`;
|
|
}
|
|
exports.prepareKeyValueMessage = prepareKeyValueMessage;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_proxy = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.checkBypass = exports.getProxyUrl = void 0;
|
|
function getProxyUrl(reqUrl) {
|
|
const usingSsl = reqUrl.protocol === "https:";
|
|
if (checkBypass(reqUrl)) {
|
|
return void 0;
|
|
}
|
|
const proxyVar = (() => {
|
|
if (usingSsl) {
|
|
return process.env["https_proxy"] || process.env["HTTPS_PROXY"];
|
|
} else {
|
|
return process.env["http_proxy"] || process.env["HTTP_PROXY"];
|
|
}
|
|
})();
|
|
if (proxyVar) {
|
|
try {
|
|
return new URL(proxyVar);
|
|
} catch (_a) {
|
|
if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://"))
|
|
return new URL(`http://${proxyVar}`);
|
|
}
|
|
} else {
|
|
return void 0;
|
|
}
|
|
}
|
|
exports.getProxyUrl = getProxyUrl;
|
|
function checkBypass(reqUrl) {
|
|
if (!reqUrl.hostname) {
|
|
return false;
|
|
}
|
|
const reqHost = reqUrl.hostname;
|
|
if (isLoopbackAddress(reqHost)) {
|
|
return true;
|
|
}
|
|
const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || "";
|
|
if (!noProxy) {
|
|
return false;
|
|
}
|
|
let reqPort;
|
|
if (reqUrl.port) {
|
|
reqPort = Number(reqUrl.port);
|
|
} else if (reqUrl.protocol === "http:") {
|
|
reqPort = 80;
|
|
} else if (reqUrl.protocol === "https:") {
|
|
reqPort = 443;
|
|
}
|
|
const upperReqHosts = [reqUrl.hostname.toUpperCase()];
|
|
if (typeof reqPort === "number") {
|
|
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
|
|
}
|
|
for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) {
|
|
if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
exports.checkBypass = checkBypass;
|
|
function isLoopbackAddress(host) {
|
|
const hostLower = host.toLowerCase();
|
|
return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]");
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_tunnel = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var net = __require("net");
|
|
var tls = __require("tls");
|
|
var http = __require("http");
|
|
var https = __require("https");
|
|
var events = __require("events");
|
|
var assert = __require("assert");
|
|
var util = __require("util");
|
|
exports.httpOverHttp = httpOverHttp;
|
|
exports.httpsOverHttp = httpsOverHttp;
|
|
exports.httpOverHttps = httpOverHttps;
|
|
exports.httpsOverHttps = httpsOverHttps;
|
|
function httpOverHttp(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = http.request;
|
|
return agent;
|
|
}
|
|
function httpsOverHttp(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = http.request;
|
|
agent.createSocket = createSecureSocket;
|
|
agent.defaultPort = 443;
|
|
return agent;
|
|
}
|
|
function httpOverHttps(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = https.request;
|
|
return agent;
|
|
}
|
|
function httpsOverHttps(options) {
|
|
var agent = new TunnelingAgent(options);
|
|
agent.request = https.request;
|
|
agent.createSocket = createSecureSocket;
|
|
agent.defaultPort = 443;
|
|
return agent;
|
|
}
|
|
function TunnelingAgent(options) {
|
|
var self = this;
|
|
self.options = options || {};
|
|
self.proxyOptions = self.options.proxy || {};
|
|
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
|
|
self.requests = [];
|
|
self.sockets = [];
|
|
self.on("free", function onFree(socket, host, port, localAddress) {
|
|
var options2 = toOptions(host, port, localAddress);
|
|
for (var i = 0, len = self.requests.length; i < len; ++i) {
|
|
var pending = self.requests[i];
|
|
if (pending.host === options2.host && pending.port === options2.port) {
|
|
self.requests.splice(i, 1);
|
|
pending.request.onSocket(socket);
|
|
return;
|
|
}
|
|
}
|
|
socket.destroy();
|
|
self.removeSocket(socket);
|
|
});
|
|
}
|
|
util.inherits(TunnelingAgent, events.EventEmitter);
|
|
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
|
|
var self = this;
|
|
var options = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress));
|
|
if (self.sockets.length >= this.maxSockets) {
|
|
self.requests.push(options);
|
|
return;
|
|
}
|
|
self.createSocket(options, function(socket) {
|
|
socket.on("free", onFree);
|
|
socket.on("close", onCloseOrRemove);
|
|
socket.on("agentRemove", onCloseOrRemove);
|
|
req.onSocket(socket);
|
|
function onFree() {
|
|
self.emit("free", socket, options);
|
|
}
|
|
function onCloseOrRemove(err) {
|
|
self.removeSocket(socket);
|
|
socket.removeListener("free", onFree);
|
|
socket.removeListener("close", onCloseOrRemove);
|
|
socket.removeListener("agentRemove", onCloseOrRemove);
|
|
}
|
|
});
|
|
};
|
|
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
|
|
var self = this;
|
|
var placeholder = {};
|
|
self.sockets.push(placeholder);
|
|
var connectOptions = mergeOptions({}, self.proxyOptions, {
|
|
method: "CONNECT",
|
|
path: options.host + ":" + options.port,
|
|
agent: false,
|
|
headers: {
|
|
host: options.host + ":" + options.port
|
|
}
|
|
});
|
|
if (options.localAddress) {
|
|
connectOptions.localAddress = options.localAddress;
|
|
}
|
|
if (connectOptions.proxyAuth) {
|
|
connectOptions.headers = connectOptions.headers || {};
|
|
connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64");
|
|
}
|
|
debug("making CONNECT request");
|
|
var connectReq = self.request(connectOptions);
|
|
connectReq.useChunkedEncodingByDefault = false;
|
|
connectReq.once("response", onResponse);
|
|
connectReq.once("upgrade", onUpgrade);
|
|
connectReq.once("connect", onConnect);
|
|
connectReq.once("error", onError);
|
|
connectReq.end();
|
|
function onResponse(res) {
|
|
res.upgrade = true;
|
|
}
|
|
function onUpgrade(res, socket, head) {
|
|
process.nextTick(function() {
|
|
onConnect(res, socket, head);
|
|
});
|
|
}
|
|
function onConnect(res, socket, head) {
|
|
connectReq.removeAllListeners();
|
|
socket.removeAllListeners();
|
|
if (res.statusCode !== 200) {
|
|
debug(
|
|
"tunneling socket could not be established, statusCode=%d",
|
|
res.statusCode
|
|
);
|
|
socket.destroy();
|
|
var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode);
|
|
error.code = "ECONNRESET";
|
|
options.request.emit("error", error);
|
|
self.removeSocket(placeholder);
|
|
return;
|
|
}
|
|
if (head.length > 0) {
|
|
debug("got illegal response body from proxy");
|
|
socket.destroy();
|
|
var error = new Error("got illegal response body from proxy");
|
|
error.code = "ECONNRESET";
|
|
options.request.emit("error", error);
|
|
self.removeSocket(placeholder);
|
|
return;
|
|
}
|
|
debug("tunneling connection has established");
|
|
self.sockets[self.sockets.indexOf(placeholder)] = socket;
|
|
return cb(socket);
|
|
}
|
|
function onError(cause) {
|
|
connectReq.removeAllListeners();
|
|
debug(
|
|
"tunneling socket could not be established, cause=%s\n",
|
|
cause.message,
|
|
cause.stack
|
|
);
|
|
var error = new Error("tunneling socket could not be established, cause=" + cause.message);
|
|
error.code = "ECONNRESET";
|
|
options.request.emit("error", error);
|
|
self.removeSocket(placeholder);
|
|
}
|
|
};
|
|
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
|
|
var pos = this.sockets.indexOf(socket);
|
|
if (pos === -1) {
|
|
return;
|
|
}
|
|
this.sockets.splice(pos, 1);
|
|
var pending = this.requests.shift();
|
|
if (pending) {
|
|
this.createSocket(pending, function(socket2) {
|
|
pending.request.onSocket(socket2);
|
|
});
|
|
}
|
|
};
|
|
function createSecureSocket(options, cb) {
|
|
var self = this;
|
|
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
|
|
var hostHeader = options.request.getHeader("host");
|
|
var tlsOptions = mergeOptions({}, self.options, {
|
|
socket,
|
|
servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options.host
|
|
});
|
|
var secureSocket = tls.connect(0, tlsOptions);
|
|
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
|
|
cb(secureSocket);
|
|
});
|
|
}
|
|
function toOptions(host, port, localAddress) {
|
|
if (typeof host === "string") {
|
|
return {
|
|
host,
|
|
port,
|
|
localAddress
|
|
};
|
|
}
|
|
return host;
|
|
}
|
|
function mergeOptions(target) {
|
|
for (var i = 1, len = arguments.length; i < len; ++i) {
|
|
var overrides = arguments[i];
|
|
if (typeof overrides === "object") {
|
|
var keys = Object.keys(overrides);
|
|
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
|
|
var k = keys[j];
|
|
if (overrides[k] !== void 0) {
|
|
target[k] = overrides[k];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
var debug;
|
|
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
|
debug = function() {
|
|
var args = Array.prototype.slice.call(arguments);
|
|
if (typeof args[0] === "string") {
|
|
args[0] = "TUNNEL: " + args[0];
|
|
} else {
|
|
args.unshift("TUNNEL:");
|
|
}
|
|
console.error.apply(console, args);
|
|
};
|
|
} else {
|
|
debug = function() {
|
|
};
|
|
}
|
|
exports.debug = debug;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_tunnel2 = __commonJS({
|
|
""(exports, module) {
|
|
module.exports = require_tunnel();
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_lib = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() {
|
|
return m[k];
|
|
} };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
function adopt(value) {
|
|
return value instanceof P ? value : new P(function(resolve) {
|
|
resolve(value);
|
|
});
|
|
}
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
|
|
var http = __importStar(__require("http"));
|
|
var https = __importStar(__require("https"));
|
|
var pm = __importStar(require_proxy());
|
|
var tunnel = __importStar(require_tunnel2());
|
|
var undici_1 = __require("undici");
|
|
var HttpCodes;
|
|
(function(HttpCodes2) {
|
|
HttpCodes2[HttpCodes2["OK"] = 200] = "OK";
|
|
HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices";
|
|
HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently";
|
|
HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved";
|
|
HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther";
|
|
HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified";
|
|
HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy";
|
|
HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy";
|
|
HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
|
HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect";
|
|
HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest";
|
|
HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized";
|
|
HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired";
|
|
HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden";
|
|
HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound";
|
|
HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
|
HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable";
|
|
HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
|
HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout";
|
|
HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict";
|
|
HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone";
|
|
HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests";
|
|
HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError";
|
|
HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented";
|
|
HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway";
|
|
HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
|
HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
})(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
|
|
var Headers;
|
|
(function(Headers2) {
|
|
Headers2["Accept"] = "accept";
|
|
Headers2["ContentType"] = "content-type";
|
|
})(Headers || (exports.Headers = Headers = {}));
|
|
var MediaTypes;
|
|
(function(MediaTypes2) {
|
|
MediaTypes2["ApplicationJson"] = "application/json";
|
|
})(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
|
|
function getProxyUrl(serverUrl) {
|
|
const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
|
|
return proxyUrl ? proxyUrl.href : "";
|
|
}
|
|
exports.getProxyUrl = getProxyUrl;
|
|
var HttpRedirectCodes = [
|
|
HttpCodes.MovedPermanently,
|
|
HttpCodes.ResourceMoved,
|
|
HttpCodes.SeeOther,
|
|
HttpCodes.TemporaryRedirect,
|
|
HttpCodes.PermanentRedirect
|
|
];
|
|
var HttpResponseRetryCodes = [
|
|
HttpCodes.BadGateway,
|
|
HttpCodes.ServiceUnavailable,
|
|
HttpCodes.GatewayTimeout
|
|
];
|
|
var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"];
|
|
var ExponentialBackoffCeiling = 10;
|
|
var ExponentialBackoffTimeSlice = 5;
|
|
var HttpClientError = class extends Error {
|
|
constructor(message, statusCode) {
|
|
super(message);
|
|
this.name = "HttpClientError";
|
|
this.statusCode = statusCode;
|
|
Object.setPrototypeOf(this, HttpClientError.prototype);
|
|
}
|
|
};
|
|
exports.HttpClientError = HttpClientError;
|
|
var HttpClientResponse = class {
|
|
constructor(message) {
|
|
this.message = message;
|
|
}
|
|
readBody() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
let output = Buffer.alloc(0);
|
|
this.message.on("data", (chunk) => {
|
|
output = Buffer.concat([output, chunk]);
|
|
});
|
|
this.message.on("end", () => {
|
|
resolve(output.toString());
|
|
});
|
|
}));
|
|
});
|
|
}
|
|
readBodyBuffer() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
const chunks = [];
|
|
this.message.on("data", (chunk) => {
|
|
chunks.push(chunk);
|
|
});
|
|
this.message.on("end", () => {
|
|
resolve(Buffer.concat(chunks));
|
|
});
|
|
}));
|
|
});
|
|
}
|
|
};
|
|
exports.HttpClientResponse = HttpClientResponse;
|
|
function isHttps(requestUrl) {
|
|
const parsedUrl = new URL(requestUrl);
|
|
return parsedUrl.protocol === "https:";
|
|
}
|
|
exports.isHttps = isHttps;
|
|
var HttpClient = class {
|
|
constructor(userAgent, handlers, requestOptions) {
|
|
this._ignoreSslError = false;
|
|
this._allowRedirects = true;
|
|
this._allowRedirectDowngrade = false;
|
|
this._maxRedirects = 50;
|
|
this._allowRetries = false;
|
|
this._maxRetries = 1;
|
|
this._keepAlive = false;
|
|
this._disposed = false;
|
|
this.userAgent = userAgent;
|
|
this.handlers = handlers || [];
|
|
this.requestOptions = requestOptions;
|
|
if (requestOptions) {
|
|
if (requestOptions.ignoreSslError != null) {
|
|
this._ignoreSslError = requestOptions.ignoreSslError;
|
|
}
|
|
this._socketTimeout = requestOptions.socketTimeout;
|
|
if (requestOptions.allowRedirects != null) {
|
|
this._allowRedirects = requestOptions.allowRedirects;
|
|
}
|
|
if (requestOptions.allowRedirectDowngrade != null) {
|
|
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
|
}
|
|
if (requestOptions.maxRedirects != null) {
|
|
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
|
}
|
|
if (requestOptions.keepAlive != null) {
|
|
this._keepAlive = requestOptions.keepAlive;
|
|
}
|
|
if (requestOptions.allowRetries != null) {
|
|
this._allowRetries = requestOptions.allowRetries;
|
|
}
|
|
if (requestOptions.maxRetries != null) {
|
|
this._maxRetries = requestOptions.maxRetries;
|
|
}
|
|
}
|
|
}
|
|
options(requestUrl, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request("OPTIONS", requestUrl, null, additionalHeaders || {});
|
|
});
|
|
}
|
|
get(requestUrl, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request("GET", requestUrl, null, additionalHeaders || {});
|
|
});
|
|
}
|
|
del(requestUrl, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request("DELETE", requestUrl, null, additionalHeaders || {});
|
|
});
|
|
}
|
|
post(requestUrl, data, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request("POST", requestUrl, data, additionalHeaders || {});
|
|
});
|
|
}
|
|
patch(requestUrl, data, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request("PATCH", requestUrl, data, additionalHeaders || {});
|
|
});
|
|
}
|
|
put(requestUrl, data, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request("PUT", requestUrl, data, additionalHeaders || {});
|
|
});
|
|
}
|
|
head(requestUrl, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request("HEAD", requestUrl, null, additionalHeaders || {});
|
|
});
|
|
}
|
|
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.request(verb, requestUrl, stream, additionalHeaders);
|
|
});
|
|
}
|
|
getJson(requestUrl, additionalHeaders = {}) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
const res = yield this.get(requestUrl, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
});
|
|
}
|
|
postJson(requestUrl, obj, additionalHeaders = {}) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const data = JSON.stringify(obj, null, 2);
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
const res = yield this.post(requestUrl, data, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
});
|
|
}
|
|
putJson(requestUrl, obj, additionalHeaders = {}) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const data = JSON.stringify(obj, null, 2);
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
const res = yield this.put(requestUrl, data, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
});
|
|
}
|
|
patchJson(requestUrl, obj, additionalHeaders = {}) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const data = JSON.stringify(obj, null, 2);
|
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
|
const res = yield this.patch(requestUrl, data, additionalHeaders);
|
|
return this._processResponse(res, this.requestOptions);
|
|
});
|
|
}
|
|
request(verb, requestUrl, data, headers) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
if (this._disposed) {
|
|
throw new Error("Client has already been disposed.");
|
|
}
|
|
const parsedUrl = new URL(requestUrl);
|
|
let info = this._prepareRequest(verb, parsedUrl, headers);
|
|
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
|
|
let numTries = 0;
|
|
let response;
|
|
do {
|
|
response = yield this.requestRaw(info, data);
|
|
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
|
let authenticationHandler;
|
|
for (const handler of this.handlers) {
|
|
if (handler.canHandleAuthentication(response)) {
|
|
authenticationHandler = handler;
|
|
break;
|
|
}
|
|
}
|
|
if (authenticationHandler) {
|
|
return authenticationHandler.handleAuthentication(this, info, data);
|
|
} else {
|
|
return response;
|
|
}
|
|
}
|
|
let redirectsRemaining = this._maxRedirects;
|
|
while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) {
|
|
const redirectUrl = response.message.headers["location"];
|
|
if (!redirectUrl) {
|
|
break;
|
|
}
|
|
const parsedRedirectUrl = new URL(redirectUrl);
|
|
if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
|
|
throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
|
|
}
|
|
yield response.readBody();
|
|
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
|
|
for (const header in headers) {
|
|
if (header.toLowerCase() === "authorization") {
|
|
delete headers[header];
|
|
}
|
|
}
|
|
}
|
|
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
|
response = yield this.requestRaw(info, data);
|
|
redirectsRemaining--;
|
|
}
|
|
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
|
|
return response;
|
|
}
|
|
numTries += 1;
|
|
if (numTries < maxTries) {
|
|
yield response.readBody();
|
|
yield this._performExponentialBackoff(numTries);
|
|
}
|
|
} while (numTries < maxTries);
|
|
return response;
|
|
});
|
|
}
|
|
dispose() {
|
|
if (this._agent) {
|
|
this._agent.destroy();
|
|
}
|
|
this._disposed = true;
|
|
}
|
|
requestRaw(info, data) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return new Promise((resolve, reject) => {
|
|
function callbackForResult(err, res) {
|
|
if (err) {
|
|
reject(err);
|
|
} else if (!res) {
|
|
reject(new Error("Unknown error"));
|
|
} else {
|
|
resolve(res);
|
|
}
|
|
}
|
|
this.requestRawWithCallback(info, data, callbackForResult);
|
|
});
|
|
});
|
|
}
|
|
requestRawWithCallback(info, data, onResult) {
|
|
if (typeof data === "string") {
|
|
if (!info.options.headers) {
|
|
info.options.headers = {};
|
|
}
|
|
info.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
|
|
}
|
|
let callbackCalled = false;
|
|
function handleResult(err, res) {
|
|
if (!callbackCalled) {
|
|
callbackCalled = true;
|
|
onResult(err, res);
|
|
}
|
|
}
|
|
const req = info.httpModule.request(info.options, (msg) => {
|
|
const res = new HttpClientResponse(msg);
|
|
handleResult(void 0, res);
|
|
});
|
|
let socket;
|
|
req.on("socket", (sock) => {
|
|
socket = sock;
|
|
});
|
|
req.setTimeout(this._socketTimeout || 3 * 6e4, () => {
|
|
if (socket) {
|
|
socket.end();
|
|
}
|
|
handleResult(new Error(`Request timeout: ${info.options.path}`));
|
|
});
|
|
req.on("error", function(err) {
|
|
handleResult(err);
|
|
});
|
|
if (data && typeof data === "string") {
|
|
req.write(data, "utf8");
|
|
}
|
|
if (data && typeof data !== "string") {
|
|
data.on("close", function() {
|
|
req.end();
|
|
});
|
|
data.pipe(req);
|
|
} else {
|
|
req.end();
|
|
}
|
|
}
|
|
getAgent(serverUrl) {
|
|
const parsedUrl = new URL(serverUrl);
|
|
return this._getAgent(parsedUrl);
|
|
}
|
|
getAgentDispatcher(serverUrl) {
|
|
const parsedUrl = new URL(serverUrl);
|
|
const proxyUrl = pm.getProxyUrl(parsedUrl);
|
|
const useProxy = proxyUrl && proxyUrl.hostname;
|
|
if (!useProxy) {
|
|
return;
|
|
}
|
|
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
|
|
}
|
|
_prepareRequest(method, requestUrl, headers) {
|
|
const info = {};
|
|
info.parsedUrl = requestUrl;
|
|
const usingSsl = info.parsedUrl.protocol === "https:";
|
|
info.httpModule = usingSsl ? https : http;
|
|
const defaultPort = usingSsl ? 443 : 80;
|
|
info.options = {};
|
|
info.options.host = info.parsedUrl.hostname;
|
|
info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
|
|
info.options.path = (info.parsedUrl.pathname || "") + (info.parsedUrl.search || "");
|
|
info.options.method = method;
|
|
info.options.headers = this._mergeHeaders(headers);
|
|
if (this.userAgent != null) {
|
|
info.options.headers["user-agent"] = this.userAgent;
|
|
}
|
|
info.options.agent = this._getAgent(info.parsedUrl);
|
|
if (this.handlers) {
|
|
for (const handler of this.handlers) {
|
|
handler.prepareRequest(info.options);
|
|
}
|
|
}
|
|
return info;
|
|
}
|
|
_mergeHeaders(headers) {
|
|
if (this.requestOptions && this.requestOptions.headers) {
|
|
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
|
|
}
|
|
return lowercaseKeys(headers || {});
|
|
}
|
|
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
|
|
let clientHeader;
|
|
if (this.requestOptions && this.requestOptions.headers) {
|
|
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
|
|
}
|
|
return additionalHeaders[header] || clientHeader || _default;
|
|
}
|
|
_getAgent(parsedUrl) {
|
|
let agent;
|
|
const proxyUrl = pm.getProxyUrl(parsedUrl);
|
|
const useProxy = proxyUrl && proxyUrl.hostname;
|
|
if (this._keepAlive && useProxy) {
|
|
agent = this._proxyAgent;
|
|
}
|
|
if (!useProxy) {
|
|
agent = this._agent;
|
|
}
|
|
if (agent) {
|
|
return agent;
|
|
}
|
|
const usingSsl = parsedUrl.protocol === "https:";
|
|
let maxSockets = 100;
|
|
if (this.requestOptions) {
|
|
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
|
|
}
|
|
if (proxyUrl && proxyUrl.hostname) {
|
|
const agentOptions = {
|
|
maxSockets,
|
|
keepAlive: this._keepAlive,
|
|
proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && {
|
|
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
|
|
}), { host: proxyUrl.hostname, port: proxyUrl.port })
|
|
};
|
|
let tunnelAgent;
|
|
const overHttps = proxyUrl.protocol === "https:";
|
|
if (usingSsl) {
|
|
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
|
} else {
|
|
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
|
|
}
|
|
agent = tunnelAgent(agentOptions);
|
|
this._proxyAgent = agent;
|
|
}
|
|
if (!agent) {
|
|
const options = { keepAlive: this._keepAlive, maxSockets };
|
|
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
|
|
this._agent = agent;
|
|
}
|
|
if (usingSsl && this._ignoreSslError) {
|
|
agent.options = Object.assign(agent.options || {}, {
|
|
rejectUnauthorized: false
|
|
});
|
|
}
|
|
return agent;
|
|
}
|
|
_getProxyAgentDispatcher(parsedUrl, proxyUrl) {
|
|
let proxyAgent;
|
|
if (this._keepAlive) {
|
|
proxyAgent = this._proxyAgentDispatcher;
|
|
}
|
|
if (proxyAgent) {
|
|
return proxyAgent;
|
|
}
|
|
const usingSsl = parsedUrl.protocol === "https:";
|
|
proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && {
|
|
token: `${proxyUrl.username}:${proxyUrl.password}`
|
|
}));
|
|
this._proxyAgentDispatcher = proxyAgent;
|
|
if (usingSsl && this._ignoreSslError) {
|
|
proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
|
|
rejectUnauthorized: false
|
|
});
|
|
}
|
|
return proxyAgent;
|
|
}
|
|
_performExponentialBackoff(retryNumber) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
|
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
|
return new Promise((resolve) => setTimeout(() => resolve(), ms));
|
|
});
|
|
}
|
|
_processResponse(res, options) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
const statusCode = res.message.statusCode || 0;
|
|
const response = {
|
|
statusCode,
|
|
result: null,
|
|
headers: {}
|
|
};
|
|
if (statusCode === HttpCodes.NotFound) {
|
|
resolve(response);
|
|
}
|
|
function dateTimeDeserializer(key, value) {
|
|
if (typeof value === "string") {
|
|
const a = new Date(value);
|
|
if (!isNaN(a.valueOf())) {
|
|
return a;
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
let obj;
|
|
let contents;
|
|
try {
|
|
contents = yield res.readBody();
|
|
if (contents && contents.length > 0) {
|
|
if (options && options.deserializeDates) {
|
|
obj = JSON.parse(contents, dateTimeDeserializer);
|
|
} else {
|
|
obj = JSON.parse(contents);
|
|
}
|
|
response.result = obj;
|
|
}
|
|
response.headers = res.message.headers;
|
|
} catch (err) {
|
|
}
|
|
if (statusCode > 299) {
|
|
let msg;
|
|
if (obj && obj.message) {
|
|
msg = obj.message;
|
|
} else if (contents && contents.length > 0) {
|
|
msg = contents;
|
|
} else {
|
|
msg = `Failed request: (${statusCode})`;
|
|
}
|
|
const err = new HttpClientError(msg, statusCode);
|
|
err.result = response.result;
|
|
reject(err);
|
|
} else {
|
|
resolve(response);
|
|
}
|
|
}));
|
|
});
|
|
}
|
|
};
|
|
exports.HttpClient = HttpClient;
|
|
var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_auth = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
function adopt(value) {
|
|
return value instanceof P ? value : new P(function(resolve) {
|
|
resolve(value);
|
|
});
|
|
}
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
|
|
var BasicCredentialHandler = class {
|
|
constructor(username, password) {
|
|
this.username = username;
|
|
this.password = password;
|
|
}
|
|
prepareRequest(options) {
|
|
if (!options.headers) {
|
|
throw Error("The request has no headers");
|
|
}
|
|
options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`;
|
|
}
|
|
canHandleAuthentication() {
|
|
return false;
|
|
}
|
|
handleAuthentication() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
throw new Error("not implemented");
|
|
});
|
|
}
|
|
};
|
|
exports.BasicCredentialHandler = BasicCredentialHandler;
|
|
var BearerCredentialHandler = class {
|
|
constructor(token) {
|
|
this.token = token;
|
|
}
|
|
prepareRequest(options) {
|
|
if (!options.headers) {
|
|
throw Error("The request has no headers");
|
|
}
|
|
options.headers["Authorization"] = `Bearer ${this.token}`;
|
|
}
|
|
canHandleAuthentication() {
|
|
return false;
|
|
}
|
|
handleAuthentication() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
throw new Error("not implemented");
|
|
});
|
|
}
|
|
};
|
|
exports.BearerCredentialHandler = BearerCredentialHandler;
|
|
var PersonalAccessTokenCredentialHandler = class {
|
|
constructor(token) {
|
|
this.token = token;
|
|
}
|
|
prepareRequest(options) {
|
|
if (!options.headers) {
|
|
throw Error("The request has no headers");
|
|
}
|
|
options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`;
|
|
}
|
|
canHandleAuthentication() {
|
|
return false;
|
|
}
|
|
handleAuthentication() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
throw new Error("not implemented");
|
|
});
|
|
}
|
|
};
|
|
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_oidc_utils = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
function adopt(value) {
|
|
return value instanceof P ? value : new P(function(resolve) {
|
|
resolve(value);
|
|
});
|
|
}
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.OidcClient = void 0;
|
|
var http_client_1 = require_lib();
|
|
var auth_1 = require_auth();
|
|
var core_1 = require_core();
|
|
var OidcClient = class {
|
|
static createHttpClient(allowRetry = true, maxRetry = 10) {
|
|
const requestOptions = {
|
|
allowRetries: allowRetry,
|
|
maxRetries: maxRetry
|
|
};
|
|
return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
|
|
}
|
|
static getRequestToken() {
|
|
const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];
|
|
if (!token) {
|
|
throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");
|
|
}
|
|
return token;
|
|
}
|
|
static getIDTokenUrl() {
|
|
const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];
|
|
if (!runtimeUrl) {
|
|
throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");
|
|
}
|
|
return runtimeUrl;
|
|
}
|
|
static getCall(id_token_url) {
|
|
var _a;
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const httpclient = OidcClient.createHttpClient();
|
|
const res = yield httpclient.getJson(id_token_url).catch((error) => {
|
|
throw new Error(`Failed to get ID Token.
|
|
|
|
Error Code : ${error.statusCode}
|
|
|
|
Error Message: ${error.message}`);
|
|
});
|
|
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
|
if (!id_token) {
|
|
throw new Error("Response json body do not have ID Token field");
|
|
}
|
|
return id_token;
|
|
});
|
|
}
|
|
static getIDToken(audience) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
try {
|
|
let id_token_url = OidcClient.getIDTokenUrl();
|
|
if (audience) {
|
|
const encodedAudience = encodeURIComponent(audience);
|
|
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
|
|
}
|
|
core_1.debug(`ID token url is ${id_token_url}`);
|
|
const id_token = yield OidcClient.getCall(id_token_url);
|
|
core_1.setSecret(id_token);
|
|
return id_token;
|
|
} catch (error) {
|
|
throw new Error(`Error message: ${error.message}`);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
exports.OidcClient = OidcClient;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_summary = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
function adopt(value) {
|
|
return value instanceof P ? value : new P(function(resolve) {
|
|
resolve(value);
|
|
});
|
|
}
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
|
|
var os_1 = __require("os");
|
|
var fs_1 = __require("fs");
|
|
var { access, appendFile, writeFile: writeFile2 } = fs_1.promises;
|
|
exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY";
|
|
exports.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";
|
|
var Summary = class {
|
|
constructor() {
|
|
this._buffer = "";
|
|
}
|
|
filePath() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
if (this._filePath) {
|
|
return this._filePath;
|
|
}
|
|
const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
|
|
if (!pathFromEnv) {
|
|
throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
|
|
}
|
|
try {
|
|
yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
|
|
} catch (_a) {
|
|
throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
|
|
}
|
|
this._filePath = pathFromEnv;
|
|
return this._filePath;
|
|
});
|
|
}
|
|
wrap(tag, content, attrs = {}) {
|
|
const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join("");
|
|
if (!content) {
|
|
return `<${tag}${htmlAttrs}>`;
|
|
}
|
|
return `<${tag}${htmlAttrs}>${content}</${tag}>`;
|
|
}
|
|
write(options) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
|
|
const filePath = yield this.filePath();
|
|
const writeFunc = overwrite ? writeFile2 : appendFile;
|
|
yield writeFunc(filePath, this._buffer, { encoding: "utf8" });
|
|
return this.emptyBuffer();
|
|
});
|
|
}
|
|
clear() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return this.emptyBuffer().write({ overwrite: true });
|
|
});
|
|
}
|
|
stringify() {
|
|
return this._buffer;
|
|
}
|
|
isEmptyBuffer() {
|
|
return this._buffer.length === 0;
|
|
}
|
|
emptyBuffer() {
|
|
this._buffer = "";
|
|
return this;
|
|
}
|
|
addRaw(text, addEOL = false) {
|
|
this._buffer += text;
|
|
return addEOL ? this.addEOL() : this;
|
|
}
|
|
addEOL() {
|
|
return this.addRaw(os_1.EOL);
|
|
}
|
|
addCodeBlock(code, lang) {
|
|
const attrs = Object.assign({}, lang && { lang });
|
|
const element = this.wrap("pre", this.wrap("code", code), attrs);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addList(items, ordered = false) {
|
|
const tag = ordered ? "ol" : "ul";
|
|
const listItems = items.map((item) => this.wrap("li", item)).join("");
|
|
const element = this.wrap(tag, listItems);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addTable(rows) {
|
|
const tableBody = rows.map((row) => {
|
|
const cells = row.map((cell) => {
|
|
if (typeof cell === "string") {
|
|
return this.wrap("td", cell);
|
|
}
|
|
const { header, data, colspan, rowspan } = cell;
|
|
const tag = header ? "th" : "td";
|
|
const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan });
|
|
return this.wrap(tag, data, attrs);
|
|
}).join("");
|
|
return this.wrap("tr", cells);
|
|
}).join("");
|
|
const element = this.wrap("table", tableBody);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addDetails(label, content) {
|
|
const element = this.wrap("details", this.wrap("summary", label) + content);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addImage(src, alt, options) {
|
|
const { width, height } = options || {};
|
|
const attrs = Object.assign(Object.assign({}, width && { width }), height && { height });
|
|
const element = this.wrap("img", null, Object.assign({ src, alt }, attrs));
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addHeading(text, level) {
|
|
const tag = `h${level}`;
|
|
const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1";
|
|
const element = this.wrap(allowedTag, text);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addSeparator() {
|
|
const element = this.wrap("hr", null);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addBreak() {
|
|
const element = this.wrap("br", null);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addQuote(text, cite) {
|
|
const attrs = Object.assign({}, cite && { cite });
|
|
const element = this.wrap("blockquote", text, attrs);
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
addLink(text, href) {
|
|
const element = this.wrap("a", text, { href });
|
|
return this.addRaw(element).addEOL();
|
|
}
|
|
};
|
|
var _summary = new Summary();
|
|
exports.markdownSummary = _summary;
|
|
exports.summary = _summary;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_path_utils = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
return m[k];
|
|
} });
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
|
|
var path = __importStar(__require("path"));
|
|
function toPosixPath(pth) {
|
|
return pth.replace(/[\\]/g, "/");
|
|
}
|
|
exports.toPosixPath = toPosixPath;
|
|
function toWin32Path(pth) {
|
|
return pth.replace(/[/]/g, "\\");
|
|
}
|
|
exports.toWin32Path = toWin32Path;
|
|
function toPlatformPath(pth) {
|
|
return pth.replace(/[/\\]/g, path.sep);
|
|
}
|
|
exports.toPlatformPath = toPlatformPath;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_core = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
return m[k];
|
|
} });
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
function adopt(value) {
|
|
return value instanceof P ? value : new P(function(resolve) {
|
|
resolve(value);
|
|
});
|
|
}
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
|
|
var command_1 = require_command();
|
|
var file_command_1 = require_file_command();
|
|
var utils_1 = require_utils();
|
|
var os3 = __importStar(__require("os"));
|
|
var path = __importStar(__require("path"));
|
|
var oidc_utils_1 = require_oidc_utils();
|
|
var ExitCode;
|
|
(function(ExitCode2) {
|
|
ExitCode2[ExitCode2["Success"] = 0] = "Success";
|
|
ExitCode2[ExitCode2["Failure"] = 1] = "Failure";
|
|
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
|
|
function exportVariable(name, val) {
|
|
const convertedVal = utils_1.toCommandValue(val);
|
|
process.env[name] = convertedVal;
|
|
const filePath = process.env["GITHUB_ENV"] || "";
|
|
if (filePath) {
|
|
return file_command_1.issueFileCommand("ENV", file_command_1.prepareKeyValueMessage(name, val));
|
|
}
|
|
command_1.issueCommand("set-env", { name }, convertedVal);
|
|
}
|
|
exports.exportVariable = exportVariable;
|
|
function setSecret2(secret) {
|
|
command_1.issueCommand("add-mask", {}, secret);
|
|
}
|
|
exports.setSecret = setSecret2;
|
|
function addPath(inputPath) {
|
|
const filePath = process.env["GITHUB_PATH"] || "";
|
|
if (filePath) {
|
|
file_command_1.issueFileCommand("PATH", inputPath);
|
|
} else {
|
|
command_1.issueCommand("add-path", {}, inputPath);
|
|
}
|
|
process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`;
|
|
}
|
|
exports.addPath = addPath;
|
|
function getInput3(name, options) {
|
|
const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || "";
|
|
if (options && options.required && !val) {
|
|
throw new Error(`Input required and not supplied: ${name}`);
|
|
}
|
|
if (options && options.trimWhitespace === false) {
|
|
return val;
|
|
}
|
|
return val.trim();
|
|
}
|
|
exports.getInput = getInput3;
|
|
function getMultilineInput(name, options) {
|
|
const inputs = getInput3(name, options).split("\n").filter((x) => x !== "");
|
|
if (options && options.trimWhitespace === false) {
|
|
return inputs;
|
|
}
|
|
return inputs.map((input) => input.trim());
|
|
}
|
|
exports.getMultilineInput = getMultilineInput;
|
|
function getBooleanInput(name, options) {
|
|
const trueValue = ["true", "True", "TRUE"];
|
|
const falseValue = ["false", "False", "FALSE"];
|
|
const val = getInput3(name, options);
|
|
if (trueValue.includes(val))
|
|
return true;
|
|
if (falseValue.includes(val))
|
|
return false;
|
|
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}
|
|
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
|
}
|
|
exports.getBooleanInput = getBooleanInput;
|
|
function setOutput(name, value) {
|
|
const filePath = process.env["GITHUB_OUTPUT"] || "";
|
|
if (filePath) {
|
|
return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value));
|
|
}
|
|
process.stdout.write(os3.EOL);
|
|
command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value));
|
|
}
|
|
exports.setOutput = setOutput;
|
|
function setCommandEcho(enabled) {
|
|
command_1.issue("echo", enabled ? "on" : "off");
|
|
}
|
|
exports.setCommandEcho = setCommandEcho;
|
|
function setFailed2(message) {
|
|
process.exitCode = ExitCode.Failure;
|
|
error(message);
|
|
}
|
|
exports.setFailed = setFailed2;
|
|
function isDebug() {
|
|
return process.env["RUNNER_DEBUG"] === "1";
|
|
}
|
|
exports.isDebug = isDebug;
|
|
function debug(message) {
|
|
command_1.issueCommand("debug", {}, message);
|
|
}
|
|
exports.debug = debug;
|
|
function error(message, properties = {}) {
|
|
command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
}
|
|
exports.error = error;
|
|
function warning(message, properties = {}) {
|
|
command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
}
|
|
exports.warning = warning;
|
|
function notice(message, properties = {}) {
|
|
command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
|
|
}
|
|
exports.notice = notice;
|
|
function info(message) {
|
|
process.stdout.write(message + os3.EOL);
|
|
}
|
|
exports.info = info;
|
|
function startGroup(name) {
|
|
command_1.issue("group", name);
|
|
}
|
|
exports.startGroup = startGroup;
|
|
function endGroup() {
|
|
command_1.issue("endgroup");
|
|
}
|
|
exports.endGroup = endGroup;
|
|
function group(name, fn) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
startGroup(name);
|
|
let result;
|
|
try {
|
|
result = yield fn();
|
|
} finally {
|
|
endGroup();
|
|
}
|
|
return result;
|
|
});
|
|
}
|
|
exports.group = group;
|
|
function saveState(name, value) {
|
|
const filePath = process.env["GITHUB_STATE"] || "";
|
|
if (filePath) {
|
|
return file_command_1.issueFileCommand("STATE", file_command_1.prepareKeyValueMessage(name, value));
|
|
}
|
|
command_1.issueCommand("save-state", { name }, utils_1.toCommandValue(value));
|
|
}
|
|
exports.saveState = saveState;
|
|
function getState(name) {
|
|
return process.env[`STATE_${name}`] || "";
|
|
}
|
|
exports.getState = getState;
|
|
function getIDToken(aud) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return yield oidc_utils_1.OidcClient.getIDToken(aud);
|
|
});
|
|
}
|
|
exports.getIDToken = getIDToken;
|
|
var summary_1 = require_summary();
|
|
Object.defineProperty(exports, "summary", { enumerable: true, get: function() {
|
|
return summary_1.summary;
|
|
} });
|
|
var summary_2 = require_summary();
|
|
Object.defineProperty(exports, "markdownSummary", { enumerable: true, get: function() {
|
|
return summary_2.markdownSummary;
|
|
} });
|
|
var path_utils_1 = require_path_utils();
|
|
Object.defineProperty(exports, "toPosixPath", { enumerable: true, get: function() {
|
|
return path_utils_1.toPosixPath;
|
|
} });
|
|
Object.defineProperty(exports, "toWin32Path", { enumerable: true, get: function() {
|
|
return path_utils_1.toWin32Path;
|
|
} });
|
|
Object.defineProperty(exports, "toPlatformPath", { enumerable: true, get: function() {
|
|
return path_utils_1.toPlatformPath;
|
|
} });
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_context = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Context = void 0;
|
|
var fs_1 = __require("fs");
|
|
var os_1 = __require("os");
|
|
var Context = class {
|
|
constructor() {
|
|
var _a, _b, _c;
|
|
this.payload = {};
|
|
if (process.env.GITHUB_EVENT_PATH) {
|
|
if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
|
|
this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" }));
|
|
} else {
|
|
const path = process.env.GITHUB_EVENT_PATH;
|
|
process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
|
|
}
|
|
}
|
|
this.eventName = process.env.GITHUB_EVENT_NAME;
|
|
this.sha = process.env.GITHUB_SHA;
|
|
this.ref = process.env.GITHUB_REF;
|
|
this.workflow = process.env.GITHUB_WORKFLOW;
|
|
this.action = process.env.GITHUB_ACTION;
|
|
this.actor = process.env.GITHUB_ACTOR;
|
|
this.job = process.env.GITHUB_JOB;
|
|
this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
|
|
this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
|
|
this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
|
|
this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
|
|
this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
|
|
}
|
|
get issue() {
|
|
const payload = this.payload;
|
|
return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
|
|
}
|
|
get repo() {
|
|
if (process.env.GITHUB_REPOSITORY) {
|
|
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
|
|
return { owner, repo };
|
|
}
|
|
if (this.payload.repository) {
|
|
return {
|
|
owner: this.payload.repository.owner.login,
|
|
repo: this.payload.repository.name
|
|
};
|
|
}
|
|
throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
|
|
}
|
|
};
|
|
exports.Context = Context;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_utils2 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() {
|
|
return m[k];
|
|
} };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
function adopt(value) {
|
|
return value instanceof P ? value : new P(function(resolve) {
|
|
resolve(value);
|
|
});
|
|
}
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
|
|
var httpClient = __importStar(require_lib());
|
|
var undici_1 = __require("undici");
|
|
function getAuthString(token, options) {
|
|
if (!token && !options.auth) {
|
|
throw new Error("Parameter token or opts.auth is required");
|
|
} else if (token && options.auth) {
|
|
throw new Error("Parameters token and opts.auth may not both be specified");
|
|
}
|
|
return typeof options.auth === "string" ? options.auth : `token ${token}`;
|
|
}
|
|
exports.getAuthString = getAuthString;
|
|
function getProxyAgent(destinationUrl) {
|
|
const hc = new httpClient.HttpClient();
|
|
return hc.getAgent(destinationUrl);
|
|
}
|
|
exports.getProxyAgent = getProxyAgent;
|
|
function getProxyAgentDispatcher(destinationUrl) {
|
|
const hc = new httpClient.HttpClient();
|
|
return hc.getAgentDispatcher(destinationUrl);
|
|
}
|
|
exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
|
|
function getProxyFetch(destinationUrl) {
|
|
const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
|
|
const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
|
|
});
|
|
return proxyFetch;
|
|
}
|
|
exports.getProxyFetch = getProxyFetch;
|
|
function getApiBaseUrl() {
|
|
return process.env["GITHUB_API_URL"] || "https://api.github.com";
|
|
}
|
|
exports.getApiBaseUrl = getApiBaseUrl;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function getUserAgent() {
|
|
if (typeof navigator === "object" && "userAgent" in navigator) {
|
|
return navigator.userAgent;
|
|
}
|
|
if (typeof process === "object" && process.version !== void 0) {
|
|
return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
|
|
}
|
|
return "<environment undetectable>";
|
|
}
|
|
exports.getUserAgent = getUserAgent;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_register = __commonJS({
|
|
""(exports, module) {
|
|
module.exports = register;
|
|
function register(state, name, method, options) {
|
|
if (typeof method !== "function") {
|
|
throw new Error("method for before hook must be a function");
|
|
}
|
|
if (!options) {
|
|
options = {};
|
|
}
|
|
if (Array.isArray(name)) {
|
|
return name.reverse().reduce(function(callback, name2) {
|
|
return register.bind(null, state, name2, callback, options);
|
|
}, method)();
|
|
}
|
|
return Promise.resolve().then(function() {
|
|
if (!state.registry[name]) {
|
|
return method(options);
|
|
}
|
|
return state.registry[name].reduce(function(method2, registered) {
|
|
return registered.hook.bind(null, method2, options);
|
|
}, method)();
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_add = __commonJS({
|
|
""(exports, module) {
|
|
module.exports = addHook;
|
|
function addHook(state, kind, name, hook) {
|
|
var orig = hook;
|
|
if (!state.registry[name]) {
|
|
state.registry[name] = [];
|
|
}
|
|
if (kind === "before") {
|
|
hook = function(method, options) {
|
|
return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options));
|
|
};
|
|
}
|
|
if (kind === "after") {
|
|
hook = function(method, options) {
|
|
var result;
|
|
return Promise.resolve().then(method.bind(null, options)).then(function(result_) {
|
|
result = result_;
|
|
return orig(result, options);
|
|
}).then(function() {
|
|
return result;
|
|
});
|
|
};
|
|
}
|
|
if (kind === "error") {
|
|
hook = function(method, options) {
|
|
return Promise.resolve().then(method.bind(null, options)).catch(function(error) {
|
|
return orig(error, options);
|
|
});
|
|
};
|
|
}
|
|
state.registry[name].push({
|
|
hook,
|
|
orig
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_remove = __commonJS({
|
|
""(exports, module) {
|
|
module.exports = removeHook;
|
|
function removeHook(state, name, method) {
|
|
if (!state.registry[name]) {
|
|
return;
|
|
}
|
|
var index = state.registry[name].map(function(registered) {
|
|
return registered.orig;
|
|
}).indexOf(method);
|
|
if (index === -1) {
|
|
return;
|
|
}
|
|
state.registry[name].splice(index, 1);
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_before_after_hook = __commonJS({
|
|
""(exports, module) {
|
|
var register = require_register();
|
|
var addHook = require_add();
|
|
var removeHook = require_remove();
|
|
var bind = Function.bind;
|
|
var bindable = bind.bind(bind);
|
|
function bindApi(hook, state, name) {
|
|
var removeHookRef = bindable(removeHook, null).apply(
|
|
null,
|
|
name ? [state, name] : [state]
|
|
);
|
|
hook.api = { remove: removeHookRef };
|
|
hook.remove = removeHookRef;
|
|
["before", "error", "after", "wrap"].forEach(function(kind) {
|
|
var args = name ? [state, kind, name] : [state, kind];
|
|
hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
|
|
});
|
|
}
|
|
function HookSingular() {
|
|
var singularHookName = "h";
|
|
var singularHookState = {
|
|
registry: {}
|
|
};
|
|
var singularHook = register.bind(null, singularHookState, singularHookName);
|
|
bindApi(singularHook, singularHookState, singularHookName);
|
|
return singularHook;
|
|
}
|
|
function HookCollection() {
|
|
var state = {
|
|
registry: {}
|
|
};
|
|
var hook = register.bind(null, state);
|
|
bindApi(hook, state);
|
|
return hook;
|
|
}
|
|
var collectionHookDeprecationMessageDisplayed = false;
|
|
function Hook() {
|
|
if (!collectionHookDeprecationMessageDisplayed) {
|
|
console.warn(
|
|
'[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
|
|
);
|
|
collectionHookDeprecationMessageDisplayed = true;
|
|
}
|
|
return HookCollection();
|
|
}
|
|
Hook.Singular = HookSingular.bind();
|
|
Hook.Collection = HookCollection.bind();
|
|
module.exports = Hook;
|
|
module.exports.Hook = Hook;
|
|
module.exports.Singular = Hook.Singular;
|
|
module.exports.Collection = Hook.Collection;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node2 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
endpoint: () => endpoint
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var import_universal_user_agent = require_dist_node();
|
|
var VERSION = "9.0.5";
|
|
var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
|
|
var DEFAULTS = {
|
|
method: "GET",
|
|
baseUrl: "https://api.github.com",
|
|
headers: {
|
|
accept: "application/vnd.github.v3+json",
|
|
"user-agent": userAgent
|
|
},
|
|
mediaType: {
|
|
format: ""
|
|
}
|
|
};
|
|
function lowercaseKeys(object) {
|
|
if (!object) {
|
|
return {};
|
|
}
|
|
return Object.keys(object).reduce((newObj, key) => {
|
|
newObj[key.toLowerCase()] = object[key];
|
|
return newObj;
|
|
}, {});
|
|
}
|
|
function isPlainObject(value) {
|
|
if (typeof value !== "object" || value === null)
|
|
return false;
|
|
if (Object.prototype.toString.call(value) !== "[object Object]")
|
|
return false;
|
|
const proto2 = Object.getPrototypeOf(value);
|
|
if (proto2 === null)
|
|
return true;
|
|
const Ctor = Object.prototype.hasOwnProperty.call(proto2, "constructor") && proto2.constructor;
|
|
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
}
|
|
function mergeDeep(defaults, options) {
|
|
const result = Object.assign({}, defaults);
|
|
Object.keys(options).forEach((key) => {
|
|
if (isPlainObject(options[key])) {
|
|
if (!(key in defaults))
|
|
Object.assign(result, { [key]: options[key] });
|
|
else
|
|
result[key] = mergeDeep(defaults[key], options[key]);
|
|
} else {
|
|
Object.assign(result, { [key]: options[key] });
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
function removeUndefinedProperties(obj) {
|
|
for (const key in obj) {
|
|
if (obj[key] === void 0) {
|
|
delete obj[key];
|
|
}
|
|
}
|
|
return obj;
|
|
}
|
|
function merge(defaults, route, options) {
|
|
var _a;
|
|
if (typeof route === "string") {
|
|
let [method, url] = route.split(" ");
|
|
options = Object.assign(url ? { method, url } : { url: method }, options);
|
|
} else {
|
|
options = Object.assign({}, route);
|
|
}
|
|
options.headers = lowercaseKeys(options.headers);
|
|
removeUndefinedProperties(options);
|
|
removeUndefinedProperties(options.headers);
|
|
const mergedOptions = mergeDeep(defaults || {}, options);
|
|
if (options.url === "/graphql") {
|
|
if (defaults && ((_a = defaults.mediaType.previews) == null ? void 0 : _a.length)) {
|
|
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
|
|
(preview) => !mergedOptions.mediaType.previews.includes(preview)
|
|
).concat(mergedOptions.mediaType.previews);
|
|
}
|
|
mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
|
|
}
|
|
return mergedOptions;
|
|
}
|
|
function addQueryParameters(url, parameters) {
|
|
const separator = /\?/.test(url) ? "&" : "?";
|
|
const names = Object.keys(parameters);
|
|
if (names.length === 0) {
|
|
return url;
|
|
}
|
|
return url + separator + names.map((name) => {
|
|
if (name === "q") {
|
|
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
|
|
}
|
|
return `${name}=${encodeURIComponent(parameters[name])}`;
|
|
}).join("&");
|
|
}
|
|
var urlVariableRegex = /\{[^}]+\}/g;
|
|
function removeNonChars(variableName) {
|
|
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
|
|
}
|
|
function extractUrlVariableNames(url) {
|
|
const matches = url.match(urlVariableRegex);
|
|
if (!matches) {
|
|
return [];
|
|
}
|
|
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
|
}
|
|
function omit(object, keysToOmit) {
|
|
const result = { __proto__: null };
|
|
for (const key of Object.keys(object)) {
|
|
if (keysToOmit.indexOf(key) === -1) {
|
|
result[key] = object[key];
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function encodeReserved(str) {
|
|
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
|
|
if (!/%[0-9A-Fa-f]/.test(part)) {
|
|
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
}
|
|
return part;
|
|
}).join("");
|
|
}
|
|
function encodeUnreserved(str) {
|
|
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
|
|
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
});
|
|
}
|
|
function encodeValue(operator, value, key) {
|
|
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
|
|
if (key) {
|
|
return encodeUnreserved(key) + "=" + value;
|
|
} else {
|
|
return value;
|
|
}
|
|
}
|
|
function isDefined(value) {
|
|
return value !== void 0 && value !== null;
|
|
}
|
|
function isKeyOperator(operator) {
|
|
return operator === ";" || operator === "&" || operator === "?";
|
|
}
|
|
function getValues(context2, operator, key, modifier) {
|
|
var value = context2[key], result = [];
|
|
if (isDefined(value) && value !== "") {
|
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
value = value.toString();
|
|
if (modifier && modifier !== "*") {
|
|
value = value.substring(0, parseInt(modifier, 10));
|
|
}
|
|
result.push(
|
|
encodeValue(operator, value, isKeyOperator(operator) ? key : "")
|
|
);
|
|
} else {
|
|
if (modifier === "*") {
|
|
if (Array.isArray(value)) {
|
|
value.filter(isDefined).forEach(function(value2) {
|
|
result.push(
|
|
encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
|
|
);
|
|
});
|
|
} else {
|
|
Object.keys(value).forEach(function(k) {
|
|
if (isDefined(value[k])) {
|
|
result.push(encodeValue(operator, value[k], k));
|
|
}
|
|
});
|
|
}
|
|
} else {
|
|
const tmp = [];
|
|
if (Array.isArray(value)) {
|
|
value.filter(isDefined).forEach(function(value2) {
|
|
tmp.push(encodeValue(operator, value2));
|
|
});
|
|
} else {
|
|
Object.keys(value).forEach(function(k) {
|
|
if (isDefined(value[k])) {
|
|
tmp.push(encodeUnreserved(k));
|
|
tmp.push(encodeValue(operator, value[k].toString()));
|
|
}
|
|
});
|
|
}
|
|
if (isKeyOperator(operator)) {
|
|
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
|
} else if (tmp.length !== 0) {
|
|
result.push(tmp.join(","));
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (operator === ";") {
|
|
if (isDefined(value)) {
|
|
result.push(encodeUnreserved(key));
|
|
}
|
|
} else if (value === "" && (operator === "&" || operator === "?")) {
|
|
result.push(encodeUnreserved(key) + "=");
|
|
} else if (value === "") {
|
|
result.push("");
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function parseUrl(template) {
|
|
return {
|
|
expand: expand.bind(null, template)
|
|
};
|
|
}
|
|
function expand(template, context2) {
|
|
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
|
template = template.replace(
|
|
/\{([^\{\}]+)\}|([^\{\}]+)/g,
|
|
function(_, expression, literal) {
|
|
if (expression) {
|
|
let operator = "";
|
|
const values = [];
|
|
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
|
operator = expression.charAt(0);
|
|
expression = expression.substr(1);
|
|
}
|
|
expression.split(/,/g).forEach(function(variable) {
|
|
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
|
values.push(getValues(context2, operator, tmp[1], tmp[2] || tmp[3]));
|
|
});
|
|
if (operator && operator !== "+") {
|
|
var separator = ",";
|
|
if (operator === "?") {
|
|
separator = "&";
|
|
} else if (operator !== "#") {
|
|
separator = operator;
|
|
}
|
|
return (values.length !== 0 ? operator : "") + values.join(separator);
|
|
} else {
|
|
return values.join(",");
|
|
}
|
|
} else {
|
|
return encodeReserved(literal);
|
|
}
|
|
}
|
|
);
|
|
if (template === "/") {
|
|
return template;
|
|
} else {
|
|
return template.replace(/\/$/, "");
|
|
}
|
|
}
|
|
function parse(options) {
|
|
var _a;
|
|
let method = options.method.toUpperCase();
|
|
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
let headers = Object.assign({}, options.headers);
|
|
let body;
|
|
let parameters = omit(options, [
|
|
"method",
|
|
"baseUrl",
|
|
"url",
|
|
"headers",
|
|
"request",
|
|
"mediaType"
|
|
]);
|
|
const urlVariableNames = extractUrlVariableNames(url);
|
|
url = parseUrl(url).expand(parameters);
|
|
if (!/^http/.test(url)) {
|
|
url = options.baseUrl + url;
|
|
}
|
|
const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
|
|
const remainingParameters = omit(parameters, omittedParameters);
|
|
const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
|
|
if (!isBinaryRequest) {
|
|
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(",");
|
|
}
|
|
if (url.endsWith("/graphql")) {
|
|
if ((_a = options.mediaType.previews) == null ? void 0 : _a.length) {
|
|
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
|
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
|
|
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
|
|
return `application/vnd.github.${preview}-preview${format}`;
|
|
}).join(",");
|
|
}
|
|
}
|
|
}
|
|
if (["GET", "HEAD"].includes(method)) {
|
|
url = addQueryParameters(url, remainingParameters);
|
|
} else {
|
|
if ("data" in remainingParameters) {
|
|
body = remainingParameters.data;
|
|
} else {
|
|
if (Object.keys(remainingParameters).length) {
|
|
body = remainingParameters;
|
|
}
|
|
}
|
|
}
|
|
if (!headers["content-type"] && typeof body !== "undefined") {
|
|
headers["content-type"] = "application/json; charset=utf-8";
|
|
}
|
|
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
|
body = "";
|
|
}
|
|
return Object.assign(
|
|
{ method, url, headers },
|
|
typeof body !== "undefined" ? { body } : null,
|
|
options.request ? { request: options.request } : null
|
|
);
|
|
}
|
|
function endpointWithDefaults(defaults, route, options) {
|
|
return parse(merge(defaults, route, options));
|
|
}
|
|
function withDefaults(oldDefaults, newDefaults) {
|
|
const DEFAULTS2 = merge(oldDefaults, newDefaults);
|
|
const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
|
|
return Object.assign(endpoint2, {
|
|
DEFAULTS: DEFAULTS2,
|
|
defaults: withDefaults.bind(null, DEFAULTS2),
|
|
merge: merge.bind(null, DEFAULTS2),
|
|
parse
|
|
});
|
|
}
|
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node3 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var Deprecation = class extends Error {
|
|
constructor(message) {
|
|
super(message);
|
|
if (Error.captureStackTrace) {
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
this.name = "Deprecation";
|
|
}
|
|
};
|
|
exports.Deprecation = Deprecation;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_wrappy = __commonJS({
|
|
""(exports, module) {
|
|
module.exports = wrappy;
|
|
function wrappy(fn, cb) {
|
|
if (fn && cb)
|
|
return wrappy(fn)(cb);
|
|
if (typeof fn !== "function")
|
|
throw new TypeError("need wrapper function");
|
|
Object.keys(fn).forEach(function(k) {
|
|
wrapper[k] = fn[k];
|
|
});
|
|
return wrapper;
|
|
function wrapper() {
|
|
var args = new Array(arguments.length);
|
|
for (var i = 0; i < args.length; i++) {
|
|
args[i] = arguments[i];
|
|
}
|
|
var ret = fn.apply(this, args);
|
|
var cb2 = args[args.length - 1];
|
|
if (typeof ret === "function" && ret !== cb2) {
|
|
Object.keys(cb2).forEach(function(k) {
|
|
ret[k] = cb2[k];
|
|
});
|
|
}
|
|
return ret;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_once = __commonJS({
|
|
""(exports, module) {
|
|
var wrappy = require_wrappy();
|
|
module.exports = wrappy(once);
|
|
module.exports.strict = wrappy(onceStrict);
|
|
once.proto = once(function() {
|
|
Object.defineProperty(Function.prototype, "once", {
|
|
value: function() {
|
|
return once(this);
|
|
},
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Function.prototype, "onceStrict", {
|
|
value: function() {
|
|
return onceStrict(this);
|
|
},
|
|
configurable: true
|
|
});
|
|
});
|
|
function once(fn) {
|
|
var f = function() {
|
|
if (f.called)
|
|
return f.value;
|
|
f.called = true;
|
|
return f.value = fn.apply(this, arguments);
|
|
};
|
|
f.called = false;
|
|
return f;
|
|
}
|
|
function onceStrict(fn) {
|
|
var f = function() {
|
|
if (f.called)
|
|
throw new Error(f.onceError);
|
|
f.called = true;
|
|
return f.value = fn.apply(this, arguments);
|
|
};
|
|
var name = fn.name || "Function wrapped with `once`";
|
|
f.onceError = name + " shouldn't be called more than once";
|
|
f.called = false;
|
|
return f;
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node4 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __create2 = Object.create;
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __getProtoOf2 = Object.getPrototypeOf;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
mod
|
|
));
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
RequestError: () => RequestError
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var import_deprecation = require_dist_node3();
|
|
var import_once = __toESM2(require_once());
|
|
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
|
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
|
var RequestError = class extends Error {
|
|
constructor(message, statusCode, options) {
|
|
super(message);
|
|
if (Error.captureStackTrace) {
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
this.name = "HttpError";
|
|
this.status = statusCode;
|
|
let headers;
|
|
if ("headers" in options && typeof options.headers !== "undefined") {
|
|
headers = options.headers;
|
|
}
|
|
if ("response" in options) {
|
|
this.response = options.response;
|
|
headers = options.response.headers;
|
|
}
|
|
const requestCopy = Object.assign({}, options.request);
|
|
if (options.request.headers.authorization) {
|
|
requestCopy.headers = Object.assign({}, options.request.headers, {
|
|
authorization: options.request.headers.authorization.replace(
|
|
/ .*$/,
|
|
" [REDACTED]"
|
|
)
|
|
});
|
|
}
|
|
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
|
this.request = requestCopy;
|
|
Object.defineProperty(this, "code", {
|
|
get() {
|
|
logOnceCode(
|
|
new import_deprecation.Deprecation(
|
|
"[@octokit/request-error] `error.code` is deprecated, use `error.status`."
|
|
)
|
|
);
|
|
return statusCode;
|
|
}
|
|
});
|
|
Object.defineProperty(this, "headers", {
|
|
get() {
|
|
logOnceHeaders(
|
|
new import_deprecation.Deprecation(
|
|
"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
|
|
)
|
|
);
|
|
return headers || {};
|
|
}
|
|
});
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node5 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
request: () => request
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var import_endpoint = require_dist_node2();
|
|
var import_universal_user_agent = require_dist_node();
|
|
var VERSION = "8.4.0";
|
|
function isPlainObject(value) {
|
|
if (typeof value !== "object" || value === null)
|
|
return false;
|
|
if (Object.prototype.toString.call(value) !== "[object Object]")
|
|
return false;
|
|
const proto2 = Object.getPrototypeOf(value);
|
|
if (proto2 === null)
|
|
return true;
|
|
const Ctor = Object.prototype.hasOwnProperty.call(proto2, "constructor") && proto2.constructor;
|
|
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
}
|
|
var import_request_error = require_dist_node4();
|
|
function getBufferResponse(response) {
|
|
return response.arrayBuffer();
|
|
}
|
|
function fetchWrapper(requestOptions) {
|
|
var _a, _b, _c, _d;
|
|
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
|
|
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
|
|
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
|
|
requestOptions.body = JSON.stringify(requestOptions.body);
|
|
}
|
|
let headers = {};
|
|
let status;
|
|
let url;
|
|
let { fetch: fetch2 } = globalThis;
|
|
if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
|
|
fetch2 = requestOptions.request.fetch;
|
|
}
|
|
if (!fetch2) {
|
|
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"
|
|
);
|
|
}
|
|
return fetch2(requestOptions.url, {
|
|
method: requestOptions.method,
|
|
body: requestOptions.body,
|
|
redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
|
|
headers: requestOptions.headers,
|
|
signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
|
|
...requestOptions.body && { duplex: "half" }
|
|
}).then(async (response) => {
|
|
url = response.url;
|
|
status = response.status;
|
|
for (const keyAndValue of response.headers) {
|
|
headers[keyAndValue[0]] = keyAndValue[1];
|
|
}
|
|
if ("deprecation" in headers) {
|
|
const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
|
|
const deprecationLink = matches && matches.pop();
|
|
log.warn(
|
|
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
|
|
);
|
|
}
|
|
if (status === 204 || status === 205) {
|
|
return;
|
|
}
|
|
if (requestOptions.method === "HEAD") {
|
|
if (status < 400) {
|
|
return;
|
|
}
|
|
throw new import_request_error.RequestError(response.statusText, status, {
|
|
response: {
|
|
url,
|
|
status,
|
|
headers,
|
|
data: void 0
|
|
},
|
|
request: requestOptions
|
|
});
|
|
}
|
|
if (status === 304) {
|
|
throw new import_request_error.RequestError("Not modified", status, {
|
|
response: {
|
|
url,
|
|
status,
|
|
headers,
|
|
data: await getResponseData(response)
|
|
},
|
|
request: requestOptions
|
|
});
|
|
}
|
|
if (status >= 400) {
|
|
const data = await getResponseData(response);
|
|
const error = new import_request_error.RequestError(toErrorMessage(data), status, {
|
|
response: {
|
|
url,
|
|
status,
|
|
headers,
|
|
data
|
|
},
|
|
request: requestOptions
|
|
});
|
|
throw error;
|
|
}
|
|
return parseSuccessResponseBody ? await getResponseData(response) : response.body;
|
|
}).then((data) => {
|
|
return {
|
|
status,
|
|
url,
|
|
headers,
|
|
data
|
|
};
|
|
}).catch((error) => {
|
|
if (error instanceof import_request_error.RequestError)
|
|
throw error;
|
|
else if (error.name === "AbortError")
|
|
throw error;
|
|
let message = error.message;
|
|
if (error.name === "TypeError" && "cause" in error) {
|
|
if (error.cause instanceof Error) {
|
|
message = error.cause.message;
|
|
} else if (typeof error.cause === "string") {
|
|
message = error.cause;
|
|
}
|
|
}
|
|
throw new import_request_error.RequestError(message, 500, {
|
|
request: requestOptions
|
|
});
|
|
});
|
|
}
|
|
async function getResponseData(response) {
|
|
const contentType = response.headers.get("content-type");
|
|
if (/application\/json/.test(contentType)) {
|
|
return response.json().catch(() => response.text()).catch(() => "");
|
|
}
|
|
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
|
|
return response.text();
|
|
}
|
|
return getBufferResponse(response);
|
|
}
|
|
function toErrorMessage(data) {
|
|
if (typeof data === "string")
|
|
return data;
|
|
let suffix;
|
|
if ("documentation_url" in data) {
|
|
suffix = ` - ${data.documentation_url}`;
|
|
} else {
|
|
suffix = "";
|
|
}
|
|
if ("message" in data) {
|
|
if (Array.isArray(data.errors)) {
|
|
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
|
|
}
|
|
return `${data.message}${suffix}`;
|
|
}
|
|
return `Unknown error: ${JSON.stringify(data)}`;
|
|
}
|
|
function withDefaults(oldEndpoint, newDefaults) {
|
|
const endpoint2 = oldEndpoint.defaults(newDefaults);
|
|
const newApi = function(route, parameters) {
|
|
const endpointOptions = endpoint2.merge(route, parameters);
|
|
if (!endpointOptions.request || !endpointOptions.request.hook) {
|
|
return fetchWrapper(endpoint2.parse(endpointOptions));
|
|
}
|
|
const request2 = (route2, parameters2) => {
|
|
return fetchWrapper(
|
|
endpoint2.parse(endpoint2.merge(route2, parameters2))
|
|
);
|
|
};
|
|
Object.assign(request2, {
|
|
endpoint: endpoint2,
|
|
defaults: withDefaults.bind(null, endpoint2)
|
|
});
|
|
return endpointOptions.request.hook(request2, endpointOptions);
|
|
};
|
|
return Object.assign(newApi, {
|
|
endpoint: endpoint2,
|
|
defaults: withDefaults.bind(null, endpoint2)
|
|
});
|
|
}
|
|
var request = withDefaults(import_endpoint.endpoint, {
|
|
headers: {
|
|
"user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node6 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
GraphqlResponseError: () => GraphqlResponseError,
|
|
graphql: () => graphql2,
|
|
withCustomRequest: () => withCustomRequest
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var import_request3 = require_dist_node5();
|
|
var import_universal_user_agent = require_dist_node();
|
|
var VERSION = "7.1.0";
|
|
var import_request2 = require_dist_node5();
|
|
var import_request = require_dist_node5();
|
|
function _buildMessageForResponseErrors(data) {
|
|
return `Request failed due to following response errors:
|
|
` + data.errors.map((e) => ` - ${e.message}`).join("\n");
|
|
}
|
|
var GraphqlResponseError = class extends Error {
|
|
constructor(request2, headers, response) {
|
|
super(_buildMessageForResponseErrors(response));
|
|
this.request = request2;
|
|
this.headers = headers;
|
|
this.response = response;
|
|
this.name = "GraphqlResponseError";
|
|
this.errors = response.errors;
|
|
this.data = response.data;
|
|
if (Error.captureStackTrace) {
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
}
|
|
};
|
|
var NON_VARIABLE_OPTIONS = [
|
|
"method",
|
|
"baseUrl",
|
|
"url",
|
|
"headers",
|
|
"request",
|
|
"query",
|
|
"mediaType"
|
|
];
|
|
var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
|
|
var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
|
function graphql(request2, query2, options) {
|
|
if (options) {
|
|
if (typeof query2 === "string" && "query" in options) {
|
|
return Promise.reject(
|
|
new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
|
|
);
|
|
}
|
|
for (const key in options) {
|
|
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
|
|
continue;
|
|
return Promise.reject(
|
|
new Error(
|
|
`[@octokit/graphql] "${key}" cannot be used as variable name`
|
|
)
|
|
);
|
|
}
|
|
}
|
|
const parsedOptions = typeof query2 === "string" ? Object.assign({ query: query2 }, options) : query2;
|
|
const requestOptions = Object.keys(
|
|
parsedOptions
|
|
).reduce((result, key) => {
|
|
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
|
result[key] = parsedOptions[key];
|
|
return result;
|
|
}
|
|
if (!result.variables) {
|
|
result.variables = {};
|
|
}
|
|
result.variables[key] = parsedOptions[key];
|
|
return result;
|
|
}, {});
|
|
const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
|
|
if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
|
|
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
|
|
}
|
|
return request2(requestOptions).then((response) => {
|
|
if (response.data.errors) {
|
|
const headers = {};
|
|
for (const key of Object.keys(response.headers)) {
|
|
headers[key] = response.headers[key];
|
|
}
|
|
throw new GraphqlResponseError(
|
|
requestOptions,
|
|
headers,
|
|
response.data
|
|
);
|
|
}
|
|
return response.data.data;
|
|
});
|
|
}
|
|
function withDefaults(request2, newDefaults) {
|
|
const newRequest = request2.defaults(newDefaults);
|
|
const newApi = (query2, options) => {
|
|
return graphql(newRequest, query2, options);
|
|
};
|
|
return Object.assign(newApi, {
|
|
defaults: withDefaults.bind(null, newRequest),
|
|
endpoint: newRequest.endpoint
|
|
});
|
|
}
|
|
var graphql2 = withDefaults(import_request3.request, {
|
|
headers: {
|
|
"user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
|
|
},
|
|
method: "POST",
|
|
url: "/graphql"
|
|
});
|
|
function withCustomRequest(customRequest) {
|
|
return withDefaults(customRequest, {
|
|
method: "POST",
|
|
url: "/graphql"
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node7 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
createTokenAuth: () => createTokenAuth
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
|
var REGEX_IS_INSTALLATION = /^ghs_/;
|
|
var REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
|
async function auth(token) {
|
|
const isApp = token.split(/\./).length === 3;
|
|
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
|
|
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
|
|
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
|
return {
|
|
type: "token",
|
|
token,
|
|
tokenType
|
|
};
|
|
}
|
|
function withAuthorizationPrefix(token) {
|
|
if (token.split(/\./).length === 3) {
|
|
return `bearer ${token}`;
|
|
}
|
|
return `token ${token}`;
|
|
}
|
|
async function hook(token, request, route, parameters) {
|
|
const endpoint = request.endpoint.merge(
|
|
route,
|
|
parameters
|
|
);
|
|
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
|
return request(endpoint);
|
|
}
|
|
var createTokenAuth = function createTokenAuth2(token) {
|
|
if (!token) {
|
|
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
|
}
|
|
if (typeof token !== "string") {
|
|
throw new Error(
|
|
"[@octokit/auth-token] Token passed to createTokenAuth is not a string"
|
|
);
|
|
}
|
|
token = token.replace(/^(token|bearer) +/i, "");
|
|
return Object.assign(auth.bind(null, token), {
|
|
hook: hook.bind(null, token)
|
|
});
|
|
};
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node8 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
Octokit: () => Octokit2
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var import_universal_user_agent = require_dist_node();
|
|
var import_before_after_hook = require_before_after_hook();
|
|
var import_request = require_dist_node5();
|
|
var import_graphql = require_dist_node6();
|
|
var import_auth_token = require_dist_node7();
|
|
var VERSION = "5.2.0";
|
|
var noop = () => {
|
|
};
|
|
var consoleWarn = console.warn.bind(console);
|
|
var consoleError = console.error.bind(console);
|
|
var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
|
|
var _a;
|
|
var Octokit2 = (_a = class {
|
|
static defaults(defaults) {
|
|
const OctokitWithDefaults = class extends this {
|
|
constructor(...args) {
|
|
const options = args[0] || {};
|
|
if (typeof defaults === "function") {
|
|
super(defaults(options));
|
|
return;
|
|
}
|
|
super(
|
|
Object.assign(
|
|
{},
|
|
defaults,
|
|
options,
|
|
options.userAgent && defaults.userAgent ? {
|
|
userAgent: `${options.userAgent} ${defaults.userAgent}`
|
|
} : null
|
|
)
|
|
);
|
|
}
|
|
};
|
|
return OctokitWithDefaults;
|
|
}
|
|
static plugin(...newPlugins) {
|
|
var _a2;
|
|
const currentPlugins = this.plugins;
|
|
const NewOctokit = (_a2 = class extends this {
|
|
}, (() => {
|
|
_a2.plugins = currentPlugins.concat(
|
|
newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
|
|
);
|
|
})(), _a2);
|
|
return NewOctokit;
|
|
}
|
|
constructor(options = {}) {
|
|
const hook = new import_before_after_hook.Collection();
|
|
const requestDefaults = {
|
|
baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
|
|
headers: {},
|
|
request: Object.assign({}, options.request, {
|
|
hook: hook.bind(null, "request")
|
|
}),
|
|
mediaType: {
|
|
previews: [],
|
|
format: ""
|
|
}
|
|
};
|
|
requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
|
|
if (options.baseUrl) {
|
|
requestDefaults.baseUrl = options.baseUrl;
|
|
}
|
|
if (options.previews) {
|
|
requestDefaults.mediaType.previews = options.previews;
|
|
}
|
|
if (options.timeZone) {
|
|
requestDefaults.headers["time-zone"] = options.timeZone;
|
|
}
|
|
this.request = import_request.request.defaults(requestDefaults);
|
|
this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
|
|
this.log = Object.assign(
|
|
{
|
|
debug: noop,
|
|
info: noop,
|
|
warn: consoleWarn,
|
|
error: consoleError
|
|
},
|
|
options.log
|
|
);
|
|
this.hook = hook;
|
|
if (!options.authStrategy) {
|
|
if (!options.auth) {
|
|
this.auth = async () => ({
|
|
type: "unauthenticated"
|
|
});
|
|
} else {
|
|
const auth = (0, import_auth_token.createTokenAuth)(options.auth);
|
|
hook.wrap("request", auth.hook);
|
|
this.auth = auth;
|
|
}
|
|
} else {
|
|
const { authStrategy, ...otherOptions } = options;
|
|
const auth = authStrategy(
|
|
Object.assign(
|
|
{
|
|
request: this.request,
|
|
log: this.log,
|
|
octokit: this,
|
|
octokitOptions: otherOptions
|
|
},
|
|
options.auth
|
|
)
|
|
);
|
|
hook.wrap("request", auth.hook);
|
|
this.auth = auth;
|
|
}
|
|
const classConstructor = this.constructor;
|
|
for (let i = 0; i < classConstructor.plugins.length; ++i) {
|
|
Object.assign(this, classConstructor.plugins[i](this, options));
|
|
}
|
|
}
|
|
}, (() => {
|
|
_a.VERSION = VERSION;
|
|
})(), (() => {
|
|
_a.plugins = [];
|
|
})(), _a);
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node9 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
legacyRestEndpointMethods: () => legacyRestEndpointMethods,
|
|
restEndpointMethods: () => restEndpointMethods
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var VERSION = "10.4.1";
|
|
var Endpoints = {
|
|
actions: {
|
|
addCustomLabelsToSelfHostedRunnerForOrg: [
|
|
"POST /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
addCustomLabelsToSelfHostedRunnerForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
addSelectedRepoToOrgSecret: [
|
|
"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
addSelectedRepoToOrgVariable: [
|
|
"PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
|
|
],
|
|
approveWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
|
|
],
|
|
cancelWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
|
|
],
|
|
createEnvironmentVariable: [
|
|
"POST /repositories/{repository_id}/environments/{environment_name}/variables"
|
|
],
|
|
createOrUpdateEnvironmentSecret: [
|
|
"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
|
|
createOrUpdateRepoSecret: [
|
|
"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
|
|
],
|
|
createOrgVariable: ["POST /orgs/{org}/actions/variables"],
|
|
createRegistrationTokenForOrg: [
|
|
"POST /orgs/{org}/actions/runners/registration-token"
|
|
],
|
|
createRegistrationTokenForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/registration-token"
|
|
],
|
|
createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
|
|
createRemoveTokenForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/remove-token"
|
|
],
|
|
createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
|
|
createWorkflowDispatch: [
|
|
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
|
|
],
|
|
deleteActionsCacheById: [
|
|
"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
|
|
],
|
|
deleteActionsCacheByKey: [
|
|
"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
|
|
],
|
|
deleteArtifact: [
|
|
"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
|
|
],
|
|
deleteEnvironmentSecret: [
|
|
"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
|
|
],
|
|
deleteEnvironmentVariable: [
|
|
"DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
|
|
],
|
|
deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
|
|
deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
|
|
deleteRepoSecret: [
|
|
"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
|
|
],
|
|
deleteRepoVariable: [
|
|
"DELETE /repos/{owner}/{repo}/actions/variables/{name}"
|
|
],
|
|
deleteSelfHostedRunnerFromOrg: [
|
|
"DELETE /orgs/{org}/actions/runners/{runner_id}"
|
|
],
|
|
deleteSelfHostedRunnerFromRepo: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
|
|
],
|
|
deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
|
|
deleteWorkflowRunLogs: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
|
|
],
|
|
disableSelectedRepositoryGithubActionsOrganization: [
|
|
"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
|
|
],
|
|
disableWorkflow: [
|
|
"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
|
|
],
|
|
downloadArtifact: [
|
|
"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
|
|
],
|
|
downloadJobLogsForWorkflowRun: [
|
|
"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
|
|
],
|
|
downloadWorkflowRunAttemptLogs: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
|
|
],
|
|
downloadWorkflowRunLogs: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
|
|
],
|
|
enableSelectedRepositoryGithubActionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
|
|
],
|
|
enableWorkflow: [
|
|
"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
|
|
],
|
|
forceCancelWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
|
|
],
|
|
generateRunnerJitconfigForOrg: [
|
|
"POST /orgs/{org}/actions/runners/generate-jitconfig"
|
|
],
|
|
generateRunnerJitconfigForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
|
|
],
|
|
getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
|
|
getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
|
|
getActionsCacheUsageByRepoForOrg: [
|
|
"GET /orgs/{org}/actions/cache/usage-by-repository"
|
|
],
|
|
getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
|
|
getAllowedActionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions/selected-actions"
|
|
],
|
|
getAllowedActionsRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
|
|
],
|
|
getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
|
|
getCustomOidcSubClaimForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
|
|
],
|
|
getEnvironmentPublicKey: [
|
|
"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
|
|
],
|
|
getEnvironmentSecret: [
|
|
"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
|
|
],
|
|
getEnvironmentVariable: [
|
|
"GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
|
|
],
|
|
getGithubActionsDefaultWorkflowPermissionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions/workflow"
|
|
],
|
|
getGithubActionsDefaultWorkflowPermissionsRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions/workflow"
|
|
],
|
|
getGithubActionsPermissionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions"
|
|
],
|
|
getGithubActionsPermissionsRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions"
|
|
],
|
|
getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
|
|
getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
|
|
getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
|
|
getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
|
|
getPendingDeploymentsForRun: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
|
|
],
|
|
getRepoPermissions: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions",
|
|
{},
|
|
{ renamed: ["actions", "getGithubActionsPermissionsRepository"] }
|
|
],
|
|
getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
|
|
getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
|
|
getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
|
|
getReviewsForRun: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
|
|
],
|
|
getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
|
|
getSelfHostedRunnerForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
|
|
],
|
|
getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
|
|
getWorkflowAccessToRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions/access"
|
|
],
|
|
getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
|
|
getWorkflowRunAttempt: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
|
|
],
|
|
getWorkflowRunUsage: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
|
|
],
|
|
getWorkflowUsage: [
|
|
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
|
|
],
|
|
listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
|
|
listEnvironmentSecrets: [
|
|
"GET /repositories/{repository_id}/environments/{environment_name}/secrets"
|
|
],
|
|
listEnvironmentVariables: [
|
|
"GET /repositories/{repository_id}/environments/{environment_name}/variables"
|
|
],
|
|
listJobsForWorkflowRun: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
|
|
],
|
|
listJobsForWorkflowRunAttempt: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
|
|
],
|
|
listLabelsForSelfHostedRunnerForOrg: [
|
|
"GET /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
listLabelsForSelfHostedRunnerForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
|
|
listOrgVariables: ["GET /orgs/{org}/actions/variables"],
|
|
listRepoOrganizationSecrets: [
|
|
"GET /repos/{owner}/{repo}/actions/organization-secrets"
|
|
],
|
|
listRepoOrganizationVariables: [
|
|
"GET /repos/{owner}/{repo}/actions/organization-variables"
|
|
],
|
|
listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
|
|
listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
|
|
listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
|
|
listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
|
|
listRunnerApplicationsForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/runners/downloads"
|
|
],
|
|
listSelectedReposForOrgSecret: [
|
|
"GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
|
|
],
|
|
listSelectedReposForOrgVariable: [
|
|
"GET /orgs/{org}/actions/variables/{name}/repositories"
|
|
],
|
|
listSelectedRepositoriesEnabledGithubActionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions/repositories"
|
|
],
|
|
listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
|
|
listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
|
|
listWorkflowRunArtifacts: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
|
|
],
|
|
listWorkflowRuns: [
|
|
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
|
|
],
|
|
listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
|
|
reRunJobForWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
|
|
],
|
|
reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
|
|
reRunWorkflowFailedJobs: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
|
|
],
|
|
removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
|
|
"DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
removeCustomLabelFromSelfHostedRunnerForOrg: [
|
|
"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
|
|
],
|
|
removeCustomLabelFromSelfHostedRunnerForRepo: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
|
|
],
|
|
removeSelectedRepoFromOrgSecret: [
|
|
"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
removeSelectedRepoFromOrgVariable: [
|
|
"DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
|
|
],
|
|
reviewCustomGatesForRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
|
|
],
|
|
reviewPendingDeploymentsForRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
|
|
],
|
|
setAllowedActionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/selected-actions"
|
|
],
|
|
setAllowedActionsRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
|
|
],
|
|
setCustomLabelsForSelfHostedRunnerForOrg: [
|
|
"PUT /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
setCustomLabelsForSelfHostedRunnerForRepo: [
|
|
"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
setCustomOidcSubClaimForRepo: [
|
|
"PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
|
|
],
|
|
setGithubActionsDefaultWorkflowPermissionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/workflow"
|
|
],
|
|
setGithubActionsDefaultWorkflowPermissionsRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions/workflow"
|
|
],
|
|
setGithubActionsPermissionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions"
|
|
],
|
|
setGithubActionsPermissionsRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions"
|
|
],
|
|
setSelectedReposForOrgSecret: [
|
|
"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
|
|
],
|
|
setSelectedReposForOrgVariable: [
|
|
"PUT /orgs/{org}/actions/variables/{name}/repositories"
|
|
],
|
|
setSelectedRepositoriesEnabledGithubActionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/repositories"
|
|
],
|
|
setWorkflowAccessToRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions/access"
|
|
],
|
|
updateEnvironmentVariable: [
|
|
"PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
|
|
],
|
|
updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
|
|
updateRepoVariable: [
|
|
"PATCH /repos/{owner}/{repo}/actions/variables/{name}"
|
|
]
|
|
},
|
|
activity: {
|
|
checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
|
|
deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
|
|
deleteThreadSubscription: [
|
|
"DELETE /notifications/threads/{thread_id}/subscription"
|
|
],
|
|
getFeeds: ["GET /feeds"],
|
|
getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
|
|
getThread: ["GET /notifications/threads/{thread_id}"],
|
|
getThreadSubscriptionForAuthenticatedUser: [
|
|
"GET /notifications/threads/{thread_id}/subscription"
|
|
],
|
|
listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
|
|
listNotificationsForAuthenticatedUser: ["GET /notifications"],
|
|
listOrgEventsForAuthenticatedUser: [
|
|
"GET /users/{username}/events/orgs/{org}"
|
|
],
|
|
listPublicEvents: ["GET /events"],
|
|
listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
|
|
listPublicEventsForUser: ["GET /users/{username}/events/public"],
|
|
listPublicOrgEvents: ["GET /orgs/{org}/events"],
|
|
listReceivedEventsForUser: ["GET /users/{username}/received_events"],
|
|
listReceivedPublicEventsForUser: [
|
|
"GET /users/{username}/received_events/public"
|
|
],
|
|
listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
|
|
listRepoNotificationsForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/notifications"
|
|
],
|
|
listReposStarredByAuthenticatedUser: ["GET /user/starred"],
|
|
listReposStarredByUser: ["GET /users/{username}/starred"],
|
|
listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
|
|
listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
|
|
listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
|
|
listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
|
|
markNotificationsAsRead: ["PUT /notifications"],
|
|
markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
|
|
markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
|
|
markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
|
|
setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
|
|
setThreadSubscription: [
|
|
"PUT /notifications/threads/{thread_id}/subscription"
|
|
],
|
|
starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
|
|
unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
|
|
},
|
|
apps: {
|
|
addRepoToInstallation: [
|
|
"PUT /user/installations/{installation_id}/repositories/{repository_id}",
|
|
{},
|
|
{ renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
|
|
],
|
|
addRepoToInstallationForAuthenticatedUser: [
|
|
"PUT /user/installations/{installation_id}/repositories/{repository_id}"
|
|
],
|
|
checkToken: ["POST /applications/{client_id}/token"],
|
|
createFromManifest: ["POST /app-manifests/{code}/conversions"],
|
|
createInstallationAccessToken: [
|
|
"POST /app/installations/{installation_id}/access_tokens"
|
|
],
|
|
deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
|
|
deleteInstallation: ["DELETE /app/installations/{installation_id}"],
|
|
deleteToken: ["DELETE /applications/{client_id}/token"],
|
|
getAuthenticated: ["GET /app"],
|
|
getBySlug: ["GET /apps/{app_slug}"],
|
|
getInstallation: ["GET /app/installations/{installation_id}"],
|
|
getOrgInstallation: ["GET /orgs/{org}/installation"],
|
|
getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
|
|
getSubscriptionPlanForAccount: [
|
|
"GET /marketplace_listing/accounts/{account_id}"
|
|
],
|
|
getSubscriptionPlanForAccountStubbed: [
|
|
"GET /marketplace_listing/stubbed/accounts/{account_id}"
|
|
],
|
|
getUserInstallation: ["GET /users/{username}/installation"],
|
|
getWebhookConfigForApp: ["GET /app/hook/config"],
|
|
getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
|
|
listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
|
|
listAccountsForPlanStubbed: [
|
|
"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
|
|
],
|
|
listInstallationReposForAuthenticatedUser: [
|
|
"GET /user/installations/{installation_id}/repositories"
|
|
],
|
|
listInstallationRequestsForAuthenticatedApp: [
|
|
"GET /app/installation-requests"
|
|
],
|
|
listInstallations: ["GET /app/installations"],
|
|
listInstallationsForAuthenticatedUser: ["GET /user/installations"],
|
|
listPlans: ["GET /marketplace_listing/plans"],
|
|
listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
|
|
listReposAccessibleToInstallation: ["GET /installation/repositories"],
|
|
listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
|
|
listSubscriptionsForAuthenticatedUserStubbed: [
|
|
"GET /user/marketplace_purchases/stubbed"
|
|
],
|
|
listWebhookDeliveries: ["GET /app/hook/deliveries"],
|
|
redeliverWebhookDelivery: [
|
|
"POST /app/hook/deliveries/{delivery_id}/attempts"
|
|
],
|
|
removeRepoFromInstallation: [
|
|
"DELETE /user/installations/{installation_id}/repositories/{repository_id}",
|
|
{},
|
|
{ renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
|
|
],
|
|
removeRepoFromInstallationForAuthenticatedUser: [
|
|
"DELETE /user/installations/{installation_id}/repositories/{repository_id}"
|
|
],
|
|
resetToken: ["PATCH /applications/{client_id}/token"],
|
|
revokeInstallationAccessToken: ["DELETE /installation/token"],
|
|
scopeToken: ["POST /applications/{client_id}/token/scoped"],
|
|
suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
|
|
unsuspendInstallation: [
|
|
"DELETE /app/installations/{installation_id}/suspended"
|
|
],
|
|
updateWebhookConfigForApp: ["PATCH /app/hook/config"]
|
|
},
|
|
billing: {
|
|
getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
|
|
getGithubActionsBillingUser: [
|
|
"GET /users/{username}/settings/billing/actions"
|
|
],
|
|
getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
|
|
getGithubPackagesBillingUser: [
|
|
"GET /users/{username}/settings/billing/packages"
|
|
],
|
|
getSharedStorageBillingOrg: [
|
|
"GET /orgs/{org}/settings/billing/shared-storage"
|
|
],
|
|
getSharedStorageBillingUser: [
|
|
"GET /users/{username}/settings/billing/shared-storage"
|
|
]
|
|
},
|
|
checks: {
|
|
create: ["POST /repos/{owner}/{repo}/check-runs"],
|
|
createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
|
|
get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
|
|
getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
|
|
listAnnotations: [
|
|
"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
|
|
],
|
|
listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
|
|
listForSuite: [
|
|
"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
|
|
],
|
|
listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
|
|
rerequestRun: [
|
|
"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
|
|
],
|
|
rerequestSuite: [
|
|
"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
|
|
],
|
|
setSuitesPreferences: [
|
|
"PATCH /repos/{owner}/{repo}/check-suites/preferences"
|
|
],
|
|
update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
|
|
},
|
|
codeScanning: {
|
|
deleteAnalysis: [
|
|
"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
|
|
],
|
|
getAlert: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
|
|
{},
|
|
{ renamedParameters: { alert_id: "alert_number" } }
|
|
],
|
|
getAnalysis: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
|
|
],
|
|
getCodeqlDatabase: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
|
|
],
|
|
getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
|
|
getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
|
|
listAlertInstances: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
|
|
],
|
|
listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
|
|
listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
|
|
listAlertsInstances: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
|
|
{},
|
|
{ renamed: ["codeScanning", "listAlertInstances"] }
|
|
],
|
|
listCodeqlDatabases: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
|
|
],
|
|
listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
|
|
updateAlert: [
|
|
"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
|
|
],
|
|
updateDefaultSetup: [
|
|
"PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
|
|
],
|
|
uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
|
|
},
|
|
codesOfConduct: {
|
|
getAllCodesOfConduct: ["GET /codes_of_conduct"],
|
|
getConductCode: ["GET /codes_of_conduct/{key}"]
|
|
},
|
|
codespaces: {
|
|
addRepositoryForSecretForAuthenticatedUser: [
|
|
"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
addSelectedRepoToOrgSecret: [
|
|
"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
checkPermissionsForDevcontainer: [
|
|
"GET /repos/{owner}/{repo}/codespaces/permissions_check"
|
|
],
|
|
codespaceMachinesForAuthenticatedUser: [
|
|
"GET /user/codespaces/{codespace_name}/machines"
|
|
],
|
|
createForAuthenticatedUser: ["POST /user/codespaces"],
|
|
createOrUpdateOrgSecret: [
|
|
"PUT /orgs/{org}/codespaces/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateRepoSecret: [
|
|
"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateSecretForAuthenticatedUser: [
|
|
"PUT /user/codespaces/secrets/{secret_name}"
|
|
],
|
|
createWithPrForAuthenticatedUser: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
|
|
],
|
|
createWithRepoForAuthenticatedUser: [
|
|
"POST /repos/{owner}/{repo}/codespaces"
|
|
],
|
|
deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
|
|
deleteFromOrganization: [
|
|
"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
|
|
],
|
|
deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
|
|
deleteRepoSecret: [
|
|
"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
|
|
],
|
|
deleteSecretForAuthenticatedUser: [
|
|
"DELETE /user/codespaces/secrets/{secret_name}"
|
|
],
|
|
exportForAuthenticatedUser: [
|
|
"POST /user/codespaces/{codespace_name}/exports"
|
|
],
|
|
getCodespacesForUserInOrg: [
|
|
"GET /orgs/{org}/members/{username}/codespaces"
|
|
],
|
|
getExportDetailsForAuthenticatedUser: [
|
|
"GET /user/codespaces/{codespace_name}/exports/{export_id}"
|
|
],
|
|
getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
|
|
getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
|
|
getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
|
|
getPublicKeyForAuthenticatedUser: [
|
|
"GET /user/codespaces/secrets/public-key"
|
|
],
|
|
getRepoPublicKey: [
|
|
"GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
|
|
],
|
|
getRepoSecret: [
|
|
"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
|
|
],
|
|
getSecretForAuthenticatedUser: [
|
|
"GET /user/codespaces/secrets/{secret_name}"
|
|
],
|
|
listDevcontainersInRepositoryForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces/devcontainers"
|
|
],
|
|
listForAuthenticatedUser: ["GET /user/codespaces"],
|
|
listInOrganization: [
|
|
"GET /orgs/{org}/codespaces",
|
|
{},
|
|
{ renamedParameters: { org_id: "org" } }
|
|
],
|
|
listInRepositoryForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces"
|
|
],
|
|
listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
|
|
listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
|
|
listRepositoriesForSecretForAuthenticatedUser: [
|
|
"GET /user/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
|
|
listSelectedReposForOrgSecret: [
|
|
"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
preFlightWithRepoForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces/new"
|
|
],
|
|
publishForAuthenticatedUser: [
|
|
"POST /user/codespaces/{codespace_name}/publish"
|
|
],
|
|
removeRepositoryForSecretForAuthenticatedUser: [
|
|
"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
removeSelectedRepoFromOrgSecret: [
|
|
"DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
repoMachinesForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces/machines"
|
|
],
|
|
setRepositoriesForSecretForAuthenticatedUser: [
|
|
"PUT /user/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
setSelectedReposForOrgSecret: [
|
|
"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
|
|
stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
|
|
stopInOrganization: [
|
|
"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
|
|
],
|
|
updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
|
|
},
|
|
copilot: {
|
|
addCopilotSeatsForTeams: [
|
|
"POST /orgs/{org}/copilot/billing/selected_teams"
|
|
],
|
|
addCopilotSeatsForUsers: [
|
|
"POST /orgs/{org}/copilot/billing/selected_users"
|
|
],
|
|
cancelCopilotSeatAssignmentForTeams: [
|
|
"DELETE /orgs/{org}/copilot/billing/selected_teams"
|
|
],
|
|
cancelCopilotSeatAssignmentForUsers: [
|
|
"DELETE /orgs/{org}/copilot/billing/selected_users"
|
|
],
|
|
getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
|
|
getCopilotSeatDetailsForUser: [
|
|
"GET /orgs/{org}/members/{username}/copilot"
|
|
],
|
|
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
|
|
},
|
|
dependabot: {
|
|
addSelectedRepoToOrgSecret: [
|
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
createOrUpdateOrgSecret: [
|
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateRepoSecret: [
|
|
"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
|
|
],
|
|
deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
|
|
deleteRepoSecret: [
|
|
"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
|
|
],
|
|
getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
|
|
getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
|
|
getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
|
|
getRepoPublicKey: [
|
|
"GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
|
|
],
|
|
getRepoSecret: [
|
|
"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
|
|
],
|
|
listAlertsForEnterprise: [
|
|
"GET /enterprises/{enterprise}/dependabot/alerts"
|
|
],
|
|
listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
|
|
listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
|
|
listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
|
|
listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
|
|
listSelectedReposForOrgSecret: [
|
|
"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
|
|
],
|
|
removeSelectedRepoFromOrgSecret: [
|
|
"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
setSelectedReposForOrgSecret: [
|
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
|
|
],
|
|
updateAlert: [
|
|
"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
|
|
]
|
|
},
|
|
dependencyGraph: {
|
|
createRepositorySnapshot: [
|
|
"POST /repos/{owner}/{repo}/dependency-graph/snapshots"
|
|
],
|
|
diffRange: [
|
|
"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
|
|
],
|
|
exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
|
|
},
|
|
emojis: { get: ["GET /emojis"] },
|
|
gists: {
|
|
checkIsStarred: ["GET /gists/{gist_id}/star"],
|
|
create: ["POST /gists"],
|
|
createComment: ["POST /gists/{gist_id}/comments"],
|
|
delete: ["DELETE /gists/{gist_id}"],
|
|
deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
|
|
fork: ["POST /gists/{gist_id}/forks"],
|
|
get: ["GET /gists/{gist_id}"],
|
|
getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
|
|
getRevision: ["GET /gists/{gist_id}/{sha}"],
|
|
list: ["GET /gists"],
|
|
listComments: ["GET /gists/{gist_id}/comments"],
|
|
listCommits: ["GET /gists/{gist_id}/commits"],
|
|
listForUser: ["GET /users/{username}/gists"],
|
|
listForks: ["GET /gists/{gist_id}/forks"],
|
|
listPublic: ["GET /gists/public"],
|
|
listStarred: ["GET /gists/starred"],
|
|
star: ["PUT /gists/{gist_id}/star"],
|
|
unstar: ["DELETE /gists/{gist_id}/star"],
|
|
update: ["PATCH /gists/{gist_id}"],
|
|
updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
|
|
},
|
|
git: {
|
|
createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
|
|
createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
|
|
createRef: ["POST /repos/{owner}/{repo}/git/refs"],
|
|
createTag: ["POST /repos/{owner}/{repo}/git/tags"],
|
|
createTree: ["POST /repos/{owner}/{repo}/git/trees"],
|
|
deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
|
|
getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
|
|
getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
|
|
getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
|
|
getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
|
|
getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
|
|
listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
|
|
updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
|
|
},
|
|
gitignore: {
|
|
getAllTemplates: ["GET /gitignore/templates"],
|
|
getTemplate: ["GET /gitignore/templates/{name}"]
|
|
},
|
|
interactions: {
|
|
getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
|
|
getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
|
|
getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
|
|
getRestrictionsForYourPublicRepos: [
|
|
"GET /user/interaction-limits",
|
|
{},
|
|
{ renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
|
|
],
|
|
removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
|
|
removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
|
|
removeRestrictionsForRepo: [
|
|
"DELETE /repos/{owner}/{repo}/interaction-limits"
|
|
],
|
|
removeRestrictionsForYourPublicRepos: [
|
|
"DELETE /user/interaction-limits",
|
|
{},
|
|
{ renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
|
|
],
|
|
setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
|
|
setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
|
|
setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
|
|
setRestrictionsForYourPublicRepos: [
|
|
"PUT /user/interaction-limits",
|
|
{},
|
|
{ renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
|
|
]
|
|
},
|
|
issues: {
|
|
addAssignees: [
|
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
|
|
],
|
|
addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
|
|
checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
|
|
checkUserCanBeAssignedToIssue: [
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
|
|
],
|
|
create: ["POST /repos/{owner}/{repo}/issues"],
|
|
createComment: [
|
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
|
|
],
|
|
createLabel: ["POST /repos/{owner}/{repo}/labels"],
|
|
createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
|
|
deleteComment: [
|
|
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
|
|
],
|
|
deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
|
|
deleteMilestone: [
|
|
"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
|
|
],
|
|
get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
|
|
getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
|
|
getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
|
|
getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
|
|
getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
|
|
list: ["GET /issues"],
|
|
listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
|
|
listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
|
|
listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
|
|
listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
|
|
listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
|
|
listEventsForTimeline: [
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
|
|
],
|
|
listForAuthenticatedUser: ["GET /user/issues"],
|
|
listForOrg: ["GET /orgs/{org}/issues"],
|
|
listForRepo: ["GET /repos/{owner}/{repo}/issues"],
|
|
listLabelsForMilestone: [
|
|
"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
|
|
],
|
|
listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
|
|
listLabelsOnIssue: [
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
|
|
],
|
|
listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
|
|
lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
|
|
removeAllLabels: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
|
|
],
|
|
removeAssignees: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
|
|
],
|
|
removeLabel: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
|
|
],
|
|
setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
|
|
unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
|
|
update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
|
|
updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
|
|
updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
|
|
updateMilestone: [
|
|
"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
|
|
]
|
|
},
|
|
licenses: {
|
|
get: ["GET /licenses/{license}"],
|
|
getAllCommonlyUsed: ["GET /licenses"],
|
|
getForRepo: ["GET /repos/{owner}/{repo}/license"]
|
|
},
|
|
markdown: {
|
|
render: ["POST /markdown"],
|
|
renderRaw: [
|
|
"POST /markdown/raw",
|
|
{ headers: { "content-type": "text/plain; charset=utf-8" } }
|
|
]
|
|
},
|
|
meta: {
|
|
get: ["GET /meta"],
|
|
getAllVersions: ["GET /versions"],
|
|
getOctocat: ["GET /octocat"],
|
|
getZen: ["GET /zen"],
|
|
root: ["GET /"]
|
|
},
|
|
migrations: {
|
|
cancelImport: [
|
|
"DELETE /repos/{owner}/{repo}/import",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
|
|
}
|
|
],
|
|
deleteArchiveForAuthenticatedUser: [
|
|
"DELETE /user/migrations/{migration_id}/archive"
|
|
],
|
|
deleteArchiveForOrg: [
|
|
"DELETE /orgs/{org}/migrations/{migration_id}/archive"
|
|
],
|
|
downloadArchiveForOrg: [
|
|
"GET /orgs/{org}/migrations/{migration_id}/archive"
|
|
],
|
|
getArchiveForAuthenticatedUser: [
|
|
"GET /user/migrations/{migration_id}/archive"
|
|
],
|
|
getCommitAuthors: [
|
|
"GET /repos/{owner}/{repo}/import/authors",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
|
|
}
|
|
],
|
|
getImportStatus: [
|
|
"GET /repos/{owner}/{repo}/import",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
|
|
}
|
|
],
|
|
getLargeFiles: [
|
|
"GET /repos/{owner}/{repo}/import/large_files",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
|
|
}
|
|
],
|
|
getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
|
|
getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
|
|
listForAuthenticatedUser: ["GET /user/migrations"],
|
|
listForOrg: ["GET /orgs/{org}/migrations"],
|
|
listReposForAuthenticatedUser: [
|
|
"GET /user/migrations/{migration_id}/repositories"
|
|
],
|
|
listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
|
|
listReposForUser: [
|
|
"GET /user/migrations/{migration_id}/repositories",
|
|
{},
|
|
{ renamed: ["migrations", "listReposForAuthenticatedUser"] }
|
|
],
|
|
mapCommitAuthor: [
|
|
"PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
|
|
}
|
|
],
|
|
setLfsPreference: [
|
|
"PATCH /repos/{owner}/{repo}/import/lfs",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
|
|
}
|
|
],
|
|
startForAuthenticatedUser: ["POST /user/migrations"],
|
|
startForOrg: ["POST /orgs/{org}/migrations"],
|
|
startImport: [
|
|
"PUT /repos/{owner}/{repo}/import",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
|
|
}
|
|
],
|
|
unlockRepoForAuthenticatedUser: [
|
|
"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
|
|
],
|
|
unlockRepoForOrg: [
|
|
"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
|
|
],
|
|
updateImport: [
|
|
"PATCH /repos/{owner}/{repo}/import",
|
|
{},
|
|
{
|
|
deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
|
|
}
|
|
]
|
|
},
|
|
oidc: {
|
|
getOidcCustomSubTemplateForOrg: [
|
|
"GET /orgs/{org}/actions/oidc/customization/sub"
|
|
],
|
|
updateOidcCustomSubTemplateForOrg: [
|
|
"PUT /orgs/{org}/actions/oidc/customization/sub"
|
|
]
|
|
},
|
|
orgs: {
|
|
addSecurityManagerTeam: [
|
|
"PUT /orgs/{org}/security-managers/teams/{team_slug}"
|
|
],
|
|
assignTeamToOrgRole: [
|
|
"PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
],
|
|
assignUserToOrgRole: [
|
|
"PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
],
|
|
blockUser: ["PUT /orgs/{org}/blocks/{username}"],
|
|
cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
|
|
checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
|
|
checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
|
|
checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
|
|
convertMemberToOutsideCollaborator: [
|
|
"PUT /orgs/{org}/outside_collaborators/{username}"
|
|
],
|
|
createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
|
|
createInvitation: ["POST /orgs/{org}/invitations"],
|
|
createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
|
|
createOrUpdateCustomPropertiesValuesForRepos: [
|
|
"PATCH /orgs/{org}/properties/values"
|
|
],
|
|
createOrUpdateCustomProperty: [
|
|
"PUT /orgs/{org}/properties/schema/{custom_property_name}"
|
|
],
|
|
createWebhook: ["POST /orgs/{org}/hooks"],
|
|
delete: ["DELETE /orgs/{org}"],
|
|
deleteCustomOrganizationRole: [
|
|
"DELETE /orgs/{org}/organization-roles/{role_id}"
|
|
],
|
|
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
|
|
enableOrDisableSecurityProductOnAllOrgRepos: [
|
|
"POST /orgs/{org}/{security_product}/{enablement}"
|
|
],
|
|
get: ["GET /orgs/{org}"],
|
|
getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
|
|
getCustomProperty: [
|
|
"GET /orgs/{org}/properties/schema/{custom_property_name}"
|
|
],
|
|
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
|
|
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
|
|
getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
|
|
getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
|
|
getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
|
|
getWebhookDelivery: [
|
|
"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
|
|
],
|
|
list: ["GET /organizations"],
|
|
listAppInstallations: ["GET /orgs/{org}/installations"],
|
|
listBlockedUsers: ["GET /orgs/{org}/blocks"],
|
|
listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
|
|
listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
|
|
listForAuthenticatedUser: ["GET /user/orgs"],
|
|
listForUser: ["GET /users/{username}/orgs"],
|
|
listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
|
|
listMembers: ["GET /orgs/{org}/members"],
|
|
listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
|
|
listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
|
|
listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
|
|
listOrgRoles: ["GET /orgs/{org}/organization-roles"],
|
|
listOrganizationFineGrainedPermissions: [
|
|
"GET /orgs/{org}/organization-fine-grained-permissions"
|
|
],
|
|
listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
|
|
listPatGrantRepositories: [
|
|
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
|
|
],
|
|
listPatGrantRequestRepositories: [
|
|
"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
|
|
],
|
|
listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
|
|
listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
|
|
listPendingInvitations: ["GET /orgs/{org}/invitations"],
|
|
listPublicMembers: ["GET /orgs/{org}/public_members"],
|
|
listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
|
|
listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
|
|
listWebhooks: ["GET /orgs/{org}/hooks"],
|
|
patchCustomOrganizationRole: [
|
|
"PATCH /orgs/{org}/organization-roles/{role_id}"
|
|
],
|
|
pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
|
|
redeliverWebhookDelivery: [
|
|
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
|
],
|
|
removeCustomProperty: [
|
|
"DELETE /orgs/{org}/properties/schema/{custom_property_name}"
|
|
],
|
|
removeMember: ["DELETE /orgs/{org}/members/{username}"],
|
|
removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
|
|
removeOutsideCollaborator: [
|
|
"DELETE /orgs/{org}/outside_collaborators/{username}"
|
|
],
|
|
removePublicMembershipForAuthenticatedUser: [
|
|
"DELETE /orgs/{org}/public_members/{username}"
|
|
],
|
|
removeSecurityManagerTeam: [
|
|
"DELETE /orgs/{org}/security-managers/teams/{team_slug}"
|
|
],
|
|
reviewPatGrantRequest: [
|
|
"POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
|
|
],
|
|
reviewPatGrantRequestsInBulk: [
|
|
"POST /orgs/{org}/personal-access-token-requests"
|
|
],
|
|
revokeAllOrgRolesTeam: [
|
|
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
|
|
],
|
|
revokeAllOrgRolesUser: [
|
|
"DELETE /orgs/{org}/organization-roles/users/{username}"
|
|
],
|
|
revokeOrgRoleTeam: [
|
|
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
],
|
|
revokeOrgRoleUser: [
|
|
"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
],
|
|
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
|
|
setPublicMembershipForAuthenticatedUser: [
|
|
"PUT /orgs/{org}/public_members/{username}"
|
|
],
|
|
unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
|
|
update: ["PATCH /orgs/{org}"],
|
|
updateMembershipForAuthenticatedUser: [
|
|
"PATCH /user/memberships/orgs/{org}"
|
|
],
|
|
updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
|
|
updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
|
|
updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
|
|
updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
|
|
},
|
|
packages: {
|
|
deletePackageForAuthenticatedUser: [
|
|
"DELETE /user/packages/{package_type}/{package_name}"
|
|
],
|
|
deletePackageForOrg: [
|
|
"DELETE /orgs/{org}/packages/{package_type}/{package_name}"
|
|
],
|
|
deletePackageForUser: [
|
|
"DELETE /users/{username}/packages/{package_type}/{package_name}"
|
|
],
|
|
deletePackageVersionForAuthenticatedUser: [
|
|
"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
deletePackageVersionForOrg: [
|
|
"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
deletePackageVersionForUser: [
|
|
"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
getAllPackageVersionsForAPackageOwnedByAnOrg: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
|
|
{},
|
|
{ renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
|
|
],
|
|
getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}/versions",
|
|
{},
|
|
{
|
|
renamed: [
|
|
"packages",
|
|
"getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
|
|
]
|
|
}
|
|
],
|
|
getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}/versions"
|
|
],
|
|
getAllPackageVersionsForPackageOwnedByOrg: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
|
|
],
|
|
getAllPackageVersionsForPackageOwnedByUser: [
|
|
"GET /users/{username}/packages/{package_type}/{package_name}/versions"
|
|
],
|
|
getPackageForAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}"
|
|
],
|
|
getPackageForOrganization: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}"
|
|
],
|
|
getPackageForUser: [
|
|
"GET /users/{username}/packages/{package_type}/{package_name}"
|
|
],
|
|
getPackageVersionForAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
getPackageVersionForOrganization: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
getPackageVersionForUser: [
|
|
"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
listDockerMigrationConflictingPackagesForAuthenticatedUser: [
|
|
"GET /user/docker/conflicts"
|
|
],
|
|
listDockerMigrationConflictingPackagesForOrganization: [
|
|
"GET /orgs/{org}/docker/conflicts"
|
|
],
|
|
listDockerMigrationConflictingPackagesForUser: [
|
|
"GET /users/{username}/docker/conflicts"
|
|
],
|
|
listPackagesForAuthenticatedUser: ["GET /user/packages"],
|
|
listPackagesForOrganization: ["GET /orgs/{org}/packages"],
|
|
listPackagesForUser: ["GET /users/{username}/packages"],
|
|
restorePackageForAuthenticatedUser: [
|
|
"POST /user/packages/{package_type}/{package_name}/restore{?token}"
|
|
],
|
|
restorePackageForOrg: [
|
|
"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
|
|
],
|
|
restorePackageForUser: [
|
|
"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
|
|
],
|
|
restorePackageVersionForAuthenticatedUser: [
|
|
"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
|
|
],
|
|
restorePackageVersionForOrg: [
|
|
"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
|
|
],
|
|
restorePackageVersionForUser: [
|
|
"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
|
|
]
|
|
},
|
|
projects: {
|
|
addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
|
|
createCard: ["POST /projects/columns/{column_id}/cards"],
|
|
createColumn: ["POST /projects/{project_id}/columns"],
|
|
createForAuthenticatedUser: ["POST /user/projects"],
|
|
createForOrg: ["POST /orgs/{org}/projects"],
|
|
createForRepo: ["POST /repos/{owner}/{repo}/projects"],
|
|
delete: ["DELETE /projects/{project_id}"],
|
|
deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
|
|
deleteColumn: ["DELETE /projects/columns/{column_id}"],
|
|
get: ["GET /projects/{project_id}"],
|
|
getCard: ["GET /projects/columns/cards/{card_id}"],
|
|
getColumn: ["GET /projects/columns/{column_id}"],
|
|
getPermissionForUser: [
|
|
"GET /projects/{project_id}/collaborators/{username}/permission"
|
|
],
|
|
listCards: ["GET /projects/columns/{column_id}/cards"],
|
|
listCollaborators: ["GET /projects/{project_id}/collaborators"],
|
|
listColumns: ["GET /projects/{project_id}/columns"],
|
|
listForOrg: ["GET /orgs/{org}/projects"],
|
|
listForRepo: ["GET /repos/{owner}/{repo}/projects"],
|
|
listForUser: ["GET /users/{username}/projects"],
|
|
moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
|
|
moveColumn: ["POST /projects/columns/{column_id}/moves"],
|
|
removeCollaborator: [
|
|
"DELETE /projects/{project_id}/collaborators/{username}"
|
|
],
|
|
update: ["PATCH /projects/{project_id}"],
|
|
updateCard: ["PATCH /projects/columns/cards/{card_id}"],
|
|
updateColumn: ["PATCH /projects/columns/{column_id}"]
|
|
},
|
|
pulls: {
|
|
checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
|
|
create: ["POST /repos/{owner}/{repo}/pulls"],
|
|
createReplyForReviewComment: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
|
|
],
|
|
createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
|
|
createReviewComment: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
|
|
],
|
|
deletePendingReview: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
|
|
],
|
|
deleteReviewComment: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
|
|
],
|
|
dismissReview: [
|
|
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
|
|
],
|
|
get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
|
|
getReview: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
|
|
],
|
|
getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
|
|
list: ["GET /repos/{owner}/{repo}/pulls"],
|
|
listCommentsForReview: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
|
|
],
|
|
listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
|
|
listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
|
|
listRequestedReviewers: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
|
|
],
|
|
listReviewComments: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
|
|
],
|
|
listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
|
|
listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
|
|
merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
|
|
removeRequestedReviewers: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
|
|
],
|
|
requestReviewers: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
|
|
],
|
|
submitReview: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
|
|
],
|
|
update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
|
|
updateBranch: [
|
|
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
|
|
],
|
|
updateReview: [
|
|
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
|
|
],
|
|
updateReviewComment: [
|
|
"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
|
|
]
|
|
},
|
|
rateLimit: { get: ["GET /rate_limit"] },
|
|
reactions: {
|
|
createForCommitComment: [
|
|
"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
],
|
|
createForIssue: [
|
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
|
|
],
|
|
createForIssueComment: [
|
|
"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
],
|
|
createForPullRequestReviewComment: [
|
|
"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
],
|
|
createForRelease: [
|
|
"POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
|
|
],
|
|
createForTeamDiscussionCommentInOrg: [
|
|
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
],
|
|
createForTeamDiscussionInOrg: [
|
|
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
],
|
|
deleteForCommitComment: [
|
|
"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForIssue: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
|
|
],
|
|
deleteForIssueComment: [
|
|
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForPullRequestComment: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForRelease: [
|
|
"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForTeamDiscussion: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
|
|
],
|
|
deleteForTeamDiscussionComment: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
|
|
],
|
|
listForCommitComment: [
|
|
"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
],
|
|
listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
|
|
listForIssueComment: [
|
|
"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
],
|
|
listForPullRequestReviewComment: [
|
|
"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
],
|
|
listForRelease: [
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
|
|
],
|
|
listForTeamDiscussionCommentInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
],
|
|
listForTeamDiscussionInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
]
|
|
},
|
|
repos: {
|
|
acceptInvitation: [
|
|
"PATCH /user/repository_invitations/{invitation_id}",
|
|
{},
|
|
{ renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
|
|
],
|
|
acceptInvitationForAuthenticatedUser: [
|
|
"PATCH /user/repository_invitations/{invitation_id}"
|
|
],
|
|
addAppAccessRestrictions: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
|
|
{},
|
|
{ mapToData: "apps" }
|
|
],
|
|
addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
|
|
addStatusCheckContexts: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
|
|
{},
|
|
{ mapToData: "contexts" }
|
|
],
|
|
addTeamAccessRestrictions: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
|
|
{},
|
|
{ mapToData: "teams" }
|
|
],
|
|
addUserAccessRestrictions: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
|
|
{},
|
|
{ mapToData: "users" }
|
|
],
|
|
cancelPagesDeployment: [
|
|
"POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
|
|
],
|
|
checkAutomatedSecurityFixes: [
|
|
"GET /repos/{owner}/{repo}/automated-security-fixes"
|
|
],
|
|
checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
|
|
checkVulnerabilityAlerts: [
|
|
"GET /repos/{owner}/{repo}/vulnerability-alerts"
|
|
],
|
|
codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
|
|
compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
|
|
compareCommitsWithBasehead: [
|
|
"GET /repos/{owner}/{repo}/compare/{basehead}"
|
|
],
|
|
createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
|
|
createCommitComment: [
|
|
"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
|
|
],
|
|
createCommitSignatureProtection: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
],
|
|
createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
|
|
createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
|
|
createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
|
|
createDeploymentBranchPolicy: [
|
|
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
|
|
],
|
|
createDeploymentProtectionRule: [
|
|
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
|
|
],
|
|
createDeploymentStatus: [
|
|
"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
|
|
],
|
|
createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
|
|
createForAuthenticatedUser: ["POST /user/repos"],
|
|
createFork: ["POST /repos/{owner}/{repo}/forks"],
|
|
createInOrg: ["POST /orgs/{org}/repos"],
|
|
createOrUpdateCustomPropertiesValues: [
|
|
"PATCH /repos/{owner}/{repo}/properties/values"
|
|
],
|
|
createOrUpdateEnvironment: [
|
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}"
|
|
],
|
|
createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
|
|
createOrgRuleset: ["POST /orgs/{org}/rulesets"],
|
|
createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
|
|
createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
|
|
createRelease: ["POST /repos/{owner}/{repo}/releases"],
|
|
createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
|
|
createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
|
|
createUsingTemplate: [
|
|
"POST /repos/{template_owner}/{template_repo}/generate"
|
|
],
|
|
createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
|
|
declineInvitation: [
|
|
"DELETE /user/repository_invitations/{invitation_id}",
|
|
{},
|
|
{ renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
|
|
],
|
|
declineInvitationForAuthenticatedUser: [
|
|
"DELETE /user/repository_invitations/{invitation_id}"
|
|
],
|
|
delete: ["DELETE /repos/{owner}/{repo}"],
|
|
deleteAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
|
|
],
|
|
deleteAdminBranchProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
|
|
],
|
|
deleteAnEnvironment: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}"
|
|
],
|
|
deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
|
|
deleteBranchProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
|
|
],
|
|
deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
deleteCommitSignatureProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
],
|
|
deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
|
|
deleteDeployment: [
|
|
"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
|
|
],
|
|
deleteDeploymentBranchPolicy: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
|
|
],
|
|
deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
|
|
deleteInvitation: [
|
|
"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
|
|
],
|
|
deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
|
|
deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
|
|
deletePullRequestReviewProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
|
|
],
|
|
deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
|
|
deleteReleaseAsset: [
|
|
"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
|
|
],
|
|
deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
|
deleteTagProtection: [
|
|
"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
|
|
],
|
|
deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
|
|
disableAutomatedSecurityFixes: [
|
|
"DELETE /repos/{owner}/{repo}/automated-security-fixes"
|
|
],
|
|
disableDeploymentProtectionRule: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
|
],
|
|
disablePrivateVulnerabilityReporting: [
|
|
"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
],
|
|
disableVulnerabilityAlerts: [
|
|
"DELETE /repos/{owner}/{repo}/vulnerability-alerts"
|
|
],
|
|
downloadArchive: [
|
|
"GET /repos/{owner}/{repo}/zipball/{ref}",
|
|
{},
|
|
{ renamed: ["repos", "downloadZipballArchive"] }
|
|
],
|
|
downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
|
|
downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
|
|
enableAutomatedSecurityFixes: [
|
|
"PUT /repos/{owner}/{repo}/automated-security-fixes"
|
|
],
|
|
enablePrivateVulnerabilityReporting: [
|
|
"PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
],
|
|
enableVulnerabilityAlerts: [
|
|
"PUT /repos/{owner}/{repo}/vulnerability-alerts"
|
|
],
|
|
generateReleaseNotes: [
|
|
"POST /repos/{owner}/{repo}/releases/generate-notes"
|
|
],
|
|
get: ["GET /repos/{owner}/{repo}"],
|
|
getAccessRestrictions: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
|
|
],
|
|
getAdminBranchProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
|
|
],
|
|
getAllDeploymentProtectionRules: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
|
|
],
|
|
getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
|
|
getAllStatusCheckContexts: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
|
|
],
|
|
getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
|
|
getAppsWithAccessToProtectedBranch: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
|
|
],
|
|
getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
|
|
getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
|
|
getBranchProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection"
|
|
],
|
|
getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
|
|
getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
|
|
getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
|
|
getCollaboratorPermissionLevel: [
|
|
"GET /repos/{owner}/{repo}/collaborators/{username}/permission"
|
|
],
|
|
getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
|
|
getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
|
|
getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
|
|
getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
getCommitSignatureProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
],
|
|
getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
|
|
getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
|
|
getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
|
|
getCustomDeploymentProtectionRule: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
|
],
|
|
getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
|
|
getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
|
|
getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
|
|
getDeploymentBranchPolicy: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
|
|
],
|
|
getDeploymentStatus: [
|
|
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
|
|
],
|
|
getEnvironment: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}"
|
|
],
|
|
getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
|
|
getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
|
|
getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
|
|
getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
|
|
getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
|
|
getOrgRulesets: ["GET /orgs/{org}/rulesets"],
|
|
getPages: ["GET /repos/{owner}/{repo}/pages"],
|
|
getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
|
|
getPagesDeployment: [
|
|
"GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
|
|
],
|
|
getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
|
|
getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
|
|
getPullRequestReviewProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
|
|
],
|
|
getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
|
|
getReadme: ["GET /repos/{owner}/{repo}/readme"],
|
|
getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
|
|
getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
|
|
getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
|
|
getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
|
|
getRepoRuleSuite: [
|
|
"GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
|
|
],
|
|
getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
|
|
getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
|
getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
|
|
getStatusChecksProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
|
|
],
|
|
getTeamsWithAccessToProtectedBranch: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
|
|
],
|
|
getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
|
|
getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
|
|
getUsersWithAccessToProtectedBranch: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
|
|
],
|
|
getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
|
|
getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
|
|
getWebhookConfigForRepo: [
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
|
|
],
|
|
getWebhookDelivery: [
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
|
|
],
|
|
listActivities: ["GET /repos/{owner}/{repo}/activity"],
|
|
listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
|
|
listBranches: ["GET /repos/{owner}/{repo}/branches"],
|
|
listBranchesForHeadCommit: [
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
|
|
],
|
|
listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
|
|
listCommentsForCommit: [
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
|
|
],
|
|
listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
|
|
listCommitStatusesForRef: [
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/statuses"
|
|
],
|
|
listCommits: ["GET /repos/{owner}/{repo}/commits"],
|
|
listContributors: ["GET /repos/{owner}/{repo}/contributors"],
|
|
listCustomDeploymentRuleIntegrations: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
|
|
],
|
|
listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
|
|
listDeploymentBranchPolicies: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
|
|
],
|
|
listDeploymentStatuses: [
|
|
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
|
|
],
|
|
listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
|
|
listForAuthenticatedUser: ["GET /user/repos"],
|
|
listForOrg: ["GET /orgs/{org}/repos"],
|
|
listForUser: ["GET /users/{username}/repos"],
|
|
listForks: ["GET /repos/{owner}/{repo}/forks"],
|
|
listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
|
|
listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
|
|
listLanguages: ["GET /repos/{owner}/{repo}/languages"],
|
|
listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
|
|
listPublic: ["GET /repositories"],
|
|
listPullRequestsAssociatedWithCommit: [
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
|
|
],
|
|
listReleaseAssets: [
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/assets"
|
|
],
|
|
listReleases: ["GET /repos/{owner}/{repo}/releases"],
|
|
listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
|
|
listTags: ["GET /repos/{owner}/{repo}/tags"],
|
|
listTeams: ["GET /repos/{owner}/{repo}/teams"],
|
|
listWebhookDeliveries: [
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
|
|
],
|
|
listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
|
|
merge: ["POST /repos/{owner}/{repo}/merges"],
|
|
mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
|
|
pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
|
|
redeliverWebhookDelivery: [
|
|
"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
|
],
|
|
removeAppAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
|
|
{},
|
|
{ mapToData: "apps" }
|
|
],
|
|
removeCollaborator: [
|
|
"DELETE /repos/{owner}/{repo}/collaborators/{username}"
|
|
],
|
|
removeStatusCheckContexts: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
|
|
{},
|
|
{ mapToData: "contexts" }
|
|
],
|
|
removeStatusCheckProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
|
|
],
|
|
removeTeamAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
|
|
{},
|
|
{ mapToData: "teams" }
|
|
],
|
|
removeUserAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
|
|
{},
|
|
{ mapToData: "users" }
|
|
],
|
|
renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
|
|
replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
|
|
requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
|
|
setAdminBranchProtection: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
|
|
],
|
|
setAppAccessRestrictions: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
|
|
{},
|
|
{ mapToData: "apps" }
|
|
],
|
|
setStatusCheckContexts: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
|
|
{},
|
|
{ mapToData: "contexts" }
|
|
],
|
|
setTeamAccessRestrictions: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
|
|
{},
|
|
{ mapToData: "teams" }
|
|
],
|
|
setUserAccessRestrictions: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
|
|
{},
|
|
{ mapToData: "users" }
|
|
],
|
|
testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
|
|
transfer: ["POST /repos/{owner}/{repo}/transfer"],
|
|
update: ["PATCH /repos/{owner}/{repo}"],
|
|
updateBranchProtection: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection"
|
|
],
|
|
updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
updateDeploymentBranchPolicy: [
|
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
|
|
],
|
|
updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
|
|
updateInvitation: [
|
|
"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
|
|
],
|
|
updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
|
|
updatePullRequestReviewProtection: [
|
|
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
|
|
],
|
|
updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
|
|
updateReleaseAsset: [
|
|
"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
|
|
],
|
|
updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
|
updateStatusCheckPotection: [
|
|
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
|
|
{},
|
|
{ renamed: ["repos", "updateStatusCheckProtection"] }
|
|
],
|
|
updateStatusCheckProtection: [
|
|
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
|
|
],
|
|
updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
|
|
updateWebhookConfigForRepo: [
|
|
"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
|
|
],
|
|
uploadReleaseAsset: [
|
|
"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
|
|
{ baseUrl: "https://uploads.github.com" }
|
|
]
|
|
},
|
|
search: {
|
|
code: ["GET /search/code"],
|
|
commits: ["GET /search/commits"],
|
|
issuesAndPullRequests: ["GET /search/issues"],
|
|
labels: ["GET /search/labels"],
|
|
repos: ["GET /search/repositories"],
|
|
topics: ["GET /search/topics"],
|
|
users: ["GET /search/users"]
|
|
},
|
|
secretScanning: {
|
|
getAlert: [
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
|
|
],
|
|
listAlertsForEnterprise: [
|
|
"GET /enterprises/{enterprise}/secret-scanning/alerts"
|
|
],
|
|
listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
|
|
listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
|
|
listLocationsForAlert: [
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
|
|
],
|
|
updateAlert: [
|
|
"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
|
|
]
|
|
},
|
|
securityAdvisories: {
|
|
createFork: [
|
|
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
|
|
],
|
|
createPrivateVulnerabilityReport: [
|
|
"POST /repos/{owner}/{repo}/security-advisories/reports"
|
|
],
|
|
createRepositoryAdvisory: [
|
|
"POST /repos/{owner}/{repo}/security-advisories"
|
|
],
|
|
createRepositoryAdvisoryCveRequest: [
|
|
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
|
|
],
|
|
getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
|
|
getRepositoryAdvisory: [
|
|
"GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
|
|
],
|
|
listGlobalAdvisories: ["GET /advisories"],
|
|
listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
|
|
listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
|
|
updateRepositoryAdvisory: [
|
|
"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
|
|
]
|
|
},
|
|
teams: {
|
|
addOrUpdateMembershipForUserInOrg: [
|
|
"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
],
|
|
addOrUpdateProjectPermissionsInOrg: [
|
|
"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
],
|
|
addOrUpdateRepoPermissionsInOrg: [
|
|
"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
],
|
|
checkPermissionsForProjectInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
],
|
|
checkPermissionsForRepoInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
],
|
|
create: ["POST /orgs/{org}/teams"],
|
|
createDiscussionCommentInOrg: [
|
|
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
|
|
],
|
|
createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
|
|
deleteDiscussionCommentInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
],
|
|
deleteDiscussionInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
],
|
|
deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
|
|
getByName: ["GET /orgs/{org}/teams/{team_slug}"],
|
|
getDiscussionCommentInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
],
|
|
getDiscussionInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
],
|
|
getMembershipForUserInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
],
|
|
list: ["GET /orgs/{org}/teams"],
|
|
listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
|
|
listDiscussionCommentsInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
|
|
],
|
|
listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
|
|
listForAuthenticatedUser: ["GET /user/teams"],
|
|
listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
|
|
listPendingInvitationsInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/invitations"
|
|
],
|
|
listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
|
|
listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
|
|
removeMembershipForUserInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
],
|
|
removeProjectInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
],
|
|
removeRepoInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
],
|
|
updateDiscussionCommentInOrg: [
|
|
"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
],
|
|
updateDiscussionInOrg: [
|
|
"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
],
|
|
updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
|
|
},
|
|
users: {
|
|
addEmailForAuthenticated: [
|
|
"POST /user/emails",
|
|
{},
|
|
{ renamed: ["users", "addEmailForAuthenticatedUser"] }
|
|
],
|
|
addEmailForAuthenticatedUser: ["POST /user/emails"],
|
|
addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
|
|
block: ["PUT /user/blocks/{username}"],
|
|
checkBlocked: ["GET /user/blocks/{username}"],
|
|
checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
|
|
checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
|
|
createGpgKeyForAuthenticated: [
|
|
"POST /user/gpg_keys",
|
|
{},
|
|
{ renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
|
|
],
|
|
createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
|
|
createPublicSshKeyForAuthenticated: [
|
|
"POST /user/keys",
|
|
{},
|
|
{ renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
|
|
],
|
|
createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
|
|
createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
|
|
deleteEmailForAuthenticated: [
|
|
"DELETE /user/emails",
|
|
{},
|
|
{ renamed: ["users", "deleteEmailForAuthenticatedUser"] }
|
|
],
|
|
deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
|
|
deleteGpgKeyForAuthenticated: [
|
|
"DELETE /user/gpg_keys/{gpg_key_id}",
|
|
{},
|
|
{ renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
|
|
],
|
|
deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
|
|
deletePublicSshKeyForAuthenticated: [
|
|
"DELETE /user/keys/{key_id}",
|
|
{},
|
|
{ renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
|
|
],
|
|
deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
|
|
deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
|
|
deleteSshSigningKeyForAuthenticatedUser: [
|
|
"DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
|
|
],
|
|
follow: ["PUT /user/following/{username}"],
|
|
getAuthenticated: ["GET /user"],
|
|
getByUsername: ["GET /users/{username}"],
|
|
getContextForUser: ["GET /users/{username}/hovercard"],
|
|
getGpgKeyForAuthenticated: [
|
|
"GET /user/gpg_keys/{gpg_key_id}",
|
|
{},
|
|
{ renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
|
|
],
|
|
getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
|
|
getPublicSshKeyForAuthenticated: [
|
|
"GET /user/keys/{key_id}",
|
|
{},
|
|
{ renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
|
|
],
|
|
getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
|
|
getSshSigningKeyForAuthenticatedUser: [
|
|
"GET /user/ssh_signing_keys/{ssh_signing_key_id}"
|
|
],
|
|
list: ["GET /users"],
|
|
listBlockedByAuthenticated: [
|
|
"GET /user/blocks",
|
|
{},
|
|
{ renamed: ["users", "listBlockedByAuthenticatedUser"] }
|
|
],
|
|
listBlockedByAuthenticatedUser: ["GET /user/blocks"],
|
|
listEmailsForAuthenticated: [
|
|
"GET /user/emails",
|
|
{},
|
|
{ renamed: ["users", "listEmailsForAuthenticatedUser"] }
|
|
],
|
|
listEmailsForAuthenticatedUser: ["GET /user/emails"],
|
|
listFollowedByAuthenticated: [
|
|
"GET /user/following",
|
|
{},
|
|
{ renamed: ["users", "listFollowedByAuthenticatedUser"] }
|
|
],
|
|
listFollowedByAuthenticatedUser: ["GET /user/following"],
|
|
listFollowersForAuthenticatedUser: ["GET /user/followers"],
|
|
listFollowersForUser: ["GET /users/{username}/followers"],
|
|
listFollowingForUser: ["GET /users/{username}/following"],
|
|
listGpgKeysForAuthenticated: [
|
|
"GET /user/gpg_keys",
|
|
{},
|
|
{ renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
|
|
],
|
|
listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
|
|
listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
|
|
listPublicEmailsForAuthenticated: [
|
|
"GET /user/public_emails",
|
|
{},
|
|
{ renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
|
|
],
|
|
listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
|
|
listPublicKeysForUser: ["GET /users/{username}/keys"],
|
|
listPublicSshKeysForAuthenticated: [
|
|
"GET /user/keys",
|
|
{},
|
|
{ renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
|
|
],
|
|
listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
|
|
listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
|
|
listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
|
|
listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
|
|
listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
|
|
setPrimaryEmailVisibilityForAuthenticated: [
|
|
"PATCH /user/email/visibility",
|
|
{},
|
|
{ renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
|
|
],
|
|
setPrimaryEmailVisibilityForAuthenticatedUser: [
|
|
"PATCH /user/email/visibility"
|
|
],
|
|
unblock: ["DELETE /user/blocks/{username}"],
|
|
unfollow: ["DELETE /user/following/{username}"],
|
|
updateAuthenticated: ["PATCH /user"]
|
|
}
|
|
};
|
|
var endpoints_default = Endpoints;
|
|
var endpointMethodsMap = /* @__PURE__ */ new Map();
|
|
for (const [scope, endpoints] of Object.entries(endpoints_default)) {
|
|
for (const [methodName, endpoint] of Object.entries(endpoints)) {
|
|
const [route, defaults, decorations] = endpoint;
|
|
const [method, url] = route.split(/ /);
|
|
const endpointDefaults = Object.assign(
|
|
{
|
|
method,
|
|
url
|
|
},
|
|
defaults
|
|
);
|
|
if (!endpointMethodsMap.has(scope)) {
|
|
endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
|
|
}
|
|
endpointMethodsMap.get(scope).set(methodName, {
|
|
scope,
|
|
methodName,
|
|
endpointDefaults,
|
|
decorations
|
|
});
|
|
}
|
|
}
|
|
var handler = {
|
|
has({ scope }, methodName) {
|
|
return endpointMethodsMap.get(scope).has(methodName);
|
|
},
|
|
getOwnPropertyDescriptor(target, methodName) {
|
|
return {
|
|
value: this.get(target, methodName),
|
|
configurable: true,
|
|
writable: true,
|
|
enumerable: true
|
|
};
|
|
},
|
|
defineProperty(target, methodName, descriptor) {
|
|
Object.defineProperty(target.cache, methodName, descriptor);
|
|
return true;
|
|
},
|
|
deleteProperty(target, methodName) {
|
|
delete target.cache[methodName];
|
|
return true;
|
|
},
|
|
ownKeys({ scope }) {
|
|
return [...endpointMethodsMap.get(scope).keys()];
|
|
},
|
|
set(target, methodName, value) {
|
|
return target.cache[methodName] = value;
|
|
},
|
|
get({ octokit, scope, cache }, methodName) {
|
|
if (cache[methodName]) {
|
|
return cache[methodName];
|
|
}
|
|
const method = endpointMethodsMap.get(scope).get(methodName);
|
|
if (!method) {
|
|
return void 0;
|
|
}
|
|
const { endpointDefaults, decorations } = method;
|
|
if (decorations) {
|
|
cache[methodName] = decorate(
|
|
octokit,
|
|
scope,
|
|
methodName,
|
|
endpointDefaults,
|
|
decorations
|
|
);
|
|
} else {
|
|
cache[methodName] = octokit.request.defaults(endpointDefaults);
|
|
}
|
|
return cache[methodName];
|
|
}
|
|
};
|
|
function endpointsToMethods(octokit) {
|
|
const newMethods = {};
|
|
for (const scope of endpointMethodsMap.keys()) {
|
|
newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
|
|
}
|
|
return newMethods;
|
|
}
|
|
function decorate(octokit, scope, methodName, defaults, decorations) {
|
|
const requestWithDefaults = octokit.request.defaults(defaults);
|
|
function withDecorations(...args) {
|
|
let options = requestWithDefaults.endpoint.merge(...args);
|
|
if (decorations.mapToData) {
|
|
options = Object.assign({}, options, {
|
|
data: options[decorations.mapToData],
|
|
[decorations.mapToData]: void 0
|
|
});
|
|
return requestWithDefaults(options);
|
|
}
|
|
if (decorations.renamed) {
|
|
const [newScope, newMethodName] = decorations.renamed;
|
|
octokit.log.warn(
|
|
`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
|
|
);
|
|
}
|
|
if (decorations.deprecated) {
|
|
octokit.log.warn(decorations.deprecated);
|
|
}
|
|
if (decorations.renamedParameters) {
|
|
const options2 = requestWithDefaults.endpoint.merge(...args);
|
|
for (const [name, alias] of Object.entries(
|
|
decorations.renamedParameters
|
|
)) {
|
|
if (name in options2) {
|
|
octokit.log.warn(
|
|
`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
|
|
);
|
|
if (!(alias in options2)) {
|
|
options2[alias] = options2[name];
|
|
}
|
|
delete options2[name];
|
|
}
|
|
}
|
|
return requestWithDefaults(options2);
|
|
}
|
|
return requestWithDefaults(...args);
|
|
}
|
|
return Object.assign(withDecorations, requestWithDefaults);
|
|
}
|
|
function restEndpointMethods(octokit) {
|
|
const api = endpointsToMethods(octokit);
|
|
return {
|
|
rest: api
|
|
};
|
|
}
|
|
restEndpointMethods.VERSION = VERSION;
|
|
function legacyRestEndpointMethods(octokit) {
|
|
const api = endpointsToMethods(octokit);
|
|
return {
|
|
...api,
|
|
rest: api
|
|
};
|
|
}
|
|
legacyRestEndpointMethods.VERSION = VERSION;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node10 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
composePaginateRest: () => composePaginateRest,
|
|
isPaginatingEndpoint: () => isPaginatingEndpoint,
|
|
paginateRest: () => paginateRest,
|
|
paginatingEndpoints: () => paginatingEndpoints
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var VERSION = "9.2.1";
|
|
function normalizePaginatedListResponse(response) {
|
|
if (!response.data) {
|
|
return {
|
|
...response,
|
|
data: []
|
|
};
|
|
}
|
|
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
|
|
if (!responseNeedsNormalization)
|
|
return response;
|
|
const incompleteResults = response.data.incomplete_results;
|
|
const repositorySelection = response.data.repository_selection;
|
|
const totalCount = response.data.total_count;
|
|
delete response.data.incomplete_results;
|
|
delete response.data.repository_selection;
|
|
delete response.data.total_count;
|
|
const namespaceKey = Object.keys(response.data)[0];
|
|
const data = response.data[namespaceKey];
|
|
response.data = data;
|
|
if (typeof incompleteResults !== "undefined") {
|
|
response.data.incomplete_results = incompleteResults;
|
|
}
|
|
if (typeof repositorySelection !== "undefined") {
|
|
response.data.repository_selection = repositorySelection;
|
|
}
|
|
response.data.total_count = totalCount;
|
|
return response;
|
|
}
|
|
function iterator(octokit, route, parameters) {
|
|
const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
|
|
const requestMethod = typeof route === "function" ? route : octokit.request;
|
|
const method = options.method;
|
|
const headers = options.headers;
|
|
let url = options.url;
|
|
return {
|
|
[Symbol.asyncIterator]: () => ({
|
|
async next() {
|
|
if (!url)
|
|
return { done: true };
|
|
try {
|
|
const response = await requestMethod({ method, url, headers });
|
|
const normalizedResponse = normalizePaginatedListResponse(response);
|
|
url = ((normalizedResponse.headers.link || "").match(
|
|
/<([^>]+)>;\s*rel="next"/
|
|
) || [])[1];
|
|
return { value: normalizedResponse };
|
|
} catch (error) {
|
|
if (error.status !== 409)
|
|
throw error;
|
|
url = "";
|
|
return {
|
|
value: {
|
|
status: 200,
|
|
headers: {},
|
|
data: []
|
|
}
|
|
};
|
|
}
|
|
}
|
|
})
|
|
};
|
|
}
|
|
function paginate(octokit, route, parameters, mapFn) {
|
|
if (typeof parameters === "function") {
|
|
mapFn = parameters;
|
|
parameters = void 0;
|
|
}
|
|
return gather(
|
|
octokit,
|
|
[],
|
|
iterator(octokit, route, parameters)[Symbol.asyncIterator](),
|
|
mapFn
|
|
);
|
|
}
|
|
function gather(octokit, results, iterator2, mapFn) {
|
|
return iterator2.next().then((result) => {
|
|
if (result.done) {
|
|
return results;
|
|
}
|
|
let earlyExit = false;
|
|
function done() {
|
|
earlyExit = true;
|
|
}
|
|
results = results.concat(
|
|
mapFn ? mapFn(result.value, done) : result.value.data
|
|
);
|
|
if (earlyExit) {
|
|
return results;
|
|
}
|
|
return gather(octokit, results, iterator2, mapFn);
|
|
});
|
|
}
|
|
var composePaginateRest = Object.assign(paginate, {
|
|
iterator
|
|
});
|
|
var paginatingEndpoints = [
|
|
"GET /advisories",
|
|
"GET /app/hook/deliveries",
|
|
"GET /app/installation-requests",
|
|
"GET /app/installations",
|
|
"GET /assignments/{assignment_id}/accepted_assignments",
|
|
"GET /classrooms",
|
|
"GET /classrooms/{classroom_id}/assignments",
|
|
"GET /enterprises/{enterprise}/dependabot/alerts",
|
|
"GET /enterprises/{enterprise}/secret-scanning/alerts",
|
|
"GET /events",
|
|
"GET /gists",
|
|
"GET /gists/public",
|
|
"GET /gists/starred",
|
|
"GET /gists/{gist_id}/comments",
|
|
"GET /gists/{gist_id}/commits",
|
|
"GET /gists/{gist_id}/forks",
|
|
"GET /installation/repositories",
|
|
"GET /issues",
|
|
"GET /licenses",
|
|
"GET /marketplace_listing/plans",
|
|
"GET /marketplace_listing/plans/{plan_id}/accounts",
|
|
"GET /marketplace_listing/stubbed/plans",
|
|
"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
|
|
"GET /networks/{owner}/{repo}/events",
|
|
"GET /notifications",
|
|
"GET /organizations",
|
|
"GET /orgs/{org}/actions/cache/usage-by-repository",
|
|
"GET /orgs/{org}/actions/permissions/repositories",
|
|
"GET /orgs/{org}/actions/runners",
|
|
"GET /orgs/{org}/actions/secrets",
|
|
"GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
|
|
"GET /orgs/{org}/actions/variables",
|
|
"GET /orgs/{org}/actions/variables/{name}/repositories",
|
|
"GET /orgs/{org}/blocks",
|
|
"GET /orgs/{org}/code-scanning/alerts",
|
|
"GET /orgs/{org}/codespaces",
|
|
"GET /orgs/{org}/codespaces/secrets",
|
|
"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
|
|
"GET /orgs/{org}/copilot/billing/seats",
|
|
"GET /orgs/{org}/dependabot/alerts",
|
|
"GET /orgs/{org}/dependabot/secrets",
|
|
"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
|
|
"GET /orgs/{org}/events",
|
|
"GET /orgs/{org}/failed_invitations",
|
|
"GET /orgs/{org}/hooks",
|
|
"GET /orgs/{org}/hooks/{hook_id}/deliveries",
|
|
"GET /orgs/{org}/installations",
|
|
"GET /orgs/{org}/invitations",
|
|
"GET /orgs/{org}/invitations/{invitation_id}/teams",
|
|
"GET /orgs/{org}/issues",
|
|
"GET /orgs/{org}/members",
|
|
"GET /orgs/{org}/members/{username}/codespaces",
|
|
"GET /orgs/{org}/migrations",
|
|
"GET /orgs/{org}/migrations/{migration_id}/repositories",
|
|
"GET /orgs/{org}/organization-roles/{role_id}/teams",
|
|
"GET /orgs/{org}/organization-roles/{role_id}/users",
|
|
"GET /orgs/{org}/outside_collaborators",
|
|
"GET /orgs/{org}/packages",
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
|
|
"GET /orgs/{org}/personal-access-token-requests",
|
|
"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
|
|
"GET /orgs/{org}/personal-access-tokens",
|
|
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
|
|
"GET /orgs/{org}/projects",
|
|
"GET /orgs/{org}/properties/values",
|
|
"GET /orgs/{org}/public_members",
|
|
"GET /orgs/{org}/repos",
|
|
"GET /orgs/{org}/rulesets",
|
|
"GET /orgs/{org}/rulesets/rule-suites",
|
|
"GET /orgs/{org}/secret-scanning/alerts",
|
|
"GET /orgs/{org}/security-advisories",
|
|
"GET /orgs/{org}/teams",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
|
|
"GET /orgs/{org}/teams/{team_slug}/invitations",
|
|
"GET /orgs/{org}/teams/{team_slug}/members",
|
|
"GET /orgs/{org}/teams/{team_slug}/projects",
|
|
"GET /orgs/{org}/teams/{team_slug}/repos",
|
|
"GET /orgs/{org}/teams/{team_slug}/teams",
|
|
"GET /projects/columns/{column_id}/cards",
|
|
"GET /projects/{project_id}/collaborators",
|
|
"GET /projects/{project_id}/columns",
|
|
"GET /repos/{owner}/{repo}/actions/artifacts",
|
|
"GET /repos/{owner}/{repo}/actions/caches",
|
|
"GET /repos/{owner}/{repo}/actions/organization-secrets",
|
|
"GET /repos/{owner}/{repo}/actions/organization-variables",
|
|
"GET /repos/{owner}/{repo}/actions/runners",
|
|
"GET /repos/{owner}/{repo}/actions/runs",
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
|
|
"GET /repos/{owner}/{repo}/actions/secrets",
|
|
"GET /repos/{owner}/{repo}/actions/variables",
|
|
"GET /repos/{owner}/{repo}/actions/workflows",
|
|
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
|
|
"GET /repos/{owner}/{repo}/activity",
|
|
"GET /repos/{owner}/{repo}/assignees",
|
|
"GET /repos/{owner}/{repo}/branches",
|
|
"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
|
|
"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts",
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
|
|
"GET /repos/{owner}/{repo}/code-scanning/analyses",
|
|
"GET /repos/{owner}/{repo}/codespaces",
|
|
"GET /repos/{owner}/{repo}/codespaces/devcontainers",
|
|
"GET /repos/{owner}/{repo}/codespaces/secrets",
|
|
"GET /repos/{owner}/{repo}/collaborators",
|
|
"GET /repos/{owner}/{repo}/comments",
|
|
"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/commits",
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/status",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/statuses",
|
|
"GET /repos/{owner}/{repo}/contributors",
|
|
"GET /repos/{owner}/{repo}/dependabot/alerts",
|
|
"GET /repos/{owner}/{repo}/dependabot/secrets",
|
|
"GET /repos/{owner}/{repo}/deployments",
|
|
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
|
|
"GET /repos/{owner}/{repo}/environments",
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
|
|
"GET /repos/{owner}/{repo}/events",
|
|
"GET /repos/{owner}/{repo}/forks",
|
|
"GET /repos/{owner}/{repo}/hooks",
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
|
|
"GET /repos/{owner}/{repo}/invitations",
|
|
"GET /repos/{owner}/{repo}/issues",
|
|
"GET /repos/{owner}/{repo}/issues/comments",
|
|
"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/issues/events",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/events",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
|
|
"GET /repos/{owner}/{repo}/keys",
|
|
"GET /repos/{owner}/{repo}/labels",
|
|
"GET /repos/{owner}/{repo}/milestones",
|
|
"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
|
|
"GET /repos/{owner}/{repo}/notifications",
|
|
"GET /repos/{owner}/{repo}/pages/builds",
|
|
"GET /repos/{owner}/{repo}/projects",
|
|
"GET /repos/{owner}/{repo}/pulls",
|
|
"GET /repos/{owner}/{repo}/pulls/comments",
|
|
"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
|
|
"GET /repos/{owner}/{repo}/releases",
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/assets",
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/rules/branches/{branch}",
|
|
"GET /repos/{owner}/{repo}/rulesets",
|
|
"GET /repos/{owner}/{repo}/rulesets/rule-suites",
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts",
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
|
|
"GET /repos/{owner}/{repo}/security-advisories",
|
|
"GET /repos/{owner}/{repo}/stargazers",
|
|
"GET /repos/{owner}/{repo}/subscribers",
|
|
"GET /repos/{owner}/{repo}/tags",
|
|
"GET /repos/{owner}/{repo}/teams",
|
|
"GET /repos/{owner}/{repo}/topics",
|
|
"GET /repositories",
|
|
"GET /repositories/{repository_id}/environments/{environment_name}/secrets",
|
|
"GET /repositories/{repository_id}/environments/{environment_name}/variables",
|
|
"GET /search/code",
|
|
"GET /search/commits",
|
|
"GET /search/issues",
|
|
"GET /search/labels",
|
|
"GET /search/repositories",
|
|
"GET /search/topics",
|
|
"GET /search/users",
|
|
"GET /teams/{team_id}/discussions",
|
|
"GET /teams/{team_id}/discussions/{discussion_number}/comments",
|
|
"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
|
|
"GET /teams/{team_id}/discussions/{discussion_number}/reactions",
|
|
"GET /teams/{team_id}/invitations",
|
|
"GET /teams/{team_id}/members",
|
|
"GET /teams/{team_id}/projects",
|
|
"GET /teams/{team_id}/repos",
|
|
"GET /teams/{team_id}/teams",
|
|
"GET /user/blocks",
|
|
"GET /user/codespaces",
|
|
"GET /user/codespaces/secrets",
|
|
"GET /user/emails",
|
|
"GET /user/followers",
|
|
"GET /user/following",
|
|
"GET /user/gpg_keys",
|
|
"GET /user/installations",
|
|
"GET /user/installations/{installation_id}/repositories",
|
|
"GET /user/issues",
|
|
"GET /user/keys",
|
|
"GET /user/marketplace_purchases",
|
|
"GET /user/marketplace_purchases/stubbed",
|
|
"GET /user/memberships/orgs",
|
|
"GET /user/migrations",
|
|
"GET /user/migrations/{migration_id}/repositories",
|
|
"GET /user/orgs",
|
|
"GET /user/packages",
|
|
"GET /user/packages/{package_type}/{package_name}/versions",
|
|
"GET /user/public_emails",
|
|
"GET /user/repos",
|
|
"GET /user/repository_invitations",
|
|
"GET /user/social_accounts",
|
|
"GET /user/ssh_signing_keys",
|
|
"GET /user/starred",
|
|
"GET /user/subscriptions",
|
|
"GET /user/teams",
|
|
"GET /users",
|
|
"GET /users/{username}/events",
|
|
"GET /users/{username}/events/orgs/{org}",
|
|
"GET /users/{username}/events/public",
|
|
"GET /users/{username}/followers",
|
|
"GET /users/{username}/following",
|
|
"GET /users/{username}/gists",
|
|
"GET /users/{username}/gpg_keys",
|
|
"GET /users/{username}/keys",
|
|
"GET /users/{username}/orgs",
|
|
"GET /users/{username}/packages",
|
|
"GET /users/{username}/projects",
|
|
"GET /users/{username}/received_events",
|
|
"GET /users/{username}/received_events/public",
|
|
"GET /users/{username}/repos",
|
|
"GET /users/{username}/social_accounts",
|
|
"GET /users/{username}/ssh_signing_keys",
|
|
"GET /users/{username}/starred",
|
|
"GET /users/{username}/subscriptions"
|
|
];
|
|
function isPaginatingEndpoint(arg) {
|
|
if (typeof arg === "string") {
|
|
return paginatingEndpoints.includes(arg);
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
function paginateRest(octokit) {
|
|
return {
|
|
paginate: Object.assign(paginate.bind(null, octokit), {
|
|
iterator: iterator.bind(null, octokit)
|
|
})
|
|
};
|
|
}
|
|
paginateRest.VERSION = VERSION;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_utils3 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() {
|
|
return m[k];
|
|
} };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
|
|
var Context = __importStar(require_context());
|
|
var Utils = __importStar(require_utils2());
|
|
var core_1 = require_dist_node8();
|
|
var plugin_rest_endpoint_methods_1 = require_dist_node9();
|
|
var plugin_paginate_rest_1 = require_dist_node10();
|
|
exports.context = new Context.Context();
|
|
var baseUrl = Utils.getApiBaseUrl();
|
|
exports.defaults = {
|
|
baseUrl,
|
|
request: {
|
|
agent: Utils.getProxyAgent(baseUrl),
|
|
fetch: Utils.getProxyFetch(baseUrl)
|
|
}
|
|
};
|
|
exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
|
|
function getOctokitOptions(token, options) {
|
|
const opts = Object.assign({}, options || {});
|
|
const auth = Utils.getAuthString(token, opts);
|
|
if (auth) {
|
|
opts.auth = auth;
|
|
}
|
|
return opts;
|
|
}
|
|
exports.getOctokitOptions = getOctokitOptions;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_github = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() {
|
|
return m[k];
|
|
} };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
} : function(o, m, k, k2) {
|
|
if (k2 === void 0)
|
|
k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
} : function(o, v) {
|
|
o["default"] = v;
|
|
});
|
|
var __importStar = exports && exports.__importStar || function(mod) {
|
|
if (mod && mod.__esModule)
|
|
return mod;
|
|
var result = {};
|
|
if (mod != null) {
|
|
for (var k in mod)
|
|
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
__createBinding(result, mod, k);
|
|
}
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getOctokit = exports.context = void 0;
|
|
var Context = __importStar(require_context());
|
|
var utils_1 = require_utils3();
|
|
exports.context = new Context.Context();
|
|
function getOctokit(token, options, ...additionalPlugins) {
|
|
const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
|
|
return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
|
|
}
|
|
exports.getOctokit = getOctokit;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_tmp = __commonJS({
|
|
""(exports, module) {
|
|
var fs = __require("fs");
|
|
var os3 = __require("os");
|
|
var path = __require("path");
|
|
var crypto = __require("crypto");
|
|
var _c = { fs: fs.constants, os: os3.constants };
|
|
var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
var TEMPLATE_PATTERN = /XXXXXX/;
|
|
var DEFAULT_TRIES = 3;
|
|
var CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR);
|
|
var IS_WIN32 = os3.platform() === "win32";
|
|
var EBADF = _c.EBADF || _c.os.errno.EBADF;
|
|
var ENOENT = _c.ENOENT || _c.os.errno.ENOENT;
|
|
var DIR_MODE = 448;
|
|
var FILE_MODE = 384;
|
|
var EXIT = "exit";
|
|
var _removeObjects = [];
|
|
var FN_RMDIR_SYNC = fs.rmdirSync.bind(fs);
|
|
var _gracefulCleanup = false;
|
|
function rimraf(dirPath, callback) {
|
|
return fs.rm(dirPath, { recursive: true }, callback);
|
|
}
|
|
function FN_RIMRAF_SYNC(dirPath) {
|
|
return fs.rmSync(dirPath, { recursive: true });
|
|
}
|
|
function tmpName(options, callback) {
|
|
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
try {
|
|
_assertAndSanitizeOptions(opts);
|
|
} catch (err) {
|
|
return cb(err);
|
|
}
|
|
let tries = opts.tries;
|
|
(function _getUniqueName() {
|
|
try {
|
|
const name = _generateTmpName(opts);
|
|
fs.stat(name, function(err) {
|
|
if (!err) {
|
|
if (tries-- > 0)
|
|
return _getUniqueName();
|
|
return cb(new Error("Could not get a unique tmp filename, max tries reached " + name));
|
|
}
|
|
cb(null, name);
|
|
});
|
|
} catch (err) {
|
|
cb(err);
|
|
}
|
|
})();
|
|
}
|
|
function tmpNameSync(options) {
|
|
const args = _parseArguments(options), opts = args[0];
|
|
_assertAndSanitizeOptions(opts);
|
|
let tries = opts.tries;
|
|
do {
|
|
const name = _generateTmpName(opts);
|
|
try {
|
|
fs.statSync(name);
|
|
} catch (e) {
|
|
return name;
|
|
}
|
|
} while (tries-- > 0);
|
|
throw new Error("Could not get a unique tmp filename, max tries reached");
|
|
}
|
|
function file(options, callback) {
|
|
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
tmpName(opts, function _tmpNameCreated(err, name) {
|
|
if (err)
|
|
return cb(err);
|
|
fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
|
|
if (err2)
|
|
return cb(err2);
|
|
if (opts.discardDescriptor) {
|
|
return fs.close(fd, function _discardCallback(possibleErr) {
|
|
return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false));
|
|
});
|
|
} else {
|
|
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false));
|
|
}
|
|
});
|
|
});
|
|
}
|
|
function fileSync2(options) {
|
|
const args = _parseArguments(options), opts = args[0];
|
|
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
const name = tmpNameSync(opts);
|
|
var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
|
|
if (opts.discardDescriptor) {
|
|
fs.closeSync(fd);
|
|
fd = void 0;
|
|
}
|
|
return {
|
|
name,
|
|
fd,
|
|
removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true)
|
|
};
|
|
}
|
|
function dir(options, callback) {
|
|
const args = _parseArguments(options, callback), opts = args[0], cb = args[1];
|
|
tmpName(opts, function _tmpNameCreated(err, name) {
|
|
if (err)
|
|
return cb(err);
|
|
fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) {
|
|
if (err2)
|
|
return cb(err2);
|
|
cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false));
|
|
});
|
|
});
|
|
}
|
|
function dirSync(options) {
|
|
const args = _parseArguments(options), opts = args[0];
|
|
const name = tmpNameSync(opts);
|
|
fs.mkdirSync(name, opts.mode || DIR_MODE);
|
|
return {
|
|
name,
|
|
removeCallback: _prepareTmpDirRemoveCallback(name, opts, true)
|
|
};
|
|
}
|
|
function _removeFileAsync(fdPath, next) {
|
|
const _handler = function(err) {
|
|
if (err && !_isENOENT(err)) {
|
|
return next(err);
|
|
}
|
|
next();
|
|
};
|
|
if (0 <= fdPath[0])
|
|
fs.close(fdPath[0], function() {
|
|
fs.unlink(fdPath[1], _handler);
|
|
});
|
|
else
|
|
fs.unlink(fdPath[1], _handler);
|
|
}
|
|
function _removeFileSync(fdPath) {
|
|
let rethrownException = null;
|
|
try {
|
|
if (0 <= fdPath[0])
|
|
fs.closeSync(fdPath[0]);
|
|
} catch (e) {
|
|
if (!_isEBADF(e) && !_isENOENT(e))
|
|
throw e;
|
|
} finally {
|
|
try {
|
|
fs.unlinkSync(fdPath[1]);
|
|
} catch (e) {
|
|
if (!_isENOENT(e))
|
|
rethrownException = e;
|
|
}
|
|
}
|
|
if (rethrownException !== null) {
|
|
throw rethrownException;
|
|
}
|
|
}
|
|
function _prepareTmpFileRemoveCallback(name, fd, opts, sync) {
|
|
const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync);
|
|
const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync);
|
|
if (!opts.keep)
|
|
_removeObjects.unshift(removeCallbackSync);
|
|
return sync ? removeCallbackSync : removeCallback;
|
|
}
|
|
function _prepareTmpDirRemoveCallback(name, opts, sync) {
|
|
const removeFunction = opts.unsafeCleanup ? rimraf : fs.rmdir.bind(fs);
|
|
const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;
|
|
const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync);
|
|
const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync);
|
|
if (!opts.keep)
|
|
_removeObjects.unshift(removeCallbackSync);
|
|
return sync ? removeCallbackSync : removeCallback;
|
|
}
|
|
function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
|
|
let called = false;
|
|
return function _cleanupCallback(next) {
|
|
if (!called) {
|
|
const toRemove = cleanupCallbackSync || _cleanupCallback;
|
|
const index = _removeObjects.indexOf(toRemove);
|
|
if (index >= 0)
|
|
_removeObjects.splice(index, 1);
|
|
called = true;
|
|
if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {
|
|
return removeFunction(fileOrDirName);
|
|
} else {
|
|
return removeFunction(fileOrDirName, next || function() {
|
|
});
|
|
}
|
|
}
|
|
};
|
|
}
|
|
function _garbageCollector() {
|
|
if (!_gracefulCleanup)
|
|
return;
|
|
while (_removeObjects.length) {
|
|
try {
|
|
_removeObjects[0]();
|
|
} catch (e) {
|
|
}
|
|
}
|
|
}
|
|
function _randomChars(howMany) {
|
|
let value = [], rnd = null;
|
|
try {
|
|
rnd = crypto.randomBytes(howMany);
|
|
} catch (e) {
|
|
rnd = crypto.pseudoRandomBytes(howMany);
|
|
}
|
|
for (var i = 0; i < howMany; i++) {
|
|
value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
|
|
}
|
|
return value.join("");
|
|
}
|
|
function _isBlank(s) {
|
|
return s === null || _isUndefined(s) || !s.trim();
|
|
}
|
|
function _isUndefined(obj) {
|
|
return typeof obj === "undefined";
|
|
}
|
|
function _parseArguments(options, callback) {
|
|
if (typeof options === "function") {
|
|
return [{}, options];
|
|
}
|
|
if (_isUndefined(options)) {
|
|
return [{}, callback];
|
|
}
|
|
const actualOptions = {};
|
|
for (const key of Object.getOwnPropertyNames(options)) {
|
|
actualOptions[key] = options[key];
|
|
}
|
|
return [actualOptions, callback];
|
|
}
|
|
function _generateTmpName(opts) {
|
|
const tmpDir = opts.tmpdir;
|
|
if (!_isUndefined(opts.name))
|
|
return path.join(tmpDir, opts.dir, opts.name);
|
|
if (!_isUndefined(opts.template))
|
|
return path.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
|
|
const name = [
|
|
opts.prefix ? opts.prefix : "tmp",
|
|
"-",
|
|
process.pid,
|
|
"-",
|
|
_randomChars(12),
|
|
opts.postfix ? "-" + opts.postfix : ""
|
|
].join("");
|
|
return path.join(tmpDir, opts.dir, name);
|
|
}
|
|
function _assertAndSanitizeOptions(options) {
|
|
options.tmpdir = _getTmpDir(options);
|
|
const tmpDir = options.tmpdir;
|
|
if (!_isUndefined(options.name))
|
|
_assertIsRelative(options.name, "name", tmpDir);
|
|
if (!_isUndefined(options.dir))
|
|
_assertIsRelative(options.dir, "dir", tmpDir);
|
|
if (!_isUndefined(options.template)) {
|
|
_assertIsRelative(options.template, "template", tmpDir);
|
|
if (!options.template.match(TEMPLATE_PATTERN))
|
|
throw new Error(`Invalid template, found "${options.template}".`);
|
|
}
|
|
if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0)
|
|
throw new Error(`Invalid tries, found "${options.tries}".`);
|
|
options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1;
|
|
options.keep = !!options.keep;
|
|
options.detachDescriptor = !!options.detachDescriptor;
|
|
options.discardDescriptor = !!options.discardDescriptor;
|
|
options.unsafeCleanup = !!options.unsafeCleanup;
|
|
options.dir = _isUndefined(options.dir) ? "" : path.relative(tmpDir, _resolvePath(options.dir, tmpDir));
|
|
options.template = _isUndefined(options.template) ? void 0 : path.relative(tmpDir, _resolvePath(options.template, tmpDir));
|
|
options.template = _isBlank(options.template) ? void 0 : path.relative(options.dir, options.template);
|
|
options.name = _isUndefined(options.name) ? void 0 : options.name;
|
|
options.prefix = _isUndefined(options.prefix) ? "" : options.prefix;
|
|
options.postfix = _isUndefined(options.postfix) ? "" : options.postfix;
|
|
}
|
|
function _resolvePath(name, tmpDir) {
|
|
if (name.startsWith(tmpDir)) {
|
|
return path.resolve(name);
|
|
} else {
|
|
return path.resolve(path.join(tmpDir, name));
|
|
}
|
|
}
|
|
function _assertIsRelative(name, option, tmpDir) {
|
|
if (option === "name") {
|
|
if (path.isAbsolute(name))
|
|
throw new Error(`${option} option must not contain an absolute path, found "${name}".`);
|
|
let basename = path.basename(name);
|
|
if (basename === ".." || basename === "." || basename !== name)
|
|
throw new Error(`${option} option must not contain a path, found "${name}".`);
|
|
} else {
|
|
if (path.isAbsolute(name) && !name.startsWith(tmpDir)) {
|
|
throw new Error(`${option} option must be relative to "${tmpDir}", found "${name}".`);
|
|
}
|
|
let resolvedPath = _resolvePath(name, tmpDir);
|
|
if (!resolvedPath.startsWith(tmpDir))
|
|
throw new Error(`${option} option must be relative to "${tmpDir}", found "${resolvedPath}".`);
|
|
}
|
|
}
|
|
function _isEBADF(error) {
|
|
return _isExpectedError(error, -EBADF, "EBADF");
|
|
}
|
|
function _isENOENT(error) {
|
|
return _isExpectedError(error, -ENOENT, "ENOENT");
|
|
}
|
|
function _isExpectedError(error, errno, code) {
|
|
return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno;
|
|
}
|
|
function setGracefulCleanup() {
|
|
_gracefulCleanup = true;
|
|
}
|
|
function _getTmpDir(options) {
|
|
return path.resolve(options && options.tmpdir || os3.tmpdir());
|
|
}
|
|
process.addListener(EXIT, _garbageCollector);
|
|
Object.defineProperty(module.exports, "tmpdir", {
|
|
enumerable: true,
|
|
configurable: false,
|
|
get: function() {
|
|
return _getTmpDir();
|
|
}
|
|
});
|
|
module.exports.dir = dir;
|
|
module.exports.dirSync = dirSync;
|
|
module.exports.file = file;
|
|
module.exports.fileSync = fileSync2;
|
|
module.exports.tmpName = tmpName;
|
|
module.exports.tmpNameSync = tmpNameSync;
|
|
module.exports.setGracefulCleanup = setGracefulCleanup;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_constants = __commonJS({
|
|
""(exports, module) {
|
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
var MAX_LENGTH = 256;
|
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
var RELEASE_TYPES = [
|
|
"major",
|
|
"premajor",
|
|
"minor",
|
|
"preminor",
|
|
"patch",
|
|
"prepatch",
|
|
"prerelease"
|
|
];
|
|
module.exports = {
|
|
MAX_LENGTH,
|
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
MAX_SAFE_BUILD_LENGTH,
|
|
MAX_SAFE_INTEGER,
|
|
RELEASE_TYPES,
|
|
SEMVER_SPEC_VERSION,
|
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
FLAG_LOOSE: 2
|
|
};
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_debug = __commonJS({
|
|
""(exports, module) {
|
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
};
|
|
module.exports = debug;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_re = __commonJS({
|
|
""(exports, module) {
|
|
var {
|
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
MAX_SAFE_BUILD_LENGTH,
|
|
MAX_LENGTH
|
|
} = require_constants();
|
|
var debug = require_debug();
|
|
exports = module.exports = {};
|
|
var re = exports.re = [];
|
|
var safeRe = exports.safeRe = [];
|
|
var src = exports.src = [];
|
|
var t = exports.t = {};
|
|
var R = 0;
|
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
var safeRegexReplacements = [
|
|
["\\s", 1],
|
|
["\\d", MAX_LENGTH],
|
|
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
];
|
|
var makeSafeRegex = (value) => {
|
|
for (const [token, max] of safeRegexReplacements) {
|
|
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
}
|
|
return value;
|
|
};
|
|
var createToken = (name, value, isGlobal) => {
|
|
const safe = makeSafeRegex(value);
|
|
const index = R++;
|
|
debug(name, index, value);
|
|
t[name] = index;
|
|
src[index] = value;
|
|
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
};
|
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
createToken("GTLT", "((?:<|>)?=?)");
|
|
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
createToken("COERCERTL", src[t.COERCE], true);
|
|
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
createToken("LONETILDE", "(?:~>?)");
|
|
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
exports.tildeTrimReplace = "$1~";
|
|
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
createToken("LONECARET", "(?:\\^)");
|
|
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
exports.caretTrimReplace = "$1^";
|
|
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
exports.comparatorTrimReplace = "$1$2$3";
|
|
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_parse_options = __commonJS({
|
|
""(exports, module) {
|
|
var looseOption = Object.freeze({ loose: true });
|
|
var emptyOpts = Object.freeze({});
|
|
var parseOptions = (options) => {
|
|
if (!options) {
|
|
return emptyOpts;
|
|
}
|
|
if (typeof options !== "object") {
|
|
return looseOption;
|
|
}
|
|
return options;
|
|
};
|
|
module.exports = parseOptions;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_identifiers = __commonJS({
|
|
""(exports, module) {
|
|
var numeric = /^[0-9]+$/;
|
|
var compareIdentifiers = (a, b) => {
|
|
const anum = numeric.test(a);
|
|
const bnum = numeric.test(b);
|
|
if (anum && bnum) {
|
|
a = +a;
|
|
b = +b;
|
|
}
|
|
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
};
|
|
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
module.exports = {
|
|
compareIdentifiers,
|
|
rcompareIdentifiers
|
|
};
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_semver = __commonJS({
|
|
""(exports, module) {
|
|
var debug = require_debug();
|
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
var { safeRe: re, t } = require_re();
|
|
var parseOptions = require_parse_options();
|
|
var { compareIdentifiers } = require_identifiers();
|
|
var SemVer = class {
|
|
constructor(version, options) {
|
|
options = parseOptions(options);
|
|
if (version instanceof SemVer) {
|
|
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
return version;
|
|
} else {
|
|
version = version.version;
|
|
}
|
|
} else if (typeof version !== "string") {
|
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
}
|
|
if (version.length > MAX_LENGTH) {
|
|
throw new TypeError(
|
|
`version is longer than ${MAX_LENGTH} characters`
|
|
);
|
|
}
|
|
debug("SemVer", version, options);
|
|
this.options = options;
|
|
this.loose = !!options.loose;
|
|
this.includePrerelease = !!options.includePrerelease;
|
|
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
if (!m) {
|
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
}
|
|
this.raw = version;
|
|
this.major = +m[1];
|
|
this.minor = +m[2];
|
|
this.patch = +m[3];
|
|
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
throw new TypeError("Invalid major version");
|
|
}
|
|
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
throw new TypeError("Invalid minor version");
|
|
}
|
|
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
throw new TypeError("Invalid patch version");
|
|
}
|
|
if (!m[4]) {
|
|
this.prerelease = [];
|
|
} else {
|
|
this.prerelease = m[4].split(".").map((id) => {
|
|
if (/^[0-9]+$/.test(id)) {
|
|
const num = +id;
|
|
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
return num;
|
|
}
|
|
}
|
|
return id;
|
|
});
|
|
}
|
|
this.build = m[5] ? m[5].split(".") : [];
|
|
this.format();
|
|
}
|
|
format() {
|
|
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
if (this.prerelease.length) {
|
|
this.version += `-${this.prerelease.join(".")}`;
|
|
}
|
|
return this.version;
|
|
}
|
|
toString() {
|
|
return this.version;
|
|
}
|
|
compare(other) {
|
|
debug("SemVer.compare", this.version, this.options, other);
|
|
if (!(other instanceof SemVer)) {
|
|
if (typeof other === "string" && other === this.version) {
|
|
return 0;
|
|
}
|
|
other = new SemVer(other, this.options);
|
|
}
|
|
if (other.version === this.version) {
|
|
return 0;
|
|
}
|
|
return this.compareMain(other) || this.comparePre(other);
|
|
}
|
|
compareMain(other) {
|
|
if (!(other instanceof SemVer)) {
|
|
other = new SemVer(other, this.options);
|
|
}
|
|
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
}
|
|
comparePre(other) {
|
|
if (!(other instanceof SemVer)) {
|
|
other = new SemVer(other, this.options);
|
|
}
|
|
if (this.prerelease.length && !other.prerelease.length) {
|
|
return -1;
|
|
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
return 1;
|
|
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
return 0;
|
|
}
|
|
let i = 0;
|
|
do {
|
|
const a = this.prerelease[i];
|
|
const b = other.prerelease[i];
|
|
debug("prerelease compare", i, a, b);
|
|
if (a === void 0 && b === void 0) {
|
|
return 0;
|
|
} else if (b === void 0) {
|
|
return 1;
|
|
} else if (a === void 0) {
|
|
return -1;
|
|
} else if (a === b) {
|
|
continue;
|
|
} else {
|
|
return compareIdentifiers(a, b);
|
|
}
|
|
} while (++i);
|
|
}
|
|
compareBuild(other) {
|
|
if (!(other instanceof SemVer)) {
|
|
other = new SemVer(other, this.options);
|
|
}
|
|
let i = 0;
|
|
do {
|
|
const a = this.build[i];
|
|
const b = other.build[i];
|
|
debug("build compare", i, a, b);
|
|
if (a === void 0 && b === void 0) {
|
|
return 0;
|
|
} else if (b === void 0) {
|
|
return 1;
|
|
} else if (a === void 0) {
|
|
return -1;
|
|
} else if (a === b) {
|
|
continue;
|
|
} else {
|
|
return compareIdentifiers(a, b);
|
|
}
|
|
} while (++i);
|
|
}
|
|
inc(release, identifier, identifierBase) {
|
|
switch (release) {
|
|
case "premajor":
|
|
this.prerelease.length = 0;
|
|
this.patch = 0;
|
|
this.minor = 0;
|
|
this.major++;
|
|
this.inc("pre", identifier, identifierBase);
|
|
break;
|
|
case "preminor":
|
|
this.prerelease.length = 0;
|
|
this.patch = 0;
|
|
this.minor++;
|
|
this.inc("pre", identifier, identifierBase);
|
|
break;
|
|
case "prepatch":
|
|
this.prerelease.length = 0;
|
|
this.inc("patch", identifier, identifierBase);
|
|
this.inc("pre", identifier, identifierBase);
|
|
break;
|
|
case "prerelease":
|
|
if (this.prerelease.length === 0) {
|
|
this.inc("patch", identifier, identifierBase);
|
|
}
|
|
this.inc("pre", identifier, identifierBase);
|
|
break;
|
|
case "major":
|
|
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
this.major++;
|
|
}
|
|
this.minor = 0;
|
|
this.patch = 0;
|
|
this.prerelease = [];
|
|
break;
|
|
case "minor":
|
|
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
this.minor++;
|
|
}
|
|
this.patch = 0;
|
|
this.prerelease = [];
|
|
break;
|
|
case "patch":
|
|
if (this.prerelease.length === 0) {
|
|
this.patch++;
|
|
}
|
|
this.prerelease = [];
|
|
break;
|
|
case "pre": {
|
|
const base = Number(identifierBase) ? 1 : 0;
|
|
if (!identifier && identifierBase === false) {
|
|
throw new Error("invalid increment argument: identifier is empty");
|
|
}
|
|
if (this.prerelease.length === 0) {
|
|
this.prerelease = [base];
|
|
} else {
|
|
let i = this.prerelease.length;
|
|
while (--i >= 0) {
|
|
if (typeof this.prerelease[i] === "number") {
|
|
this.prerelease[i]++;
|
|
i = -2;
|
|
}
|
|
}
|
|
if (i === -1) {
|
|
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
throw new Error("invalid increment argument: identifier already exists");
|
|
}
|
|
this.prerelease.push(base);
|
|
}
|
|
}
|
|
if (identifier) {
|
|
let prerelease = [identifier, base];
|
|
if (identifierBase === false) {
|
|
prerelease = [identifier];
|
|
}
|
|
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
if (isNaN(this.prerelease[1])) {
|
|
this.prerelease = prerelease;
|
|
}
|
|
} else {
|
|
this.prerelease = prerelease;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
throw new Error(`invalid increment argument: ${release}`);
|
|
}
|
|
this.raw = this.format();
|
|
if (this.build.length) {
|
|
this.raw += `+${this.build.join(".")}`;
|
|
}
|
|
return this;
|
|
}
|
|
};
|
|
module.exports = SemVer;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_parse2 = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var parse = (version, options, throwErrors = false) => {
|
|
if (version instanceof SemVer) {
|
|
return version;
|
|
}
|
|
try {
|
|
return new SemVer(version, options);
|
|
} catch (er) {
|
|
if (!throwErrors) {
|
|
return null;
|
|
}
|
|
throw er;
|
|
}
|
|
};
|
|
module.exports = parse;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_valid = __commonJS({
|
|
""(exports, module) {
|
|
var parse = require_parse2();
|
|
var valid = (version, options) => {
|
|
const v = parse(version, options);
|
|
return v ? v.version : null;
|
|
};
|
|
module.exports = valid;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_clean = __commonJS({
|
|
""(exports, module) {
|
|
var parse = require_parse2();
|
|
var clean = (version, options) => {
|
|
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
return s ? s.version : null;
|
|
};
|
|
module.exports = clean;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_inc = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var inc = (version, release, options, identifier, identifierBase) => {
|
|
if (typeof options === "string") {
|
|
identifierBase = identifier;
|
|
identifier = options;
|
|
options = void 0;
|
|
}
|
|
try {
|
|
return new SemVer(
|
|
version instanceof SemVer ? version.version : version,
|
|
options
|
|
).inc(release, identifier, identifierBase).version;
|
|
} catch (er) {
|
|
return null;
|
|
}
|
|
};
|
|
module.exports = inc;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_diff = __commonJS({
|
|
""(exports, module) {
|
|
var parse = require_parse2();
|
|
var diff = (version1, version2) => {
|
|
const v1 = parse(version1, null, true);
|
|
const v2 = parse(version2, null, true);
|
|
const comparison = v1.compare(v2);
|
|
if (comparison === 0) {
|
|
return null;
|
|
}
|
|
const v1Higher = comparison > 0;
|
|
const highVersion = v1Higher ? v1 : v2;
|
|
const lowVersion = v1Higher ? v2 : v1;
|
|
const highHasPre = !!highVersion.prerelease.length;
|
|
const lowHasPre = !!lowVersion.prerelease.length;
|
|
if (lowHasPre && !highHasPre) {
|
|
if (!lowVersion.patch && !lowVersion.minor) {
|
|
return "major";
|
|
}
|
|
if (highVersion.patch) {
|
|
return "patch";
|
|
}
|
|
if (highVersion.minor) {
|
|
return "minor";
|
|
}
|
|
return "major";
|
|
}
|
|
const prefix = highHasPre ? "pre" : "";
|
|
if (v1.major !== v2.major) {
|
|
return prefix + "major";
|
|
}
|
|
if (v1.minor !== v2.minor) {
|
|
return prefix + "minor";
|
|
}
|
|
if (v1.patch !== v2.patch) {
|
|
return prefix + "patch";
|
|
}
|
|
return "prerelease";
|
|
};
|
|
module.exports = diff;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_major = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var major = (a, loose) => new SemVer(a, loose).major;
|
|
module.exports = major;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_minor = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
module.exports = minor;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_patch = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
module.exports = patch;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_prerelease = __commonJS({
|
|
""(exports, module) {
|
|
var parse = require_parse2();
|
|
var prerelease = (version, options) => {
|
|
const parsed = parse(version, options);
|
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
};
|
|
module.exports = prerelease;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_compare = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
module.exports = compare;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_rcompare = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
module.exports = rcompare;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_compare_loose = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var compareLoose = (a, b) => compare(a, b, true);
|
|
module.exports = compareLoose;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_compare_build = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var compareBuild = (a, b, loose) => {
|
|
const versionA = new SemVer(a, loose);
|
|
const versionB = new SemVer(b, loose);
|
|
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
};
|
|
module.exports = compareBuild;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_sort = __commonJS({
|
|
""(exports, module) {
|
|
var compareBuild = require_compare_build();
|
|
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
module.exports = sort;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_rsort = __commonJS({
|
|
""(exports, module) {
|
|
var compareBuild = require_compare_build();
|
|
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
module.exports = rsort;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_gt = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
module.exports = gt;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_lt = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
module.exports = lt;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_eq = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
module.exports = eq;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_neq = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
module.exports = neq;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_gte = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
module.exports = gte;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_lte = __commonJS({
|
|
""(exports, module) {
|
|
var compare = require_compare();
|
|
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
module.exports = lte;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_cmp = __commonJS({
|
|
""(exports, module) {
|
|
var eq = require_eq();
|
|
var neq = require_neq();
|
|
var gt = require_gt();
|
|
var gte = require_gte();
|
|
var lt = require_lt();
|
|
var lte = require_lte();
|
|
var cmp = (a, op, b, loose) => {
|
|
switch (op) {
|
|
case "===":
|
|
if (typeof a === "object") {
|
|
a = a.version;
|
|
}
|
|
if (typeof b === "object") {
|
|
b = b.version;
|
|
}
|
|
return a === b;
|
|
case "!==":
|
|
if (typeof a === "object") {
|
|
a = a.version;
|
|
}
|
|
if (typeof b === "object") {
|
|
b = b.version;
|
|
}
|
|
return a !== b;
|
|
case "":
|
|
case "=":
|
|
case "==":
|
|
return eq(a, b, loose);
|
|
case "!=":
|
|
return neq(a, b, loose);
|
|
case ">":
|
|
return gt(a, b, loose);
|
|
case ">=":
|
|
return gte(a, b, loose);
|
|
case "<":
|
|
return lt(a, b, loose);
|
|
case "<=":
|
|
return lte(a, b, loose);
|
|
default:
|
|
throw new TypeError(`Invalid operator: ${op}`);
|
|
}
|
|
};
|
|
module.exports = cmp;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_coerce = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var parse = require_parse2();
|
|
var { safeRe: re, t } = require_re();
|
|
var coerce = (version, options) => {
|
|
if (version instanceof SemVer) {
|
|
return version;
|
|
}
|
|
if (typeof version === "number") {
|
|
version = String(version);
|
|
}
|
|
if (typeof version !== "string") {
|
|
return null;
|
|
}
|
|
options = options || {};
|
|
let match = null;
|
|
if (!options.rtl) {
|
|
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
} else {
|
|
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
let next;
|
|
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
match = next;
|
|
}
|
|
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
}
|
|
coerceRtlRegex.lastIndex = -1;
|
|
}
|
|
if (match === null) {
|
|
return null;
|
|
}
|
|
const major = match[2];
|
|
const minor = match[3] || "0";
|
|
const patch = match[4] || "0";
|
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
};
|
|
module.exports = coerce;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_lrucache = __commonJS({
|
|
""(exports, module) {
|
|
var LRUCache = class {
|
|
constructor() {
|
|
this.max = 1e3;
|
|
this.map = /* @__PURE__ */ new Map();
|
|
}
|
|
get(key) {
|
|
const value = this.map.get(key);
|
|
if (value === void 0) {
|
|
return void 0;
|
|
} else {
|
|
this.map.delete(key);
|
|
this.map.set(key, value);
|
|
return value;
|
|
}
|
|
}
|
|
delete(key) {
|
|
return this.map.delete(key);
|
|
}
|
|
set(key, value) {
|
|
const deleted = this.delete(key);
|
|
if (!deleted && value !== void 0) {
|
|
if (this.map.size >= this.max) {
|
|
const firstKey = this.map.keys().next().value;
|
|
this.delete(firstKey);
|
|
}
|
|
this.map.set(key, value);
|
|
}
|
|
return this;
|
|
}
|
|
};
|
|
module.exports = LRUCache;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_range = __commonJS({
|
|
""(exports, module) {
|
|
var Range = class {
|
|
constructor(range, options) {
|
|
options = parseOptions(options);
|
|
if (range instanceof Range) {
|
|
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
return range;
|
|
} else {
|
|
return new Range(range.raw, options);
|
|
}
|
|
}
|
|
if (range instanceof Comparator) {
|
|
this.raw = range.value;
|
|
this.set = [[range]];
|
|
this.format();
|
|
return this;
|
|
}
|
|
this.options = options;
|
|
this.loose = !!options.loose;
|
|
this.includePrerelease = !!options.includePrerelease;
|
|
this.raw = range.trim().split(/\s+/).join(" ");
|
|
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
if (!this.set.length) {
|
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
}
|
|
if (this.set.length > 1) {
|
|
const first = this.set[0];
|
|
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
if (this.set.length === 0) {
|
|
this.set = [first];
|
|
} else if (this.set.length > 1) {
|
|
for (const c of this.set) {
|
|
if (c.length === 1 && isAny(c[0])) {
|
|
this.set = [c];
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.format();
|
|
}
|
|
format() {
|
|
this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim();
|
|
return this.range;
|
|
}
|
|
toString() {
|
|
return this.range;
|
|
}
|
|
parseRange(range) {
|
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
const memoKey = memoOpts + ":" + range;
|
|
const cached = cache.get(memoKey);
|
|
if (cached) {
|
|
return cached;
|
|
}
|
|
const loose = this.options.loose;
|
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
debug("hyphen replace", range);
|
|
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
debug("comparator trim", range);
|
|
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
debug("tilde trim", range);
|
|
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
debug("caret trim", range);
|
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
if (loose) {
|
|
rangeList = rangeList.filter((comp) => {
|
|
debug("loose invalid filter", comp, this.options);
|
|
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
});
|
|
}
|
|
debug("range list", rangeList);
|
|
const rangeMap = /* @__PURE__ */ new Map();
|
|
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
for (const comp of comparators) {
|
|
if (isNullSet(comp)) {
|
|
return [comp];
|
|
}
|
|
rangeMap.set(comp.value, comp);
|
|
}
|
|
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
rangeMap.delete("");
|
|
}
|
|
const result = [...rangeMap.values()];
|
|
cache.set(memoKey, result);
|
|
return result;
|
|
}
|
|
intersects(range, options) {
|
|
if (!(range instanceof Range)) {
|
|
throw new TypeError("a Range is required");
|
|
}
|
|
return this.set.some((thisComparators) => {
|
|
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
return rangeComparators.every((rangeComparator) => {
|
|
return thisComparator.intersects(rangeComparator, options);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
test(version) {
|
|
if (!version) {
|
|
return false;
|
|
}
|
|
if (typeof version === "string") {
|
|
try {
|
|
version = new SemVer(version, this.options);
|
|
} catch (er) {
|
|
return false;
|
|
}
|
|
}
|
|
for (let i = 0; i < this.set.length; i++) {
|
|
if (testSet(this.set[i], version, this.options)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
};
|
|
module.exports = Range;
|
|
var LRU = require_lrucache();
|
|
var cache = new LRU();
|
|
var parseOptions = require_parse_options();
|
|
var Comparator = require_comparator();
|
|
var debug = require_debug();
|
|
var SemVer = require_semver();
|
|
var {
|
|
safeRe: re,
|
|
t,
|
|
comparatorTrimReplace,
|
|
tildeTrimReplace,
|
|
caretTrimReplace
|
|
} = require_re();
|
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
var isAny = (c) => c.value === "";
|
|
var isSatisfiable = (comparators, options) => {
|
|
let result = true;
|
|
const remainingComparators = comparators.slice();
|
|
let testComparator = remainingComparators.pop();
|
|
while (result && remainingComparators.length) {
|
|
result = remainingComparators.every((otherComparator) => {
|
|
return testComparator.intersects(otherComparator, options);
|
|
});
|
|
testComparator = remainingComparators.pop();
|
|
}
|
|
return result;
|
|
};
|
|
var parseComparator = (comp, options) => {
|
|
debug("comp", comp, options);
|
|
comp = replaceCarets(comp, options);
|
|
debug("caret", comp);
|
|
comp = replaceTildes(comp, options);
|
|
debug("tildes", comp);
|
|
comp = replaceXRanges(comp, options);
|
|
debug("xrange", comp);
|
|
comp = replaceStars(comp, options);
|
|
debug("stars", comp);
|
|
return comp;
|
|
};
|
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
var replaceTildes = (comp, options) => {
|
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
};
|
|
var replaceTilde = (comp, options) => {
|
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
debug("tilde", comp, _, M, m, p, pr);
|
|
let ret;
|
|
if (isX(M)) {
|
|
ret = "";
|
|
} else if (isX(m)) {
|
|
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
} else if (isX(p)) {
|
|
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
} else if (pr) {
|
|
debug("replaceTilde pr", pr);
|
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
} else {
|
|
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
}
|
|
debug("tilde return", ret);
|
|
return ret;
|
|
});
|
|
};
|
|
var replaceCarets = (comp, options) => {
|
|
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
};
|
|
var replaceCaret = (comp, options) => {
|
|
debug("caret", comp, options);
|
|
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
const z = options.includePrerelease ? "-0" : "";
|
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
debug("caret", comp, _, M, m, p, pr);
|
|
let ret;
|
|
if (isX(M)) {
|
|
ret = "";
|
|
} else if (isX(m)) {
|
|
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
} else if (isX(p)) {
|
|
if (M === "0") {
|
|
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
} else {
|
|
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
}
|
|
} else if (pr) {
|
|
debug("replaceCaret pr", pr);
|
|
if (M === "0") {
|
|
if (m === "0") {
|
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
} else {
|
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
}
|
|
} else {
|
|
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
}
|
|
} else {
|
|
debug("no pr");
|
|
if (M === "0") {
|
|
if (m === "0") {
|
|
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
} else {
|
|
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
}
|
|
} else {
|
|
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
}
|
|
}
|
|
debug("caret return", ret);
|
|
return ret;
|
|
});
|
|
};
|
|
var replaceXRanges = (comp, options) => {
|
|
debug("replaceXRanges", comp, options);
|
|
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
};
|
|
var replaceXRange = (comp, options) => {
|
|
comp = comp.trim();
|
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
const xM = isX(M);
|
|
const xm = xM || isX(m);
|
|
const xp = xm || isX(p);
|
|
const anyX = xp;
|
|
if (gtlt === "=" && anyX) {
|
|
gtlt = "";
|
|
}
|
|
pr = options.includePrerelease ? "-0" : "";
|
|
if (xM) {
|
|
if (gtlt === ">" || gtlt === "<") {
|
|
ret = "<0.0.0-0";
|
|
} else {
|
|
ret = "*";
|
|
}
|
|
} else if (gtlt && anyX) {
|
|
if (xm) {
|
|
m = 0;
|
|
}
|
|
p = 0;
|
|
if (gtlt === ">") {
|
|
gtlt = ">=";
|
|
if (xm) {
|
|
M = +M + 1;
|
|
m = 0;
|
|
p = 0;
|
|
} else {
|
|
m = +m + 1;
|
|
p = 0;
|
|
}
|
|
} else if (gtlt === "<=") {
|
|
gtlt = "<";
|
|
if (xm) {
|
|
M = +M + 1;
|
|
} else {
|
|
m = +m + 1;
|
|
}
|
|
}
|
|
if (gtlt === "<") {
|
|
pr = "-0";
|
|
}
|
|
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
} else if (xm) {
|
|
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
} else if (xp) {
|
|
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
}
|
|
debug("xRange return", ret);
|
|
return ret;
|
|
});
|
|
};
|
|
var replaceStars = (comp, options) => {
|
|
debug("replaceStars", comp, options);
|
|
return comp.trim().replace(re[t.STAR], "");
|
|
};
|
|
var replaceGTE0 = (comp, options) => {
|
|
debug("replaceGTE0", comp, options);
|
|
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
};
|
|
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
if (isX(fM)) {
|
|
from = "";
|
|
} else if (isX(fm)) {
|
|
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
} else if (isX(fp)) {
|
|
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
} else if (fpr) {
|
|
from = `>=${from}`;
|
|
} else {
|
|
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
}
|
|
if (isX(tM)) {
|
|
to = "";
|
|
} else if (isX(tm)) {
|
|
to = `<${+tM + 1}.0.0-0`;
|
|
} else if (isX(tp)) {
|
|
to = `<${tM}.${+tm + 1}.0-0`;
|
|
} else if (tpr) {
|
|
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
} else if (incPr) {
|
|
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
} else {
|
|
to = `<=${to}`;
|
|
}
|
|
return `${from} ${to}`.trim();
|
|
};
|
|
var testSet = (set, version, options) => {
|
|
for (let i = 0; i < set.length; i++) {
|
|
if (!set[i].test(version)) {
|
|
return false;
|
|
}
|
|
}
|
|
if (version.prerelease.length && !options.includePrerelease) {
|
|
for (let i = 0; i < set.length; i++) {
|
|
debug(set[i].semver);
|
|
if (set[i].semver === Comparator.ANY) {
|
|
continue;
|
|
}
|
|
if (set[i].semver.prerelease.length > 0) {
|
|
const allowed = set[i].semver;
|
|
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_comparator = __commonJS({
|
|
""(exports, module) {
|
|
var ANY = Symbol("SemVer ANY");
|
|
var Comparator = class {
|
|
static get ANY() {
|
|
return ANY;
|
|
}
|
|
constructor(comp, options) {
|
|
options = parseOptions(options);
|
|
if (comp instanceof Comparator) {
|
|
if (comp.loose === !!options.loose) {
|
|
return comp;
|
|
} else {
|
|
comp = comp.value;
|
|
}
|
|
}
|
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
debug("comparator", comp, options);
|
|
this.options = options;
|
|
this.loose = !!options.loose;
|
|
this.parse(comp);
|
|
if (this.semver === ANY) {
|
|
this.value = "";
|
|
} else {
|
|
this.value = this.operator + this.semver.version;
|
|
}
|
|
debug("comp", this);
|
|
}
|
|
parse(comp) {
|
|
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
const m = comp.match(r);
|
|
if (!m) {
|
|
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
}
|
|
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
if (this.operator === "=") {
|
|
this.operator = "";
|
|
}
|
|
if (!m[2]) {
|
|
this.semver = ANY;
|
|
} else {
|
|
this.semver = new SemVer(m[2], this.options.loose);
|
|
}
|
|
}
|
|
toString() {
|
|
return this.value;
|
|
}
|
|
test(version) {
|
|
debug("Comparator.test", version, this.options.loose);
|
|
if (this.semver === ANY || version === ANY) {
|
|
return true;
|
|
}
|
|
if (typeof version === "string") {
|
|
try {
|
|
version = new SemVer(version, this.options);
|
|
} catch (er) {
|
|
return false;
|
|
}
|
|
}
|
|
return cmp(version, this.operator, this.semver, this.options);
|
|
}
|
|
intersects(comp, options) {
|
|
if (!(comp instanceof Comparator)) {
|
|
throw new TypeError("a Comparator is required");
|
|
}
|
|
if (this.operator === "") {
|
|
if (this.value === "") {
|
|
return true;
|
|
}
|
|
return new Range(comp.value, options).test(this.value);
|
|
} else if (comp.operator === "") {
|
|
if (comp.value === "") {
|
|
return true;
|
|
}
|
|
return new Range(this.value, options).test(comp.semver);
|
|
}
|
|
options = parseOptions(options);
|
|
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
return false;
|
|
}
|
|
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
return false;
|
|
}
|
|
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
return true;
|
|
}
|
|
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
return true;
|
|
}
|
|
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
return true;
|
|
}
|
|
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
return true;
|
|
}
|
|
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
};
|
|
module.exports = Comparator;
|
|
var parseOptions = require_parse_options();
|
|
var { safeRe: re, t } = require_re();
|
|
var cmp = require_cmp();
|
|
var debug = require_debug();
|
|
var SemVer = require_semver();
|
|
var Range = require_range();
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_satisfies = __commonJS({
|
|
""(exports, module) {
|
|
var Range = require_range();
|
|
var satisfies = (version, range, options) => {
|
|
try {
|
|
range = new Range(range, options);
|
|
} catch (er) {
|
|
return false;
|
|
}
|
|
return range.test(version);
|
|
};
|
|
module.exports = satisfies;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_to_comparators = __commonJS({
|
|
""(exports, module) {
|
|
var Range = require_range();
|
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
module.exports = toComparators;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_max_satisfying = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var Range = require_range();
|
|
var maxSatisfying = (versions, range, options) => {
|
|
let max = null;
|
|
let maxSV = null;
|
|
let rangeObj = null;
|
|
try {
|
|
rangeObj = new Range(range, options);
|
|
} catch (er) {
|
|
return null;
|
|
}
|
|
versions.forEach((v) => {
|
|
if (rangeObj.test(v)) {
|
|
if (!max || maxSV.compare(v) === -1) {
|
|
max = v;
|
|
maxSV = new SemVer(max, options);
|
|
}
|
|
}
|
|
});
|
|
return max;
|
|
};
|
|
module.exports = maxSatisfying;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_min_satisfying = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var Range = require_range();
|
|
var minSatisfying = (versions, range, options) => {
|
|
let min = null;
|
|
let minSV = null;
|
|
let rangeObj = null;
|
|
try {
|
|
rangeObj = new Range(range, options);
|
|
} catch (er) {
|
|
return null;
|
|
}
|
|
versions.forEach((v) => {
|
|
if (rangeObj.test(v)) {
|
|
if (!min || minSV.compare(v) === 1) {
|
|
min = v;
|
|
minSV = new SemVer(min, options);
|
|
}
|
|
}
|
|
});
|
|
return min;
|
|
};
|
|
module.exports = minSatisfying;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_min_version = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var Range = require_range();
|
|
var gt = require_gt();
|
|
var minVersion = (range, loose) => {
|
|
range = new Range(range, loose);
|
|
let minver = new SemVer("0.0.0");
|
|
if (range.test(minver)) {
|
|
return minver;
|
|
}
|
|
minver = new SemVer("0.0.0-0");
|
|
if (range.test(minver)) {
|
|
return minver;
|
|
}
|
|
minver = null;
|
|
for (let i = 0; i < range.set.length; ++i) {
|
|
const comparators = range.set[i];
|
|
let setMin = null;
|
|
comparators.forEach((comparator) => {
|
|
const compver = new SemVer(comparator.semver.version);
|
|
switch (comparator.operator) {
|
|
case ">":
|
|
if (compver.prerelease.length === 0) {
|
|
compver.patch++;
|
|
} else {
|
|
compver.prerelease.push(0);
|
|
}
|
|
compver.raw = compver.format();
|
|
case "":
|
|
case ">=":
|
|
if (!setMin || gt(compver, setMin)) {
|
|
setMin = compver;
|
|
}
|
|
break;
|
|
case "<":
|
|
case "<=":
|
|
break;
|
|
default:
|
|
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
}
|
|
});
|
|
if (setMin && (!minver || gt(minver, setMin))) {
|
|
minver = setMin;
|
|
}
|
|
}
|
|
if (minver && range.test(minver)) {
|
|
return minver;
|
|
}
|
|
return null;
|
|
};
|
|
module.exports = minVersion;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_valid2 = __commonJS({
|
|
""(exports, module) {
|
|
var Range = require_range();
|
|
var validRange = (range, options) => {
|
|
try {
|
|
return new Range(range, options).range || "*";
|
|
} catch (er) {
|
|
return null;
|
|
}
|
|
};
|
|
module.exports = validRange;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_outside = __commonJS({
|
|
""(exports, module) {
|
|
var SemVer = require_semver();
|
|
var Comparator = require_comparator();
|
|
var { ANY } = Comparator;
|
|
var Range = require_range();
|
|
var satisfies = require_satisfies();
|
|
var gt = require_gt();
|
|
var lt = require_lt();
|
|
var lte = require_lte();
|
|
var gte = require_gte();
|
|
var outside = (version, range, hilo, options) => {
|
|
version = new SemVer(version, options);
|
|
range = new Range(range, options);
|
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
switch (hilo) {
|
|
case ">":
|
|
gtfn = gt;
|
|
ltefn = lte;
|
|
ltfn = lt;
|
|
comp = ">";
|
|
ecomp = ">=";
|
|
break;
|
|
case "<":
|
|
gtfn = lt;
|
|
ltefn = gte;
|
|
ltfn = gt;
|
|
comp = "<";
|
|
ecomp = "<=";
|
|
break;
|
|
default:
|
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
}
|
|
if (satisfies(version, range, options)) {
|
|
return false;
|
|
}
|
|
for (let i = 0; i < range.set.length; ++i) {
|
|
const comparators = range.set[i];
|
|
let high = null;
|
|
let low = null;
|
|
comparators.forEach((comparator) => {
|
|
if (comparator.semver === ANY) {
|
|
comparator = new Comparator(">=0.0.0");
|
|
}
|
|
high = high || comparator;
|
|
low = low || comparator;
|
|
if (gtfn(comparator.semver, high.semver, options)) {
|
|
high = comparator;
|
|
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
low = comparator;
|
|
}
|
|
});
|
|
if (high.operator === comp || high.operator === ecomp) {
|
|
return false;
|
|
}
|
|
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
return false;
|
|
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
module.exports = outside;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_gtr = __commonJS({
|
|
""(exports, module) {
|
|
var outside = require_outside();
|
|
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
module.exports = gtr;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_ltr = __commonJS({
|
|
""(exports, module) {
|
|
var outside = require_outside();
|
|
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
module.exports = ltr;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_intersects = __commonJS({
|
|
""(exports, module) {
|
|
var Range = require_range();
|
|
var intersects = (r1, r2, options) => {
|
|
r1 = new Range(r1, options);
|
|
r2 = new Range(r2, options);
|
|
return r1.intersects(r2, options);
|
|
};
|
|
module.exports = intersects;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_simplify = __commonJS({
|
|
""(exports, module) {
|
|
var satisfies = require_satisfies();
|
|
var compare = require_compare();
|
|
module.exports = (versions, range, options) => {
|
|
const set = [];
|
|
let first = null;
|
|
let prev = null;
|
|
const v = versions.sort((a, b) => compare(a, b, options));
|
|
for (const version of v) {
|
|
const included = satisfies(version, range, options);
|
|
if (included) {
|
|
prev = version;
|
|
if (!first) {
|
|
first = version;
|
|
}
|
|
} else {
|
|
if (prev) {
|
|
set.push([first, prev]);
|
|
}
|
|
prev = null;
|
|
first = null;
|
|
}
|
|
}
|
|
if (first) {
|
|
set.push([first, null]);
|
|
}
|
|
const ranges = [];
|
|
for (const [min, max] of set) {
|
|
if (min === max) {
|
|
ranges.push(min);
|
|
} else if (!max && min === v[0]) {
|
|
ranges.push("*");
|
|
} else if (!max) {
|
|
ranges.push(`>=${min}`);
|
|
} else if (min === v[0]) {
|
|
ranges.push(`<=${max}`);
|
|
} else {
|
|
ranges.push(`${min} - ${max}`);
|
|
}
|
|
}
|
|
const simplified = ranges.join(" || ");
|
|
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
return simplified.length < original.length ? simplified : range;
|
|
};
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_subset = __commonJS({
|
|
""(exports, module) {
|
|
var Range = require_range();
|
|
var Comparator = require_comparator();
|
|
var { ANY } = Comparator;
|
|
var satisfies = require_satisfies();
|
|
var compare = require_compare();
|
|
var subset = (sub, dom, options = {}) => {
|
|
if (sub === dom) {
|
|
return true;
|
|
}
|
|
sub = new Range(sub, options);
|
|
dom = new Range(dom, options);
|
|
let sawNonNull = false;
|
|
OUTER:
|
|
for (const simpleSub of sub.set) {
|
|
for (const simpleDom of dom.set) {
|
|
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
sawNonNull = sawNonNull || isSub !== null;
|
|
if (isSub) {
|
|
continue OUTER;
|
|
}
|
|
}
|
|
if (sawNonNull) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
var simpleSubset = (sub, dom, options) => {
|
|
if (sub === dom) {
|
|
return true;
|
|
}
|
|
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
return true;
|
|
} else if (options.includePrerelease) {
|
|
sub = minimumVersionWithPreRelease;
|
|
} else {
|
|
sub = minimumVersion;
|
|
}
|
|
}
|
|
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
if (options.includePrerelease) {
|
|
return true;
|
|
} else {
|
|
dom = minimumVersion;
|
|
}
|
|
}
|
|
const eqSet = /* @__PURE__ */ new Set();
|
|
let gt, lt;
|
|
for (const c of sub) {
|
|
if (c.operator === ">" || c.operator === ">=") {
|
|
gt = higherGT(gt, c, options);
|
|
} else if (c.operator === "<" || c.operator === "<=") {
|
|
lt = lowerLT(lt, c, options);
|
|
} else {
|
|
eqSet.add(c.semver);
|
|
}
|
|
}
|
|
if (eqSet.size > 1) {
|
|
return null;
|
|
}
|
|
let gtltComp;
|
|
if (gt && lt) {
|
|
gtltComp = compare(gt.semver, lt.semver, options);
|
|
if (gtltComp > 0) {
|
|
return null;
|
|
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
return null;
|
|
}
|
|
}
|
|
for (const eq of eqSet) {
|
|
if (gt && !satisfies(eq, String(gt), options)) {
|
|
return null;
|
|
}
|
|
if (lt && !satisfies(eq, String(lt), options)) {
|
|
return null;
|
|
}
|
|
for (const c of dom) {
|
|
if (!satisfies(eq, String(c), options)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
let higher, lower;
|
|
let hasDomLT, hasDomGT;
|
|
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
needDomLTPre = false;
|
|
}
|
|
for (const c of dom) {
|
|
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
if (gt) {
|
|
if (needDomGTPre) {
|
|
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
needDomGTPre = false;
|
|
}
|
|
}
|
|
if (c.operator === ">" || c.operator === ">=") {
|
|
higher = higherGT(gt, c, options);
|
|
if (higher === c && higher !== gt) {
|
|
return false;
|
|
}
|
|
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
return false;
|
|
}
|
|
}
|
|
if (lt) {
|
|
if (needDomLTPre) {
|
|
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
needDomLTPre = false;
|
|
}
|
|
}
|
|
if (c.operator === "<" || c.operator === "<=") {
|
|
lower = lowerLT(lt, c, options);
|
|
if (lower === c && lower !== lt) {
|
|
return false;
|
|
}
|
|
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
return false;
|
|
}
|
|
}
|
|
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
return false;
|
|
}
|
|
}
|
|
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
return false;
|
|
}
|
|
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
return false;
|
|
}
|
|
if (needDomGTPre || needDomLTPre) {
|
|
return false;
|
|
}
|
|
return true;
|
|
};
|
|
var higherGT = (a, b, options) => {
|
|
if (!a) {
|
|
return b;
|
|
}
|
|
const comp = compare(a.semver, b.semver, options);
|
|
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
};
|
|
var lowerLT = (a, b, options) => {
|
|
if (!a) {
|
|
return b;
|
|
}
|
|
const comp = compare(a.semver, b.semver, options);
|
|
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
};
|
|
module.exports = subset;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_semver2 = __commonJS({
|
|
""(exports, module) {
|
|
var internalRe = require_re();
|
|
var constants = require_constants();
|
|
var SemVer = require_semver();
|
|
var identifiers = require_identifiers();
|
|
var parse = require_parse2();
|
|
var valid = require_valid();
|
|
var clean = require_clean();
|
|
var inc = require_inc();
|
|
var diff = require_diff();
|
|
var major = require_major();
|
|
var minor = require_minor();
|
|
var patch = require_patch();
|
|
var prerelease = require_prerelease();
|
|
var compare = require_compare();
|
|
var rcompare = require_rcompare();
|
|
var compareLoose = require_compare_loose();
|
|
var compareBuild = require_compare_build();
|
|
var sort = require_sort();
|
|
var rsort = require_rsort();
|
|
var gt = require_gt();
|
|
var lt = require_lt();
|
|
var eq = require_eq();
|
|
var neq = require_neq();
|
|
var gte = require_gte();
|
|
var lte = require_lte();
|
|
var cmp = require_cmp();
|
|
var coerce = require_coerce();
|
|
var Comparator = require_comparator();
|
|
var Range = require_range();
|
|
var satisfies = require_satisfies();
|
|
var toComparators = require_to_comparators();
|
|
var maxSatisfying = require_max_satisfying();
|
|
var minSatisfying = require_min_satisfying();
|
|
var minVersion = require_min_version();
|
|
var validRange = require_valid2();
|
|
var outside = require_outside();
|
|
var gtr = require_gtr();
|
|
var ltr = require_ltr();
|
|
var intersects = require_intersects();
|
|
var simplifyRange = require_simplify();
|
|
var subset = require_subset();
|
|
module.exports = {
|
|
parse,
|
|
valid,
|
|
clean,
|
|
inc,
|
|
diff,
|
|
major,
|
|
minor,
|
|
patch,
|
|
prerelease,
|
|
compare,
|
|
rcompare,
|
|
compareLoose,
|
|
compareBuild,
|
|
sort,
|
|
rsort,
|
|
gt,
|
|
lt,
|
|
eq,
|
|
neq,
|
|
gte,
|
|
lte,
|
|
cmp,
|
|
coerce,
|
|
Comparator,
|
|
Range,
|
|
satisfies,
|
|
toComparators,
|
|
maxSatisfying,
|
|
minSatisfying,
|
|
minVersion,
|
|
validRange,
|
|
outside,
|
|
gtr,
|
|
ltr,
|
|
intersects,
|
|
simplifyRange,
|
|
subset,
|
|
SemVer,
|
|
re: internalRe.re,
|
|
src: internalRe.src,
|
|
tokens: internalRe.t,
|
|
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
};
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist2 = __commonJS({
|
|
""(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.GraphQLType = void 0;
|
|
(function(GraphQLType) {
|
|
GraphQLType[GraphQLType["SCALAR"] = 0] = "SCALAR";
|
|
GraphQLType[GraphQLType["INLINE_FRAGMENT"] = 1] = "INLINE_FRAGMENT";
|
|
GraphQLType[GraphQLType["FRAGMENT"] = 2] = "FRAGMENT";
|
|
})(exports.GraphQLType || (exports.GraphQLType = {}));
|
|
var typeSymbol = Symbol("GraphQL Type");
|
|
var paramsSymbol = Symbol("GraphQL Params");
|
|
function isInlineFragmentObject(value) {
|
|
return typeof value === "object" && value !== null && value[typeSymbol] === exports.GraphQLType.INLINE_FRAGMENT;
|
|
}
|
|
function isFragmentObject(value) {
|
|
return typeof value === "object" && value !== null && value[typeSymbol] === exports.GraphQLType.FRAGMENT;
|
|
}
|
|
function isScalarObject(value) {
|
|
return typeof value === "object" && value !== null && value[typeSymbol] === exports.GraphQLType.SCALAR;
|
|
}
|
|
function renderName(name) {
|
|
return name === void 0 ? "" : name;
|
|
}
|
|
function renderParams(params3, brackets, array) {
|
|
if (brackets === void 0) {
|
|
brackets = true;
|
|
}
|
|
if (array === void 0) {
|
|
array = false;
|
|
}
|
|
if (!params3) {
|
|
return "";
|
|
}
|
|
var builder = [];
|
|
for (var _i = 0, _a = Object.entries(params3); _i < _a.length; _i++) {
|
|
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
var params_1 = void 0;
|
|
if (value === null) {
|
|
params_1 = "null";
|
|
} else if (Array.isArray(value)) {
|
|
params_1 = "[".concat(renderParams(value, false, true), "]");
|
|
} else if (typeof value === "object") {
|
|
params_1 = "{".concat(renderParams(value, false), "}");
|
|
} else {
|
|
params_1 = "".concat(value);
|
|
}
|
|
builder.push(array ? "".concat(params_1) : "".concat(key, ":").concat(params_1));
|
|
}
|
|
var built = builder.join(",");
|
|
if (brackets) {
|
|
built = "(".concat(built, ")");
|
|
}
|
|
return built;
|
|
}
|
|
function renderScalar(name, params3) {
|
|
return renderName(name) + renderParams(params3);
|
|
}
|
|
function renderInlineFragment(fragment2, context2) {
|
|
return "...on ".concat(fragment2.typeName).concat(renderObject(void 0, fragment2.internal, context2));
|
|
}
|
|
function renderFragment(fragment2, context2) {
|
|
return "fragment ".concat(fragment2.name, " on ").concat(fragment2.typeName).concat(renderObject(void 0, fragment2.internal, context2));
|
|
}
|
|
function renderArray(name, arr, context2) {
|
|
var first = arr[0];
|
|
if (first === void 0 || first === null) {
|
|
throw new Error("Cannot render array with no first value");
|
|
}
|
|
first[paramsSymbol] = arr[paramsSymbol];
|
|
return renderType(name, first, context2);
|
|
}
|
|
function renderType(name, value, context2) {
|
|
switch (typeof value) {
|
|
case "bigint":
|
|
case "boolean":
|
|
case "number":
|
|
case "string":
|
|
throw new Error("Rendering type ".concat(typeof value, " directly is disallowed"));
|
|
case "object":
|
|
if (value === null) {
|
|
throw new Error("Cannot render null");
|
|
}
|
|
if (isScalarObject(value)) {
|
|
return "".concat(renderScalar(name, value[paramsSymbol]), " ");
|
|
} else if (Array.isArray(value)) {
|
|
return renderArray(name, value, context2);
|
|
} else {
|
|
return renderObject(name, value, context2);
|
|
}
|
|
case "undefined":
|
|
return "";
|
|
default:
|
|
throw new Error("Cannot render type ".concat(typeof value));
|
|
}
|
|
}
|
|
function renderObject(name, obj, context2) {
|
|
var fields = [];
|
|
for (var _i = 0, _a = Object.entries(obj); _i < _a.length; _i++) {
|
|
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
fields.push(renderType(key, value, context2));
|
|
}
|
|
for (var _c = 0, _d = Object.getOwnPropertySymbols(obj); _c < _d.length; _c++) {
|
|
var sym = _d[_c];
|
|
var value = obj[sym];
|
|
if (isInlineFragmentObject(value)) {
|
|
fields.push(renderInlineFragment(value, context2));
|
|
} else if (isFragmentObject(value)) {
|
|
context2.fragments.set(sym, value);
|
|
fields.push("...".concat(value.name));
|
|
}
|
|
}
|
|
if (fields.length === 0) {
|
|
throw new Error("Object cannot have no fields");
|
|
}
|
|
return "".concat(renderName(name)).concat(renderParams(obj[paramsSymbol]), "{").concat(fields.join("").trim(), "}");
|
|
}
|
|
function render(value) {
|
|
var context2 = {
|
|
fragments: /* @__PURE__ */ new Map()
|
|
};
|
|
var rend = renderObject(void 0, value, context2);
|
|
var rendered = /* @__PURE__ */ new Map();
|
|
var executingContext = context2;
|
|
var currentContext = {
|
|
fragments: /* @__PURE__ */ new Map()
|
|
};
|
|
while (executingContext.fragments.size > 0) {
|
|
for (var _i = 0, _a = Array.from(executingContext.fragments.entries()); _i < _a.length; _i++) {
|
|
var _b = _a[_i], sym = _b[0], fragment2 = _b[1];
|
|
if (!rendered.has(sym)) {
|
|
rendered.set(sym, renderFragment(fragment2, currentContext));
|
|
}
|
|
}
|
|
executingContext = currentContext;
|
|
currentContext = {
|
|
fragments: /* @__PURE__ */ new Map()
|
|
};
|
|
}
|
|
return rend + Array.from(rendered.values()).join("");
|
|
}
|
|
function fragmentToString(value) {
|
|
var context2 = {
|
|
fragments: /* @__PURE__ */ new Map()
|
|
};
|
|
renderObject(void 0, value, context2);
|
|
var currentContext = {
|
|
fragments: /* @__PURE__ */ new Map()
|
|
};
|
|
var output = "";
|
|
for (var _i = 0, _a = Array.from(context2.fragments.entries()); _i < _a.length; _i++) {
|
|
var _b = _a[_i], fragment2 = _b[1];
|
|
output = output + renderFragment(fragment2, currentContext);
|
|
}
|
|
return output;
|
|
}
|
|
function createOperate(operateType) {
|
|
function operate(opNameOrQueryObject, queryObject) {
|
|
if (typeof opNameOrQueryObject === "string") {
|
|
if (!queryObject) {
|
|
throw new Error("queryObject is not set");
|
|
}
|
|
return {
|
|
toString: function() {
|
|
return "".concat(operateType, " ").concat(opNameOrQueryObject).concat(render(queryObject));
|
|
}
|
|
};
|
|
}
|
|
return {
|
|
toString: function() {
|
|
return "".concat(operateType).concat(render(opNameOrQueryObject));
|
|
}
|
|
};
|
|
}
|
|
return operate;
|
|
}
|
|
var query2 = createOperate("query");
|
|
var mutation = createOperate("mutation");
|
|
var subscription = createOperate("subscription");
|
|
function params2(params3, input) {
|
|
if (typeof params3 !== "object") {
|
|
throw new Error("Params have to be an object");
|
|
}
|
|
if (typeof input !== "object") {
|
|
throw new Error("Cannot apply params to JS ".concat(typeof params3));
|
|
}
|
|
input[paramsSymbol] = params3;
|
|
return input;
|
|
}
|
|
function alias(alias2, target) {
|
|
return "".concat(alias2, ":").concat(target);
|
|
}
|
|
function fragment(name, typeName, input) {
|
|
var _a, _b;
|
|
var fragment2 = (_a = {}, _a[typeSymbol] = exports.GraphQLType.FRAGMENT, _a.name = name, _a.typeName = typeName, _a.internal = input, _a);
|
|
return _b = {}, _b[Symbol("Fragment(".concat(name, " on ").concat(typeName, ")"))] = fragment2, _b;
|
|
}
|
|
function rawString(input) {
|
|
return JSON.stringify(input);
|
|
}
|
|
var __assign = function() {
|
|
__assign = Object.assign || function __assign2(t) {
|
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
s = arguments[i];
|
|
for (var p in s)
|
|
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
t[p] = s[p];
|
|
}
|
|
return t;
|
|
};
|
|
return __assign.apply(this, arguments);
|
|
};
|
|
function optional(obj) {
|
|
return obj;
|
|
}
|
|
function on(typeName, internal) {
|
|
var _a, _b;
|
|
var fragment2 = (_a = {}, _a[typeSymbol] = exports.GraphQLType.INLINE_FRAGMENT, _a.typeName = typeName, _a.internal = internal, _a);
|
|
return _b = {}, _b[Symbol("InlineFragment(".concat(typeName, ")"))] = fragment2, _b;
|
|
}
|
|
function onUnion(types3) {
|
|
var fragments = {};
|
|
for (var _i = 0, _a = Object.entries(types3); _i < _a.length; _i++) {
|
|
var _b = _a[_i], typeName = _b[0], internal = _b[1];
|
|
fragments = __assign(__assign({}, fragments), on(typeName, internal));
|
|
}
|
|
return fragments;
|
|
}
|
|
function scalarType() {
|
|
var _a;
|
|
var scalar = (_a = {}, _a[typeSymbol] = exports.GraphQLType.SCALAR, _a);
|
|
return scalar;
|
|
}
|
|
var types2 = function() {
|
|
function types3() {
|
|
}
|
|
Object.defineProperty(types3, "number", {
|
|
get: function() {
|
|
return scalarType();
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(types3, "string", {
|
|
get: function() {
|
|
return scalarType();
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(types3, "boolean", {
|
|
get: function() {
|
|
return scalarType();
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
types3.constant = function(_c) {
|
|
return scalarType();
|
|
};
|
|
types3.oneOf = function(_e) {
|
|
return scalarType();
|
|
};
|
|
types3.custom = function() {
|
|
return scalarType();
|
|
};
|
|
types3.optional = types3;
|
|
return types3;
|
|
}();
|
|
exports.alias = alias;
|
|
exports.fragment = fragment;
|
|
exports.fragmentToString = fragmentToString;
|
|
exports.mutation = mutation;
|
|
exports.on = on;
|
|
exports.onUnion = onUnion;
|
|
exports.optional = optional;
|
|
exports.params = params2;
|
|
exports.paramsSymbol = paramsSymbol;
|
|
exports.query = query2;
|
|
exports.rawString = rawString;
|
|
exports.render = render;
|
|
exports.subscription = subscription;
|
|
exports.typeSymbol = typeSymbol;
|
|
exports.types = types2;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node11 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
requestLog: () => requestLog
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var VERSION = "4.0.1";
|
|
function requestLog(octokit) {
|
|
octokit.hook.wrap("request", (request, options) => {
|
|
octokit.log.debug("request", options);
|
|
const start = Date.now();
|
|
const requestOptions = octokit.request.endpoint.parse(options);
|
|
const path = requestOptions.url.replace(options.baseUrl, "");
|
|
return request(options).then((response) => {
|
|
octokit.log.info(
|
|
`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`
|
|
);
|
|
return response;
|
|
}).catch((error) => {
|
|
octokit.log.info(
|
|
`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`
|
|
);
|
|
throw error;
|
|
});
|
|
});
|
|
}
|
|
requestLog.VERSION = VERSION;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node12 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
composePaginateRest: () => composePaginateRest,
|
|
isPaginatingEndpoint: () => isPaginatingEndpoint,
|
|
paginateRest: () => paginateRest,
|
|
paginatingEndpoints: () => paginatingEndpoints
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var VERSION = "11.3.1";
|
|
function normalizePaginatedListResponse(response) {
|
|
if (!response.data) {
|
|
return {
|
|
...response,
|
|
data: []
|
|
};
|
|
}
|
|
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
|
|
if (!responseNeedsNormalization)
|
|
return response;
|
|
const incompleteResults = response.data.incomplete_results;
|
|
const repositorySelection = response.data.repository_selection;
|
|
const totalCount = response.data.total_count;
|
|
delete response.data.incomplete_results;
|
|
delete response.data.repository_selection;
|
|
delete response.data.total_count;
|
|
const namespaceKey = Object.keys(response.data)[0];
|
|
const data = response.data[namespaceKey];
|
|
response.data = data;
|
|
if (typeof incompleteResults !== "undefined") {
|
|
response.data.incomplete_results = incompleteResults;
|
|
}
|
|
if (typeof repositorySelection !== "undefined") {
|
|
response.data.repository_selection = repositorySelection;
|
|
}
|
|
response.data.total_count = totalCount;
|
|
return response;
|
|
}
|
|
function iterator(octokit, route, parameters) {
|
|
const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
|
|
const requestMethod = typeof route === "function" ? route : octokit.request;
|
|
const method = options.method;
|
|
const headers = options.headers;
|
|
let url = options.url;
|
|
return {
|
|
[Symbol.asyncIterator]: () => ({
|
|
async next() {
|
|
if (!url)
|
|
return { done: true };
|
|
try {
|
|
const response = await requestMethod({ method, url, headers });
|
|
const normalizedResponse = normalizePaginatedListResponse(response);
|
|
url = ((normalizedResponse.headers.link || "").match(
|
|
/<([^>]+)>;\s*rel="next"/
|
|
) || [])[1];
|
|
return { value: normalizedResponse };
|
|
} catch (error) {
|
|
if (error.status !== 409)
|
|
throw error;
|
|
url = "";
|
|
return {
|
|
value: {
|
|
status: 200,
|
|
headers: {},
|
|
data: []
|
|
}
|
|
};
|
|
}
|
|
}
|
|
})
|
|
};
|
|
}
|
|
function paginate(octokit, route, parameters, mapFn) {
|
|
if (typeof parameters === "function") {
|
|
mapFn = parameters;
|
|
parameters = void 0;
|
|
}
|
|
return gather(
|
|
octokit,
|
|
[],
|
|
iterator(octokit, route, parameters)[Symbol.asyncIterator](),
|
|
mapFn
|
|
);
|
|
}
|
|
function gather(octokit, results, iterator2, mapFn) {
|
|
return iterator2.next().then((result) => {
|
|
if (result.done) {
|
|
return results;
|
|
}
|
|
let earlyExit = false;
|
|
function done() {
|
|
earlyExit = true;
|
|
}
|
|
results = results.concat(
|
|
mapFn ? mapFn(result.value, done) : result.value.data
|
|
);
|
|
if (earlyExit) {
|
|
return results;
|
|
}
|
|
return gather(octokit, results, iterator2, mapFn);
|
|
});
|
|
}
|
|
var composePaginateRest = Object.assign(paginate, {
|
|
iterator
|
|
});
|
|
var paginatingEndpoints = [
|
|
"GET /advisories",
|
|
"GET /app/hook/deliveries",
|
|
"GET /app/installation-requests",
|
|
"GET /app/installations",
|
|
"GET /assignments/{assignment_id}/accepted_assignments",
|
|
"GET /classrooms",
|
|
"GET /classrooms/{classroom_id}/assignments",
|
|
"GET /enterprises/{enterprise}/copilot/usage",
|
|
"GET /enterprises/{enterprise}/dependabot/alerts",
|
|
"GET /enterprises/{enterprise}/secret-scanning/alerts",
|
|
"GET /events",
|
|
"GET /gists",
|
|
"GET /gists/public",
|
|
"GET /gists/starred",
|
|
"GET /gists/{gist_id}/comments",
|
|
"GET /gists/{gist_id}/commits",
|
|
"GET /gists/{gist_id}/forks",
|
|
"GET /installation/repositories",
|
|
"GET /issues",
|
|
"GET /licenses",
|
|
"GET /marketplace_listing/plans",
|
|
"GET /marketplace_listing/plans/{plan_id}/accounts",
|
|
"GET /marketplace_listing/stubbed/plans",
|
|
"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
|
|
"GET /networks/{owner}/{repo}/events",
|
|
"GET /notifications",
|
|
"GET /organizations",
|
|
"GET /orgs/{org}/actions/cache/usage-by-repository",
|
|
"GET /orgs/{org}/actions/permissions/repositories",
|
|
"GET /orgs/{org}/actions/runners",
|
|
"GET /orgs/{org}/actions/secrets",
|
|
"GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
|
|
"GET /orgs/{org}/actions/variables",
|
|
"GET /orgs/{org}/actions/variables/{name}/repositories",
|
|
"GET /orgs/{org}/blocks",
|
|
"GET /orgs/{org}/code-scanning/alerts",
|
|
"GET /orgs/{org}/codespaces",
|
|
"GET /orgs/{org}/codespaces/secrets",
|
|
"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
|
|
"GET /orgs/{org}/copilot/billing/seats",
|
|
"GET /orgs/{org}/copilot/usage",
|
|
"GET /orgs/{org}/dependabot/alerts",
|
|
"GET /orgs/{org}/dependabot/secrets",
|
|
"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
|
|
"GET /orgs/{org}/events",
|
|
"GET /orgs/{org}/failed_invitations",
|
|
"GET /orgs/{org}/hooks",
|
|
"GET /orgs/{org}/hooks/{hook_id}/deliveries",
|
|
"GET /orgs/{org}/installations",
|
|
"GET /orgs/{org}/invitations",
|
|
"GET /orgs/{org}/invitations/{invitation_id}/teams",
|
|
"GET /orgs/{org}/issues",
|
|
"GET /orgs/{org}/members",
|
|
"GET /orgs/{org}/members/{username}/codespaces",
|
|
"GET /orgs/{org}/migrations",
|
|
"GET /orgs/{org}/migrations/{migration_id}/repositories",
|
|
"GET /orgs/{org}/organization-roles/{role_id}/teams",
|
|
"GET /orgs/{org}/organization-roles/{role_id}/users",
|
|
"GET /orgs/{org}/outside_collaborators",
|
|
"GET /orgs/{org}/packages",
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
|
|
"GET /orgs/{org}/personal-access-token-requests",
|
|
"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
|
|
"GET /orgs/{org}/personal-access-tokens",
|
|
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
|
|
"GET /orgs/{org}/projects",
|
|
"GET /orgs/{org}/properties/values",
|
|
"GET /orgs/{org}/public_members",
|
|
"GET /orgs/{org}/repos",
|
|
"GET /orgs/{org}/rulesets",
|
|
"GET /orgs/{org}/rulesets/rule-suites",
|
|
"GET /orgs/{org}/secret-scanning/alerts",
|
|
"GET /orgs/{org}/security-advisories",
|
|
"GET /orgs/{org}/team/{team_slug}/copilot/usage",
|
|
"GET /orgs/{org}/teams",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
|
|
"GET /orgs/{org}/teams/{team_slug}/invitations",
|
|
"GET /orgs/{org}/teams/{team_slug}/members",
|
|
"GET /orgs/{org}/teams/{team_slug}/projects",
|
|
"GET /orgs/{org}/teams/{team_slug}/repos",
|
|
"GET /orgs/{org}/teams/{team_slug}/teams",
|
|
"GET /projects/columns/{column_id}/cards",
|
|
"GET /projects/{project_id}/collaborators",
|
|
"GET /projects/{project_id}/columns",
|
|
"GET /repos/{owner}/{repo}/actions/artifacts",
|
|
"GET /repos/{owner}/{repo}/actions/caches",
|
|
"GET /repos/{owner}/{repo}/actions/organization-secrets",
|
|
"GET /repos/{owner}/{repo}/actions/organization-variables",
|
|
"GET /repos/{owner}/{repo}/actions/runners",
|
|
"GET /repos/{owner}/{repo}/actions/runs",
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
|
|
"GET /repos/{owner}/{repo}/actions/secrets",
|
|
"GET /repos/{owner}/{repo}/actions/variables",
|
|
"GET /repos/{owner}/{repo}/actions/workflows",
|
|
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
|
|
"GET /repos/{owner}/{repo}/activity",
|
|
"GET /repos/{owner}/{repo}/assignees",
|
|
"GET /repos/{owner}/{repo}/branches",
|
|
"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
|
|
"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts",
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
|
|
"GET /repos/{owner}/{repo}/code-scanning/analyses",
|
|
"GET /repos/{owner}/{repo}/codespaces",
|
|
"GET /repos/{owner}/{repo}/codespaces/devcontainers",
|
|
"GET /repos/{owner}/{repo}/codespaces/secrets",
|
|
"GET /repos/{owner}/{repo}/collaborators",
|
|
"GET /repos/{owner}/{repo}/comments",
|
|
"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/commits",
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/status",
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/statuses",
|
|
"GET /repos/{owner}/{repo}/contributors",
|
|
"GET /repos/{owner}/{repo}/dependabot/alerts",
|
|
"GET /repos/{owner}/{repo}/dependabot/secrets",
|
|
"GET /repos/{owner}/{repo}/deployments",
|
|
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
|
|
"GET /repos/{owner}/{repo}/environments",
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets",
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables",
|
|
"GET /repos/{owner}/{repo}/events",
|
|
"GET /repos/{owner}/{repo}/forks",
|
|
"GET /repos/{owner}/{repo}/hooks",
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
|
|
"GET /repos/{owner}/{repo}/invitations",
|
|
"GET /repos/{owner}/{repo}/issues",
|
|
"GET /repos/{owner}/{repo}/issues/comments",
|
|
"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/issues/events",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/events",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
|
|
"GET /repos/{owner}/{repo}/keys",
|
|
"GET /repos/{owner}/{repo}/labels",
|
|
"GET /repos/{owner}/{repo}/milestones",
|
|
"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
|
|
"GET /repos/{owner}/{repo}/notifications",
|
|
"GET /repos/{owner}/{repo}/pages/builds",
|
|
"GET /repos/{owner}/{repo}/projects",
|
|
"GET /repos/{owner}/{repo}/pulls",
|
|
"GET /repos/{owner}/{repo}/pulls/comments",
|
|
"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
|
|
"GET /repos/{owner}/{repo}/releases",
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/assets",
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
|
|
"GET /repos/{owner}/{repo}/rules/branches/{branch}",
|
|
"GET /repos/{owner}/{repo}/rulesets",
|
|
"GET /repos/{owner}/{repo}/rulesets/rule-suites",
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts",
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
|
|
"GET /repos/{owner}/{repo}/security-advisories",
|
|
"GET /repos/{owner}/{repo}/stargazers",
|
|
"GET /repos/{owner}/{repo}/subscribers",
|
|
"GET /repos/{owner}/{repo}/tags",
|
|
"GET /repos/{owner}/{repo}/teams",
|
|
"GET /repos/{owner}/{repo}/topics",
|
|
"GET /repositories",
|
|
"GET /search/code",
|
|
"GET /search/commits",
|
|
"GET /search/issues",
|
|
"GET /search/labels",
|
|
"GET /search/repositories",
|
|
"GET /search/topics",
|
|
"GET /search/users",
|
|
"GET /teams/{team_id}/discussions",
|
|
"GET /teams/{team_id}/discussions/{discussion_number}/comments",
|
|
"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
|
|
"GET /teams/{team_id}/discussions/{discussion_number}/reactions",
|
|
"GET /teams/{team_id}/invitations",
|
|
"GET /teams/{team_id}/members",
|
|
"GET /teams/{team_id}/projects",
|
|
"GET /teams/{team_id}/repos",
|
|
"GET /teams/{team_id}/teams",
|
|
"GET /user/blocks",
|
|
"GET /user/codespaces",
|
|
"GET /user/codespaces/secrets",
|
|
"GET /user/emails",
|
|
"GET /user/followers",
|
|
"GET /user/following",
|
|
"GET /user/gpg_keys",
|
|
"GET /user/installations",
|
|
"GET /user/installations/{installation_id}/repositories",
|
|
"GET /user/issues",
|
|
"GET /user/keys",
|
|
"GET /user/marketplace_purchases",
|
|
"GET /user/marketplace_purchases/stubbed",
|
|
"GET /user/memberships/orgs",
|
|
"GET /user/migrations",
|
|
"GET /user/migrations/{migration_id}/repositories",
|
|
"GET /user/orgs",
|
|
"GET /user/packages",
|
|
"GET /user/packages/{package_type}/{package_name}/versions",
|
|
"GET /user/public_emails",
|
|
"GET /user/repos",
|
|
"GET /user/repository_invitations",
|
|
"GET /user/social_accounts",
|
|
"GET /user/ssh_signing_keys",
|
|
"GET /user/starred",
|
|
"GET /user/subscriptions",
|
|
"GET /user/teams",
|
|
"GET /users",
|
|
"GET /users/{username}/events",
|
|
"GET /users/{username}/events/orgs/{org}",
|
|
"GET /users/{username}/events/public",
|
|
"GET /users/{username}/followers",
|
|
"GET /users/{username}/following",
|
|
"GET /users/{username}/gists",
|
|
"GET /users/{username}/gpg_keys",
|
|
"GET /users/{username}/keys",
|
|
"GET /users/{username}/orgs",
|
|
"GET /users/{username}/packages",
|
|
"GET /users/{username}/projects",
|
|
"GET /users/{username}/received_events",
|
|
"GET /users/{username}/received_events/public",
|
|
"GET /users/{username}/repos",
|
|
"GET /users/{username}/social_accounts",
|
|
"GET /users/{username}/ssh_signing_keys",
|
|
"GET /users/{username}/starred",
|
|
"GET /users/{username}/subscriptions"
|
|
];
|
|
function isPaginatingEndpoint(arg) {
|
|
if (typeof arg === "string") {
|
|
return paginatingEndpoints.includes(arg);
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
function paginateRest(octokit) {
|
|
return {
|
|
paginate: Object.assign(paginate.bind(null, octokit), {
|
|
iterator: iterator.bind(null, octokit)
|
|
})
|
|
};
|
|
}
|
|
paginateRest.VERSION = VERSION;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node13 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
legacyRestEndpointMethods: () => legacyRestEndpointMethods,
|
|
restEndpointMethods: () => restEndpointMethods
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var VERSION = "13.2.2";
|
|
var Endpoints = {
|
|
actions: {
|
|
addCustomLabelsToSelfHostedRunnerForOrg: [
|
|
"POST /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
addCustomLabelsToSelfHostedRunnerForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
addSelectedRepoToOrgSecret: [
|
|
"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
addSelectedRepoToOrgVariable: [
|
|
"PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
|
|
],
|
|
approveWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
|
|
],
|
|
cancelWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
|
|
],
|
|
createEnvironmentVariable: [
|
|
"POST /repos/{owner}/{repo}/environments/{environment_name}/variables"
|
|
],
|
|
createOrUpdateEnvironmentSecret: [
|
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
|
|
createOrUpdateRepoSecret: [
|
|
"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
|
|
],
|
|
createOrgVariable: ["POST /orgs/{org}/actions/variables"],
|
|
createRegistrationTokenForOrg: [
|
|
"POST /orgs/{org}/actions/runners/registration-token"
|
|
],
|
|
createRegistrationTokenForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/registration-token"
|
|
],
|
|
createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
|
|
createRemoveTokenForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/remove-token"
|
|
],
|
|
createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
|
|
createWorkflowDispatch: [
|
|
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
|
|
],
|
|
deleteActionsCacheById: [
|
|
"DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
|
|
],
|
|
deleteActionsCacheByKey: [
|
|
"DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
|
|
],
|
|
deleteArtifact: [
|
|
"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
|
|
],
|
|
deleteEnvironmentSecret: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
|
|
],
|
|
deleteEnvironmentVariable: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
|
|
],
|
|
deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
|
|
deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
|
|
deleteRepoSecret: [
|
|
"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
|
|
],
|
|
deleteRepoVariable: [
|
|
"DELETE /repos/{owner}/{repo}/actions/variables/{name}"
|
|
],
|
|
deleteSelfHostedRunnerFromOrg: [
|
|
"DELETE /orgs/{org}/actions/runners/{runner_id}"
|
|
],
|
|
deleteSelfHostedRunnerFromRepo: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
|
|
],
|
|
deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
|
|
deleteWorkflowRunLogs: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
|
|
],
|
|
disableSelectedRepositoryGithubActionsOrganization: [
|
|
"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
|
|
],
|
|
disableWorkflow: [
|
|
"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
|
|
],
|
|
downloadArtifact: [
|
|
"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
|
|
],
|
|
downloadJobLogsForWorkflowRun: [
|
|
"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
|
|
],
|
|
downloadWorkflowRunAttemptLogs: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
|
|
],
|
|
downloadWorkflowRunLogs: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
|
|
],
|
|
enableSelectedRepositoryGithubActionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
|
|
],
|
|
enableWorkflow: [
|
|
"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
|
|
],
|
|
forceCancelWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
|
|
],
|
|
generateRunnerJitconfigForOrg: [
|
|
"POST /orgs/{org}/actions/runners/generate-jitconfig"
|
|
],
|
|
generateRunnerJitconfigForRepo: [
|
|
"POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
|
|
],
|
|
getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
|
|
getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
|
|
getActionsCacheUsageByRepoForOrg: [
|
|
"GET /orgs/{org}/actions/cache/usage-by-repository"
|
|
],
|
|
getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
|
|
getAllowedActionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions/selected-actions"
|
|
],
|
|
getAllowedActionsRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
|
|
],
|
|
getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
|
|
getCustomOidcSubClaimForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
|
|
],
|
|
getEnvironmentPublicKey: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"
|
|
],
|
|
getEnvironmentSecret: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"
|
|
],
|
|
getEnvironmentVariable: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
|
|
],
|
|
getGithubActionsDefaultWorkflowPermissionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions/workflow"
|
|
],
|
|
getGithubActionsDefaultWorkflowPermissionsRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions/workflow"
|
|
],
|
|
getGithubActionsPermissionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions"
|
|
],
|
|
getGithubActionsPermissionsRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions"
|
|
],
|
|
getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
|
|
getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
|
|
getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
|
|
getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
|
|
getPendingDeploymentsForRun: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
|
|
],
|
|
getRepoPermissions: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions",
|
|
{},
|
|
{ renamed: ["actions", "getGithubActionsPermissionsRepository"] }
|
|
],
|
|
getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
|
|
getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
|
|
getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
|
|
getReviewsForRun: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
|
|
],
|
|
getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
|
|
getSelfHostedRunnerForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
|
|
],
|
|
getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
|
|
getWorkflowAccessToRepository: [
|
|
"GET /repos/{owner}/{repo}/actions/permissions/access"
|
|
],
|
|
getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
|
|
getWorkflowRunAttempt: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
|
|
],
|
|
getWorkflowRunUsage: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
|
|
],
|
|
getWorkflowUsage: [
|
|
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
|
|
],
|
|
listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
|
|
listEnvironmentSecrets: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"
|
|
],
|
|
listEnvironmentVariables: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/variables"
|
|
],
|
|
listJobsForWorkflowRun: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
|
|
],
|
|
listJobsForWorkflowRunAttempt: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
|
|
],
|
|
listLabelsForSelfHostedRunnerForOrg: [
|
|
"GET /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
listLabelsForSelfHostedRunnerForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
|
|
listOrgVariables: ["GET /orgs/{org}/actions/variables"],
|
|
listRepoOrganizationSecrets: [
|
|
"GET /repos/{owner}/{repo}/actions/organization-secrets"
|
|
],
|
|
listRepoOrganizationVariables: [
|
|
"GET /repos/{owner}/{repo}/actions/organization-variables"
|
|
],
|
|
listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
|
|
listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
|
|
listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
|
|
listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
|
|
listRunnerApplicationsForRepo: [
|
|
"GET /repos/{owner}/{repo}/actions/runners/downloads"
|
|
],
|
|
listSelectedReposForOrgSecret: [
|
|
"GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
|
|
],
|
|
listSelectedReposForOrgVariable: [
|
|
"GET /orgs/{org}/actions/variables/{name}/repositories"
|
|
],
|
|
listSelectedRepositoriesEnabledGithubActionsOrganization: [
|
|
"GET /orgs/{org}/actions/permissions/repositories"
|
|
],
|
|
listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
|
|
listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
|
|
listWorkflowRunArtifacts: [
|
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
|
|
],
|
|
listWorkflowRuns: [
|
|
"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
|
|
],
|
|
listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
|
|
reRunJobForWorkflowRun: [
|
|
"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
|
|
],
|
|
reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
|
|
reRunWorkflowFailedJobs: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
|
|
],
|
|
removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
|
|
"DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
removeCustomLabelFromSelfHostedRunnerForOrg: [
|
|
"DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
|
|
],
|
|
removeCustomLabelFromSelfHostedRunnerForRepo: [
|
|
"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
|
|
],
|
|
removeSelectedRepoFromOrgSecret: [
|
|
"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
removeSelectedRepoFromOrgVariable: [
|
|
"DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
|
|
],
|
|
reviewCustomGatesForRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
|
|
],
|
|
reviewPendingDeploymentsForRun: [
|
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
|
|
],
|
|
setAllowedActionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/selected-actions"
|
|
],
|
|
setAllowedActionsRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
|
|
],
|
|
setCustomLabelsForSelfHostedRunnerForOrg: [
|
|
"PUT /orgs/{org}/actions/runners/{runner_id}/labels"
|
|
],
|
|
setCustomLabelsForSelfHostedRunnerForRepo: [
|
|
"PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
|
|
],
|
|
setCustomOidcSubClaimForRepo: [
|
|
"PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
|
|
],
|
|
setGithubActionsDefaultWorkflowPermissionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/workflow"
|
|
],
|
|
setGithubActionsDefaultWorkflowPermissionsRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions/workflow"
|
|
],
|
|
setGithubActionsPermissionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions"
|
|
],
|
|
setGithubActionsPermissionsRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions"
|
|
],
|
|
setSelectedReposForOrgSecret: [
|
|
"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
|
|
],
|
|
setSelectedReposForOrgVariable: [
|
|
"PUT /orgs/{org}/actions/variables/{name}/repositories"
|
|
],
|
|
setSelectedRepositoriesEnabledGithubActionsOrganization: [
|
|
"PUT /orgs/{org}/actions/permissions/repositories"
|
|
],
|
|
setWorkflowAccessToRepository: [
|
|
"PUT /repos/{owner}/{repo}/actions/permissions/access"
|
|
],
|
|
updateEnvironmentVariable: [
|
|
"PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"
|
|
],
|
|
updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
|
|
updateRepoVariable: [
|
|
"PATCH /repos/{owner}/{repo}/actions/variables/{name}"
|
|
]
|
|
},
|
|
activity: {
|
|
checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
|
|
deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
|
|
deleteThreadSubscription: [
|
|
"DELETE /notifications/threads/{thread_id}/subscription"
|
|
],
|
|
getFeeds: ["GET /feeds"],
|
|
getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
|
|
getThread: ["GET /notifications/threads/{thread_id}"],
|
|
getThreadSubscriptionForAuthenticatedUser: [
|
|
"GET /notifications/threads/{thread_id}/subscription"
|
|
],
|
|
listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
|
|
listNotificationsForAuthenticatedUser: ["GET /notifications"],
|
|
listOrgEventsForAuthenticatedUser: [
|
|
"GET /users/{username}/events/orgs/{org}"
|
|
],
|
|
listPublicEvents: ["GET /events"],
|
|
listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
|
|
listPublicEventsForUser: ["GET /users/{username}/events/public"],
|
|
listPublicOrgEvents: ["GET /orgs/{org}/events"],
|
|
listReceivedEventsForUser: ["GET /users/{username}/received_events"],
|
|
listReceivedPublicEventsForUser: [
|
|
"GET /users/{username}/received_events/public"
|
|
],
|
|
listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
|
|
listRepoNotificationsForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/notifications"
|
|
],
|
|
listReposStarredByAuthenticatedUser: ["GET /user/starred"],
|
|
listReposStarredByUser: ["GET /users/{username}/starred"],
|
|
listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
|
|
listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
|
|
listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
|
|
listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
|
|
markNotificationsAsRead: ["PUT /notifications"],
|
|
markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
|
|
markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
|
|
markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
|
|
setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
|
|
setThreadSubscription: [
|
|
"PUT /notifications/threads/{thread_id}/subscription"
|
|
],
|
|
starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
|
|
unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
|
|
},
|
|
apps: {
|
|
addRepoToInstallation: [
|
|
"PUT /user/installations/{installation_id}/repositories/{repository_id}",
|
|
{},
|
|
{ renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
|
|
],
|
|
addRepoToInstallationForAuthenticatedUser: [
|
|
"PUT /user/installations/{installation_id}/repositories/{repository_id}"
|
|
],
|
|
checkToken: ["POST /applications/{client_id}/token"],
|
|
createFromManifest: ["POST /app-manifests/{code}/conversions"],
|
|
createInstallationAccessToken: [
|
|
"POST /app/installations/{installation_id}/access_tokens"
|
|
],
|
|
deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
|
|
deleteInstallation: ["DELETE /app/installations/{installation_id}"],
|
|
deleteToken: ["DELETE /applications/{client_id}/token"],
|
|
getAuthenticated: ["GET /app"],
|
|
getBySlug: ["GET /apps/{app_slug}"],
|
|
getInstallation: ["GET /app/installations/{installation_id}"],
|
|
getOrgInstallation: ["GET /orgs/{org}/installation"],
|
|
getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
|
|
getSubscriptionPlanForAccount: [
|
|
"GET /marketplace_listing/accounts/{account_id}"
|
|
],
|
|
getSubscriptionPlanForAccountStubbed: [
|
|
"GET /marketplace_listing/stubbed/accounts/{account_id}"
|
|
],
|
|
getUserInstallation: ["GET /users/{username}/installation"],
|
|
getWebhookConfigForApp: ["GET /app/hook/config"],
|
|
getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
|
|
listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
|
|
listAccountsForPlanStubbed: [
|
|
"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
|
|
],
|
|
listInstallationReposForAuthenticatedUser: [
|
|
"GET /user/installations/{installation_id}/repositories"
|
|
],
|
|
listInstallationRequestsForAuthenticatedApp: [
|
|
"GET /app/installation-requests"
|
|
],
|
|
listInstallations: ["GET /app/installations"],
|
|
listInstallationsForAuthenticatedUser: ["GET /user/installations"],
|
|
listPlans: ["GET /marketplace_listing/plans"],
|
|
listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
|
|
listReposAccessibleToInstallation: ["GET /installation/repositories"],
|
|
listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
|
|
listSubscriptionsForAuthenticatedUserStubbed: [
|
|
"GET /user/marketplace_purchases/stubbed"
|
|
],
|
|
listWebhookDeliveries: ["GET /app/hook/deliveries"],
|
|
redeliverWebhookDelivery: [
|
|
"POST /app/hook/deliveries/{delivery_id}/attempts"
|
|
],
|
|
removeRepoFromInstallation: [
|
|
"DELETE /user/installations/{installation_id}/repositories/{repository_id}",
|
|
{},
|
|
{ renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
|
|
],
|
|
removeRepoFromInstallationForAuthenticatedUser: [
|
|
"DELETE /user/installations/{installation_id}/repositories/{repository_id}"
|
|
],
|
|
resetToken: ["PATCH /applications/{client_id}/token"],
|
|
revokeInstallationAccessToken: ["DELETE /installation/token"],
|
|
scopeToken: ["POST /applications/{client_id}/token/scoped"],
|
|
suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
|
|
unsuspendInstallation: [
|
|
"DELETE /app/installations/{installation_id}/suspended"
|
|
],
|
|
updateWebhookConfigForApp: ["PATCH /app/hook/config"]
|
|
},
|
|
billing: {
|
|
getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
|
|
getGithubActionsBillingUser: [
|
|
"GET /users/{username}/settings/billing/actions"
|
|
],
|
|
getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
|
|
getGithubPackagesBillingUser: [
|
|
"GET /users/{username}/settings/billing/packages"
|
|
],
|
|
getSharedStorageBillingOrg: [
|
|
"GET /orgs/{org}/settings/billing/shared-storage"
|
|
],
|
|
getSharedStorageBillingUser: [
|
|
"GET /users/{username}/settings/billing/shared-storage"
|
|
]
|
|
},
|
|
checks: {
|
|
create: ["POST /repos/{owner}/{repo}/check-runs"],
|
|
createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
|
|
get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
|
|
getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
|
|
listAnnotations: [
|
|
"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
|
|
],
|
|
listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
|
|
listForSuite: [
|
|
"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
|
|
],
|
|
listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
|
|
rerequestRun: [
|
|
"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
|
|
],
|
|
rerequestSuite: [
|
|
"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
|
|
],
|
|
setSuitesPreferences: [
|
|
"PATCH /repos/{owner}/{repo}/check-suites/preferences"
|
|
],
|
|
update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
|
|
},
|
|
codeScanning: {
|
|
deleteAnalysis: [
|
|
"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
|
|
],
|
|
getAlert: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
|
|
{},
|
|
{ renamedParameters: { alert_id: "alert_number" } }
|
|
],
|
|
getAnalysis: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
|
|
],
|
|
getCodeqlDatabase: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
|
|
],
|
|
getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
|
|
getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
|
|
listAlertInstances: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
|
|
],
|
|
listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
|
|
listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
|
|
listAlertsInstances: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
|
|
{},
|
|
{ renamed: ["codeScanning", "listAlertInstances"] }
|
|
],
|
|
listCodeqlDatabases: [
|
|
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
|
|
],
|
|
listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
|
|
updateAlert: [
|
|
"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
|
|
],
|
|
updateDefaultSetup: [
|
|
"PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
|
|
],
|
|
uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
|
|
},
|
|
codesOfConduct: {
|
|
getAllCodesOfConduct: ["GET /codes_of_conduct"],
|
|
getConductCode: ["GET /codes_of_conduct/{key}"]
|
|
},
|
|
codespaces: {
|
|
addRepositoryForSecretForAuthenticatedUser: [
|
|
"PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
addSelectedRepoToOrgSecret: [
|
|
"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
checkPermissionsForDevcontainer: [
|
|
"GET /repos/{owner}/{repo}/codespaces/permissions_check"
|
|
],
|
|
codespaceMachinesForAuthenticatedUser: [
|
|
"GET /user/codespaces/{codespace_name}/machines"
|
|
],
|
|
createForAuthenticatedUser: ["POST /user/codespaces"],
|
|
createOrUpdateOrgSecret: [
|
|
"PUT /orgs/{org}/codespaces/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateRepoSecret: [
|
|
"PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateSecretForAuthenticatedUser: [
|
|
"PUT /user/codespaces/secrets/{secret_name}"
|
|
],
|
|
createWithPrForAuthenticatedUser: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
|
|
],
|
|
createWithRepoForAuthenticatedUser: [
|
|
"POST /repos/{owner}/{repo}/codespaces"
|
|
],
|
|
deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
|
|
deleteFromOrganization: [
|
|
"DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
|
|
],
|
|
deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
|
|
deleteRepoSecret: [
|
|
"DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
|
|
],
|
|
deleteSecretForAuthenticatedUser: [
|
|
"DELETE /user/codespaces/secrets/{secret_name}"
|
|
],
|
|
exportForAuthenticatedUser: [
|
|
"POST /user/codespaces/{codespace_name}/exports"
|
|
],
|
|
getCodespacesForUserInOrg: [
|
|
"GET /orgs/{org}/members/{username}/codespaces"
|
|
],
|
|
getExportDetailsForAuthenticatedUser: [
|
|
"GET /user/codespaces/{codespace_name}/exports/{export_id}"
|
|
],
|
|
getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
|
|
getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
|
|
getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
|
|
getPublicKeyForAuthenticatedUser: [
|
|
"GET /user/codespaces/secrets/public-key"
|
|
],
|
|
getRepoPublicKey: [
|
|
"GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
|
|
],
|
|
getRepoSecret: [
|
|
"GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
|
|
],
|
|
getSecretForAuthenticatedUser: [
|
|
"GET /user/codespaces/secrets/{secret_name}"
|
|
],
|
|
listDevcontainersInRepositoryForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces/devcontainers"
|
|
],
|
|
listForAuthenticatedUser: ["GET /user/codespaces"],
|
|
listInOrganization: [
|
|
"GET /orgs/{org}/codespaces",
|
|
{},
|
|
{ renamedParameters: { org_id: "org" } }
|
|
],
|
|
listInRepositoryForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces"
|
|
],
|
|
listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
|
|
listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
|
|
listRepositoriesForSecretForAuthenticatedUser: [
|
|
"GET /user/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
|
|
listSelectedReposForOrgSecret: [
|
|
"GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
preFlightWithRepoForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces/new"
|
|
],
|
|
publishForAuthenticatedUser: [
|
|
"POST /user/codespaces/{codespace_name}/publish"
|
|
],
|
|
removeRepositoryForSecretForAuthenticatedUser: [
|
|
"DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
removeSelectedRepoFromOrgSecret: [
|
|
"DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
repoMachinesForAuthenticatedUser: [
|
|
"GET /repos/{owner}/{repo}/codespaces/machines"
|
|
],
|
|
setRepositoriesForSecretForAuthenticatedUser: [
|
|
"PUT /user/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
setSelectedReposForOrgSecret: [
|
|
"PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
|
|
],
|
|
startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
|
|
stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
|
|
stopInOrganization: [
|
|
"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
|
|
],
|
|
updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
|
|
},
|
|
copilot: {
|
|
addCopilotSeatsForTeams: [
|
|
"POST /orgs/{org}/copilot/billing/selected_teams"
|
|
],
|
|
addCopilotSeatsForUsers: [
|
|
"POST /orgs/{org}/copilot/billing/selected_users"
|
|
],
|
|
cancelCopilotSeatAssignmentForTeams: [
|
|
"DELETE /orgs/{org}/copilot/billing/selected_teams"
|
|
],
|
|
cancelCopilotSeatAssignmentForUsers: [
|
|
"DELETE /orgs/{org}/copilot/billing/selected_users"
|
|
],
|
|
getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
|
|
getCopilotSeatDetailsForUser: [
|
|
"GET /orgs/{org}/members/{username}/copilot"
|
|
],
|
|
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"],
|
|
usageMetricsForEnterprise: ["GET /enterprises/{enterprise}/copilot/usage"],
|
|
usageMetricsForOrg: ["GET /orgs/{org}/copilot/usage"],
|
|
usageMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/usage"]
|
|
},
|
|
dependabot: {
|
|
addSelectedRepoToOrgSecret: [
|
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
createOrUpdateOrgSecret: [
|
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}"
|
|
],
|
|
createOrUpdateRepoSecret: [
|
|
"PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
|
|
],
|
|
deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
|
|
deleteRepoSecret: [
|
|
"DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
|
|
],
|
|
getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
|
|
getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
|
|
getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
|
|
getRepoPublicKey: [
|
|
"GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
|
|
],
|
|
getRepoSecret: [
|
|
"GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
|
|
],
|
|
listAlertsForEnterprise: [
|
|
"GET /enterprises/{enterprise}/dependabot/alerts"
|
|
],
|
|
listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
|
|
listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
|
|
listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
|
|
listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
|
|
listSelectedReposForOrgSecret: [
|
|
"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
|
|
],
|
|
removeSelectedRepoFromOrgSecret: [
|
|
"DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
|
],
|
|
setSelectedReposForOrgSecret: [
|
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
|
|
],
|
|
updateAlert: [
|
|
"PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
|
|
]
|
|
},
|
|
dependencyGraph: {
|
|
createRepositorySnapshot: [
|
|
"POST /repos/{owner}/{repo}/dependency-graph/snapshots"
|
|
],
|
|
diffRange: [
|
|
"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
|
|
],
|
|
exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
|
|
},
|
|
emojis: { get: ["GET /emojis"] },
|
|
gists: {
|
|
checkIsStarred: ["GET /gists/{gist_id}/star"],
|
|
create: ["POST /gists"],
|
|
createComment: ["POST /gists/{gist_id}/comments"],
|
|
delete: ["DELETE /gists/{gist_id}"],
|
|
deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
|
|
fork: ["POST /gists/{gist_id}/forks"],
|
|
get: ["GET /gists/{gist_id}"],
|
|
getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
|
|
getRevision: ["GET /gists/{gist_id}/{sha}"],
|
|
list: ["GET /gists"],
|
|
listComments: ["GET /gists/{gist_id}/comments"],
|
|
listCommits: ["GET /gists/{gist_id}/commits"],
|
|
listForUser: ["GET /users/{username}/gists"],
|
|
listForks: ["GET /gists/{gist_id}/forks"],
|
|
listPublic: ["GET /gists/public"],
|
|
listStarred: ["GET /gists/starred"],
|
|
star: ["PUT /gists/{gist_id}/star"],
|
|
unstar: ["DELETE /gists/{gist_id}/star"],
|
|
update: ["PATCH /gists/{gist_id}"],
|
|
updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
|
|
},
|
|
git: {
|
|
createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
|
|
createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
|
|
createRef: ["POST /repos/{owner}/{repo}/git/refs"],
|
|
createTag: ["POST /repos/{owner}/{repo}/git/tags"],
|
|
createTree: ["POST /repos/{owner}/{repo}/git/trees"],
|
|
deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
|
|
getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
|
|
getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
|
|
getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
|
|
getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
|
|
getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
|
|
listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
|
|
updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
|
|
},
|
|
gitignore: {
|
|
getAllTemplates: ["GET /gitignore/templates"],
|
|
getTemplate: ["GET /gitignore/templates/{name}"]
|
|
},
|
|
interactions: {
|
|
getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
|
|
getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
|
|
getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
|
|
getRestrictionsForYourPublicRepos: [
|
|
"GET /user/interaction-limits",
|
|
{},
|
|
{ renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
|
|
],
|
|
removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
|
|
removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
|
|
removeRestrictionsForRepo: [
|
|
"DELETE /repos/{owner}/{repo}/interaction-limits"
|
|
],
|
|
removeRestrictionsForYourPublicRepos: [
|
|
"DELETE /user/interaction-limits",
|
|
{},
|
|
{ renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
|
|
],
|
|
setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
|
|
setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
|
|
setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
|
|
setRestrictionsForYourPublicRepos: [
|
|
"PUT /user/interaction-limits",
|
|
{},
|
|
{ renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
|
|
]
|
|
},
|
|
issues: {
|
|
addAssignees: [
|
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
|
|
],
|
|
addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
|
|
checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
|
|
checkUserCanBeAssignedToIssue: [
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
|
|
],
|
|
create: ["POST /repos/{owner}/{repo}/issues"],
|
|
createComment: [
|
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
|
|
],
|
|
createLabel: ["POST /repos/{owner}/{repo}/labels"],
|
|
createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
|
|
deleteComment: [
|
|
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
|
|
],
|
|
deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
|
|
deleteMilestone: [
|
|
"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
|
|
],
|
|
get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
|
|
getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
|
|
getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
|
|
getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
|
|
getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
|
|
list: ["GET /issues"],
|
|
listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
|
|
listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
|
|
listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
|
|
listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
|
|
listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
|
|
listEventsForTimeline: [
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
|
|
],
|
|
listForAuthenticatedUser: ["GET /user/issues"],
|
|
listForOrg: ["GET /orgs/{org}/issues"],
|
|
listForRepo: ["GET /repos/{owner}/{repo}/issues"],
|
|
listLabelsForMilestone: [
|
|
"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
|
|
],
|
|
listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
|
|
listLabelsOnIssue: [
|
|
"GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
|
|
],
|
|
listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
|
|
lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
|
|
removeAllLabels: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
|
|
],
|
|
removeAssignees: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
|
|
],
|
|
removeLabel: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
|
|
],
|
|
setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
|
|
unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
|
|
update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
|
|
updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
|
|
updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
|
|
updateMilestone: [
|
|
"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
|
|
]
|
|
},
|
|
licenses: {
|
|
get: ["GET /licenses/{license}"],
|
|
getAllCommonlyUsed: ["GET /licenses"],
|
|
getForRepo: ["GET /repos/{owner}/{repo}/license"]
|
|
},
|
|
markdown: {
|
|
render: ["POST /markdown"],
|
|
renderRaw: [
|
|
"POST /markdown/raw",
|
|
{ headers: { "content-type": "text/plain; charset=utf-8" } }
|
|
]
|
|
},
|
|
meta: {
|
|
get: ["GET /meta"],
|
|
getAllVersions: ["GET /versions"],
|
|
getOctocat: ["GET /octocat"],
|
|
getZen: ["GET /zen"],
|
|
root: ["GET /"]
|
|
},
|
|
migrations: {
|
|
deleteArchiveForAuthenticatedUser: [
|
|
"DELETE /user/migrations/{migration_id}/archive"
|
|
],
|
|
deleteArchiveForOrg: [
|
|
"DELETE /orgs/{org}/migrations/{migration_id}/archive"
|
|
],
|
|
downloadArchiveForOrg: [
|
|
"GET /orgs/{org}/migrations/{migration_id}/archive"
|
|
],
|
|
getArchiveForAuthenticatedUser: [
|
|
"GET /user/migrations/{migration_id}/archive"
|
|
],
|
|
getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
|
|
getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
|
|
listForAuthenticatedUser: ["GET /user/migrations"],
|
|
listForOrg: ["GET /orgs/{org}/migrations"],
|
|
listReposForAuthenticatedUser: [
|
|
"GET /user/migrations/{migration_id}/repositories"
|
|
],
|
|
listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
|
|
listReposForUser: [
|
|
"GET /user/migrations/{migration_id}/repositories",
|
|
{},
|
|
{ renamed: ["migrations", "listReposForAuthenticatedUser"] }
|
|
],
|
|
startForAuthenticatedUser: ["POST /user/migrations"],
|
|
startForOrg: ["POST /orgs/{org}/migrations"],
|
|
unlockRepoForAuthenticatedUser: [
|
|
"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
|
|
],
|
|
unlockRepoForOrg: [
|
|
"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
|
|
]
|
|
},
|
|
oidc: {
|
|
getOidcCustomSubTemplateForOrg: [
|
|
"GET /orgs/{org}/actions/oidc/customization/sub"
|
|
],
|
|
updateOidcCustomSubTemplateForOrg: [
|
|
"PUT /orgs/{org}/actions/oidc/customization/sub"
|
|
]
|
|
},
|
|
orgs: {
|
|
addSecurityManagerTeam: [
|
|
"PUT /orgs/{org}/security-managers/teams/{team_slug}"
|
|
],
|
|
assignTeamToOrgRole: [
|
|
"PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
],
|
|
assignUserToOrgRole: [
|
|
"PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
],
|
|
blockUser: ["PUT /orgs/{org}/blocks/{username}"],
|
|
cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
|
|
checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
|
|
checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
|
|
checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
|
|
convertMemberToOutsideCollaborator: [
|
|
"PUT /orgs/{org}/outside_collaborators/{username}"
|
|
],
|
|
createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
|
|
createInvitation: ["POST /orgs/{org}/invitations"],
|
|
createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
|
|
createOrUpdateCustomPropertiesValuesForRepos: [
|
|
"PATCH /orgs/{org}/properties/values"
|
|
],
|
|
createOrUpdateCustomProperty: [
|
|
"PUT /orgs/{org}/properties/schema/{custom_property_name}"
|
|
],
|
|
createWebhook: ["POST /orgs/{org}/hooks"],
|
|
delete: ["DELETE /orgs/{org}"],
|
|
deleteCustomOrganizationRole: [
|
|
"DELETE /orgs/{org}/organization-roles/{role_id}"
|
|
],
|
|
deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
|
|
enableOrDisableSecurityProductOnAllOrgRepos: [
|
|
"POST /orgs/{org}/{security_product}/{enablement}"
|
|
],
|
|
get: ["GET /orgs/{org}"],
|
|
getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
|
|
getCustomProperty: [
|
|
"GET /orgs/{org}/properties/schema/{custom_property_name}"
|
|
],
|
|
getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
|
|
getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
|
|
getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
|
|
getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
|
|
getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
|
|
getWebhookDelivery: [
|
|
"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
|
|
],
|
|
list: ["GET /organizations"],
|
|
listAppInstallations: ["GET /orgs/{org}/installations"],
|
|
listBlockedUsers: ["GET /orgs/{org}/blocks"],
|
|
listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
|
|
listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
|
|
listForAuthenticatedUser: ["GET /user/orgs"],
|
|
listForUser: ["GET /users/{username}/orgs"],
|
|
listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
|
|
listMembers: ["GET /orgs/{org}/members"],
|
|
listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
|
|
listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
|
|
listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
|
|
listOrgRoles: ["GET /orgs/{org}/organization-roles"],
|
|
listOrganizationFineGrainedPermissions: [
|
|
"GET /orgs/{org}/organization-fine-grained-permissions"
|
|
],
|
|
listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
|
|
listPatGrantRepositories: [
|
|
"GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
|
|
],
|
|
listPatGrantRequestRepositories: [
|
|
"GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
|
|
],
|
|
listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
|
|
listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
|
|
listPendingInvitations: ["GET /orgs/{org}/invitations"],
|
|
listPublicMembers: ["GET /orgs/{org}/public_members"],
|
|
listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
|
|
listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
|
|
listWebhooks: ["GET /orgs/{org}/hooks"],
|
|
patchCustomOrganizationRole: [
|
|
"PATCH /orgs/{org}/organization-roles/{role_id}"
|
|
],
|
|
pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
|
|
redeliverWebhookDelivery: [
|
|
"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
|
],
|
|
removeCustomProperty: [
|
|
"DELETE /orgs/{org}/properties/schema/{custom_property_name}"
|
|
],
|
|
removeMember: ["DELETE /orgs/{org}/members/{username}"],
|
|
removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
|
|
removeOutsideCollaborator: [
|
|
"DELETE /orgs/{org}/outside_collaborators/{username}"
|
|
],
|
|
removePublicMembershipForAuthenticatedUser: [
|
|
"DELETE /orgs/{org}/public_members/{username}"
|
|
],
|
|
removeSecurityManagerTeam: [
|
|
"DELETE /orgs/{org}/security-managers/teams/{team_slug}"
|
|
],
|
|
reviewPatGrantRequest: [
|
|
"POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
|
|
],
|
|
reviewPatGrantRequestsInBulk: [
|
|
"POST /orgs/{org}/personal-access-token-requests"
|
|
],
|
|
revokeAllOrgRolesTeam: [
|
|
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
|
|
],
|
|
revokeAllOrgRolesUser: [
|
|
"DELETE /orgs/{org}/organization-roles/users/{username}"
|
|
],
|
|
revokeOrgRoleTeam: [
|
|
"DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
],
|
|
revokeOrgRoleUser: [
|
|
"DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
],
|
|
setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
|
|
setPublicMembershipForAuthenticatedUser: [
|
|
"PUT /orgs/{org}/public_members/{username}"
|
|
],
|
|
unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
|
|
update: ["PATCH /orgs/{org}"],
|
|
updateMembershipForAuthenticatedUser: [
|
|
"PATCH /user/memberships/orgs/{org}"
|
|
],
|
|
updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
|
|
updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
|
|
updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
|
|
updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
|
|
},
|
|
packages: {
|
|
deletePackageForAuthenticatedUser: [
|
|
"DELETE /user/packages/{package_type}/{package_name}"
|
|
],
|
|
deletePackageForOrg: [
|
|
"DELETE /orgs/{org}/packages/{package_type}/{package_name}"
|
|
],
|
|
deletePackageForUser: [
|
|
"DELETE /users/{username}/packages/{package_type}/{package_name}"
|
|
],
|
|
deletePackageVersionForAuthenticatedUser: [
|
|
"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
deletePackageVersionForOrg: [
|
|
"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
deletePackageVersionForUser: [
|
|
"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
getAllPackageVersionsForAPackageOwnedByAnOrg: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
|
|
{},
|
|
{ renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
|
|
],
|
|
getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}/versions",
|
|
{},
|
|
{
|
|
renamed: [
|
|
"packages",
|
|
"getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
|
|
]
|
|
}
|
|
],
|
|
getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}/versions"
|
|
],
|
|
getAllPackageVersionsForPackageOwnedByOrg: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
|
|
],
|
|
getAllPackageVersionsForPackageOwnedByUser: [
|
|
"GET /users/{username}/packages/{package_type}/{package_name}/versions"
|
|
],
|
|
getPackageForAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}"
|
|
],
|
|
getPackageForOrganization: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}"
|
|
],
|
|
getPackageForUser: [
|
|
"GET /users/{username}/packages/{package_type}/{package_name}"
|
|
],
|
|
getPackageVersionForAuthenticatedUser: [
|
|
"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
getPackageVersionForOrganization: [
|
|
"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
getPackageVersionForUser: [
|
|
"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
|
|
],
|
|
listDockerMigrationConflictingPackagesForAuthenticatedUser: [
|
|
"GET /user/docker/conflicts"
|
|
],
|
|
listDockerMigrationConflictingPackagesForOrganization: [
|
|
"GET /orgs/{org}/docker/conflicts"
|
|
],
|
|
listDockerMigrationConflictingPackagesForUser: [
|
|
"GET /users/{username}/docker/conflicts"
|
|
],
|
|
listPackagesForAuthenticatedUser: ["GET /user/packages"],
|
|
listPackagesForOrganization: ["GET /orgs/{org}/packages"],
|
|
listPackagesForUser: ["GET /users/{username}/packages"],
|
|
restorePackageForAuthenticatedUser: [
|
|
"POST /user/packages/{package_type}/{package_name}/restore{?token}"
|
|
],
|
|
restorePackageForOrg: [
|
|
"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
|
|
],
|
|
restorePackageForUser: [
|
|
"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
|
|
],
|
|
restorePackageVersionForAuthenticatedUser: [
|
|
"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
|
|
],
|
|
restorePackageVersionForOrg: [
|
|
"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
|
|
],
|
|
restorePackageVersionForUser: [
|
|
"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
|
|
]
|
|
},
|
|
projects: {
|
|
addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
|
|
createCard: ["POST /projects/columns/{column_id}/cards"],
|
|
createColumn: ["POST /projects/{project_id}/columns"],
|
|
createForAuthenticatedUser: ["POST /user/projects"],
|
|
createForOrg: ["POST /orgs/{org}/projects"],
|
|
createForRepo: ["POST /repos/{owner}/{repo}/projects"],
|
|
delete: ["DELETE /projects/{project_id}"],
|
|
deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
|
|
deleteColumn: ["DELETE /projects/columns/{column_id}"],
|
|
get: ["GET /projects/{project_id}"],
|
|
getCard: ["GET /projects/columns/cards/{card_id}"],
|
|
getColumn: ["GET /projects/columns/{column_id}"],
|
|
getPermissionForUser: [
|
|
"GET /projects/{project_id}/collaborators/{username}/permission"
|
|
],
|
|
listCards: ["GET /projects/columns/{column_id}/cards"],
|
|
listCollaborators: ["GET /projects/{project_id}/collaborators"],
|
|
listColumns: ["GET /projects/{project_id}/columns"],
|
|
listForOrg: ["GET /orgs/{org}/projects"],
|
|
listForRepo: ["GET /repos/{owner}/{repo}/projects"],
|
|
listForUser: ["GET /users/{username}/projects"],
|
|
moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
|
|
moveColumn: ["POST /projects/columns/{column_id}/moves"],
|
|
removeCollaborator: [
|
|
"DELETE /projects/{project_id}/collaborators/{username}"
|
|
],
|
|
update: ["PATCH /projects/{project_id}"],
|
|
updateCard: ["PATCH /projects/columns/cards/{card_id}"],
|
|
updateColumn: ["PATCH /projects/columns/{column_id}"]
|
|
},
|
|
pulls: {
|
|
checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
|
|
create: ["POST /repos/{owner}/{repo}/pulls"],
|
|
createReplyForReviewComment: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
|
|
],
|
|
createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
|
|
createReviewComment: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
|
|
],
|
|
deletePendingReview: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
|
|
],
|
|
deleteReviewComment: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
|
|
],
|
|
dismissReview: [
|
|
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
|
|
],
|
|
get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
|
|
getReview: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
|
|
],
|
|
getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
|
|
list: ["GET /repos/{owner}/{repo}/pulls"],
|
|
listCommentsForReview: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
|
|
],
|
|
listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
|
|
listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
|
|
listRequestedReviewers: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
|
|
],
|
|
listReviewComments: [
|
|
"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
|
|
],
|
|
listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
|
|
listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
|
|
merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
|
|
removeRequestedReviewers: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
|
|
],
|
|
requestReviewers: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
|
|
],
|
|
submitReview: [
|
|
"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
|
|
],
|
|
update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
|
|
updateBranch: [
|
|
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
|
|
],
|
|
updateReview: [
|
|
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
|
|
],
|
|
updateReviewComment: [
|
|
"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
|
|
]
|
|
},
|
|
rateLimit: { get: ["GET /rate_limit"] },
|
|
reactions: {
|
|
createForCommitComment: [
|
|
"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
],
|
|
createForIssue: [
|
|
"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
|
|
],
|
|
createForIssueComment: [
|
|
"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
],
|
|
createForPullRequestReviewComment: [
|
|
"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
],
|
|
createForRelease: [
|
|
"POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
|
|
],
|
|
createForTeamDiscussionCommentInOrg: [
|
|
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
],
|
|
createForTeamDiscussionInOrg: [
|
|
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
],
|
|
deleteForCommitComment: [
|
|
"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForIssue: [
|
|
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
|
|
],
|
|
deleteForIssueComment: [
|
|
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForPullRequestComment: [
|
|
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForRelease: [
|
|
"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
|
|
],
|
|
deleteForTeamDiscussion: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
|
|
],
|
|
deleteForTeamDiscussionComment: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
|
|
],
|
|
listForCommitComment: [
|
|
"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
],
|
|
listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
|
|
listForIssueComment: [
|
|
"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
],
|
|
listForPullRequestReviewComment: [
|
|
"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
],
|
|
listForRelease: [
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
|
|
],
|
|
listForTeamDiscussionCommentInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
],
|
|
listForTeamDiscussionInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
]
|
|
},
|
|
repos: {
|
|
acceptInvitation: [
|
|
"PATCH /user/repository_invitations/{invitation_id}",
|
|
{},
|
|
{ renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
|
|
],
|
|
acceptInvitationForAuthenticatedUser: [
|
|
"PATCH /user/repository_invitations/{invitation_id}"
|
|
],
|
|
addAppAccessRestrictions: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
|
|
{},
|
|
{ mapToData: "apps" }
|
|
],
|
|
addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
|
|
addStatusCheckContexts: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
|
|
{},
|
|
{ mapToData: "contexts" }
|
|
],
|
|
addTeamAccessRestrictions: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
|
|
{},
|
|
{ mapToData: "teams" }
|
|
],
|
|
addUserAccessRestrictions: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
|
|
{},
|
|
{ mapToData: "users" }
|
|
],
|
|
cancelPagesDeployment: [
|
|
"POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
|
|
],
|
|
checkAutomatedSecurityFixes: [
|
|
"GET /repos/{owner}/{repo}/automated-security-fixes"
|
|
],
|
|
checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
|
|
checkPrivateVulnerabilityReporting: [
|
|
"GET /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
],
|
|
checkVulnerabilityAlerts: [
|
|
"GET /repos/{owner}/{repo}/vulnerability-alerts"
|
|
],
|
|
codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
|
|
compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
|
|
compareCommitsWithBasehead: [
|
|
"GET /repos/{owner}/{repo}/compare/{basehead}"
|
|
],
|
|
createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
|
|
createCommitComment: [
|
|
"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
|
|
],
|
|
createCommitSignatureProtection: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
],
|
|
createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
|
|
createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
|
|
createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
|
|
createDeploymentBranchPolicy: [
|
|
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
|
|
],
|
|
createDeploymentProtectionRule: [
|
|
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
|
|
],
|
|
createDeploymentStatus: [
|
|
"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
|
|
],
|
|
createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
|
|
createForAuthenticatedUser: ["POST /user/repos"],
|
|
createFork: ["POST /repos/{owner}/{repo}/forks"],
|
|
createInOrg: ["POST /orgs/{org}/repos"],
|
|
createOrUpdateCustomPropertiesValues: [
|
|
"PATCH /repos/{owner}/{repo}/properties/values"
|
|
],
|
|
createOrUpdateEnvironment: [
|
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}"
|
|
],
|
|
createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
|
|
createOrgRuleset: ["POST /orgs/{org}/rulesets"],
|
|
createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
|
|
createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
|
|
createRelease: ["POST /repos/{owner}/{repo}/releases"],
|
|
createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
|
|
createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
|
|
createUsingTemplate: [
|
|
"POST /repos/{template_owner}/{template_repo}/generate"
|
|
],
|
|
createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
|
|
declineInvitation: [
|
|
"DELETE /user/repository_invitations/{invitation_id}",
|
|
{},
|
|
{ renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
|
|
],
|
|
declineInvitationForAuthenticatedUser: [
|
|
"DELETE /user/repository_invitations/{invitation_id}"
|
|
],
|
|
delete: ["DELETE /repos/{owner}/{repo}"],
|
|
deleteAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
|
|
],
|
|
deleteAdminBranchProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
|
|
],
|
|
deleteAnEnvironment: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}"
|
|
],
|
|
deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
|
|
deleteBranchProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
|
|
],
|
|
deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
deleteCommitSignatureProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
],
|
|
deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
|
|
deleteDeployment: [
|
|
"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
|
|
],
|
|
deleteDeploymentBranchPolicy: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
|
|
],
|
|
deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
|
|
deleteInvitation: [
|
|
"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
|
|
],
|
|
deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
|
|
deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
|
|
deletePullRequestReviewProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
|
|
],
|
|
deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
|
|
deleteReleaseAsset: [
|
|
"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
|
|
],
|
|
deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
|
deleteTagProtection: [
|
|
"DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
|
|
],
|
|
deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
|
|
disableAutomatedSecurityFixes: [
|
|
"DELETE /repos/{owner}/{repo}/automated-security-fixes"
|
|
],
|
|
disableDeploymentProtectionRule: [
|
|
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
|
],
|
|
disablePrivateVulnerabilityReporting: [
|
|
"DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
],
|
|
disableVulnerabilityAlerts: [
|
|
"DELETE /repos/{owner}/{repo}/vulnerability-alerts"
|
|
],
|
|
downloadArchive: [
|
|
"GET /repos/{owner}/{repo}/zipball/{ref}",
|
|
{},
|
|
{ renamed: ["repos", "downloadZipballArchive"] }
|
|
],
|
|
downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
|
|
downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
|
|
enableAutomatedSecurityFixes: [
|
|
"PUT /repos/{owner}/{repo}/automated-security-fixes"
|
|
],
|
|
enablePrivateVulnerabilityReporting: [
|
|
"PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
|
|
],
|
|
enableVulnerabilityAlerts: [
|
|
"PUT /repos/{owner}/{repo}/vulnerability-alerts"
|
|
],
|
|
generateReleaseNotes: [
|
|
"POST /repos/{owner}/{repo}/releases/generate-notes"
|
|
],
|
|
get: ["GET /repos/{owner}/{repo}"],
|
|
getAccessRestrictions: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
|
|
],
|
|
getAdminBranchProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
|
|
],
|
|
getAllDeploymentProtectionRules: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
|
|
],
|
|
getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
|
|
getAllStatusCheckContexts: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
|
|
],
|
|
getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
|
|
getAppsWithAccessToProtectedBranch: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
|
|
],
|
|
getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
|
|
getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
|
|
getBranchProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection"
|
|
],
|
|
getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
|
|
getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
|
|
getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
|
|
getCollaboratorPermissionLevel: [
|
|
"GET /repos/{owner}/{repo}/collaborators/{username}/permission"
|
|
],
|
|
getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
|
|
getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
|
|
getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
|
|
getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
getCommitSignatureProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
],
|
|
getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
|
|
getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
|
|
getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
|
|
getCustomDeploymentProtectionRule: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
|
|
],
|
|
getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
|
|
getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
|
|
getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
|
|
getDeploymentBranchPolicy: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
|
|
],
|
|
getDeploymentStatus: [
|
|
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
|
|
],
|
|
getEnvironment: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}"
|
|
],
|
|
getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
|
|
getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
|
|
getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
|
|
getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
|
|
getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
|
|
getOrgRulesets: ["GET /orgs/{org}/rulesets"],
|
|
getPages: ["GET /repos/{owner}/{repo}/pages"],
|
|
getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
|
|
getPagesDeployment: [
|
|
"GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
|
|
],
|
|
getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
|
|
getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
|
|
getPullRequestReviewProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
|
|
],
|
|
getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
|
|
getReadme: ["GET /repos/{owner}/{repo}/readme"],
|
|
getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
|
|
getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
|
|
getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
|
|
getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
|
|
getRepoRuleSuite: [
|
|
"GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
|
|
],
|
|
getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
|
|
getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
|
getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
|
|
getStatusChecksProtection: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
|
|
],
|
|
getTeamsWithAccessToProtectedBranch: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
|
|
],
|
|
getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
|
|
getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
|
|
getUsersWithAccessToProtectedBranch: [
|
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
|
|
],
|
|
getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
|
|
getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
|
|
getWebhookConfigForRepo: [
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
|
|
],
|
|
getWebhookDelivery: [
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
|
|
],
|
|
listActivities: ["GET /repos/{owner}/{repo}/activity"],
|
|
listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
|
|
listBranches: ["GET /repos/{owner}/{repo}/branches"],
|
|
listBranchesForHeadCommit: [
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
|
|
],
|
|
listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
|
|
listCommentsForCommit: [
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
|
|
],
|
|
listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
|
|
listCommitStatusesForRef: [
|
|
"GET /repos/{owner}/{repo}/commits/{ref}/statuses"
|
|
],
|
|
listCommits: ["GET /repos/{owner}/{repo}/commits"],
|
|
listContributors: ["GET /repos/{owner}/{repo}/contributors"],
|
|
listCustomDeploymentRuleIntegrations: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
|
|
],
|
|
listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
|
|
listDeploymentBranchPolicies: [
|
|
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
|
|
],
|
|
listDeploymentStatuses: [
|
|
"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
|
|
],
|
|
listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
|
|
listForAuthenticatedUser: ["GET /user/repos"],
|
|
listForOrg: ["GET /orgs/{org}/repos"],
|
|
listForUser: ["GET /users/{username}/repos"],
|
|
listForks: ["GET /repos/{owner}/{repo}/forks"],
|
|
listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
|
|
listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
|
|
listLanguages: ["GET /repos/{owner}/{repo}/languages"],
|
|
listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
|
|
listPublic: ["GET /repositories"],
|
|
listPullRequestsAssociatedWithCommit: [
|
|
"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
|
|
],
|
|
listReleaseAssets: [
|
|
"GET /repos/{owner}/{repo}/releases/{release_id}/assets"
|
|
],
|
|
listReleases: ["GET /repos/{owner}/{repo}/releases"],
|
|
listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
|
|
listTags: ["GET /repos/{owner}/{repo}/tags"],
|
|
listTeams: ["GET /repos/{owner}/{repo}/teams"],
|
|
listWebhookDeliveries: [
|
|
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
|
|
],
|
|
listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
|
|
merge: ["POST /repos/{owner}/{repo}/merges"],
|
|
mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
|
|
pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
|
|
redeliverWebhookDelivery: [
|
|
"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
|
],
|
|
removeAppAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
|
|
{},
|
|
{ mapToData: "apps" }
|
|
],
|
|
removeCollaborator: [
|
|
"DELETE /repos/{owner}/{repo}/collaborators/{username}"
|
|
],
|
|
removeStatusCheckContexts: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
|
|
{},
|
|
{ mapToData: "contexts" }
|
|
],
|
|
removeStatusCheckProtection: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
|
|
],
|
|
removeTeamAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
|
|
{},
|
|
{ mapToData: "teams" }
|
|
],
|
|
removeUserAccessRestrictions: [
|
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
|
|
{},
|
|
{ mapToData: "users" }
|
|
],
|
|
renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
|
|
replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
|
|
requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
|
|
setAdminBranchProtection: [
|
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
|
|
],
|
|
setAppAccessRestrictions: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
|
|
{},
|
|
{ mapToData: "apps" }
|
|
],
|
|
setStatusCheckContexts: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
|
|
{},
|
|
{ mapToData: "contexts" }
|
|
],
|
|
setTeamAccessRestrictions: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
|
|
{},
|
|
{ mapToData: "teams" }
|
|
],
|
|
setUserAccessRestrictions: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
|
|
{},
|
|
{ mapToData: "users" }
|
|
],
|
|
testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
|
|
transfer: ["POST /repos/{owner}/{repo}/transfer"],
|
|
update: ["PATCH /repos/{owner}/{repo}"],
|
|
updateBranchProtection: [
|
|
"PUT /repos/{owner}/{repo}/branches/{branch}/protection"
|
|
],
|
|
updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
updateDeploymentBranchPolicy: [
|
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
|
|
],
|
|
updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
|
|
updateInvitation: [
|
|
"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
|
|
],
|
|
updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
|
|
updatePullRequestReviewProtection: [
|
|
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
|
|
],
|
|
updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
|
|
updateReleaseAsset: [
|
|
"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
|
|
],
|
|
updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
|
|
updateStatusCheckPotection: [
|
|
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
|
|
{},
|
|
{ renamed: ["repos", "updateStatusCheckProtection"] }
|
|
],
|
|
updateStatusCheckProtection: [
|
|
"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
|
|
],
|
|
updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
|
|
updateWebhookConfigForRepo: [
|
|
"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
|
|
],
|
|
uploadReleaseAsset: [
|
|
"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
|
|
{ baseUrl: "https://uploads.github.com" }
|
|
]
|
|
},
|
|
search: {
|
|
code: ["GET /search/code"],
|
|
commits: ["GET /search/commits"],
|
|
issuesAndPullRequests: ["GET /search/issues"],
|
|
labels: ["GET /search/labels"],
|
|
repos: ["GET /search/repositories"],
|
|
topics: ["GET /search/topics"],
|
|
users: ["GET /search/users"]
|
|
},
|
|
secretScanning: {
|
|
getAlert: [
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
|
|
],
|
|
listAlertsForEnterprise: [
|
|
"GET /enterprises/{enterprise}/secret-scanning/alerts"
|
|
],
|
|
listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
|
|
listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
|
|
listLocationsForAlert: [
|
|
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
|
|
],
|
|
updateAlert: [
|
|
"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
|
|
]
|
|
},
|
|
securityAdvisories: {
|
|
createFork: [
|
|
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
|
|
],
|
|
createPrivateVulnerabilityReport: [
|
|
"POST /repos/{owner}/{repo}/security-advisories/reports"
|
|
],
|
|
createRepositoryAdvisory: [
|
|
"POST /repos/{owner}/{repo}/security-advisories"
|
|
],
|
|
createRepositoryAdvisoryCveRequest: [
|
|
"POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
|
|
],
|
|
getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
|
|
getRepositoryAdvisory: [
|
|
"GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
|
|
],
|
|
listGlobalAdvisories: ["GET /advisories"],
|
|
listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
|
|
listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
|
|
updateRepositoryAdvisory: [
|
|
"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
|
|
]
|
|
},
|
|
teams: {
|
|
addOrUpdateMembershipForUserInOrg: [
|
|
"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
],
|
|
addOrUpdateProjectPermissionsInOrg: [
|
|
"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
],
|
|
addOrUpdateRepoPermissionsInOrg: [
|
|
"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
],
|
|
checkPermissionsForProjectInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
],
|
|
checkPermissionsForRepoInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
],
|
|
create: ["POST /orgs/{org}/teams"],
|
|
createDiscussionCommentInOrg: [
|
|
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
|
|
],
|
|
createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
|
|
deleteDiscussionCommentInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
],
|
|
deleteDiscussionInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
],
|
|
deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
|
|
getByName: ["GET /orgs/{org}/teams/{team_slug}"],
|
|
getDiscussionCommentInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
],
|
|
getDiscussionInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
],
|
|
getMembershipForUserInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
],
|
|
list: ["GET /orgs/{org}/teams"],
|
|
listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
|
|
listDiscussionCommentsInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
|
|
],
|
|
listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
|
|
listForAuthenticatedUser: ["GET /user/teams"],
|
|
listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
|
|
listPendingInvitationsInOrg: [
|
|
"GET /orgs/{org}/teams/{team_slug}/invitations"
|
|
],
|
|
listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
|
|
listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
|
|
removeMembershipForUserInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
],
|
|
removeProjectInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
],
|
|
removeRepoInOrg: [
|
|
"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
],
|
|
updateDiscussionCommentInOrg: [
|
|
"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
],
|
|
updateDiscussionInOrg: [
|
|
"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
],
|
|
updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
|
|
},
|
|
users: {
|
|
addEmailForAuthenticated: [
|
|
"POST /user/emails",
|
|
{},
|
|
{ renamed: ["users", "addEmailForAuthenticatedUser"] }
|
|
],
|
|
addEmailForAuthenticatedUser: ["POST /user/emails"],
|
|
addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
|
|
block: ["PUT /user/blocks/{username}"],
|
|
checkBlocked: ["GET /user/blocks/{username}"],
|
|
checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
|
|
checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
|
|
createGpgKeyForAuthenticated: [
|
|
"POST /user/gpg_keys",
|
|
{},
|
|
{ renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
|
|
],
|
|
createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
|
|
createPublicSshKeyForAuthenticated: [
|
|
"POST /user/keys",
|
|
{},
|
|
{ renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
|
|
],
|
|
createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
|
|
createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
|
|
deleteEmailForAuthenticated: [
|
|
"DELETE /user/emails",
|
|
{},
|
|
{ renamed: ["users", "deleteEmailForAuthenticatedUser"] }
|
|
],
|
|
deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
|
|
deleteGpgKeyForAuthenticated: [
|
|
"DELETE /user/gpg_keys/{gpg_key_id}",
|
|
{},
|
|
{ renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
|
|
],
|
|
deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
|
|
deletePublicSshKeyForAuthenticated: [
|
|
"DELETE /user/keys/{key_id}",
|
|
{},
|
|
{ renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
|
|
],
|
|
deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
|
|
deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
|
|
deleteSshSigningKeyForAuthenticatedUser: [
|
|
"DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
|
|
],
|
|
follow: ["PUT /user/following/{username}"],
|
|
getAuthenticated: ["GET /user"],
|
|
getByUsername: ["GET /users/{username}"],
|
|
getContextForUser: ["GET /users/{username}/hovercard"],
|
|
getGpgKeyForAuthenticated: [
|
|
"GET /user/gpg_keys/{gpg_key_id}",
|
|
{},
|
|
{ renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
|
|
],
|
|
getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
|
|
getPublicSshKeyForAuthenticated: [
|
|
"GET /user/keys/{key_id}",
|
|
{},
|
|
{ renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
|
|
],
|
|
getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
|
|
getSshSigningKeyForAuthenticatedUser: [
|
|
"GET /user/ssh_signing_keys/{ssh_signing_key_id}"
|
|
],
|
|
list: ["GET /users"],
|
|
listBlockedByAuthenticated: [
|
|
"GET /user/blocks",
|
|
{},
|
|
{ renamed: ["users", "listBlockedByAuthenticatedUser"] }
|
|
],
|
|
listBlockedByAuthenticatedUser: ["GET /user/blocks"],
|
|
listEmailsForAuthenticated: [
|
|
"GET /user/emails",
|
|
{},
|
|
{ renamed: ["users", "listEmailsForAuthenticatedUser"] }
|
|
],
|
|
listEmailsForAuthenticatedUser: ["GET /user/emails"],
|
|
listFollowedByAuthenticated: [
|
|
"GET /user/following",
|
|
{},
|
|
{ renamed: ["users", "listFollowedByAuthenticatedUser"] }
|
|
],
|
|
listFollowedByAuthenticatedUser: ["GET /user/following"],
|
|
listFollowersForAuthenticatedUser: ["GET /user/followers"],
|
|
listFollowersForUser: ["GET /users/{username}/followers"],
|
|
listFollowingForUser: ["GET /users/{username}/following"],
|
|
listGpgKeysForAuthenticated: [
|
|
"GET /user/gpg_keys",
|
|
{},
|
|
{ renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
|
|
],
|
|
listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
|
|
listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
|
|
listPublicEmailsForAuthenticated: [
|
|
"GET /user/public_emails",
|
|
{},
|
|
{ renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
|
|
],
|
|
listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
|
|
listPublicKeysForUser: ["GET /users/{username}/keys"],
|
|
listPublicSshKeysForAuthenticated: [
|
|
"GET /user/keys",
|
|
{},
|
|
{ renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
|
|
],
|
|
listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
|
|
listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
|
|
listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
|
|
listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
|
|
listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
|
|
setPrimaryEmailVisibilityForAuthenticated: [
|
|
"PATCH /user/email/visibility",
|
|
{},
|
|
{ renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
|
|
],
|
|
setPrimaryEmailVisibilityForAuthenticatedUser: [
|
|
"PATCH /user/email/visibility"
|
|
],
|
|
unblock: ["DELETE /user/blocks/{username}"],
|
|
unfollow: ["DELETE /user/following/{username}"],
|
|
updateAuthenticated: ["PATCH /user"]
|
|
}
|
|
};
|
|
var endpoints_default = Endpoints;
|
|
var endpointMethodsMap = /* @__PURE__ */ new Map();
|
|
for (const [scope, endpoints] of Object.entries(endpoints_default)) {
|
|
for (const [methodName, endpoint] of Object.entries(endpoints)) {
|
|
const [route, defaults, decorations] = endpoint;
|
|
const [method, url] = route.split(/ /);
|
|
const endpointDefaults = Object.assign(
|
|
{
|
|
method,
|
|
url
|
|
},
|
|
defaults
|
|
);
|
|
if (!endpointMethodsMap.has(scope)) {
|
|
endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
|
|
}
|
|
endpointMethodsMap.get(scope).set(methodName, {
|
|
scope,
|
|
methodName,
|
|
endpointDefaults,
|
|
decorations
|
|
});
|
|
}
|
|
}
|
|
var handler = {
|
|
has({ scope }, methodName) {
|
|
return endpointMethodsMap.get(scope).has(methodName);
|
|
},
|
|
getOwnPropertyDescriptor(target, methodName) {
|
|
return {
|
|
value: this.get(target, methodName),
|
|
configurable: true,
|
|
writable: true,
|
|
enumerable: true
|
|
};
|
|
},
|
|
defineProperty(target, methodName, descriptor) {
|
|
Object.defineProperty(target.cache, methodName, descriptor);
|
|
return true;
|
|
},
|
|
deleteProperty(target, methodName) {
|
|
delete target.cache[methodName];
|
|
return true;
|
|
},
|
|
ownKeys({ scope }) {
|
|
return [...endpointMethodsMap.get(scope).keys()];
|
|
},
|
|
set(target, methodName, value) {
|
|
return target.cache[methodName] = value;
|
|
},
|
|
get({ octokit, scope, cache }, methodName) {
|
|
if (cache[methodName]) {
|
|
return cache[methodName];
|
|
}
|
|
const method = endpointMethodsMap.get(scope).get(methodName);
|
|
if (!method) {
|
|
return void 0;
|
|
}
|
|
const { endpointDefaults, decorations } = method;
|
|
if (decorations) {
|
|
cache[methodName] = decorate(
|
|
octokit,
|
|
scope,
|
|
methodName,
|
|
endpointDefaults,
|
|
decorations
|
|
);
|
|
} else {
|
|
cache[methodName] = octokit.request.defaults(endpointDefaults);
|
|
}
|
|
return cache[methodName];
|
|
}
|
|
};
|
|
function endpointsToMethods(octokit) {
|
|
const newMethods = {};
|
|
for (const scope of endpointMethodsMap.keys()) {
|
|
newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
|
|
}
|
|
return newMethods;
|
|
}
|
|
function decorate(octokit, scope, methodName, defaults, decorations) {
|
|
const requestWithDefaults = octokit.request.defaults(defaults);
|
|
function withDecorations(...args) {
|
|
let options = requestWithDefaults.endpoint.merge(...args);
|
|
if (decorations.mapToData) {
|
|
options = Object.assign({}, options, {
|
|
data: options[decorations.mapToData],
|
|
[decorations.mapToData]: void 0
|
|
});
|
|
return requestWithDefaults(options);
|
|
}
|
|
if (decorations.renamed) {
|
|
const [newScope, newMethodName] = decorations.renamed;
|
|
octokit.log.warn(
|
|
`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
|
|
);
|
|
}
|
|
if (decorations.deprecated) {
|
|
octokit.log.warn(decorations.deprecated);
|
|
}
|
|
if (decorations.renamedParameters) {
|
|
const options2 = requestWithDefaults.endpoint.merge(...args);
|
|
for (const [name, alias] of Object.entries(
|
|
decorations.renamedParameters
|
|
)) {
|
|
if (name in options2) {
|
|
octokit.log.warn(
|
|
`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
|
|
);
|
|
if (!(alias in options2)) {
|
|
options2[alias] = options2[name];
|
|
}
|
|
delete options2[name];
|
|
}
|
|
}
|
|
return requestWithDefaults(options2);
|
|
}
|
|
return requestWithDefaults(...args);
|
|
}
|
|
return Object.assign(withDecorations, requestWithDefaults);
|
|
}
|
|
function restEndpointMethods(octokit) {
|
|
const api = endpointsToMethods(octokit);
|
|
return {
|
|
rest: api
|
|
};
|
|
}
|
|
restEndpointMethods.VERSION = VERSION;
|
|
function legacyRestEndpointMethods(octokit) {
|
|
const api = endpointsToMethods(octokit);
|
|
return {
|
|
...api,
|
|
rest: api
|
|
};
|
|
}
|
|
legacyRestEndpointMethods.VERSION = VERSION;
|
|
}
|
|
});
|
|
|
|
//
|
|
var require_dist_node14 = __commonJS({
|
|
""(exports, module) {
|
|
"use strict";
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps2 = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames2(from))
|
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
var dist_src_exports = {};
|
|
__export(dist_src_exports, {
|
|
Octokit: () => Octokit2
|
|
});
|
|
module.exports = __toCommonJS(dist_src_exports);
|
|
var import_core3 = require_dist_node8();
|
|
var import_plugin_request_log = require_dist_node11();
|
|
var import_plugin_paginate_rest = require_dist_node12();
|
|
var import_plugin_rest_endpoint_methods = require_dist_node13();
|
|
var VERSION = "20.1.1";
|
|
var Octokit2 = import_core3.Octokit.plugin(
|
|
import_plugin_request_log.requestLog,
|
|
import_plugin_rest_endpoint_methods.legacyRestEndpointMethods,
|
|
import_plugin_paginate_rest.paginateRest
|
|
).defaults({
|
|
userAgent: `octokit-rest.js/${VERSION}`
|
|
});
|
|
}
|
|
});
|
|
|
|
//
|
|
var import_core2 = __toESM(require_core(), 1);
|
|
var import_github3 = __toESM(require_github(), 1);
|
|
|
|
//
|
|
import { cp, mkdtemp, readFile, rm, writeFile } from "fs/promises";
|
|
import { join } from "path";
|
|
import { tmpdir } from "os";
|
|
import { spawnSync } from "child_process";
|
|
|
|
//
|
|
var import_tmp = __toESM(require_tmp(), 1);
|
|
var import_core = __toESM(require_core(), 1);
|
|
import { writeSync } from "fs";
|
|
var credentialFilePath;
|
|
function getCredentialFilePath() {
|
|
if (credentialFilePath === void 0) {
|
|
const tmpFile = (0, import_tmp.fileSync)({ postfix: ".json" });
|
|
writeSync(tmpFile.fd, (0, import_core.getInput)("serviceKey", { required: true }));
|
|
(0, import_core.setSecret)(tmpFile.name);
|
|
credentialFilePath = tmpFile.name;
|
|
}
|
|
return credentialFilePath;
|
|
}
|
|
var githubReleaseTrainReadToken = (0, import_core.getInput)("githubReleaseTrainReadToken", {
|
|
required: true
|
|
});
|
|
|
|
//
|
|
async function deployToFirebase(deployment, configPath, distDirPath) {
|
|
if (deployment.destination == void 0) {
|
|
console.log(`No deployment necessary for docs created from: ${deployment.branch}`);
|
|
return;
|
|
}
|
|
console.log("Preparing for deployment to firebase...");
|
|
const tmpDeployDir = await mkdtemp(join(tmpdir(), "deploy-directory"));
|
|
const deployConfigPath = join(tmpDeployDir, "firebase.json");
|
|
const config = JSON.parse(await readFile(configPath, { encoding: "utf-8" }));
|
|
config["hosting"]["public"] = "./dist";
|
|
await writeFile(deployConfigPath, JSON.stringify(config, null, 2));
|
|
await cp(distDirPath, join(tmpDeployDir, "dist"), { recursive: true });
|
|
spawnSync(`chmod 777 -R ${tmpDeployDir}`, { encoding: "utf-8", shell: true });
|
|
firebase(`target:clear --config ${deployConfigPath} --project angular-dev-site hosting angular-docs`, tmpDeployDir);
|
|
firebase(`target:apply --config ${deployConfigPath} --project angular-dev-site hosting angular-docs ${deployment.destination}`, tmpDeployDir);
|
|
firebase(`deploy --config ${deployConfigPath} --project angular-dev-site --only hosting --non-interactive`, tmpDeployDir);
|
|
firebase(`target:clear --config ${deployConfigPath} --project angular-dev-site hosting angular-docs`, tmpDeployDir);
|
|
await rm(tmpDeployDir, { recursive: true });
|
|
}
|
|
async function setupRedirect(deployment) {
|
|
if (deployment.redirect === void 0) {
|
|
console.log(`No redirect necessary for docs created from: ${deployment.branch}`);
|
|
return;
|
|
}
|
|
console.log("Preparing to set up redirect on firebase...");
|
|
const redirectConfig = JSON.stringify({
|
|
hosting: {
|
|
target: "angular-docs",
|
|
redirects: [
|
|
{
|
|
type: 302,
|
|
regex: "^(.*)$",
|
|
destination: `${deployment.redirect.to}:1`
|
|
}
|
|
]
|
|
}
|
|
}, null, 2);
|
|
const tmpRedirectDir = await mkdtemp(join(tmpdir(), "redirect-directory"));
|
|
const redirectConfigPath = join(tmpRedirectDir, "firebase.json");
|
|
await writeFile(redirectConfigPath, redirectConfig);
|
|
spawnSync(`chmod 777 -R ${tmpRedirectDir}`, { encoding: "utf-8", shell: true });
|
|
firebase(`target:clear --config ${redirectConfigPath} --project angular-dev-site hosting angular-docs`, tmpRedirectDir);
|
|
firebase(`target:apply --config ${redirectConfigPath} --project angular-dev-site hosting angular-docs ${deployment.redirect.from}`, tmpRedirectDir);
|
|
firebase(`deploy --config ${redirectConfigPath} --project angular-dev-site --only hosting --non-interactive`, tmpRedirectDir);
|
|
firebase(`target:clear --config ${redirectConfigPath} --project angular-dev-site hosting angular-docs`, tmpRedirectDir);
|
|
await rm(tmpRedirectDir, { recursive: true });
|
|
}
|
|
function firebase(cmd, cwd) {
|
|
spawnSync("npx", `-y firebase-tools@latest ${cmd}`.split(" "), {
|
|
cwd,
|
|
encoding: "utf-8",
|
|
shell: true,
|
|
stdio: "inherit",
|
|
env: {
|
|
...process.env,
|
|
GOOGLE_APPLICATION_CREDENTIALS: getCredentialFilePath()
|
|
}
|
|
});
|
|
}
|
|
|
|
//
|
|
import { pathToFileURL } from "url";
|
|
import { join as join2 } from "path";
|
|
|
|
//
|
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
var wrapAnsi16m = (offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`;
|
|
var styles = {
|
|
modifier: {
|
|
reset: [0, 0],
|
|
bold: [1, 22],
|
|
dim: [2, 22],
|
|
italic: [3, 23],
|
|
underline: [4, 24],
|
|
overline: [53, 55],
|
|
inverse: [7, 27],
|
|
hidden: [8, 28],
|
|
strikethrough: [9, 29]
|
|
},
|
|
color: {
|
|
black: [30, 39],
|
|
red: [31, 39],
|
|
green: [32, 39],
|
|
yellow: [33, 39],
|
|
blue: [34, 39],
|
|
magenta: [35, 39],
|
|
cyan: [36, 39],
|
|
white: [37, 39],
|
|
blackBright: [90, 39],
|
|
gray: [90, 39],
|
|
grey: [90, 39],
|
|
redBright: [91, 39],
|
|
greenBright: [92, 39],
|
|
yellowBright: [93, 39],
|
|
blueBright: [94, 39],
|
|
magentaBright: [95, 39],
|
|
cyanBright: [96, 39],
|
|
whiteBright: [97, 39]
|
|
},
|
|
bgColor: {
|
|
bgBlack: [40, 49],
|
|
bgRed: [41, 49],
|
|
bgGreen: [42, 49],
|
|
bgYellow: [43, 49],
|
|
bgBlue: [44, 49],
|
|
bgMagenta: [45, 49],
|
|
bgCyan: [46, 49],
|
|
bgWhite: [47, 49],
|
|
bgBlackBright: [100, 49],
|
|
bgGray: [100, 49],
|
|
bgGrey: [100, 49],
|
|
bgRedBright: [101, 49],
|
|
bgGreenBright: [102, 49],
|
|
bgYellowBright: [103, 49],
|
|
bgBlueBright: [104, 49],
|
|
bgMagentaBright: [105, 49],
|
|
bgCyanBright: [106, 49],
|
|
bgWhiteBright: [107, 49]
|
|
}
|
|
};
|
|
var modifierNames = Object.keys(styles.modifier);
|
|
var foregroundColorNames = Object.keys(styles.color);
|
|
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
function assembleStyles() {
|
|
const codes = /* @__PURE__ */ new Map();
|
|
for (const [groupName, group] of Object.entries(styles)) {
|
|
for (const [styleName, style] of Object.entries(group)) {
|
|
styles[styleName] = {
|
|
open: `\x1B[${style[0]}m`,
|
|
close: `\x1B[${style[1]}m`
|
|
};
|
|
group[styleName] = styles[styleName];
|
|
codes.set(style[0], style[1]);
|
|
}
|
|
Object.defineProperty(styles, groupName, {
|
|
value: group,
|
|
enumerable: false
|
|
});
|
|
}
|
|
Object.defineProperty(styles, "codes", {
|
|
value: codes,
|
|
enumerable: false
|
|
});
|
|
styles.color.close = "\x1B[39m";
|
|
styles.bgColor.close = "\x1B[49m";
|
|
styles.color.ansi = wrapAnsi16();
|
|
styles.color.ansi256 = wrapAnsi256();
|
|
styles.color.ansi16m = wrapAnsi16m();
|
|
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
Object.defineProperties(styles, {
|
|
rgbToAnsi256: {
|
|
value(red2, green2, blue2) {
|
|
if (red2 === green2 && green2 === blue2) {
|
|
if (red2 < 8) {
|
|
return 16;
|
|
}
|
|
if (red2 > 248) {
|
|
return 231;
|
|
}
|
|
return Math.round((red2 - 8) / 247 * 24) + 232;
|
|
}
|
|
return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5);
|
|
},
|
|
enumerable: false
|
|
},
|
|
hexToRgb: {
|
|
value(hex) {
|
|
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
if (!matches) {
|
|
return [0, 0, 0];
|
|
}
|
|
let [colorString] = matches;
|
|
if (colorString.length === 3) {
|
|
colorString = [...colorString].map((character) => character + character).join("");
|
|
}
|
|
const integer = Number.parseInt(colorString, 16);
|
|
return [
|
|
integer >> 16 & 255,
|
|
integer >> 8 & 255,
|
|
integer & 255
|
|
];
|
|
},
|
|
enumerable: false
|
|
},
|
|
hexToAnsi256: {
|
|
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
enumerable: false
|
|
},
|
|
ansi256ToAnsi: {
|
|
value(code) {
|
|
if (code < 8) {
|
|
return 30 + code;
|
|
}
|
|
if (code < 16) {
|
|
return 90 + (code - 8);
|
|
}
|
|
let red2;
|
|
let green2;
|
|
let blue2;
|
|
if (code >= 232) {
|
|
red2 = ((code - 232) * 10 + 8) / 255;
|
|
green2 = red2;
|
|
blue2 = red2;
|
|
} else {
|
|
code -= 16;
|
|
const remainder = code % 36;
|
|
red2 = Math.floor(code / 36) / 5;
|
|
green2 = Math.floor(remainder / 6) / 5;
|
|
blue2 = remainder % 6 / 5;
|
|
}
|
|
const value = Math.max(red2, green2, blue2) * 2;
|
|
if (value === 0) {
|
|
return 30;
|
|
}
|
|
let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2));
|
|
if (value === 2) {
|
|
result += 60;
|
|
}
|
|
return result;
|
|
},
|
|
enumerable: false
|
|
},
|
|
rgbToAnsi: {
|
|
value: (red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)),
|
|
enumerable: false
|
|
},
|
|
hexToAnsi: {
|
|
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
enumerable: false
|
|
}
|
|
});
|
|
return styles;
|
|
}
|
|
var ansiStyles = assembleStyles();
|
|
var ansi_styles_default = ansiStyles;
|
|
|
|
//
|
|
import process2 from "process";
|
|
import os from "os";
|
|
import tty from "tty";
|
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
const position = argv.indexOf(prefix + flag);
|
|
const terminatorPosition = argv.indexOf("--");
|
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
}
|
|
var { env } = process2;
|
|
var flagForceColor;
|
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
flagForceColor = 0;
|
|
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
flagForceColor = 1;
|
|
}
|
|
function envForceColor() {
|
|
if ("FORCE_COLOR" in env) {
|
|
if (env.FORCE_COLOR === "true") {
|
|
return 1;
|
|
}
|
|
if (env.FORCE_COLOR === "false") {
|
|
return 0;
|
|
}
|
|
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
}
|
|
}
|
|
function translateLevel(level) {
|
|
if (level === 0) {
|
|
return false;
|
|
}
|
|
return {
|
|
level,
|
|
hasBasic: true,
|
|
has256: level >= 2,
|
|
has16m: level >= 3
|
|
};
|
|
}
|
|
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
const noFlagForceColor = envForceColor();
|
|
if (noFlagForceColor !== void 0) {
|
|
flagForceColor = noFlagForceColor;
|
|
}
|
|
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
if (forceColor === 0) {
|
|
return 0;
|
|
}
|
|
if (sniffFlags) {
|
|
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
return 3;
|
|
}
|
|
if (hasFlag("color=256")) {
|
|
return 2;
|
|
}
|
|
}
|
|
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
return 1;
|
|
}
|
|
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
return 0;
|
|
}
|
|
const min = forceColor || 0;
|
|
if (env.TERM === "dumb") {
|
|
return min;
|
|
}
|
|
if (process2.platform === "win32") {
|
|
const osRelease = os.release().split(".");
|
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
}
|
|
return 1;
|
|
}
|
|
if ("CI" in env) {
|
|
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
return 3;
|
|
}
|
|
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
return 1;
|
|
}
|
|
return min;
|
|
}
|
|
if ("TEAMCITY_VERSION" in env) {
|
|
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
}
|
|
if (env.COLORTERM === "truecolor") {
|
|
return 3;
|
|
}
|
|
if (env.TERM === "xterm-kitty") {
|
|
return 3;
|
|
}
|
|
if ("TERM_PROGRAM" in env) {
|
|
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
switch (env.TERM_PROGRAM) {
|
|
case "iTerm.app": {
|
|
return version >= 3 ? 3 : 2;
|
|
}
|
|
case "Apple_Terminal": {
|
|
return 2;
|
|
}
|
|
}
|
|
}
|
|
if (/-256(color)?$/i.test(env.TERM)) {
|
|
return 2;
|
|
}
|
|
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
return 1;
|
|
}
|
|
if ("COLORTERM" in env) {
|
|
return 1;
|
|
}
|
|
return min;
|
|
}
|
|
function createSupportsColor(stream, options = {}) {
|
|
const level = _supportsColor(stream, {
|
|
streamIsTTY: stream && stream.isTTY,
|
|
...options
|
|
});
|
|
return translateLevel(level);
|
|
}
|
|
var supportsColor = {
|
|
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
};
|
|
var supports_color_default = supportsColor;
|
|
|
|
//
|
|
function stringReplaceAll(string, substring, replacer) {
|
|
let index = string.indexOf(substring);
|
|
if (index === -1) {
|
|
return string;
|
|
}
|
|
const substringLength = substring.length;
|
|
let endIndex = 0;
|
|
let returnValue = "";
|
|
do {
|
|
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
endIndex = index + substringLength;
|
|
index = string.indexOf(substring, endIndex);
|
|
} while (index !== -1);
|
|
returnValue += string.slice(endIndex);
|
|
return returnValue;
|
|
}
|
|
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
let endIndex = 0;
|
|
let returnValue = "";
|
|
do {
|
|
const gotCR = string[index - 1] === "\r";
|
|
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
endIndex = index + 1;
|
|
index = string.indexOf("\n", endIndex);
|
|
} while (index !== -1);
|
|
returnValue += string.slice(endIndex);
|
|
return returnValue;
|
|
}
|
|
|
|
//
|
|
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
var GENERATOR = Symbol("GENERATOR");
|
|
var STYLER = Symbol("STYLER");
|
|
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
var levelMapping = [
|
|
"ansi",
|
|
"ansi",
|
|
"ansi256",
|
|
"ansi16m"
|
|
];
|
|
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
var applyOptions = (object, options = {}) => {
|
|
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
}
|
|
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
};
|
|
var chalkFactory = (options) => {
|
|
const chalk2 = (...strings) => strings.join(" ");
|
|
applyOptions(chalk2, options);
|
|
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
return chalk2;
|
|
};
|
|
function createChalk(options) {
|
|
return chalkFactory(options);
|
|
}
|
|
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
styles2[styleName] = {
|
|
get() {
|
|
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
Object.defineProperty(this, styleName, { value: builder });
|
|
return builder;
|
|
}
|
|
};
|
|
}
|
|
styles2.visible = {
|
|
get() {
|
|
const builder = createBuilder(this, this[STYLER], true);
|
|
Object.defineProperty(this, "visible", { value: builder });
|
|
return builder;
|
|
}
|
|
};
|
|
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
if (model === "rgb") {
|
|
if (level === "ansi16m") {
|
|
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
}
|
|
if (level === "ansi256") {
|
|
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
}
|
|
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
}
|
|
if (model === "hex") {
|
|
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
}
|
|
return ansi_styles_default[type][model](...arguments_);
|
|
};
|
|
var usedModels = ["rgb", "hex", "ansi256"];
|
|
for (const model of usedModels) {
|
|
styles2[model] = {
|
|
get() {
|
|
const { level } = this;
|
|
return function(...arguments_) {
|
|
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
};
|
|
}
|
|
};
|
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
styles2[bgModel] = {
|
|
get() {
|
|
const { level } = this;
|
|
return function(...arguments_) {
|
|
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
};
|
|
}
|
|
};
|
|
}
|
|
var proto = Object.defineProperties(() => {
|
|
}, {
|
|
...styles2,
|
|
level: {
|
|
enumerable: true,
|
|
get() {
|
|
return this[GENERATOR].level;
|
|
},
|
|
set(level) {
|
|
this[GENERATOR].level = level;
|
|
}
|
|
}
|
|
});
|
|
var createStyler = (open, close, parent) => {
|
|
let openAll;
|
|
let closeAll;
|
|
if (parent === void 0) {
|
|
openAll = open;
|
|
closeAll = close;
|
|
} else {
|
|
openAll = parent.openAll + open;
|
|
closeAll = close + parent.closeAll;
|
|
}
|
|
return {
|
|
open,
|
|
close,
|
|
openAll,
|
|
closeAll,
|
|
parent
|
|
};
|
|
};
|
|
var createBuilder = (self, _styler, _isEmpty) => {
|
|
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
Object.setPrototypeOf(builder, proto);
|
|
builder[GENERATOR] = self;
|
|
builder[STYLER] = _styler;
|
|
builder[IS_EMPTY] = _isEmpty;
|
|
return builder;
|
|
};
|
|
var applyStyle = (self, string) => {
|
|
if (self.level <= 0 || !string) {
|
|
return self[IS_EMPTY] ? "" : string;
|
|
}
|
|
let styler = self[STYLER];
|
|
if (styler === void 0) {
|
|
return string;
|
|
}
|
|
const { openAll, closeAll } = styler;
|
|
if (string.includes("\x1B")) {
|
|
while (styler !== void 0) {
|
|
string = stringReplaceAll(string, styler.close, styler.open);
|
|
styler = styler.parent;
|
|
}
|
|
}
|
|
const lfIndex = string.indexOf("\n");
|
|
if (lfIndex !== -1) {
|
|
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
}
|
|
return openAll + string + closeAll;
|
|
};
|
|
Object.defineProperties(createChalk.prototype, styles2);
|
|
var chalk = createChalk();
|
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
var source_default = chalk;
|
|
|
|
//
|
|
import process3 from "process";
|
|
import os2 from "os";
|
|
import tty2 from "tty";
|
|
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process3.argv) {
|
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
const position = argv.indexOf(prefix + flag);
|
|
const terminatorPosition = argv.indexOf("--");
|
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
}
|
|
var { env: env2 } = process3;
|
|
var flagForceColor2;
|
|
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
flagForceColor2 = 0;
|
|
} else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
|
|
flagForceColor2 = 1;
|
|
}
|
|
function envForceColor2() {
|
|
if ("FORCE_COLOR" in env2) {
|
|
if (env2.FORCE_COLOR === "true") {
|
|
return 1;
|
|
}
|
|
if (env2.FORCE_COLOR === "false") {
|
|
return 0;
|
|
}
|
|
return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
|
|
}
|
|
}
|
|
function translateLevel2(level) {
|
|
if (level === 0) {
|
|
return false;
|
|
}
|
|
return {
|
|
level,
|
|
hasBasic: true,
|
|
has256: level >= 2,
|
|
has16m: level >= 3
|
|
};
|
|
}
|
|
function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
const noFlagForceColor = envForceColor2();
|
|
if (noFlagForceColor !== void 0) {
|
|
flagForceColor2 = noFlagForceColor;
|
|
}
|
|
const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
|
|
if (forceColor === 0) {
|
|
return 0;
|
|
}
|
|
if (sniffFlags) {
|
|
if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
|
|
return 3;
|
|
}
|
|
if (hasFlag2("color=256")) {
|
|
return 2;
|
|
}
|
|
}
|
|
if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
|
|
return 1;
|
|
}
|
|
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
return 0;
|
|
}
|
|
const min = forceColor || 0;
|
|
if (env2.TERM === "dumb") {
|
|
return min;
|
|
}
|
|
if (process3.platform === "win32") {
|
|
const osRelease = os2.release().split(".");
|
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
}
|
|
return 1;
|
|
}
|
|
if ("CI" in env2) {
|
|
if ("GITHUB_ACTIONS" in env2 || "GITEA_ACTIONS" in env2) {
|
|
return 3;
|
|
}
|
|
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
return 1;
|
|
}
|
|
return min;
|
|
}
|
|
if ("TEAMCITY_VERSION" in env2) {
|
|
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
}
|
|
if (env2.COLORTERM === "truecolor") {
|
|
return 3;
|
|
}
|
|
if (env2.TERM === "xterm-kitty") {
|
|
return 3;
|
|
}
|
|
if ("TERM_PROGRAM" in env2) {
|
|
const version = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
switch (env2.TERM_PROGRAM) {
|
|
case "iTerm.app": {
|
|
return version >= 3 ? 3 : 2;
|
|
}
|
|
case "Apple_Terminal": {
|
|
return 2;
|
|
}
|
|
}
|
|
}
|
|
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
return 2;
|
|
}
|
|
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
return 1;
|
|
}
|
|
if ("COLORTERM" in env2) {
|
|
return 1;
|
|
}
|
|
return min;
|
|
}
|
|
function createSupportsColor2(stream, options = {}) {
|
|
const level = _supportsColor2(stream, {
|
|
streamIsTTY: stream && stream.isTTY,
|
|
...options
|
|
});
|
|
return translateLevel2(level);
|
|
}
|
|
var supportsColor2 = {
|
|
stdout: createSupportsColor2({ isTTY: tty2.isatty(1) }),
|
|
stderr: createSupportsColor2({ isTTY: tty2.isatty(2) })
|
|
};
|
|
var supports_color_default2 = supportsColor2;
|
|
|
|
//
|
|
import { spawn as _spawn, spawnSync as _spawnSync } from "child_process";
|
|
var ChildProcess = class {
|
|
static spawnInteractive(command, args, options = {}) {
|
|
return new Promise((resolve, reject) => {
|
|
const commandText = `${command} ${args.join(" ")}`;
|
|
Log.debug(`Executing command: ${commandText}`);
|
|
const childProcess = _spawn(command, args, { ...options, shell: true, stdio: "inherit" });
|
|
childProcess.on("close", (status) => status === 0 ? resolve() : reject(status));
|
|
});
|
|
}
|
|
static spawn(command, args, options = {}) {
|
|
return new Promise((resolve, reject) => {
|
|
const commandText = `${command} ${args.join(" ")}`;
|
|
const outputMode = options.mode;
|
|
const env3 = getEnvironmentForNonInteractiveSpawn(options.env);
|
|
Log.debug(`Executing command: ${commandText}`);
|
|
const childProcess = _spawn(command, args, { ...options, env: env3, shell: true, stdio: "pipe" });
|
|
let logOutput = "";
|
|
let stdout = "";
|
|
let stderr = "";
|
|
if (options.input !== void 0) {
|
|
childProcess.stdin.write(options.input);
|
|
childProcess.stdin.end();
|
|
}
|
|
childProcess.stderr.on("data", (message) => {
|
|
stderr += message;
|
|
logOutput += message;
|
|
if (outputMode === void 0 || outputMode === "enabled") {
|
|
process.stderr.write(message);
|
|
}
|
|
});
|
|
childProcess.stdout.on("data", (message) => {
|
|
stdout += message;
|
|
logOutput += message;
|
|
if (outputMode === void 0 || outputMode === "enabled") {
|
|
process.stderr.write(message);
|
|
}
|
|
});
|
|
childProcess.on("close", (exitCode, signal) => {
|
|
const exitDescription = exitCode !== null ? `exit code "${exitCode}"` : `signal "${signal}"`;
|
|
const printFn = outputMode === "on-error" ? Log.error : Log.debug;
|
|
const status = statusFromExitCodeAndSignal(exitCode, signal);
|
|
printFn(`Command "${commandText}" completed with ${exitDescription}.`);
|
|
printFn(`Process output:
|
|
${logOutput}`);
|
|
if (status === 0 || options.suppressErrorOnFailingExitCode) {
|
|
resolve({ stdout, stderr, status });
|
|
} else {
|
|
reject(outputMode === "silent" ? logOutput : void 0);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
static spawnSync(command, args, options = {}) {
|
|
const commandText = `${command} ${args.join(" ")}`;
|
|
const env3 = getEnvironmentForNonInteractiveSpawn(options.env);
|
|
Log.debug(`Executing command: ${commandText}`);
|
|
const { status: exitCode, signal, stdout, stderr } = _spawnSync(command, args, { ...options, env: env3, encoding: "utf8", shell: true, stdio: "pipe" });
|
|
const status = statusFromExitCodeAndSignal(exitCode, signal);
|
|
if (status === 0 || options.suppressErrorOnFailingExitCode) {
|
|
return { status, stdout, stderr };
|
|
}
|
|
throw new Error(stderr);
|
|
}
|
|
};
|
|
function statusFromExitCodeAndSignal(exitCode, signal) {
|
|
return exitCode ?? signal ?? -1;
|
|
}
|
|
function getEnvironmentForNonInteractiveSpawn(userProvidedEnv) {
|
|
const forceColorValue = supports_color_default2.stdout !== false ? supports_color_default2.stdout.level.toString() : void 0;
|
|
return { FORCE_COLOR: forceColorValue, ...userProvidedEnv ?? process.env };
|
|
}
|
|
|
|
//
|
|
function determineRepoBaseDirFromCwd() {
|
|
const { stdout, stderr, status } = ChildProcess.spawnSync("git", ["rev-parse --show-toplevel"]);
|
|
if (status !== 0) {
|
|
throw Error(`Unable to find the path to the base directory of the repository.
|
|
Was the command run from inside of the repo?
|
|
|
|
${stderr}`);
|
|
}
|
|
return stdout.trim();
|
|
}
|
|
|
|
//
|
|
var LogLevel;
|
|
(function(LogLevel2) {
|
|
LogLevel2[LogLevel2["SILENT"] = 0] = "SILENT";
|
|
LogLevel2[LogLevel2["ERROR"] = 1] = "ERROR";
|
|
LogLevel2[LogLevel2["WARN"] = 2] = "WARN";
|
|
LogLevel2[LogLevel2["LOG"] = 3] = "LOG";
|
|
LogLevel2[LogLevel2["INFO"] = 4] = "INFO";
|
|
LogLevel2[LogLevel2["DEBUG"] = 5] = "DEBUG";
|
|
})(LogLevel || (LogLevel = {}));
|
|
var DEFAULT_LOG_LEVEL = LogLevel.INFO;
|
|
var red = source_default.red;
|
|
var reset = source_default.reset;
|
|
var green = source_default.green;
|
|
var yellow = source_default.yellow;
|
|
var bold = source_default.bold;
|
|
var blue = source_default.blue;
|
|
var underline = source_default.underline;
|
|
var Log = class {
|
|
};
|
|
Log.info = buildLogLevelFunction(() => console.info, LogLevel.INFO, null);
|
|
Log.error = buildLogLevelFunction(() => console.error, LogLevel.ERROR, source_default.red);
|
|
Log.debug = buildLogLevelFunction(() => console.debug, LogLevel.DEBUG, null);
|
|
Log.log = buildLogLevelFunction(() => console.log, LogLevel.LOG, null);
|
|
Log.warn = buildLogLevelFunction(() => console.warn, LogLevel.WARN, source_default.yellow);
|
|
function buildLogLevelFunction(loadCommand, level, defaultColor) {
|
|
const loggingFunction = (...values) => {
|
|
runConsoleCommand(
|
|
loadCommand,
|
|
level,
|
|
...values.map((v) => typeof v === "string" && defaultColor ? defaultColor(v) : v)
|
|
);
|
|
};
|
|
loggingFunction.group = (label, collapsed = false) => {
|
|
const command = collapsed ? console.groupCollapsed : console.group;
|
|
runConsoleCommand(() => command, level, defaultColor ? defaultColor(label) : label);
|
|
};
|
|
loggingFunction.groupEnd = () => {
|
|
runConsoleCommand(() => console.groupEnd, level);
|
|
};
|
|
return loggingFunction;
|
|
}
|
|
function runConsoleCommand(loadCommand, logLevel, ...text) {
|
|
if (getLogLevel() >= logLevel) {
|
|
loadCommand()(...text);
|
|
}
|
|
printToLogFile(logLevel, ...text);
|
|
}
|
|
function getLogLevel() {
|
|
const logLevel = Object.keys(LogLevel).indexOf((process.env[`LOG_LEVEL`] || "").toUpperCase());
|
|
if (logLevel === -1) {
|
|
return DEFAULT_LOG_LEVEL;
|
|
}
|
|
return logLevel;
|
|
}
|
|
var LOGGED_TEXT = "";
|
|
var LOG_LEVEL_COLUMNS = 7;
|
|
function printToLogFile(logLevel, ...text) {
|
|
const logLevelText = `${LogLevel[logLevel]}:`.padEnd(LOG_LEVEL_COLUMNS);
|
|
LOGGED_TEXT += text.join(" ").split("\n").map((l) => `${logLevelText} ${l}
|
|
`).join("");
|
|
}
|
|
|
|
//
|
|
var cachedConfig = null;
|
|
function setCachedConfig(config) {
|
|
cachedConfig = config;
|
|
}
|
|
function getCachedConfig() {
|
|
return cachedConfig;
|
|
}
|
|
|
|
//
|
|
var CONFIG_FILE_PATH = ".ng-dev/config.mjs";
|
|
var setConfig = setCachedConfig;
|
|
async function getConfig(baseDirOrAssertions) {
|
|
let cachedConfig2 = getCachedConfig();
|
|
if (cachedConfig2 === null) {
|
|
let baseDir;
|
|
if (typeof baseDirOrAssertions === "string") {
|
|
baseDir = baseDirOrAssertions;
|
|
} else {
|
|
baseDir = determineRepoBaseDirFromCwd();
|
|
}
|
|
const configPath = join2(baseDir, CONFIG_FILE_PATH);
|
|
cachedConfig2 = await readConfigFile(configPath);
|
|
setCachedConfig(cachedConfig2);
|
|
}
|
|
if (Array.isArray(baseDirOrAssertions)) {
|
|
for (const assertion of baseDirOrAssertions) {
|
|
assertion(cachedConfig2);
|
|
}
|
|
}
|
|
return { ...cachedConfig2, __isNgDevConfigObject: true };
|
|
}
|
|
var ConfigValidationError = class extends Error {
|
|
constructor(message, errors = []) {
|
|
super(message);
|
|
this.errors = errors;
|
|
}
|
|
};
|
|
function assertValidGithubConfig(config) {
|
|
const errors = [];
|
|
if (config.github === void 0) {
|
|
errors.push(`Github repository not configured. Set the "github" option.`);
|
|
} else {
|
|
if (config.github.name === void 0) {
|
|
errors.push(`"github.name" is not defined`);
|
|
}
|
|
if (config.github.owner === void 0) {
|
|
errors.push(`"github.owner" is not defined`);
|
|
}
|
|
}
|
|
if (errors.length) {
|
|
throw new ConfigValidationError("Invalid `github` configuration", errors);
|
|
}
|
|
}
|
|
async function readConfigFile(configPath, returnEmptyObjectOnError = false) {
|
|
try {
|
|
return await import(pathToFileURL(configPath).toString());
|
|
} catch (e) {
|
|
if (returnEmptyObjectOnError) {
|
|
Log.debug(`Could not read configuration file at ${configPath}, returning empty object instead.`);
|
|
Log.debug(e);
|
|
return {};
|
|
}
|
|
Log.error(`Could not read configuration file at ${configPath}.`);
|
|
Log.error(e);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
//
|
|
var ScopeRequirement;
|
|
(function(ScopeRequirement2) {
|
|
ScopeRequirement2[ScopeRequirement2["Required"] = 0] = "Required";
|
|
ScopeRequirement2[ScopeRequirement2["Optional"] = 1] = "Optional";
|
|
ScopeRequirement2[ScopeRequirement2["Forbidden"] = 2] = "Forbidden";
|
|
})(ScopeRequirement || (ScopeRequirement = {}));
|
|
var ReleaseNotesLevel;
|
|
(function(ReleaseNotesLevel2) {
|
|
ReleaseNotesLevel2[ReleaseNotesLevel2["Hidden"] = 0] = "Hidden";
|
|
ReleaseNotesLevel2[ReleaseNotesLevel2["Visible"] = 1] = "Visible";
|
|
})(ReleaseNotesLevel || (ReleaseNotesLevel = {}));
|
|
var COMMIT_TYPES = {
|
|
build: {
|
|
name: "build",
|
|
description: "Changes to local repository build system and tooling",
|
|
scope: ScopeRequirement.Optional,
|
|
releaseNotesLevel: ReleaseNotesLevel.Hidden
|
|
},
|
|
ci: {
|
|
name: "ci",
|
|
description: "Changes to CI configuration and CI specific tooling",
|
|
scope: ScopeRequirement.Forbidden,
|
|
releaseNotesLevel: ReleaseNotesLevel.Hidden
|
|
},
|
|
docs: {
|
|
name: "docs",
|
|
description: "Changes which exclusively affects documentation.",
|
|
scope: ScopeRequirement.Optional,
|
|
releaseNotesLevel: ReleaseNotesLevel.Hidden
|
|
},
|
|
feat: {
|
|
name: "feat",
|
|
description: "Creates a new feature",
|
|
scope: ScopeRequirement.Required,
|
|
releaseNotesLevel: ReleaseNotesLevel.Visible
|
|
},
|
|
fix: {
|
|
name: "fix",
|
|
description: "Fixes a previously discovered failure/bug",
|
|
scope: ScopeRequirement.Required,
|
|
releaseNotesLevel: ReleaseNotesLevel.Visible
|
|
},
|
|
perf: {
|
|
name: "perf",
|
|
description: "Improves performance without any change in functionality or API",
|
|
scope: ScopeRequirement.Required,
|
|
releaseNotesLevel: ReleaseNotesLevel.Visible
|
|
},
|
|
refactor: {
|
|
name: "refactor",
|
|
description: "Refactor without any change in functionality or API (includes style changes)",
|
|
scope: ScopeRequirement.Optional,
|
|
releaseNotesLevel: ReleaseNotesLevel.Hidden
|
|
},
|
|
release: {
|
|
name: "release",
|
|
description: "A release point in the repository",
|
|
scope: ScopeRequirement.Forbidden,
|
|
releaseNotesLevel: ReleaseNotesLevel.Hidden
|
|
},
|
|
test: {
|
|
name: "test",
|
|
description: "Improvements or corrections made to the project's test suite",
|
|
scope: ScopeRequirement.Optional,
|
|
releaseNotesLevel: ReleaseNotesLevel.Hidden
|
|
}
|
|
};
|
|
|
|
//
|
|
var createTypedObject = () => (v) => v;
|
|
var Label = class {
|
|
constructor({ name, description, color }) {
|
|
this.name = name;
|
|
this.description = description;
|
|
this.color = color;
|
|
}
|
|
};
|
|
|
|
//
|
|
var managedLabels = createTypedObject()({
|
|
DETECTED_BREAKING_CHANGE: {
|
|
description: "PR contains a commit with a breaking change",
|
|
name: "detected: breaking change",
|
|
commitCheck: (c) => c.breakingChanges.length !== 0
|
|
},
|
|
DETECTED_DEPRECATION: {
|
|
description: "PR contains a commit with a deprecation",
|
|
name: "detected: deprecation",
|
|
commitCheck: (c) => c.deprecations.length !== 0
|
|
},
|
|
DETECTED_FEATURE: {
|
|
description: "PR contains a feature commit",
|
|
name: "detected: feature",
|
|
commitCheck: (c) => c.type === "feat"
|
|
},
|
|
DETECTED_DOCS_CHANGE: {
|
|
description: "Related to the documentation",
|
|
name: "area: docs",
|
|
commitCheck: (c) => c.type === "docs"
|
|
},
|
|
DETECTED_INFRA_CHANGE: {
|
|
description: "Related the build and CI infrastructure of the project",
|
|
name: "area: build & ci",
|
|
commitCheck: (c) => c.type === "build" || c.type === "ci"
|
|
}
|
|
});
|
|
|
|
//
|
|
var actionLabels = createTypedObject()({
|
|
ACTION_MERGE: {
|
|
description: "The PR is ready for merge by the caretaker",
|
|
name: "action: merge"
|
|
},
|
|
ACTION_CLEANUP: {
|
|
description: "The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews",
|
|
name: "action: cleanup"
|
|
},
|
|
ACTION_PRESUBMIT: {
|
|
description: "The PR is in need of a google3 presubmit",
|
|
name: "action: presubmit"
|
|
},
|
|
ACTION_GLOBAL_PRESUBMIT: {
|
|
description: "The PR is in need of a google3 global presubmit",
|
|
name: "action: global presubmit"
|
|
},
|
|
ACTION_REVIEW: {
|
|
description: "The PR is still awaiting reviews from at least one requested reviewer",
|
|
name: "action: review"
|
|
}
|
|
});
|
|
|
|
//
|
|
var mergeLabels = createTypedObject()({
|
|
MERGE_PRESERVE_COMMITS: {
|
|
description: "When the PR is merged, a rebase and merge should be performed",
|
|
name: "merge: preserve commits"
|
|
},
|
|
MERGE_SQUASH_COMMITS: {
|
|
description: "When the PR is merged, a squash and merge should be performed",
|
|
name: "merge: squash commits"
|
|
},
|
|
MERGE_FIX_COMMIT_MESSAGE: {
|
|
description: "When the PR is merged, rewrites/fixups of the commit messages are needed",
|
|
name: "merge: fix commit message"
|
|
},
|
|
MERGE_CARETAKER_NOTE: {
|
|
description: "Alert the caretaker performing the merge to check the PR for an out of normal action needed or note",
|
|
name: "merge: caretaker note"
|
|
}
|
|
});
|
|
|
|
//
|
|
var TargetLabel = class extends Label {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.__hasTargetLabelMarker__ = true;
|
|
}
|
|
};
|
|
var targetLabels = createTypedObject()({
|
|
TARGET_FEATURE: new TargetLabel({
|
|
description: "This PR is targeted for a feature branch (outside of main and semver branches)",
|
|
name: "target: feature"
|
|
}),
|
|
TARGET_LTS: new TargetLabel({
|
|
description: "This PR is targeting a version currently in long-term support",
|
|
name: "target: lts"
|
|
}),
|
|
TARGET_MAJOR: new TargetLabel({
|
|
description: "This PR is targeted for the next major release",
|
|
name: "target: major"
|
|
}),
|
|
TARGET_MINOR: new TargetLabel({
|
|
description: "This PR is targeted for the next minor release",
|
|
name: "target: minor"
|
|
}),
|
|
TARGET_PATCH: new TargetLabel({
|
|
description: "This PR is targeted for the next patch release",
|
|
name: "target: patch"
|
|
}),
|
|
TARGET_RC: new TargetLabel({
|
|
description: "This PR is targeted for the next release-candidate",
|
|
name: "target: rc"
|
|
})
|
|
});
|
|
|
|
//
|
|
var priorityLabels = createTypedObject()({
|
|
P0: {
|
|
name: "P0",
|
|
description: "Issue that causes an outage, breakage, or major function to be unusable, with no known workarounds"
|
|
},
|
|
P1: {
|
|
name: "P1",
|
|
description: "Impacts a large percentage of users; if a workaround exists it is partial or overly painful"
|
|
},
|
|
P2: {
|
|
name: "P2",
|
|
description: "The issue is important to a large percentage of users, with a workaround"
|
|
},
|
|
P3: {
|
|
name: "P3",
|
|
description: "An issue that is relevant to core functions, but does not impede progress. Important, but not urgent"
|
|
},
|
|
P4: {
|
|
name: "P4",
|
|
description: "A relatively minor issue that is not relevant to core functions"
|
|
},
|
|
P5: {
|
|
name: "P5",
|
|
description: "The team acknowledges the request but does not plan to address it, it remains open for discussion"
|
|
}
|
|
});
|
|
|
|
//
|
|
var featureLabels = createTypedObject()({
|
|
FEATURE_IN_BACKLOG: {
|
|
name: "feature: in backlog",
|
|
description: "Feature request for which voting has completed and is now in the backlog"
|
|
},
|
|
FEATURE_VOTES_REQUIRED: {
|
|
name: "feature: votes required",
|
|
description: "Feature request which is currently still in the voting phase"
|
|
},
|
|
FEATURE_UNDER_CONSIDERATION: {
|
|
name: "feature: under consideration",
|
|
description: "Feature request for which voting has completed and the request is now under consideration"
|
|
},
|
|
FEATURE_INSUFFICIENT_VOTES: {
|
|
name: "feature: insufficient votes",
|
|
description: "Label to add when the not a sufficient number of votes or comments from unique authors"
|
|
}
|
|
});
|
|
|
|
//
|
|
var requiresLabels = createTypedObject()({
|
|
REQUIRES_TGP: {
|
|
name: "requires: TGP",
|
|
description: "This PR requires a passing TGP before merging is allowed"
|
|
}
|
|
});
|
|
|
|
//
|
|
var allLabels = {
|
|
...managedLabels,
|
|
...actionLabels,
|
|
...mergeLabels,
|
|
...targetLabels,
|
|
...priorityLabels,
|
|
...featureLabels,
|
|
...requiresLabels
|
|
};
|
|
|
|
//
|
|
var import_semver2 = __toESM(require_semver2(), 1);
|
|
|
|
//
|
|
var ReleaseTrain = class {
|
|
constructor(branchName, version) {
|
|
this.branchName = branchName;
|
|
this.version = version;
|
|
this.isMajor = this.version.minor === 0 && this.version.patch === 0;
|
|
}
|
|
};
|
|
|
|
//
|
|
var import_semver = __toESM(require_semver2(), 1);
|
|
var versionBranchNameRegex = /^(\d+)\.(\d+)\.x$/;
|
|
var exceptionalMinorPackageIndicator = "__ngDevExceptionalMinor__";
|
|
async function getVersionInfoForBranch(repo, branchName) {
|
|
const { data } = await repo.api.repos.getContent({
|
|
owner: repo.owner,
|
|
repo: repo.name,
|
|
path: "/package.json",
|
|
ref: branchName
|
|
});
|
|
const content = data.content;
|
|
if (!content) {
|
|
throw Error(`Unable to read "package.json" file from repository.`);
|
|
}
|
|
const pkgJson = JSON.parse(Buffer.from(content, "base64").toString());
|
|
const parsedVersion = import_semver.default.parse(pkgJson.version);
|
|
if (parsedVersion === null) {
|
|
throw Error(`Invalid version detected in following branch: ${branchName}.`);
|
|
}
|
|
return {
|
|
version: parsedVersion,
|
|
isExceptionalMinor: pkgJson[exceptionalMinorPackageIndicator] === true
|
|
};
|
|
}
|
|
function isVersionBranch(branchName) {
|
|
return versionBranchNameRegex.test(branchName);
|
|
}
|
|
async function getBranchesForMajorVersions(repo, majorVersions) {
|
|
const branchData = await repo.api.paginate(repo.api.repos.listBranches, {
|
|
owner: repo.owner,
|
|
repo: repo.name,
|
|
protected: true
|
|
});
|
|
const branches = [];
|
|
for (const { name } of branchData) {
|
|
if (!isVersionBranch(name)) {
|
|
continue;
|
|
}
|
|
const parsed = convertVersionBranchToSemVer(name);
|
|
if (parsed !== null && majorVersions.includes(parsed.major)) {
|
|
branches.push({ name, parsed });
|
|
}
|
|
}
|
|
return branches.sort((a, b) => import_semver.default.rcompare(a.parsed, b.parsed));
|
|
}
|
|
function convertVersionBranchToSemVer(branchName) {
|
|
return import_semver.default.parse(branchName.replace(versionBranchNameRegex, "$1.$2.0"));
|
|
}
|
|
|
|
//
|
|
var ActiveReleaseTrains = class {
|
|
constructor(trains) {
|
|
this.trains = trains;
|
|
this.releaseCandidate = this.trains.releaseCandidate;
|
|
this.next = this.trains.next;
|
|
this.latest = this.trains.latest;
|
|
this.exceptionalMinor = this.trains.exceptionalMinor;
|
|
}
|
|
isFeatureFreeze() {
|
|
return this.releaseCandidate !== null && this.releaseCandidate.version.prerelease[0] === "next";
|
|
}
|
|
static async fetch(repo) {
|
|
return fetchActiveReleaseTrains(repo);
|
|
}
|
|
};
|
|
async function fetchActiveReleaseTrains(repo) {
|
|
const nextBranchName = repo.nextBranchName;
|
|
const { version: nextVersion } = await getVersionInfoForBranch(repo, nextBranchName);
|
|
const next = new ReleaseTrain(nextBranchName, nextVersion);
|
|
const majorVersionsToFetch = [];
|
|
const checks = {
|
|
canHaveExceptionalMinor: () => false,
|
|
isValidReleaseCandidateVersion: () => false,
|
|
isValidExceptionalMinorVersion: () => false
|
|
};
|
|
if (nextVersion.minor === 0) {
|
|
majorVersionsToFetch.push(nextVersion.major - 1, nextVersion.major - 2);
|
|
checks.isValidReleaseCandidateVersion = (v) => v.major === nextVersion.major - 1;
|
|
checks.canHaveExceptionalMinor = (rc) => rc === null || rc.isMajor;
|
|
checks.isValidExceptionalMinorVersion = (v, rc) => v.major === (rc === null ? nextVersion.major : rc.version.major) - 1;
|
|
} else if (nextVersion.minor === 1) {
|
|
majorVersionsToFetch.push(nextVersion.major, nextVersion.major - 1);
|
|
checks.isValidReleaseCandidateVersion = (v) => v.major === nextVersion.major;
|
|
checks.canHaveExceptionalMinor = (rc) => rc !== null && rc.isMajor;
|
|
checks.isValidExceptionalMinorVersion = (v, rc) => v.major === rc.version.major - 1;
|
|
} else {
|
|
majorVersionsToFetch.push(nextVersion.major);
|
|
checks.isValidReleaseCandidateVersion = (v) => v.major === nextVersion.major;
|
|
checks.canHaveExceptionalMinor = () => false;
|
|
}
|
|
const branches = await getBranchesForMajorVersions(repo, majorVersionsToFetch);
|
|
const { latest, releaseCandidate, exceptionalMinor } = await findActiveReleaseTrainsFromVersionBranches(repo, next, branches, checks);
|
|
if (latest === null) {
|
|
throw Error(`Unable to determine the latest release-train. The following branches have been considered: [${branches.map((b) => b.name).join(", ")}]`);
|
|
}
|
|
return new ActiveReleaseTrains({ releaseCandidate, next, latest, exceptionalMinor });
|
|
}
|
|
async function findActiveReleaseTrainsFromVersionBranches(repo, next, branches, checks) {
|
|
const nextReleaseTrainVersion = import_semver2.default.parse(`${next.version.major}.${next.version.minor}.0`);
|
|
const nextBranchName = repo.nextBranchName;
|
|
let latest = null;
|
|
let releaseCandidate = null;
|
|
let exceptionalMinor = null;
|
|
for (const { name, parsed } of branches) {
|
|
if (import_semver2.default.gt(parsed, nextReleaseTrainVersion)) {
|
|
throw Error(`Discovered unexpected version-branch "${name}" for a release-train that is more recent than the release-train currently in the "${nextBranchName}" branch. Please either delete the branch if created by accident, or update the outdated version in the next branch (${nextBranchName}).`);
|
|
} else if (import_semver2.default.eq(parsed, nextReleaseTrainVersion)) {
|
|
throw Error(`Discovered unexpected version-branch "${name}" for a release-train that is already active in the "${nextBranchName}" branch. Please either delete the branch if created by accident, or update the version in the next branch (${nextBranchName}).`);
|
|
}
|
|
const { version, isExceptionalMinor } = await getVersionInfoForBranch(repo, name);
|
|
const releaseTrain = new ReleaseTrain(name, version);
|
|
const isPrerelease = version.prerelease[0] === "rc" || version.prerelease[0] === "next";
|
|
if (isExceptionalMinor) {
|
|
if (exceptionalMinor !== null) {
|
|
throw Error(`Unable to determine latest release-train. Found an additional exceptional minor version branch: "${name}". Already discovered: ${exceptionalMinor.branchName}.`);
|
|
}
|
|
if (!checks.canHaveExceptionalMinor(releaseCandidate)) {
|
|
throw Error(`Unable to determine latest release-train. Found an unexpected exceptional minor version branch: "${name}". No exceptional minor is currently allowed.`);
|
|
}
|
|
if (!checks.isValidExceptionalMinorVersion(version, releaseCandidate)) {
|
|
throw Error(`Unable to determine latest release-train. Found an invalid exceptional minor version branch: "${name}". Invalid version: ${version}.`);
|
|
}
|
|
exceptionalMinor = releaseTrain;
|
|
continue;
|
|
}
|
|
if (isPrerelease) {
|
|
if (exceptionalMinor !== null) {
|
|
throw Error(`Unable to determine latest release-train. Discovered a feature-freeze/release-candidate version branch (${name}) that is older than an in-progress exceptional minor (${exceptionalMinor.branchName}).`);
|
|
}
|
|
if (releaseCandidate !== null) {
|
|
throw Error(`Unable to determine latest release-train. Found two consecutive pre-release version branches. No exceptional minors are allowed currently, and there cannot be multiple feature-freeze/release-candidate branches: "${name}".`);
|
|
}
|
|
if (!checks.isValidReleaseCandidateVersion(version)) {
|
|
throw Error(`Discovered unexpected old feature-freeze/release-candidate branch. Expected no version-branch in feature-freeze/release-candidate mode for v${version.major}.`);
|
|
}
|
|
releaseCandidate = releaseTrain;
|
|
continue;
|
|
}
|
|
latest = releaseTrain;
|
|
break;
|
|
}
|
|
return { releaseCandidate, exceptionalMinor, latest };
|
|
}
|
|
|
|
//
|
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
|
|
//
|
|
var _npmPackageInfoCache = {};
|
|
async function fetchProjectNpmPackageInfo(config) {
|
|
return await fetchPackageInfoFromNpmRegistry(config.representativeNpmPackage);
|
|
}
|
|
async function fetchPackageInfoFromNpmRegistry(pkgName) {
|
|
if (_npmPackageInfoCache[pkgName] === void 0) {
|
|
_npmPackageInfoCache[pkgName] = fetch(`https://registry.npmjs.org/${pkgName}`).then((r) => r.json());
|
|
}
|
|
return await _npmPackageInfoCache[pkgName];
|
|
}
|
|
|
|
//
|
|
var majorActiveSupportDuration = 6;
|
|
var majorLongTermSupportDuration = 12;
|
|
var ltsNpmDistTagRegex = /^v(\d+)-lts$/;
|
|
async function fetchLongTermSupportBranchesFromNpm(config) {
|
|
const { "dist-tags": distTags, time } = await fetchProjectNpmPackageInfo(config);
|
|
const today = new Date();
|
|
const active = [];
|
|
const inactive = [];
|
|
for (const npmDistTag in distTags) {
|
|
if (isLtsDistTag(npmDistTag)) {
|
|
const version = import_semver3.default.parse(distTags[npmDistTag]);
|
|
const branchName = `${version.major}.${version.minor}.x`;
|
|
const majorReleaseDate = new Date(time[`${version.major}.0.0`]);
|
|
const ltsEndDate = computeLtsEndDateOfMajor(majorReleaseDate);
|
|
const ltsBranch = { name: branchName, version, npmDistTag };
|
|
if (today <= ltsEndDate) {
|
|
active.push(ltsBranch);
|
|
} else {
|
|
inactive.push(ltsBranch);
|
|
}
|
|
}
|
|
}
|
|
active.sort((a, b) => import_semver3.default.rcompare(a.version, b.version));
|
|
inactive.sort((a, b) => import_semver3.default.rcompare(a.version, b.version));
|
|
return { active, inactive };
|
|
}
|
|
function isLtsDistTag(tagName) {
|
|
return ltsNpmDistTagRegex.test(tagName);
|
|
}
|
|
function computeLtsEndDateOfMajor(majorReleaseDate) {
|
|
return new Date(majorReleaseDate.getFullYear(), majorReleaseDate.getMonth() + majorActiveSupportDuration + majorLongTermSupportDuration, majorReleaseDate.getDate(), majorReleaseDate.getHours(), majorReleaseDate.getMinutes(), majorReleaseDate.getSeconds(), majorReleaseDate.getMilliseconds());
|
|
}
|
|
|
|
//
|
|
var import_typed_graphqlify = __toESM(require_dist2(), 1);
|
|
var findOwnedForksOfRepoQuery = (0, import_typed_graphqlify.params)({
|
|
$owner: "String!",
|
|
$name: "String!"
|
|
}, {
|
|
repository: (0, import_typed_graphqlify.params)({ owner: "$owner", name: "$name" }, {
|
|
forks: (0, import_typed_graphqlify.params)({ affiliations: "OWNER", first: 1, orderBy: { field: "NAME", direction: "ASC" } }, {
|
|
nodes: [
|
|
{
|
|
owner: {
|
|
login: import_typed_graphqlify.types.string
|
|
},
|
|
name: import_typed_graphqlify.types.string
|
|
}
|
|
]
|
|
})
|
|
})
|
|
});
|
|
|
|
//
|
|
function isDryRun() {
|
|
return process.env["DRY_RUN"] !== void 0;
|
|
}
|
|
var DryRunError = class extends Error {
|
|
constructor() {
|
|
super("Cannot call this function in dryRun mode.");
|
|
}
|
|
};
|
|
|
|
//
|
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
|
|
//
|
|
var import_rest = __toESM(require_dist_node14(), 1);
|
|
var import_typed_graphqlify2 = __toESM(require_dist2(), 1);
|
|
var GithubClient = class {
|
|
constructor(_octokitOptions) {
|
|
this._octokitOptions = _octokitOptions;
|
|
this._octokit = new import_rest.Octokit({ ...this._octokitOptions });
|
|
this.pulls = this._octokit.pulls;
|
|
this.orgs = this._octokit.orgs;
|
|
this.repos = this._octokit.repos;
|
|
this.issues = this._octokit.issues;
|
|
this.git = this._octokit.git;
|
|
this.rateLimit = this._octokit.rateLimit;
|
|
this.teams = this._octokit.teams;
|
|
this.search = this._octokit.search;
|
|
this.rest = this._octokit.rest;
|
|
this.paginate = this._octokit.paginate;
|
|
this.checks = this._octokit.checks;
|
|
}
|
|
};
|
|
var AuthenticatedGithubClient = class extends GithubClient {
|
|
constructor(_token) {
|
|
super({ auth: _token });
|
|
this._token = _token;
|
|
this._graphql = this._octokit.graphql.defaults({
|
|
headers: { authorization: `token ${this._token}` }
|
|
});
|
|
}
|
|
async graphql(queryObject, params2 = {}) {
|
|
return await this._graphql((0, import_typed_graphqlify2.query)(queryObject).toString(), params2);
|
|
}
|
|
};
|
|
|
|
//
|
|
import { URL as URL2 } from "url";
|
|
var GITHUB_TOKEN_SETTINGS_URL = "https://github.com/settings/tokens";
|
|
var GITHUB_TOKEN_GENERATE_URL = "https://github.com/settings/tokens/new";
|
|
function addTokenToGitHttpsUrl(githubHttpsUrl, token) {
|
|
const url = new URL2(githubHttpsUrl);
|
|
url.password = token;
|
|
url.username = "x-access-token";
|
|
return url.href;
|
|
}
|
|
function getRepositoryGitUrl(config, githubToken) {
|
|
if (config.useSsh) {
|
|
return `[email protected]:${config.owner}/${config.name}.git`;
|
|
}
|
|
const baseHttpUrl = `https://github.com/${config.owner}/${config.name}.git`;
|
|
if (githubToken !== void 0) {
|
|
return addTokenToGitHttpsUrl(baseHttpUrl, githubToken);
|
|
}
|
|
return baseHttpUrl;
|
|
}
|
|
|
|
//
|
|
var GitCommandError = class extends Error {
|
|
constructor(client, unsanitizedArgs) {
|
|
super(`Command failed: git ${client.sanitizeConsoleOutput(unsanitizedArgs.join(" "))}`);
|
|
}
|
|
};
|
|
var GitClient = class {
|
|
constructor(config, baseDir = determineRepoBaseDirFromCwd()) {
|
|
this.baseDir = baseDir;
|
|
this.github = new GithubClient();
|
|
this.gitBinPath = "git";
|
|
this.config = config;
|
|
this.remoteConfig = config.github;
|
|
this.remoteParams = { owner: config.github.owner, repo: config.github.name };
|
|
this.mainBranchName = config.github.mainBranchName;
|
|
}
|
|
run(args, options) {
|
|
const result = this.runGraceful(args, options);
|
|
if (result.status !== 0) {
|
|
throw new GitCommandError(this, args);
|
|
}
|
|
return result;
|
|
}
|
|
runGraceful(args, options = {}) {
|
|
const gitCommand = args[0];
|
|
if (isDryRun() && gitCommand === "push") {
|
|
Log.debug(`"git push" is not able to be run in dryRun mode.`);
|
|
throw new DryRunError();
|
|
}
|
|
args = ["-c", "credential.helper=", ...args];
|
|
Log.debug("Executing: git", this.sanitizeConsoleOutput(args.join(" ")));
|
|
const result = spawnSync2(this.gitBinPath, args, {
|
|
cwd: this.baseDir,
|
|
stdio: "pipe",
|
|
...options,
|
|
encoding: "utf8"
|
|
});
|
|
Log.debug(`Status: ${result.status}, Error: ${!!result.error}, Signal: ${result.signal}`);
|
|
if (result.status !== 0 && result.stderr !== null) {
|
|
process.stderr.write(this.sanitizeConsoleOutput(result.stderr));
|
|
}
|
|
Log.debug("Stdout:", result.stdout);
|
|
Log.debug("Stderr:", result.stderr);
|
|
Log.debug("Process Error:", result.error);
|
|
if (result.error !== void 0) {
|
|
process.stderr.write(this.sanitizeConsoleOutput(result.error.message));
|
|
}
|
|
return result;
|
|
}
|
|
getRepoGitUrl() {
|
|
return getRepositoryGitUrl(this.remoteConfig);
|
|
}
|
|
hasCommit(branchName, sha) {
|
|
return this.run(["branch", branchName, "--contains", sha]).stdout !== "";
|
|
}
|
|
isShallowRepo() {
|
|
return this.run(["rev-parse", "--is-shallow-repository"]).stdout.trim() === "true";
|
|
}
|
|
getCurrentBranchOrRevision() {
|
|
const branchName = this.run(["rev-parse", "--abbrev-ref", "HEAD"]).stdout.trim();
|
|
if (branchName === "HEAD") {
|
|
return this.run(["rev-parse", "HEAD"]).stdout.trim();
|
|
}
|
|
return branchName;
|
|
}
|
|
hasUncommittedChanges() {
|
|
this.runGraceful(["update-index", "-q", "--refresh"]);
|
|
return this.runGraceful(["diff-index", "--quiet", "HEAD"]).status !== 0;
|
|
}
|
|
checkout(branchOrRevision, cleanState) {
|
|
if (cleanState) {
|
|
this.runGraceful(["am", "--abort"], { stdio: "ignore" });
|
|
this.runGraceful(["cherry-pick", "--abort"], { stdio: "ignore" });
|
|
this.runGraceful(["rebase", "--abort"], { stdio: "ignore" });
|
|
this.runGraceful(["reset", "--hard"], { stdio: "ignore" });
|
|
}
|
|
return this.runGraceful(["checkout", branchOrRevision], { stdio: "ignore" }).status === 0;
|
|
}
|
|
allChangesFilesSince(shaOrRef = "HEAD") {
|
|
return Array.from(/* @__PURE__ */ new Set([
|
|
...gitOutputAsArray(this.runGraceful(["diff", "--name-only", "--diff-filter=d", shaOrRef])),
|
|
...gitOutputAsArray(this.runGraceful(["ls-files", "--others", "--exclude-standard"]))
|
|
]));
|
|
}
|
|
allStagedFiles() {
|
|
return gitOutputAsArray(this.runGraceful(["diff", "--name-only", "--diff-filter=ACM", "--staged"]));
|
|
}
|
|
allFiles() {
|
|
return gitOutputAsArray(this.runGraceful(["ls-files"]));
|
|
}
|
|
sanitizeConsoleOutput(value) {
|
|
return value;
|
|
}
|
|
static async get() {
|
|
if (GitClient._unauthenticatedInstance === null) {
|
|
GitClient._unauthenticatedInstance = (async () => {
|
|
return new GitClient(await getConfig([assertValidGithubConfig]));
|
|
})();
|
|
}
|
|
return GitClient._unauthenticatedInstance;
|
|
}
|
|
};
|
|
GitClient._unauthenticatedInstance = null;
|
|
function gitOutputAsArray(gitCommandResult) {
|
|
return gitCommandResult.stdout.split("\n").map((x) => x.trim()).filter((x) => !!x);
|
|
}
|
|
|
|
//
|
|
var AuthenticatedGitClient = class extends GitClient {
|
|
constructor(githubToken, userType, config, baseDir) {
|
|
super(config, baseDir);
|
|
this.githubToken = githubToken;
|
|
this.userType = userType;
|
|
this._githubTokenRegex = new RegExp(this.githubToken, "g");
|
|
this._cachedOauthScopes = null;
|
|
this._cachedForkRepositories = null;
|
|
this.github = new AuthenticatedGithubClient(this.githubToken);
|
|
}
|
|
sanitizeConsoleOutput(value) {
|
|
return value.replace(this._githubTokenRegex, "<TOKEN>");
|
|
}
|
|
getRepoGitUrl() {
|
|
return getRepositoryGitUrl(this.remoteConfig, this.githubToken);
|
|
}
|
|
async hasOauthScopes(testFn) {
|
|
if (this.userType === "bot") {
|
|
return true;
|
|
}
|
|
const scopes = await this._fetchAuthScopesForToken();
|
|
const missingScopes = [];
|
|
testFn(scopes, missingScopes);
|
|
if (missingScopes.length === 0) {
|
|
return true;
|
|
}
|
|
const error = `The provided <TOKEN> does not have required permissions due to missing scope(s): ${yellow(missingScopes.join(", "))}
|
|
|
|
Update the token in use at:
|
|
${GITHUB_TOKEN_SETTINGS_URL}
|
|
|
|
Alternatively, a new token can be created at: ${GITHUB_TOKEN_GENERATE_URL}
|
|
`;
|
|
return { error };
|
|
}
|
|
async getForkOfAuthenticatedUser() {
|
|
const forks = await this.getAllForksOfAuthenticatedUser();
|
|
if (forks.length === 0) {
|
|
throw Error("Unable to find fork a for currently authenticated user.");
|
|
}
|
|
return forks[0];
|
|
}
|
|
async getAllForksOfAuthenticatedUser() {
|
|
if (this._cachedForkRepositories !== null) {
|
|
return this._cachedForkRepositories;
|
|
}
|
|
const { owner, name } = this.remoteConfig;
|
|
const result = await this.github.graphql(findOwnedForksOfRepoQuery, { owner, name });
|
|
return this._cachedForkRepositories = result.repository.forks.nodes.map((node) => ({
|
|
owner: node.owner.login,
|
|
name: node.name
|
|
}));
|
|
}
|
|
_fetchAuthScopesForToken() {
|
|
if (this._cachedOauthScopes !== null) {
|
|
return this._cachedOauthScopes;
|
|
}
|
|
return this._cachedOauthScopes = this.github.rateLimit.get().then((response) => {
|
|
const scopes = response.headers["x-oauth-scopes"];
|
|
if (scopes === void 0) {
|
|
throw Error("Unable to retrieve OAuth scopes for token provided to Git client.");
|
|
}
|
|
return scopes.split(",").map((scope) => scope.trim()).filter((scope) => scope !== "");
|
|
});
|
|
}
|
|
static async get() {
|
|
if (AuthenticatedGitClient._token === null) {
|
|
throw new Error("No instance of `AuthenticatedGitClient` has been configured.");
|
|
}
|
|
if (AuthenticatedGitClient._authenticatedInstance === null) {
|
|
AuthenticatedGitClient._authenticatedInstance = (async (token, userType) => {
|
|
return new AuthenticatedGitClient(token, userType, await getConfig([assertValidGithubConfig]));
|
|
})(AuthenticatedGitClient._token, AuthenticatedGitClient._userType);
|
|
}
|
|
return AuthenticatedGitClient._authenticatedInstance;
|
|
}
|
|
static configure(token, userType = "user") {
|
|
if (AuthenticatedGitClient._token) {
|
|
throw Error("Unable to configure `AuthenticatedGitClient` as it has been configured already.");
|
|
}
|
|
AuthenticatedGitClient._token = token;
|
|
AuthenticatedGitClient._userType = userType;
|
|
}
|
|
};
|
|
AuthenticatedGitClient._token = null;
|
|
AuthenticatedGitClient._authenticatedInstance = null;
|
|
|
|
//
|
|
async function getDeployments() {
|
|
const { github } = await AuthenticatedGitClient.get();
|
|
const releaseTrains = await ActiveReleaseTrains.fetch({
|
|
api: github,
|
|
name: "angular",
|
|
owner: "angular",
|
|
nextBranchName: "main"
|
|
});
|
|
const ltsBranches = await fetchLongTermSupportBranchesFromNpm({
|
|
representativeNpmPackage: "@angular/core"
|
|
});
|
|
const docSites = /* @__PURE__ */ new Map();
|
|
[...ltsBranches.active, ...ltsBranches.inactive].forEach((branch) => {
|
|
docSites.set(branch.name, {
|
|
branch: branch.name,
|
|
destination: `v${branch.version.major}-angular-dev`
|
|
});
|
|
});
|
|
docSites.set(releaseTrains.latest.branchName, {
|
|
branch: releaseTrains.latest.branchName,
|
|
redirect: {
|
|
from: `v${releaseTrains.latest.version.major}-angular-dev`,
|
|
to: "https://angular.dev"
|
|
},
|
|
destination: "angular-dev-site"
|
|
});
|
|
if (releaseTrains.releaseCandidate) {
|
|
docSites.set(releaseTrains.next.branchName, {
|
|
branch: releaseTrains.next.branchName
|
|
});
|
|
docSites.set(releaseTrains.releaseCandidate.branchName, {
|
|
branch: releaseTrains.releaseCandidate.branchName,
|
|
destination: "next-angular-dev",
|
|
redirect: {
|
|
from: `v${releaseTrains.releaseCandidate.version.major}-angular-dev`,
|
|
to: "https://next.angular.dev"
|
|
}
|
|
});
|
|
} else {
|
|
docSites.set(releaseTrains.next.branchName, {
|
|
branch: releaseTrains.next.branchName,
|
|
destination: "next-angular-dev"
|
|
});
|
|
}
|
|
return docSites;
|
|
}
|
|
|
|
//
|
|
var refMatcher = /refs\/heads\/(.*)/;
|
|
async function deployDocs() {
|
|
setConfig({
|
|
github: {
|
|
mainBranchName: "main",
|
|
name: "angular",
|
|
owner: "angular"
|
|
}
|
|
});
|
|
AuthenticatedGitClient.configure(githubReleaseTrainReadToken);
|
|
if (import_github3.context.eventName !== "push") {
|
|
throw Error();
|
|
}
|
|
const matchedRef = import_github3.context.ref.match(refMatcher);
|
|
if (matchedRef === null) {
|
|
throw Error();
|
|
}
|
|
const currentBranch = matchedRef[1];
|
|
const configPath = (0, import_core2.getInput)("configPath");
|
|
const distDir = (0, import_core2.getInput)("distDir");
|
|
const deployment = (await getDeployments()).get(currentBranch);
|
|
if (deployment === void 0) {
|
|
console.log(`Current branch (${currentBranch}) does not deploy a documentation site.`);
|
|
console.log(`Exiting...`);
|
|
process.exit(0);
|
|
}
|
|
console.log("Doc site deployment information");
|
|
console.log("");
|
|
console.log("Current Branch:");
|
|
console.log(` ${deployment.branch}`);
|
|
console.log("");
|
|
console.log("Firebase Site:");
|
|
if (deployment.destination === void 0) {
|
|
console.log(" No deployment of a documenation site is necessary");
|
|
} else {
|
|
console.log(` Deploying to: ${deployment.destination}`);
|
|
}
|
|
console.log("");
|
|
console.log("Redirect Configuration:");
|
|
if (deployment.redirect === void 0) {
|
|
console.log(" No redirects are necessary");
|
|
} else {
|
|
console.log(` From: ${deployment.redirect.from}`);
|
|
console.log(` To: ${deployment.redirect.to}`);
|
|
}
|
|
await deployToFirebase(deployment, configPath, distDir);
|
|
await setupRedirect(deployment);
|
|
}
|
|
if (import_github3.context.repo.owner === "angular") {
|
|
deployDocs().catch((e) => {
|
|
(0, import_core2.setFailed)(e.message);
|
|
console.error(e);
|
|
});
|
|
} else {
|
|
console.warn("The action was skipped as this action is only meant to run in repos belonging to the Angular organization.");
|
|
}
|
|
/*!
|
|
* Tmp
|
|
*
|
|
* Copyright (c) 2011-2017 KARASZI Istvan <[email protected]>
|
|
*
|
|
* MIT Licensed
|
|
*/
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|