7447 lines
270 KiB
JavaScript
7447 lines
270 KiB
JavaScript
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
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(
|
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
// file that has been converted to a CommonJS file using a Babel-
|
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
mod
|
|
));
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
// node_modules/kind-of/index.js
|
|
var require_kind_of = __commonJS({
|
|
"node_modules/kind-of/index.js"(exports2, module2) {
|
|
var toString = Object.prototype.toString;
|
|
module2.exports = function kindOf(val) {
|
|
if (val === void 0) return "undefined";
|
|
if (val === null) return "null";
|
|
var type = typeof val;
|
|
if (type === "boolean") return "boolean";
|
|
if (type === "string") return "string";
|
|
if (type === "number") return "number";
|
|
if (type === "symbol") return "symbol";
|
|
if (type === "function") {
|
|
return isGeneratorFn(val) ? "generatorfunction" : "function";
|
|
}
|
|
if (isArray(val)) return "array";
|
|
if (isBuffer(val)) return "buffer";
|
|
if (isArguments(val)) return "arguments";
|
|
if (isDate(val)) return "date";
|
|
if (isError(val)) return "error";
|
|
if (isRegexp(val)) return "regexp";
|
|
switch (ctorName(val)) {
|
|
case "Symbol":
|
|
return "symbol";
|
|
case "Promise":
|
|
return "promise";
|
|
// Set, Map, WeakSet, WeakMap
|
|
case "WeakMap":
|
|
return "weakmap";
|
|
case "WeakSet":
|
|
return "weakset";
|
|
case "Map":
|
|
return "map";
|
|
case "Set":
|
|
return "set";
|
|
// 8-bit typed arrays
|
|
case "Int8Array":
|
|
return "int8array";
|
|
case "Uint8Array":
|
|
return "uint8array";
|
|
case "Uint8ClampedArray":
|
|
return "uint8clampedarray";
|
|
// 16-bit typed arrays
|
|
case "Int16Array":
|
|
return "int16array";
|
|
case "Uint16Array":
|
|
return "uint16array";
|
|
// 32-bit typed arrays
|
|
case "Int32Array":
|
|
return "int32array";
|
|
case "Uint32Array":
|
|
return "uint32array";
|
|
case "Float32Array":
|
|
return "float32array";
|
|
case "Float64Array":
|
|
return "float64array";
|
|
}
|
|
if (isGeneratorObj(val)) {
|
|
return "generator";
|
|
}
|
|
type = toString.call(val);
|
|
switch (type) {
|
|
case "[object Object]":
|
|
return "object";
|
|
// iterators
|
|
case "[object Map Iterator]":
|
|
return "mapiterator";
|
|
case "[object Set Iterator]":
|
|
return "setiterator";
|
|
case "[object String Iterator]":
|
|
return "stringiterator";
|
|
case "[object Array Iterator]":
|
|
return "arrayiterator";
|
|
}
|
|
return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
};
|
|
function ctorName(val) {
|
|
return typeof val.constructor === "function" ? val.constructor.name : null;
|
|
}
|
|
function isArray(val) {
|
|
if (Array.isArray) return Array.isArray(val);
|
|
return val instanceof Array;
|
|
}
|
|
function isError(val) {
|
|
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
|
|
}
|
|
function isDate(val) {
|
|
if (val instanceof Date) return true;
|
|
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
|
|
}
|
|
function isRegexp(val) {
|
|
if (val instanceof RegExp) return true;
|
|
return typeof val.flags === "string" && typeof val.ignoreCase === "boolean" && typeof val.multiline === "boolean" && typeof val.global === "boolean";
|
|
}
|
|
function isGeneratorFn(name, val) {
|
|
return ctorName(name) === "GeneratorFunction";
|
|
}
|
|
function isGeneratorObj(val) {
|
|
return typeof val.throw === "function" && typeof val.return === "function" && typeof val.next === "function";
|
|
}
|
|
function isArguments(val) {
|
|
try {
|
|
if (typeof val.length === "number" && typeof val.callee === "function") {
|
|
return true;
|
|
}
|
|
} catch (err) {
|
|
if (err.message.indexOf("callee") !== -1) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function isBuffer(val) {
|
|
if (val.constructor && typeof val.constructor.isBuffer === "function") {
|
|
return val.constructor.isBuffer(val);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/is-extendable/index.js
|
|
var require_is_extendable = __commonJS({
|
|
"node_modules/is-extendable/index.js"(exports2, module2) {
|
|
"use strict";
|
|
module2.exports = function isExtendable(val) {
|
|
return typeof val !== "undefined" && val !== null && (typeof val === "object" || typeof val === "function");
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/extend-shallow/index.js
|
|
var require_extend_shallow = __commonJS({
|
|
"node_modules/extend-shallow/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var isObject = require_is_extendable();
|
|
module2.exports = function extend(o) {
|
|
if (!isObject(o)) {
|
|
o = {};
|
|
}
|
|
var len = arguments.length;
|
|
for (var i = 1; i < len; i++) {
|
|
var obj = arguments[i];
|
|
if (isObject(obj)) {
|
|
assign(o, obj);
|
|
}
|
|
}
|
|
return o;
|
|
};
|
|
function assign(a, b) {
|
|
for (var key in b) {
|
|
if (hasOwn(b, key)) {
|
|
a[key] = b[key];
|
|
}
|
|
}
|
|
}
|
|
function hasOwn(obj, key) {
|
|
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/section-matter/index.js
|
|
var require_section_matter = __commonJS({
|
|
"node_modules/section-matter/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var typeOf = require_kind_of();
|
|
var extend = require_extend_shallow();
|
|
module2.exports = function(input, options2) {
|
|
if (typeof options2 === "function") {
|
|
options2 = { parse: options2 };
|
|
}
|
|
var file = toObject(input);
|
|
var defaults = { section_delimiter: "---", parse: identity };
|
|
var opts = extend({}, defaults, options2);
|
|
var delim = opts.section_delimiter;
|
|
var lines = file.content.split(/\r?\n/);
|
|
var sections = null;
|
|
var section = createSection();
|
|
var content = [];
|
|
var stack = [];
|
|
function initSections(val) {
|
|
file.content = val;
|
|
sections = [];
|
|
content = [];
|
|
}
|
|
function closeSection(val) {
|
|
if (stack.length) {
|
|
section.key = getKey(stack[0], delim);
|
|
section.content = val;
|
|
opts.parse(section, sections);
|
|
sections.push(section);
|
|
section = createSection();
|
|
content = [];
|
|
stack = [];
|
|
}
|
|
}
|
|
for (var i = 0; i < lines.length; i++) {
|
|
var line = lines[i];
|
|
var len = stack.length;
|
|
var ln = line.trim();
|
|
if (isDelimiter(ln, delim)) {
|
|
if (ln.length === 3 && i !== 0) {
|
|
if (len === 0 || len === 2) {
|
|
content.push(line);
|
|
continue;
|
|
}
|
|
stack.push(ln);
|
|
section.data = content.join("\n");
|
|
content = [];
|
|
continue;
|
|
}
|
|
if (sections === null) {
|
|
initSections(content.join("\n"));
|
|
}
|
|
if (len === 2) {
|
|
closeSection(content.join("\n"));
|
|
}
|
|
stack.push(ln);
|
|
continue;
|
|
}
|
|
content.push(line);
|
|
}
|
|
if (sections === null) {
|
|
initSections(content.join("\n"));
|
|
} else {
|
|
closeSection(content.join("\n"));
|
|
}
|
|
file.sections = sections;
|
|
return file;
|
|
};
|
|
function isDelimiter(line, delim) {
|
|
if (line.slice(0, delim.length) !== delim) {
|
|
return false;
|
|
}
|
|
if (line.charAt(delim.length + 1) === delim.slice(-1)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function toObject(input) {
|
|
if (typeOf(input) !== "object") {
|
|
input = { content: input };
|
|
}
|
|
if (typeof input.content !== "string" && !isBuffer(input.content)) {
|
|
throw new TypeError("expected a buffer or string");
|
|
}
|
|
input.content = input.content.toString();
|
|
input.sections = [];
|
|
return input;
|
|
}
|
|
function getKey(val, delim) {
|
|
return val ? val.slice(delim.length).trim() : "";
|
|
}
|
|
function createSection() {
|
|
return { key: "", data: "", content: "" };
|
|
}
|
|
function identity(val) {
|
|
return val;
|
|
}
|
|
function isBuffer(val) {
|
|
if (val && val.constructor && typeof val.constructor.isBuffer === "function") {
|
|
return val.constructor.isBuffer(val);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/common.js
|
|
var require_common = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/common.js"(exports2, module2) {
|
|
"use strict";
|
|
function isNothing(subject) {
|
|
return typeof subject === "undefined" || subject === null;
|
|
}
|
|
function isObject(subject) {
|
|
return typeof subject === "object" && subject !== null;
|
|
}
|
|
function toArray(sequence) {
|
|
if (Array.isArray(sequence)) return sequence;
|
|
else if (isNothing(sequence)) return [];
|
|
return [sequence];
|
|
}
|
|
function extend(target, source) {
|
|
var index, length, key, sourceKeys;
|
|
if (source) {
|
|
sourceKeys = Object.keys(source);
|
|
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
key = sourceKeys[index];
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
function repeat(string, count) {
|
|
var result = "", cycle;
|
|
for (cycle = 0; cycle < count; cycle += 1) {
|
|
result += string;
|
|
}
|
|
return result;
|
|
}
|
|
function isNegativeZero(number) {
|
|
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
|
|
}
|
|
module2.exports.isNothing = isNothing;
|
|
module2.exports.isObject = isObject;
|
|
module2.exports.toArray = toArray;
|
|
module2.exports.repeat = repeat;
|
|
module2.exports.isNegativeZero = isNegativeZero;
|
|
module2.exports.extend = extend;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/exception.js
|
|
var require_exception = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/exception.js"(exports2, module2) {
|
|
"use strict";
|
|
function YAMLException(reason, mark) {
|
|
Error.call(this);
|
|
this.name = "YAMLException";
|
|
this.reason = reason;
|
|
this.mark = mark;
|
|
this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : "");
|
|
if (Error.captureStackTrace) {
|
|
Error.captureStackTrace(this, this.constructor);
|
|
} else {
|
|
this.stack = new Error().stack || "";
|
|
}
|
|
}
|
|
YAMLException.prototype = Object.create(Error.prototype);
|
|
YAMLException.prototype.constructor = YAMLException;
|
|
YAMLException.prototype.toString = function toString(compact) {
|
|
var result = this.name + ": ";
|
|
result += this.reason || "(unknown reason)";
|
|
if (!compact && this.mark) {
|
|
result += " " + this.mark.toString();
|
|
}
|
|
return result;
|
|
};
|
|
module2.exports = YAMLException;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/mark.js
|
|
var require_mark = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/mark.js"(exports2, module2) {
|
|
"use strict";
|
|
var common = require_common();
|
|
function Mark(name, buffer, position, line, column) {
|
|
this.name = name;
|
|
this.buffer = buffer;
|
|
this.position = position;
|
|
this.line = line;
|
|
this.column = column;
|
|
}
|
|
Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
|
|
var head, start, tail, end, snippet;
|
|
if (!this.buffer) return null;
|
|
indent = indent || 4;
|
|
maxLength = maxLength || 75;
|
|
head = "";
|
|
start = this.position;
|
|
while (start > 0 && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) {
|
|
start -= 1;
|
|
if (this.position - start > maxLength / 2 - 1) {
|
|
head = " ... ";
|
|
start += 5;
|
|
break;
|
|
}
|
|
}
|
|
tail = "";
|
|
end = this.position;
|
|
while (end < this.buffer.length && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) {
|
|
end += 1;
|
|
if (end - this.position > maxLength / 2 - 1) {
|
|
tail = " ... ";
|
|
end -= 5;
|
|
break;
|
|
}
|
|
}
|
|
snippet = this.buffer.slice(start, end);
|
|
return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^";
|
|
};
|
|
Mark.prototype.toString = function toString(compact) {
|
|
var snippet, where = "";
|
|
if (this.name) {
|
|
where += 'in "' + this.name + '" ';
|
|
}
|
|
where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
|
|
if (!compact) {
|
|
snippet = this.getSnippet();
|
|
if (snippet) {
|
|
where += ":\n" + snippet;
|
|
}
|
|
}
|
|
return where;
|
|
};
|
|
module2.exports = Mark;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type.js
|
|
var require_type = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type.js"(exports2, module2) {
|
|
"use strict";
|
|
var YAMLException = require_exception();
|
|
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
"kind",
|
|
"resolve",
|
|
"construct",
|
|
"instanceOf",
|
|
"predicate",
|
|
"represent",
|
|
"defaultStyle",
|
|
"styleAliases"
|
|
];
|
|
var YAML_NODE_KINDS = [
|
|
"scalar",
|
|
"sequence",
|
|
"mapping"
|
|
];
|
|
function compileStyleAliases(map) {
|
|
var result = {};
|
|
if (map !== null) {
|
|
Object.keys(map).forEach(function(style) {
|
|
map[style].forEach(function(alias) {
|
|
result[String(alias)] = style;
|
|
});
|
|
});
|
|
}
|
|
return result;
|
|
}
|
|
function Type(tag, options2) {
|
|
options2 = options2 || {};
|
|
Object.keys(options2).forEach(function(name) {
|
|
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
}
|
|
});
|
|
this.tag = tag;
|
|
this.kind = options2["kind"] || null;
|
|
this.resolve = options2["resolve"] || function() {
|
|
return true;
|
|
};
|
|
this.construct = options2["construct"] || function(data) {
|
|
return data;
|
|
};
|
|
this.instanceOf = options2["instanceOf"] || null;
|
|
this.predicate = options2["predicate"] || null;
|
|
this.represent = options2["represent"] || null;
|
|
this.defaultStyle = options2["defaultStyle"] || null;
|
|
this.styleAliases = compileStyleAliases(options2["styleAliases"] || null);
|
|
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
}
|
|
}
|
|
module2.exports = Type;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema.js
|
|
var require_schema = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema.js"(exports2, module2) {
|
|
"use strict";
|
|
var common = require_common();
|
|
var YAMLException = require_exception();
|
|
var Type = require_type();
|
|
function compileList(schema, name, result) {
|
|
var exclude = [];
|
|
schema.include.forEach(function(includedSchema) {
|
|
result = compileList(includedSchema, name, result);
|
|
});
|
|
schema[name].forEach(function(currentType) {
|
|
result.forEach(function(previousType, previousIndex) {
|
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
|
exclude.push(previousIndex);
|
|
}
|
|
});
|
|
result.push(currentType);
|
|
});
|
|
return result.filter(function(type, index) {
|
|
return exclude.indexOf(index) === -1;
|
|
});
|
|
}
|
|
function compileMap() {
|
|
var result = {
|
|
scalar: {},
|
|
sequence: {},
|
|
mapping: {},
|
|
fallback: {}
|
|
}, index, length;
|
|
function collectType(type) {
|
|
result[type.kind][type.tag] = result["fallback"][type.tag] = type;
|
|
}
|
|
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
arguments[index].forEach(collectType);
|
|
}
|
|
return result;
|
|
}
|
|
function Schema(definition) {
|
|
this.include = definition.include || [];
|
|
this.implicit = definition.implicit || [];
|
|
this.explicit = definition.explicit || [];
|
|
this.implicit.forEach(function(type) {
|
|
if (type.loadKind && type.loadKind !== "scalar") {
|
|
throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
}
|
|
});
|
|
this.compiledImplicit = compileList(this, "implicit", []);
|
|
this.compiledExplicit = compileList(this, "explicit", []);
|
|
this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
|
|
}
|
|
Schema.DEFAULT = null;
|
|
Schema.create = function createSchema() {
|
|
var schemas, types;
|
|
switch (arguments.length) {
|
|
case 1:
|
|
schemas = Schema.DEFAULT;
|
|
types = arguments[0];
|
|
break;
|
|
case 2:
|
|
schemas = arguments[0];
|
|
types = arguments[1];
|
|
break;
|
|
default:
|
|
throw new YAMLException("Wrong number of arguments for Schema.create function");
|
|
}
|
|
schemas = common.toArray(schemas);
|
|
types = common.toArray(types);
|
|
if (!schemas.every(function(schema) {
|
|
return schema instanceof Schema;
|
|
})) {
|
|
throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
|
|
}
|
|
if (!types.every(function(type) {
|
|
return type instanceof Type;
|
|
})) {
|
|
throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
}
|
|
return new Schema({
|
|
include: schemas,
|
|
explicit: types
|
|
});
|
|
};
|
|
module2.exports = Schema;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/str.js
|
|
var require_str = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/str.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
module2.exports = new Type("tag:yaml.org,2002:str", {
|
|
kind: "scalar",
|
|
construct: function(data) {
|
|
return data !== null ? data : "";
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/seq.js
|
|
var require_seq = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/seq.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
module2.exports = new Type("tag:yaml.org,2002:seq", {
|
|
kind: "sequence",
|
|
construct: function(data) {
|
|
return data !== null ? data : [];
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/map.js
|
|
var require_map = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/map.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
module2.exports = new Type("tag:yaml.org,2002:map", {
|
|
kind: "mapping",
|
|
construct: function(data) {
|
|
return data !== null ? data : {};
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
|
|
var require_failsafe = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js"(exports2, module2) {
|
|
"use strict";
|
|
var Schema = require_schema();
|
|
module2.exports = new Schema({
|
|
explicit: [
|
|
require_str(),
|
|
require_seq(),
|
|
require_map()
|
|
]
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/null.js
|
|
var require_null = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/null.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
function resolveYamlNull(data) {
|
|
if (data === null) return true;
|
|
var max = data.length;
|
|
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
}
|
|
function constructYamlNull() {
|
|
return null;
|
|
}
|
|
function isNull(object) {
|
|
return object === null;
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:null", {
|
|
kind: "scalar",
|
|
resolve: resolveYamlNull,
|
|
construct: constructYamlNull,
|
|
predicate: isNull,
|
|
represent: {
|
|
canonical: function() {
|
|
return "~";
|
|
},
|
|
lowercase: function() {
|
|
return "null";
|
|
},
|
|
uppercase: function() {
|
|
return "NULL";
|
|
},
|
|
camelcase: function() {
|
|
return "Null";
|
|
}
|
|
},
|
|
defaultStyle: "lowercase"
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/bool.js
|
|
var require_bool = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/bool.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
function resolveYamlBoolean(data) {
|
|
if (data === null) return false;
|
|
var max = data.length;
|
|
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
}
|
|
function constructYamlBoolean(data) {
|
|
return data === "true" || data === "True" || data === "TRUE";
|
|
}
|
|
function isBoolean(object) {
|
|
return Object.prototype.toString.call(object) === "[object Boolean]";
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:bool", {
|
|
kind: "scalar",
|
|
resolve: resolveYamlBoolean,
|
|
construct: constructYamlBoolean,
|
|
predicate: isBoolean,
|
|
represent: {
|
|
lowercase: function(object) {
|
|
return object ? "true" : "false";
|
|
},
|
|
uppercase: function(object) {
|
|
return object ? "TRUE" : "FALSE";
|
|
},
|
|
camelcase: function(object) {
|
|
return object ? "True" : "False";
|
|
}
|
|
},
|
|
defaultStyle: "lowercase"
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/int.js
|
|
var require_int = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/int.js"(exports2, module2) {
|
|
"use strict";
|
|
var common = require_common();
|
|
var Type = require_type();
|
|
function isHexCode(c) {
|
|
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
}
|
|
function isOctCode(c) {
|
|
return 48 <= c && c <= 55;
|
|
}
|
|
function isDecCode(c) {
|
|
return 48 <= c && c <= 57;
|
|
}
|
|
function resolveYamlInteger(data) {
|
|
if (data === null) return false;
|
|
var max = data.length, index = 0, hasDigits = false, ch;
|
|
if (!max) return false;
|
|
ch = data[index];
|
|
if (ch === "-" || ch === "+") {
|
|
ch = data[++index];
|
|
}
|
|
if (ch === "0") {
|
|
if (index + 1 === max) return true;
|
|
ch = data[++index];
|
|
if (ch === "b") {
|
|
index++;
|
|
for (; index < max; index++) {
|
|
ch = data[index];
|
|
if (ch === "_") continue;
|
|
if (ch !== "0" && ch !== "1") return false;
|
|
hasDigits = true;
|
|
}
|
|
return hasDigits && ch !== "_";
|
|
}
|
|
if (ch === "x") {
|
|
index++;
|
|
for (; index < max; index++) {
|
|
ch = data[index];
|
|
if (ch === "_") continue;
|
|
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
hasDigits = true;
|
|
}
|
|
return hasDigits && ch !== "_";
|
|
}
|
|
for (; index < max; index++) {
|
|
ch = data[index];
|
|
if (ch === "_") continue;
|
|
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
hasDigits = true;
|
|
}
|
|
return hasDigits && ch !== "_";
|
|
}
|
|
if (ch === "_") return false;
|
|
for (; index < max; index++) {
|
|
ch = data[index];
|
|
if (ch === "_") continue;
|
|
if (ch === ":") break;
|
|
if (!isDecCode(data.charCodeAt(index))) {
|
|
return false;
|
|
}
|
|
hasDigits = true;
|
|
}
|
|
if (!hasDigits || ch === "_") return false;
|
|
if (ch !== ":") return true;
|
|
return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
|
|
}
|
|
function constructYamlInteger(data) {
|
|
var value = data, sign = 1, ch, base, digits = [];
|
|
if (value.indexOf("_") !== -1) {
|
|
value = value.replace(/_/g, "");
|
|
}
|
|
ch = value[0];
|
|
if (ch === "-" || ch === "+") {
|
|
if (ch === "-") sign = -1;
|
|
value = value.slice(1);
|
|
ch = value[0];
|
|
}
|
|
if (value === "0") return 0;
|
|
if (ch === "0") {
|
|
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
|
|
if (value[1] === "x") return sign * parseInt(value, 16);
|
|
return sign * parseInt(value, 8);
|
|
}
|
|
if (value.indexOf(":") !== -1) {
|
|
value.split(":").forEach(function(v) {
|
|
digits.unshift(parseInt(v, 10));
|
|
});
|
|
value = 0;
|
|
base = 1;
|
|
digits.forEach(function(d) {
|
|
value += d * base;
|
|
base *= 60;
|
|
});
|
|
return sign * value;
|
|
}
|
|
return sign * parseInt(value, 10);
|
|
}
|
|
function isInteger(object) {
|
|
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:int", {
|
|
kind: "scalar",
|
|
resolve: resolveYamlInteger,
|
|
construct: constructYamlInteger,
|
|
predicate: isInteger,
|
|
represent: {
|
|
binary: function(obj) {
|
|
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
},
|
|
octal: function(obj) {
|
|
return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1);
|
|
},
|
|
decimal: function(obj) {
|
|
return obj.toString(10);
|
|
},
|
|
/* eslint-disable max-len */
|
|
hexadecimal: function(obj) {
|
|
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
}
|
|
},
|
|
defaultStyle: "decimal",
|
|
styleAliases: {
|
|
binary: [2, "bin"],
|
|
octal: [8, "oct"],
|
|
decimal: [10, "dec"],
|
|
hexadecimal: [16, "hex"]
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/float.js
|
|
var require_float = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/float.js"(exports2, module2) {
|
|
"use strict";
|
|
var common = require_common();
|
|
var Type = require_type();
|
|
var YAML_FLOAT_PATTERN = new RegExp(
|
|
// 2.5e4, 2.5 and integers
|
|
"^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
);
|
|
function resolveYamlFloat(data) {
|
|
if (data === null) return false;
|
|
if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
|
|
// Probably should update regexp & check speed
|
|
data[data.length - 1] === "_") {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function constructYamlFloat(data) {
|
|
var value, sign, base, digits;
|
|
value = data.replace(/_/g, "").toLowerCase();
|
|
sign = value[0] === "-" ? -1 : 1;
|
|
digits = [];
|
|
if ("+-".indexOf(value[0]) >= 0) {
|
|
value = value.slice(1);
|
|
}
|
|
if (value === ".inf") {
|
|
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
} else if (value === ".nan") {
|
|
return NaN;
|
|
} else if (value.indexOf(":") >= 0) {
|
|
value.split(":").forEach(function(v) {
|
|
digits.unshift(parseFloat(v, 10));
|
|
});
|
|
value = 0;
|
|
base = 1;
|
|
digits.forEach(function(d) {
|
|
value += d * base;
|
|
base *= 60;
|
|
});
|
|
return sign * value;
|
|
}
|
|
return sign * parseFloat(value, 10);
|
|
}
|
|
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
function representYamlFloat(object, style) {
|
|
var res;
|
|
if (isNaN(object)) {
|
|
switch (style) {
|
|
case "lowercase":
|
|
return ".nan";
|
|
case "uppercase":
|
|
return ".NAN";
|
|
case "camelcase":
|
|
return ".NaN";
|
|
}
|
|
} else if (Number.POSITIVE_INFINITY === object) {
|
|
switch (style) {
|
|
case "lowercase":
|
|
return ".inf";
|
|
case "uppercase":
|
|
return ".INF";
|
|
case "camelcase":
|
|
return ".Inf";
|
|
}
|
|
} else if (Number.NEGATIVE_INFINITY === object) {
|
|
switch (style) {
|
|
case "lowercase":
|
|
return "-.inf";
|
|
case "uppercase":
|
|
return "-.INF";
|
|
case "camelcase":
|
|
return "-.Inf";
|
|
}
|
|
} else if (common.isNegativeZero(object)) {
|
|
return "-0.0";
|
|
}
|
|
res = object.toString(10);
|
|
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
}
|
|
function isFloat(object) {
|
|
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:float", {
|
|
kind: "scalar",
|
|
resolve: resolveYamlFloat,
|
|
construct: constructYamlFloat,
|
|
predicate: isFloat,
|
|
represent: representYamlFloat,
|
|
defaultStyle: "lowercase"
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/json.js
|
|
var require_json = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/json.js"(exports2, module2) {
|
|
"use strict";
|
|
var Schema = require_schema();
|
|
module2.exports = new Schema({
|
|
include: [
|
|
require_failsafe()
|
|
],
|
|
implicit: [
|
|
require_null(),
|
|
require_bool(),
|
|
require_int(),
|
|
require_float()
|
|
]
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/core.js
|
|
var require_core = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/core.js"(exports2, module2) {
|
|
"use strict";
|
|
var Schema = require_schema();
|
|
module2.exports = new Schema({
|
|
include: [
|
|
require_json()
|
|
]
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/timestamp.js
|
|
var require_timestamp = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/timestamp.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
var YAML_DATE_REGEXP = new RegExp(
|
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
);
|
|
var YAML_TIMESTAMP_REGEXP = new RegExp(
|
|
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
);
|
|
function resolveYamlTimestamp(data) {
|
|
if (data === null) return false;
|
|
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
|
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
|
return false;
|
|
}
|
|
function constructYamlTimestamp(data) {
|
|
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
match = YAML_DATE_REGEXP.exec(data);
|
|
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
if (match === null) throw new Error("Date resolve error");
|
|
year = +match[1];
|
|
month = +match[2] - 1;
|
|
day = +match[3];
|
|
if (!match[4]) {
|
|
return new Date(Date.UTC(year, month, day));
|
|
}
|
|
hour = +match[4];
|
|
minute = +match[5];
|
|
second = +match[6];
|
|
if (match[7]) {
|
|
fraction = match[7].slice(0, 3);
|
|
while (fraction.length < 3) {
|
|
fraction += "0";
|
|
}
|
|
fraction = +fraction;
|
|
}
|
|
if (match[9]) {
|
|
tz_hour = +match[10];
|
|
tz_minute = +(match[11] || 0);
|
|
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
if (match[9] === "-") delta = -delta;
|
|
}
|
|
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
if (delta) date.setTime(date.getTime() - delta);
|
|
return date;
|
|
}
|
|
function representYamlTimestamp(object) {
|
|
return object.toISOString();
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:timestamp", {
|
|
kind: "scalar",
|
|
resolve: resolveYamlTimestamp,
|
|
construct: constructYamlTimestamp,
|
|
instanceOf: Date,
|
|
represent: representYamlTimestamp
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/merge.js
|
|
var require_merge = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/merge.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
function resolveYamlMerge(data) {
|
|
return data === "<<" || data === null;
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:merge", {
|
|
kind: "scalar",
|
|
resolve: resolveYamlMerge
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/binary.js
|
|
var require_binary = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/binary.js"(exports2, module2) {
|
|
"use strict";
|
|
var NodeBuffer;
|
|
try {
|
|
_require = require;
|
|
NodeBuffer = _require("buffer").Buffer;
|
|
} catch (__) {
|
|
}
|
|
var _require;
|
|
var Type = require_type();
|
|
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
function resolveYamlBinary(data) {
|
|
if (data === null) return false;
|
|
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
|
|
for (idx = 0; idx < max; idx++) {
|
|
code = map.indexOf(data.charAt(idx));
|
|
if (code > 64) continue;
|
|
if (code < 0) return false;
|
|
bitlen += 6;
|
|
}
|
|
return bitlen % 8 === 0;
|
|
}
|
|
function constructYamlBinary(data) {
|
|
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
|
|
for (idx = 0; idx < max; idx++) {
|
|
if (idx % 4 === 0 && idx) {
|
|
result.push(bits >> 16 & 255);
|
|
result.push(bits >> 8 & 255);
|
|
result.push(bits & 255);
|
|
}
|
|
bits = bits << 6 | map.indexOf(input.charAt(idx));
|
|
}
|
|
tailbits = max % 4 * 6;
|
|
if (tailbits === 0) {
|
|
result.push(bits >> 16 & 255);
|
|
result.push(bits >> 8 & 255);
|
|
result.push(bits & 255);
|
|
} else if (tailbits === 18) {
|
|
result.push(bits >> 10 & 255);
|
|
result.push(bits >> 2 & 255);
|
|
} else if (tailbits === 12) {
|
|
result.push(bits >> 4 & 255);
|
|
}
|
|
if (NodeBuffer) {
|
|
return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
|
|
}
|
|
return result;
|
|
}
|
|
function representYamlBinary(object) {
|
|
var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
|
|
for (idx = 0; idx < max; idx++) {
|
|
if (idx % 3 === 0 && idx) {
|
|
result += map[bits >> 18 & 63];
|
|
result += map[bits >> 12 & 63];
|
|
result += map[bits >> 6 & 63];
|
|
result += map[bits & 63];
|
|
}
|
|
bits = (bits << 8) + object[idx];
|
|
}
|
|
tail = max % 3;
|
|
if (tail === 0) {
|
|
result += map[bits >> 18 & 63];
|
|
result += map[bits >> 12 & 63];
|
|
result += map[bits >> 6 & 63];
|
|
result += map[bits & 63];
|
|
} else if (tail === 2) {
|
|
result += map[bits >> 10 & 63];
|
|
result += map[bits >> 4 & 63];
|
|
result += map[bits << 2 & 63];
|
|
result += map[64];
|
|
} else if (tail === 1) {
|
|
result += map[bits >> 2 & 63];
|
|
result += map[bits << 4 & 63];
|
|
result += map[64];
|
|
result += map[64];
|
|
}
|
|
return result;
|
|
}
|
|
function isBinary(object) {
|
|
return NodeBuffer && NodeBuffer.isBuffer(object);
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:binary", {
|
|
kind: "scalar",
|
|
resolve: resolveYamlBinary,
|
|
construct: constructYamlBinary,
|
|
predicate: isBinary,
|
|
represent: representYamlBinary
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/omap.js
|
|
var require_omap = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/omap.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var _toString = Object.prototype.toString;
|
|
function resolveYamlOmap(data) {
|
|
if (data === null) return true;
|
|
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
pair = object[index];
|
|
pairHasKey = false;
|
|
if (_toString.call(pair) !== "[object Object]") return false;
|
|
for (pairKey in pair) {
|
|
if (_hasOwnProperty.call(pair, pairKey)) {
|
|
if (!pairHasKey) pairHasKey = true;
|
|
else return false;
|
|
}
|
|
}
|
|
if (!pairHasKey) return false;
|
|
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
|
else return false;
|
|
}
|
|
return true;
|
|
}
|
|
function constructYamlOmap(data) {
|
|
return data !== null ? data : [];
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:omap", {
|
|
kind: "sequence",
|
|
resolve: resolveYamlOmap,
|
|
construct: constructYamlOmap
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/pairs.js
|
|
var require_pairs = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/pairs.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
var _toString = Object.prototype.toString;
|
|
function resolveYamlPairs(data) {
|
|
if (data === null) return true;
|
|
var index, length, pair, keys, result, object = data;
|
|
result = new Array(object.length);
|
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
pair = object[index];
|
|
if (_toString.call(pair) !== "[object Object]") return false;
|
|
keys = Object.keys(pair);
|
|
if (keys.length !== 1) return false;
|
|
result[index] = [keys[0], pair[keys[0]]];
|
|
}
|
|
return true;
|
|
}
|
|
function constructYamlPairs(data) {
|
|
if (data === null) return [];
|
|
var index, length, pair, keys, result, object = data;
|
|
result = new Array(object.length);
|
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
pair = object[index];
|
|
keys = Object.keys(pair);
|
|
result[index] = [keys[0], pair[keys[0]]];
|
|
}
|
|
return result;
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:pairs", {
|
|
kind: "sequence",
|
|
resolve: resolveYamlPairs,
|
|
construct: constructYamlPairs
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/set.js
|
|
var require_set = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/set.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
function resolveYamlSet(data) {
|
|
if (data === null) return true;
|
|
var key, object = data;
|
|
for (key in object) {
|
|
if (_hasOwnProperty.call(object, key)) {
|
|
if (object[key] !== null) return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function constructYamlSet(data) {
|
|
return data !== null ? data : {};
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:set", {
|
|
kind: "mapping",
|
|
resolve: resolveYamlSet,
|
|
construct: constructYamlSet
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
|
|
var require_default_safe = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js"(exports2, module2) {
|
|
"use strict";
|
|
var Schema = require_schema();
|
|
module2.exports = new Schema({
|
|
include: [
|
|
require_core()
|
|
],
|
|
implicit: [
|
|
require_timestamp(),
|
|
require_merge()
|
|
],
|
|
explicit: [
|
|
require_binary(),
|
|
require_omap(),
|
|
require_pairs(),
|
|
require_set()
|
|
]
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
|
|
var require_undefined = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
function resolveJavascriptUndefined() {
|
|
return true;
|
|
}
|
|
function constructJavascriptUndefined() {
|
|
return void 0;
|
|
}
|
|
function representJavascriptUndefined() {
|
|
return "";
|
|
}
|
|
function isUndefined(object) {
|
|
return typeof object === "undefined";
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:js/undefined", {
|
|
kind: "scalar",
|
|
resolve: resolveJavascriptUndefined,
|
|
construct: constructJavascriptUndefined,
|
|
predicate: isUndefined,
|
|
represent: representJavascriptUndefined
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
|
|
var require_regexp = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js"(exports2, module2) {
|
|
"use strict";
|
|
var Type = require_type();
|
|
function resolveJavascriptRegExp(data) {
|
|
if (data === null) return false;
|
|
if (data.length === 0) return false;
|
|
var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
|
|
if (regexp[0] === "/") {
|
|
if (tail) modifiers = tail[1];
|
|
if (modifiers.length > 3) return false;
|
|
if (regexp[regexp.length - modifiers.length - 1] !== "/") return false;
|
|
}
|
|
return true;
|
|
}
|
|
function constructJavascriptRegExp(data) {
|
|
var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
|
|
if (regexp[0] === "/") {
|
|
if (tail) modifiers = tail[1];
|
|
regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
|
|
}
|
|
return new RegExp(regexp, modifiers);
|
|
}
|
|
function representJavascriptRegExp(object) {
|
|
var result = "/" + object.source + "/";
|
|
if (object.global) result += "g";
|
|
if (object.multiline) result += "m";
|
|
if (object.ignoreCase) result += "i";
|
|
return result;
|
|
}
|
|
function isRegExp(object) {
|
|
return Object.prototype.toString.call(object) === "[object RegExp]";
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:js/regexp", {
|
|
kind: "scalar",
|
|
resolve: resolveJavascriptRegExp,
|
|
construct: constructJavascriptRegExp,
|
|
predicate: isRegExp,
|
|
represent: representJavascriptRegExp
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/function.js
|
|
var require_function = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/type/js/function.js"(exports2, module2) {
|
|
"use strict";
|
|
var esprima;
|
|
try {
|
|
_require = require;
|
|
esprima = _require("esprima");
|
|
} catch (_) {
|
|
if (typeof window !== "undefined") esprima = window.esprima;
|
|
}
|
|
var _require;
|
|
var Type = require_type();
|
|
function resolveJavascriptFunction(data) {
|
|
if (data === null) return false;
|
|
try {
|
|
var source = "(" + data + ")", ast = esprima.parse(source, { range: true });
|
|
if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
|
|
return false;
|
|
}
|
|
return true;
|
|
} catch (err) {
|
|
return false;
|
|
}
|
|
}
|
|
function constructJavascriptFunction(data) {
|
|
var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body;
|
|
if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
|
|
throw new Error("Failed to resolve function");
|
|
}
|
|
ast.body[0].expression.params.forEach(function(param) {
|
|
params.push(param.name);
|
|
});
|
|
body = ast.body[0].expression.body.range;
|
|
if (ast.body[0].expression.body.type === "BlockStatement") {
|
|
return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
|
}
|
|
return new Function(params, "return " + source.slice(body[0], body[1]));
|
|
}
|
|
function representJavascriptFunction(object) {
|
|
return object.toString();
|
|
}
|
|
function isFunction(object) {
|
|
return Object.prototype.toString.call(object) === "[object Function]";
|
|
}
|
|
module2.exports = new Type("tag:yaml.org,2002:js/function", {
|
|
kind: "scalar",
|
|
resolve: resolveJavascriptFunction,
|
|
construct: constructJavascriptFunction,
|
|
predicate: isFunction,
|
|
represent: representJavascriptFunction
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_full.js
|
|
var require_default_full = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/schema/default_full.js"(exports2, module2) {
|
|
"use strict";
|
|
var Schema = require_schema();
|
|
module2.exports = Schema.DEFAULT = new Schema({
|
|
include: [
|
|
require_default_safe()
|
|
],
|
|
explicit: [
|
|
require_undefined(),
|
|
require_regexp(),
|
|
require_function()
|
|
]
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/loader.js
|
|
var require_loader = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/loader.js"(exports2, module2) {
|
|
"use strict";
|
|
var common = require_common();
|
|
var YAMLException = require_exception();
|
|
var Mark = require_mark();
|
|
var DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
var DEFAULT_FULL_SCHEMA = require_default_full();
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var CONTEXT_FLOW_IN = 1;
|
|
var CONTEXT_FLOW_OUT = 2;
|
|
var CONTEXT_BLOCK_IN = 3;
|
|
var CONTEXT_BLOCK_OUT = 4;
|
|
var CHOMPING_CLIP = 1;
|
|
var CHOMPING_STRIP = 2;
|
|
var CHOMPING_KEEP = 3;
|
|
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
function _class(obj) {
|
|
return Object.prototype.toString.call(obj);
|
|
}
|
|
function is_EOL(c) {
|
|
return c === 10 || c === 13;
|
|
}
|
|
function is_WHITE_SPACE(c) {
|
|
return c === 9 || c === 32;
|
|
}
|
|
function is_WS_OR_EOL(c) {
|
|
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
}
|
|
function is_FLOW_INDICATOR(c) {
|
|
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
}
|
|
function fromHexCode(c) {
|
|
var lc;
|
|
if (48 <= c && c <= 57) {
|
|
return c - 48;
|
|
}
|
|
lc = c | 32;
|
|
if (97 <= lc && lc <= 102) {
|
|
return lc - 97 + 10;
|
|
}
|
|
return -1;
|
|
}
|
|
function escapedHexLen(c) {
|
|
if (c === 120) {
|
|
return 2;
|
|
}
|
|
if (c === 117) {
|
|
return 4;
|
|
}
|
|
if (c === 85) {
|
|
return 8;
|
|
}
|
|
return 0;
|
|
}
|
|
function fromDecimalCode(c) {
|
|
if (48 <= c && c <= 57) {
|
|
return c - 48;
|
|
}
|
|
return -1;
|
|
}
|
|
function simpleEscapeSequence(c) {
|
|
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
|
}
|
|
function charFromCodepoint(c) {
|
|
if (c <= 65535) {
|
|
return String.fromCharCode(c);
|
|
}
|
|
return String.fromCharCode(
|
|
(c - 65536 >> 10) + 55296,
|
|
(c - 65536 & 1023) + 56320
|
|
);
|
|
}
|
|
var simpleEscapeCheck = new Array(256);
|
|
var simpleEscapeMap = new Array(256);
|
|
for (i = 0; i < 256; i++) {
|
|
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
}
|
|
var i;
|
|
function State(input, options2) {
|
|
this.input = input;
|
|
this.filename = options2["filename"] || null;
|
|
this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
|
|
this.onWarning = options2["onWarning"] || null;
|
|
this.legacy = options2["legacy"] || false;
|
|
this.json = options2["json"] || false;
|
|
this.listener = options2["listener"] || null;
|
|
this.implicitTypes = this.schema.compiledImplicit;
|
|
this.typeMap = this.schema.compiledTypeMap;
|
|
this.length = input.length;
|
|
this.position = 0;
|
|
this.line = 0;
|
|
this.lineStart = 0;
|
|
this.lineIndent = 0;
|
|
this.documents = [];
|
|
}
|
|
function generateError(state, message) {
|
|
return new YAMLException(
|
|
message,
|
|
new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart)
|
|
);
|
|
}
|
|
function throwError(state, message) {
|
|
throw generateError(state, message);
|
|
}
|
|
function throwWarning(state, message) {
|
|
if (state.onWarning) {
|
|
state.onWarning.call(null, generateError(state, message));
|
|
}
|
|
}
|
|
var directiveHandlers = {
|
|
YAML: function handleYamlDirective(state, name, args) {
|
|
var match, major, minor;
|
|
if (state.version !== null) {
|
|
throwError(state, "duplication of %YAML directive");
|
|
}
|
|
if (args.length !== 1) {
|
|
throwError(state, "YAML directive accepts exactly one argument");
|
|
}
|
|
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
if (match === null) {
|
|
throwError(state, "ill-formed argument of the YAML directive");
|
|
}
|
|
major = parseInt(match[1], 10);
|
|
minor = parseInt(match[2], 10);
|
|
if (major !== 1) {
|
|
throwError(state, "unacceptable YAML version of the document");
|
|
}
|
|
state.version = args[0];
|
|
state.checkLineBreaks = minor < 2;
|
|
if (minor !== 1 && minor !== 2) {
|
|
throwWarning(state, "unsupported YAML version of the document");
|
|
}
|
|
},
|
|
TAG: function handleTagDirective(state, name, args) {
|
|
var handle, prefix;
|
|
if (args.length !== 2) {
|
|
throwError(state, "TAG directive accepts exactly two arguments");
|
|
}
|
|
handle = args[0];
|
|
prefix = args[1];
|
|
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
}
|
|
if (_hasOwnProperty.call(state.tagMap, handle)) {
|
|
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
}
|
|
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
}
|
|
state.tagMap[handle] = prefix;
|
|
}
|
|
};
|
|
function captureSegment(state, start, end, checkJson) {
|
|
var _position, _length, _character, _result;
|
|
if (start < end) {
|
|
_result = state.input.slice(start, end);
|
|
if (checkJson) {
|
|
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
_character = _result.charCodeAt(_position);
|
|
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
throwError(state, "expected valid JSON character");
|
|
}
|
|
}
|
|
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
throwError(state, "the stream contains non-printable characters");
|
|
}
|
|
state.result += _result;
|
|
}
|
|
}
|
|
function mergeMappings(state, destination, source, overridableKeys) {
|
|
var sourceKeys, key, index, quantity;
|
|
if (!common.isObject(source)) {
|
|
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
}
|
|
sourceKeys = Object.keys(source);
|
|
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
key = sourceKeys[index];
|
|
if (!_hasOwnProperty.call(destination, key)) {
|
|
destination[key] = source[key];
|
|
overridableKeys[key] = true;
|
|
}
|
|
}
|
|
}
|
|
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
|
|
var index, quantity;
|
|
if (Array.isArray(keyNode)) {
|
|
keyNode = Array.prototype.slice.call(keyNode);
|
|
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
if (Array.isArray(keyNode[index])) {
|
|
throwError(state, "nested arrays are not supported inside keys");
|
|
}
|
|
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
keyNode[index] = "[object Object]";
|
|
}
|
|
}
|
|
}
|
|
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
keyNode = "[object Object]";
|
|
}
|
|
keyNode = String(keyNode);
|
|
if (_result === null) {
|
|
_result = {};
|
|
}
|
|
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
if (Array.isArray(valueNode)) {
|
|
for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
}
|
|
} else {
|
|
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
}
|
|
} else {
|
|
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
state.line = startLine || state.line;
|
|
state.position = startPos || state.position;
|
|
throwError(state, "duplicated mapping key");
|
|
}
|
|
_result[keyNode] = valueNode;
|
|
delete overridableKeys[keyNode];
|
|
}
|
|
return _result;
|
|
}
|
|
function readLineBreak(state) {
|
|
var ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch === 10) {
|
|
state.position++;
|
|
} else if (ch === 13) {
|
|
state.position++;
|
|
if (state.input.charCodeAt(state.position) === 10) {
|
|
state.position++;
|
|
}
|
|
} else {
|
|
throwError(state, "a line break is expected");
|
|
}
|
|
state.line += 1;
|
|
state.lineStart = state.position;
|
|
}
|
|
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
while (ch !== 0) {
|
|
while (is_WHITE_SPACE(ch)) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
if (allowComments && ch === 35) {
|
|
do {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
}
|
|
if (is_EOL(ch)) {
|
|
readLineBreak(state);
|
|
ch = state.input.charCodeAt(state.position);
|
|
lineBreaks++;
|
|
state.lineIndent = 0;
|
|
while (ch === 32) {
|
|
state.lineIndent++;
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
throwWarning(state, "deficient indentation");
|
|
}
|
|
return lineBreaks;
|
|
}
|
|
function testDocumentSeparator(state) {
|
|
var _position = state.position, ch;
|
|
ch = state.input.charCodeAt(_position);
|
|
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
_position += 3;
|
|
ch = state.input.charCodeAt(_position);
|
|
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function writeFoldedLines(state, count) {
|
|
if (count === 1) {
|
|
state.result += " ";
|
|
} else if (count > 1) {
|
|
state.result += common.repeat("\n", count - 1);
|
|
}
|
|
}
|
|
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
|
return false;
|
|
}
|
|
if (ch === 63 || ch === 45) {
|
|
following = state.input.charCodeAt(state.position + 1);
|
|
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
return false;
|
|
}
|
|
}
|
|
state.kind = "scalar";
|
|
state.result = "";
|
|
captureStart = captureEnd = state.position;
|
|
hasPendingContent = false;
|
|
while (ch !== 0) {
|
|
if (ch === 58) {
|
|
following = state.input.charCodeAt(state.position + 1);
|
|
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
break;
|
|
}
|
|
} else if (ch === 35) {
|
|
preceding = state.input.charCodeAt(state.position - 1);
|
|
if (is_WS_OR_EOL(preceding)) {
|
|
break;
|
|
}
|
|
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
break;
|
|
} else if (is_EOL(ch)) {
|
|
_line = state.line;
|
|
_lineStart = state.lineStart;
|
|
_lineIndent = state.lineIndent;
|
|
skipSeparationSpace(state, false, -1);
|
|
if (state.lineIndent >= nodeIndent) {
|
|
hasPendingContent = true;
|
|
ch = state.input.charCodeAt(state.position);
|
|
continue;
|
|
} else {
|
|
state.position = captureEnd;
|
|
state.line = _line;
|
|
state.lineStart = _lineStart;
|
|
state.lineIndent = _lineIndent;
|
|
break;
|
|
}
|
|
}
|
|
if (hasPendingContent) {
|
|
captureSegment(state, captureStart, captureEnd, false);
|
|
writeFoldedLines(state, state.line - _line);
|
|
captureStart = captureEnd = state.position;
|
|
hasPendingContent = false;
|
|
}
|
|
if (!is_WHITE_SPACE(ch)) {
|
|
captureEnd = state.position + 1;
|
|
}
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
captureSegment(state, captureStart, captureEnd, false);
|
|
if (state.result) {
|
|
return true;
|
|
}
|
|
state.kind = _kind;
|
|
state.result = _result;
|
|
return false;
|
|
}
|
|
function readSingleQuotedScalar(state, nodeIndent) {
|
|
var ch, captureStart, captureEnd;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch !== 39) {
|
|
return false;
|
|
}
|
|
state.kind = "scalar";
|
|
state.result = "";
|
|
state.position++;
|
|
captureStart = captureEnd = state.position;
|
|
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
if (ch === 39) {
|
|
captureSegment(state, captureStart, state.position, true);
|
|
ch = state.input.charCodeAt(++state.position);
|
|
if (ch === 39) {
|
|
captureStart = state.position;
|
|
state.position++;
|
|
captureEnd = state.position;
|
|
} else {
|
|
return true;
|
|
}
|
|
} else if (is_EOL(ch)) {
|
|
captureSegment(state, captureStart, captureEnd, true);
|
|
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
captureStart = captureEnd = state.position;
|
|
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
} else {
|
|
state.position++;
|
|
captureEnd = state.position;
|
|
}
|
|
}
|
|
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
}
|
|
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch !== 34) {
|
|
return false;
|
|
}
|
|
state.kind = "scalar";
|
|
state.result = "";
|
|
state.position++;
|
|
captureStart = captureEnd = state.position;
|
|
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
if (ch === 34) {
|
|
captureSegment(state, captureStart, state.position, true);
|
|
state.position++;
|
|
return true;
|
|
} else if (ch === 92) {
|
|
captureSegment(state, captureStart, state.position, true);
|
|
ch = state.input.charCodeAt(++state.position);
|
|
if (is_EOL(ch)) {
|
|
skipSeparationSpace(state, false, nodeIndent);
|
|
} else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
state.result += simpleEscapeMap[ch];
|
|
state.position++;
|
|
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
hexLength = tmp;
|
|
hexResult = 0;
|
|
for (; hexLength > 0; hexLength--) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
hexResult = (hexResult << 4) + tmp;
|
|
} else {
|
|
throwError(state, "expected hexadecimal character");
|
|
}
|
|
}
|
|
state.result += charFromCodepoint(hexResult);
|
|
state.position++;
|
|
} else {
|
|
throwError(state, "unknown escape sequence");
|
|
}
|
|
captureStart = captureEnd = state.position;
|
|
} else if (is_EOL(ch)) {
|
|
captureSegment(state, captureStart, captureEnd, true);
|
|
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
captureStart = captureEnd = state.position;
|
|
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
} else {
|
|
state.position++;
|
|
captureEnd = state.position;
|
|
}
|
|
}
|
|
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
}
|
|
function readFlowCollection(state, nodeIndent) {
|
|
var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch === 91) {
|
|
terminator = 93;
|
|
isMapping = false;
|
|
_result = [];
|
|
} else if (ch === 123) {
|
|
terminator = 125;
|
|
isMapping = true;
|
|
_result = {};
|
|
} else {
|
|
return false;
|
|
}
|
|
if (state.anchor !== null) {
|
|
state.anchorMap[state.anchor] = _result;
|
|
}
|
|
ch = state.input.charCodeAt(++state.position);
|
|
while (ch !== 0) {
|
|
skipSeparationSpace(state, true, nodeIndent);
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch === terminator) {
|
|
state.position++;
|
|
state.tag = _tag;
|
|
state.anchor = _anchor;
|
|
state.kind = isMapping ? "mapping" : "sequence";
|
|
state.result = _result;
|
|
return true;
|
|
} else if (!readNext) {
|
|
throwError(state, "missed comma between flow collection entries");
|
|
}
|
|
keyTag = keyNode = valueNode = null;
|
|
isPair = isExplicitPair = false;
|
|
if (ch === 63) {
|
|
following = state.input.charCodeAt(state.position + 1);
|
|
if (is_WS_OR_EOL(following)) {
|
|
isPair = isExplicitPair = true;
|
|
state.position++;
|
|
skipSeparationSpace(state, true, nodeIndent);
|
|
}
|
|
}
|
|
_line = state.line;
|
|
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
keyTag = state.tag;
|
|
keyNode = state.result;
|
|
skipSeparationSpace(state, true, nodeIndent);
|
|
ch = state.input.charCodeAt(state.position);
|
|
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
isPair = true;
|
|
ch = state.input.charCodeAt(++state.position);
|
|
skipSeparationSpace(state, true, nodeIndent);
|
|
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
valueNode = state.result;
|
|
}
|
|
if (isMapping) {
|
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
|
|
} else if (isPair) {
|
|
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
|
|
} else {
|
|
_result.push(keyNode);
|
|
}
|
|
skipSeparationSpace(state, true, nodeIndent);
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch === 44) {
|
|
readNext = true;
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} else {
|
|
readNext = false;
|
|
}
|
|
}
|
|
throwError(state, "unexpected end of the stream within a flow collection");
|
|
}
|
|
function readBlockScalar(state, nodeIndent) {
|
|
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch === 124) {
|
|
folding = false;
|
|
} else if (ch === 62) {
|
|
folding = true;
|
|
} else {
|
|
return false;
|
|
}
|
|
state.kind = "scalar";
|
|
state.result = "";
|
|
while (ch !== 0) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
if (ch === 43 || ch === 45) {
|
|
if (CHOMPING_CLIP === chomping) {
|
|
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
} else {
|
|
throwError(state, "repeat of a chomping mode identifier");
|
|
}
|
|
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
if (tmp === 0) {
|
|
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
} else if (!detectedIndent) {
|
|
textIndent = nodeIndent + tmp - 1;
|
|
detectedIndent = true;
|
|
} else {
|
|
throwError(state, "repeat of an indentation width identifier");
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
if (is_WHITE_SPACE(ch)) {
|
|
do {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} while (is_WHITE_SPACE(ch));
|
|
if (ch === 35) {
|
|
do {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} while (!is_EOL(ch) && ch !== 0);
|
|
}
|
|
}
|
|
while (ch !== 0) {
|
|
readLineBreak(state);
|
|
state.lineIndent = 0;
|
|
ch = state.input.charCodeAt(state.position);
|
|
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
state.lineIndent++;
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
textIndent = state.lineIndent;
|
|
}
|
|
if (is_EOL(ch)) {
|
|
emptyLines++;
|
|
continue;
|
|
}
|
|
if (state.lineIndent < textIndent) {
|
|
if (chomping === CHOMPING_KEEP) {
|
|
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
} else if (chomping === CHOMPING_CLIP) {
|
|
if (didReadContent) {
|
|
state.result += "\n";
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
if (folding) {
|
|
if (is_WHITE_SPACE(ch)) {
|
|
atMoreIndented = true;
|
|
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
} else if (atMoreIndented) {
|
|
atMoreIndented = false;
|
|
state.result += common.repeat("\n", emptyLines + 1);
|
|
} else if (emptyLines === 0) {
|
|
if (didReadContent) {
|
|
state.result += " ";
|
|
}
|
|
} else {
|
|
state.result += common.repeat("\n", emptyLines);
|
|
}
|
|
} else {
|
|
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
}
|
|
didReadContent = true;
|
|
detectedIndent = true;
|
|
emptyLines = 0;
|
|
captureStart = state.position;
|
|
while (!is_EOL(ch) && ch !== 0) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
captureSegment(state, captureStart, state.position, false);
|
|
}
|
|
return true;
|
|
}
|
|
function readBlockSequence(state, nodeIndent) {
|
|
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
if (state.anchor !== null) {
|
|
state.anchorMap[state.anchor] = _result;
|
|
}
|
|
ch = state.input.charCodeAt(state.position);
|
|
while (ch !== 0) {
|
|
if (ch !== 45) {
|
|
break;
|
|
}
|
|
following = state.input.charCodeAt(state.position + 1);
|
|
if (!is_WS_OR_EOL(following)) {
|
|
break;
|
|
}
|
|
detected = true;
|
|
state.position++;
|
|
if (skipSeparationSpace(state, true, -1)) {
|
|
if (state.lineIndent <= nodeIndent) {
|
|
_result.push(null);
|
|
ch = state.input.charCodeAt(state.position);
|
|
continue;
|
|
}
|
|
}
|
|
_line = state.line;
|
|
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
_result.push(state.result);
|
|
skipSeparationSpace(state, true, -1);
|
|
ch = state.input.charCodeAt(state.position);
|
|
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
throwError(state, "bad indentation of a sequence entry");
|
|
} else if (state.lineIndent < nodeIndent) {
|
|
break;
|
|
}
|
|
}
|
|
if (detected) {
|
|
state.tag = _tag;
|
|
state.anchor = _anchor;
|
|
state.kind = "sequence";
|
|
state.result = _result;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
if (state.anchor !== null) {
|
|
state.anchorMap[state.anchor] = _result;
|
|
}
|
|
ch = state.input.charCodeAt(state.position);
|
|
while (ch !== 0) {
|
|
following = state.input.charCodeAt(state.position + 1);
|
|
_line = state.line;
|
|
_pos = state.position;
|
|
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
if (ch === 63) {
|
|
if (atExplicitKey) {
|
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
keyTag = keyNode = valueNode = null;
|
|
}
|
|
detected = true;
|
|
atExplicitKey = true;
|
|
allowCompact = true;
|
|
} else if (atExplicitKey) {
|
|
atExplicitKey = false;
|
|
allowCompact = true;
|
|
} else {
|
|
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
}
|
|
state.position += 1;
|
|
ch = following;
|
|
} else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
if (state.line === _line) {
|
|
ch = state.input.charCodeAt(state.position);
|
|
while (is_WHITE_SPACE(ch)) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
if (ch === 58) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
if (!is_WS_OR_EOL(ch)) {
|
|
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
}
|
|
if (atExplicitKey) {
|
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
keyTag = keyNode = valueNode = null;
|
|
}
|
|
detected = true;
|
|
atExplicitKey = false;
|
|
allowCompact = false;
|
|
keyTag = state.tag;
|
|
keyNode = state.result;
|
|
} else if (detected) {
|
|
throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
} else {
|
|
state.tag = _tag;
|
|
state.anchor = _anchor;
|
|
return true;
|
|
}
|
|
} else if (detected) {
|
|
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
} else {
|
|
state.tag = _tag;
|
|
state.anchor = _anchor;
|
|
return true;
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
if (atExplicitKey) {
|
|
keyNode = state.result;
|
|
} else {
|
|
valueNode = state.result;
|
|
}
|
|
}
|
|
if (!atExplicitKey) {
|
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
|
|
keyTag = keyNode = valueNode = null;
|
|
}
|
|
skipSeparationSpace(state, true, -1);
|
|
ch = state.input.charCodeAt(state.position);
|
|
}
|
|
if (state.lineIndent > nodeIndent && ch !== 0) {
|
|
throwError(state, "bad indentation of a mapping entry");
|
|
} else if (state.lineIndent < nodeIndent) {
|
|
break;
|
|
}
|
|
}
|
|
if (atExplicitKey) {
|
|
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
|
|
}
|
|
if (detected) {
|
|
state.tag = _tag;
|
|
state.anchor = _anchor;
|
|
state.kind = "mapping";
|
|
state.result = _result;
|
|
}
|
|
return detected;
|
|
}
|
|
function readTagProperty(state) {
|
|
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch !== 33) return false;
|
|
if (state.tag !== null) {
|
|
throwError(state, "duplication of a tag property");
|
|
}
|
|
ch = state.input.charCodeAt(++state.position);
|
|
if (ch === 60) {
|
|
isVerbatim = true;
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} else if (ch === 33) {
|
|
isNamed = true;
|
|
tagHandle = "!!";
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} else {
|
|
tagHandle = "!";
|
|
}
|
|
_position = state.position;
|
|
if (isVerbatim) {
|
|
do {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} while (ch !== 0 && ch !== 62);
|
|
if (state.position < state.length) {
|
|
tagName = state.input.slice(_position, state.position);
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} else {
|
|
throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
}
|
|
} else {
|
|
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
if (ch === 33) {
|
|
if (!isNamed) {
|
|
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
throwError(state, "named tag handle cannot contain such characters");
|
|
}
|
|
isNamed = true;
|
|
_position = state.position + 1;
|
|
} else {
|
|
throwError(state, "tag suffix cannot contain exclamation marks");
|
|
}
|
|
}
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
tagName = state.input.slice(_position, state.position);
|
|
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
}
|
|
}
|
|
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
}
|
|
if (isVerbatim) {
|
|
state.tag = tagName;
|
|
} else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
|
|
state.tag = state.tagMap[tagHandle] + tagName;
|
|
} else if (tagHandle === "!") {
|
|
state.tag = "!" + tagName;
|
|
} else if (tagHandle === "!!") {
|
|
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
} else {
|
|
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
}
|
|
return true;
|
|
}
|
|
function readAnchorProperty(state) {
|
|
var _position, ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch !== 38) return false;
|
|
if (state.anchor !== null) {
|
|
throwError(state, "duplication of an anchor property");
|
|
}
|
|
ch = state.input.charCodeAt(++state.position);
|
|
_position = state.position;
|
|
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
if (state.position === _position) {
|
|
throwError(state, "name of an anchor node must contain at least one character");
|
|
}
|
|
state.anchor = state.input.slice(_position, state.position);
|
|
return true;
|
|
}
|
|
function readAlias(state) {
|
|
var _position, alias, ch;
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (ch !== 42) return false;
|
|
ch = state.input.charCodeAt(++state.position);
|
|
_position = state.position;
|
|
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
if (state.position === _position) {
|
|
throwError(state, "name of an alias node must contain at least one character");
|
|
}
|
|
alias = state.input.slice(_position, state.position);
|
|
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
|
throwError(state, 'unidentified alias "' + alias + '"');
|
|
}
|
|
state.result = state.anchorMap[alias];
|
|
skipSeparationSpace(state, true, -1);
|
|
return true;
|
|
}
|
|
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent;
|
|
if (state.listener !== null) {
|
|
state.listener("open", state);
|
|
}
|
|
state.tag = null;
|
|
state.anchor = null;
|
|
state.kind = null;
|
|
state.result = null;
|
|
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
if (allowToSeek) {
|
|
if (skipSeparationSpace(state, true, -1)) {
|
|
atNewLine = true;
|
|
if (state.lineIndent > parentIndent) {
|
|
indentStatus = 1;
|
|
} else if (state.lineIndent === parentIndent) {
|
|
indentStatus = 0;
|
|
} else if (state.lineIndent < parentIndent) {
|
|
indentStatus = -1;
|
|
}
|
|
}
|
|
}
|
|
if (indentStatus === 1) {
|
|
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
if (skipSeparationSpace(state, true, -1)) {
|
|
atNewLine = true;
|
|
allowBlockCollections = allowBlockStyles;
|
|
if (state.lineIndent > parentIndent) {
|
|
indentStatus = 1;
|
|
} else if (state.lineIndent === parentIndent) {
|
|
indentStatus = 0;
|
|
} else if (state.lineIndent < parentIndent) {
|
|
indentStatus = -1;
|
|
}
|
|
} else {
|
|
allowBlockCollections = false;
|
|
}
|
|
}
|
|
}
|
|
if (allowBlockCollections) {
|
|
allowBlockCollections = atNewLine || allowCompact;
|
|
}
|
|
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
flowIndent = parentIndent;
|
|
} else {
|
|
flowIndent = parentIndent + 1;
|
|
}
|
|
blockIndent = state.position - state.lineStart;
|
|
if (indentStatus === 1) {
|
|
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
|
|
hasContent = true;
|
|
} else {
|
|
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
|
|
hasContent = true;
|
|
} else if (readAlias(state)) {
|
|
hasContent = true;
|
|
if (state.tag !== null || state.anchor !== null) {
|
|
throwError(state, "alias node should not have any properties");
|
|
}
|
|
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
hasContent = true;
|
|
if (state.tag === null) {
|
|
state.tag = "?";
|
|
}
|
|
}
|
|
if (state.anchor !== null) {
|
|
state.anchorMap[state.anchor] = state.result;
|
|
}
|
|
}
|
|
} else if (indentStatus === 0) {
|
|
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
}
|
|
}
|
|
if (state.tag !== null && state.tag !== "!") {
|
|
if (state.tag === "?") {
|
|
if (state.result !== null && state.kind !== "scalar") {
|
|
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
}
|
|
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
type = state.implicitTypes[typeIndex];
|
|
if (type.resolve(state.result)) {
|
|
state.result = type.construct(state.result);
|
|
state.tag = type.tag;
|
|
if (state.anchor !== null) {
|
|
state.anchorMap[state.anchor] = state.result;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
} else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
if (state.result !== null && type.kind !== state.kind) {
|
|
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
|
}
|
|
if (!type.resolve(state.result)) {
|
|
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
} else {
|
|
state.result = type.construct(state.result);
|
|
if (state.anchor !== null) {
|
|
state.anchorMap[state.anchor] = state.result;
|
|
}
|
|
}
|
|
} else {
|
|
throwError(state, "unknown tag !<" + state.tag + ">");
|
|
}
|
|
}
|
|
if (state.listener !== null) {
|
|
state.listener("close", state);
|
|
}
|
|
return state.tag !== null || state.anchor !== null || hasContent;
|
|
}
|
|
function readDocument(state) {
|
|
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
state.version = null;
|
|
state.checkLineBreaks = state.legacy;
|
|
state.tagMap = {};
|
|
state.anchorMap = {};
|
|
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
skipSeparationSpace(state, true, -1);
|
|
ch = state.input.charCodeAt(state.position);
|
|
if (state.lineIndent > 0 || ch !== 37) {
|
|
break;
|
|
}
|
|
hasDirectives = true;
|
|
ch = state.input.charCodeAt(++state.position);
|
|
_position = state.position;
|
|
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
directiveName = state.input.slice(_position, state.position);
|
|
directiveArgs = [];
|
|
if (directiveName.length < 1) {
|
|
throwError(state, "directive name must not be less than one character in length");
|
|
}
|
|
while (ch !== 0) {
|
|
while (is_WHITE_SPACE(ch)) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
if (ch === 35) {
|
|
do {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
} while (ch !== 0 && !is_EOL(ch));
|
|
break;
|
|
}
|
|
if (is_EOL(ch)) break;
|
|
_position = state.position;
|
|
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
ch = state.input.charCodeAt(++state.position);
|
|
}
|
|
directiveArgs.push(state.input.slice(_position, state.position));
|
|
}
|
|
if (ch !== 0) readLineBreak(state);
|
|
if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
|
|
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
} else {
|
|
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
}
|
|
}
|
|
skipSeparationSpace(state, true, -1);
|
|
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
state.position += 3;
|
|
skipSeparationSpace(state, true, -1);
|
|
} else if (hasDirectives) {
|
|
throwError(state, "directives end mark is expected");
|
|
}
|
|
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
skipSeparationSpace(state, true, -1);
|
|
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
}
|
|
state.documents.push(state.result);
|
|
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
if (state.input.charCodeAt(state.position) === 46) {
|
|
state.position += 3;
|
|
skipSeparationSpace(state, true, -1);
|
|
}
|
|
return;
|
|
}
|
|
if (state.position < state.length - 1) {
|
|
throwError(state, "end of the stream or a document separator is expected");
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
function loadDocuments(input, options2) {
|
|
input = String(input);
|
|
options2 = options2 || {};
|
|
if (input.length !== 0) {
|
|
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
input += "\n";
|
|
}
|
|
if (input.charCodeAt(0) === 65279) {
|
|
input = input.slice(1);
|
|
}
|
|
}
|
|
var state = new State(input, options2);
|
|
var nullpos = input.indexOf("\0");
|
|
if (nullpos !== -1) {
|
|
state.position = nullpos;
|
|
throwError(state, "null byte is not allowed in input");
|
|
}
|
|
state.input += "\0";
|
|
while (state.input.charCodeAt(state.position) === 32) {
|
|
state.lineIndent += 1;
|
|
state.position += 1;
|
|
}
|
|
while (state.position < state.length - 1) {
|
|
readDocument(state);
|
|
}
|
|
return state.documents;
|
|
}
|
|
function loadAll(input, iterator2, options2) {
|
|
if (iterator2 !== null && typeof iterator2 === "object" && typeof options2 === "undefined") {
|
|
options2 = iterator2;
|
|
iterator2 = null;
|
|
}
|
|
var documents = loadDocuments(input, options2);
|
|
if (typeof iterator2 !== "function") {
|
|
return documents;
|
|
}
|
|
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
iterator2(documents[index]);
|
|
}
|
|
}
|
|
function load(input, options2) {
|
|
var documents = loadDocuments(input, options2);
|
|
if (documents.length === 0) {
|
|
return void 0;
|
|
} else if (documents.length === 1) {
|
|
return documents[0];
|
|
}
|
|
throw new YAMLException("expected a single document in the stream, but found more");
|
|
}
|
|
function safeLoadAll(input, iterator2, options2) {
|
|
if (typeof iterator2 === "object" && iterator2 !== null && typeof options2 === "undefined") {
|
|
options2 = iterator2;
|
|
iterator2 = null;
|
|
}
|
|
return loadAll(input, iterator2, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
}
|
|
function safeLoad(input, options2) {
|
|
return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
}
|
|
module2.exports.loadAll = loadAll;
|
|
module2.exports.load = load;
|
|
module2.exports.safeLoadAll = safeLoadAll;
|
|
module2.exports.safeLoad = safeLoad;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/dumper.js
|
|
var require_dumper = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml/dumper.js"(exports2, module2) {
|
|
"use strict";
|
|
var common = require_common();
|
|
var YAMLException = require_exception();
|
|
var DEFAULT_FULL_SCHEMA = require_default_full();
|
|
var DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
var _toString = Object.prototype.toString;
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var CHAR_TAB = 9;
|
|
var CHAR_LINE_FEED = 10;
|
|
var CHAR_CARRIAGE_RETURN = 13;
|
|
var CHAR_SPACE = 32;
|
|
var CHAR_EXCLAMATION = 33;
|
|
var CHAR_DOUBLE_QUOTE = 34;
|
|
var CHAR_SHARP = 35;
|
|
var CHAR_PERCENT = 37;
|
|
var CHAR_AMPERSAND = 38;
|
|
var CHAR_SINGLE_QUOTE = 39;
|
|
var CHAR_ASTERISK = 42;
|
|
var CHAR_COMMA = 44;
|
|
var CHAR_MINUS = 45;
|
|
var CHAR_COLON = 58;
|
|
var CHAR_EQUALS = 61;
|
|
var CHAR_GREATER_THAN = 62;
|
|
var CHAR_QUESTION = 63;
|
|
var CHAR_COMMERCIAL_AT = 64;
|
|
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
var CHAR_GRAVE_ACCENT = 96;
|
|
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
var CHAR_VERTICAL_LINE = 124;
|
|
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
var ESCAPE_SEQUENCES = {};
|
|
ESCAPE_SEQUENCES[0] = "\\0";
|
|
ESCAPE_SEQUENCES[7] = "\\a";
|
|
ESCAPE_SEQUENCES[8] = "\\b";
|
|
ESCAPE_SEQUENCES[9] = "\\t";
|
|
ESCAPE_SEQUENCES[10] = "\\n";
|
|
ESCAPE_SEQUENCES[11] = "\\v";
|
|
ESCAPE_SEQUENCES[12] = "\\f";
|
|
ESCAPE_SEQUENCES[13] = "\\r";
|
|
ESCAPE_SEQUENCES[27] = "\\e";
|
|
ESCAPE_SEQUENCES[34] = '\\"';
|
|
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
ESCAPE_SEQUENCES[133] = "\\N";
|
|
ESCAPE_SEQUENCES[160] = "\\_";
|
|
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
"y",
|
|
"Y",
|
|
"yes",
|
|
"Yes",
|
|
"YES",
|
|
"on",
|
|
"On",
|
|
"ON",
|
|
"n",
|
|
"N",
|
|
"no",
|
|
"No",
|
|
"NO",
|
|
"off",
|
|
"Off",
|
|
"OFF"
|
|
];
|
|
function compileStyleMap(schema, map) {
|
|
var result, keys, index, length, tag, style, type;
|
|
if (map === null) return {};
|
|
result = {};
|
|
keys = Object.keys(map);
|
|
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
tag = keys[index];
|
|
style = String(map[tag]);
|
|
if (tag.slice(0, 2) === "!!") {
|
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
}
|
|
type = schema.compiledTypeMap["fallback"][tag];
|
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
style = type.styleAliases[style];
|
|
}
|
|
result[tag] = style;
|
|
}
|
|
return result;
|
|
}
|
|
function encodeHex(character) {
|
|
var string, handle, length;
|
|
string = character.toString(16).toUpperCase();
|
|
if (character <= 255) {
|
|
handle = "x";
|
|
length = 2;
|
|
} else if (character <= 65535) {
|
|
handle = "u";
|
|
length = 4;
|
|
} else if (character <= 4294967295) {
|
|
handle = "U";
|
|
length = 8;
|
|
} else {
|
|
throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
|
|
}
|
|
return "\\" + handle + common.repeat("0", length - string.length) + string;
|
|
}
|
|
function State(options2) {
|
|
this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
|
|
this.indent = Math.max(1, options2["indent"] || 2);
|
|
this.noArrayIndent = options2["noArrayIndent"] || false;
|
|
this.skipInvalid = options2["skipInvalid"] || false;
|
|
this.flowLevel = common.isNothing(options2["flowLevel"]) ? -1 : options2["flowLevel"];
|
|
this.styleMap = compileStyleMap(this.schema, options2["styles"] || null);
|
|
this.sortKeys = options2["sortKeys"] || false;
|
|
this.lineWidth = options2["lineWidth"] || 80;
|
|
this.noRefs = options2["noRefs"] || false;
|
|
this.noCompatMode = options2["noCompatMode"] || false;
|
|
this.condenseFlow = options2["condenseFlow"] || false;
|
|
this.implicitTypes = this.schema.compiledImplicit;
|
|
this.explicitTypes = this.schema.compiledExplicit;
|
|
this.tag = null;
|
|
this.result = "";
|
|
this.duplicates = [];
|
|
this.usedDuplicates = null;
|
|
}
|
|
function indentString(string, spaces) {
|
|
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
|
|
while (position < length) {
|
|
next = string.indexOf("\n", position);
|
|
if (next === -1) {
|
|
line = string.slice(position);
|
|
position = length;
|
|
} else {
|
|
line = string.slice(position, next + 1);
|
|
position = next + 1;
|
|
}
|
|
if (line.length && line !== "\n") result += ind;
|
|
result += line;
|
|
}
|
|
return result;
|
|
}
|
|
function generateNextLine(state, level) {
|
|
return "\n" + common.repeat(" ", state.indent * level);
|
|
}
|
|
function testImplicitResolving(state, str2) {
|
|
var index, length, type;
|
|
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
type = state.implicitTypes[index];
|
|
if (type.resolve(str2)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function isWhitespace(c) {
|
|
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
}
|
|
function isPrintable(c) {
|
|
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111;
|
|
}
|
|
function isNsChar(c) {
|
|
return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
}
|
|
function isPlainSafe(c, prev) {
|
|
return isPrintable(c) && c !== 65279 && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev));
|
|
}
|
|
function isPlainSafeFirst(c) {
|
|
return isPrintable(c) && c !== 65279 && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
}
|
|
function needIndentIndicator(string) {
|
|
var leadingSpaceRe = /^\n* /;
|
|
return leadingSpaceRe.test(string);
|
|
}
|
|
var STYLE_PLAIN = 1;
|
|
var STYLE_SINGLE = 2;
|
|
var STYLE_LITERAL = 3;
|
|
var STYLE_FOLDED = 4;
|
|
var STYLE_DOUBLE = 5;
|
|
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
|
var i;
|
|
var char, prev_char;
|
|
var hasLineBreak = false;
|
|
var hasFoldableLine = false;
|
|
var shouldTrackWidth = lineWidth !== -1;
|
|
var previousLineBreak = -1;
|
|
var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
|
|
if (singleLineOnly) {
|
|
for (i = 0; i < string.length; i++) {
|
|
char = string.charCodeAt(i);
|
|
if (!isPrintable(char)) {
|
|
return STYLE_DOUBLE;
|
|
}
|
|
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
plain = plain && isPlainSafe(char, prev_char);
|
|
}
|
|
} else {
|
|
for (i = 0; i < string.length; i++) {
|
|
char = string.charCodeAt(i);
|
|
if (char === CHAR_LINE_FEED) {
|
|
hasLineBreak = true;
|
|
if (shouldTrackWidth) {
|
|
hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
|
|
i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
|
|
previousLineBreak = i;
|
|
}
|
|
} else if (!isPrintable(char)) {
|
|
return STYLE_DOUBLE;
|
|
}
|
|
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
|
plain = plain && isPlainSafe(char, prev_char);
|
|
}
|
|
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
|
|
}
|
|
if (!hasLineBreak && !hasFoldableLine) {
|
|
return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
|
|
}
|
|
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
|
return STYLE_DOUBLE;
|
|
}
|
|
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
}
|
|
function writeScalar(state, string, level, iskey) {
|
|
state.dump = function() {
|
|
if (string.length === 0) {
|
|
return "''";
|
|
}
|
|
if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
|
|
return "'" + string + "'";
|
|
}
|
|
var indent = state.indent * Math.max(1, level);
|
|
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
function testAmbiguity(string2) {
|
|
return testImplicitResolving(state, string2);
|
|
}
|
|
switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
|
|
case STYLE_PLAIN:
|
|
return string;
|
|
case STYLE_SINGLE:
|
|
return "'" + string.replace(/'/g, "''") + "'";
|
|
case STYLE_LITERAL:
|
|
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
|
|
case STYLE_FOLDED:
|
|
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
|
|
case STYLE_DOUBLE:
|
|
return '"' + escapeString(string, lineWidth) + '"';
|
|
default:
|
|
throw new YAMLException("impossible error: invalid scalar style");
|
|
}
|
|
}();
|
|
}
|
|
function blockHeader(string, indentPerLevel) {
|
|
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
var clip = string[string.length - 1] === "\n";
|
|
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
|
|
var chomp = keep ? "+" : clip ? "" : "-";
|
|
return indentIndicator + chomp + "\n";
|
|
}
|
|
function dropEndingNewline(string) {
|
|
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
|
|
}
|
|
function foldString(string, width) {
|
|
var lineRe = /(\n+)([^\n]*)/g;
|
|
var result = function() {
|
|
var nextLF = string.indexOf("\n");
|
|
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
lineRe.lastIndex = nextLF;
|
|
return foldLine(string.slice(0, nextLF), width);
|
|
}();
|
|
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
var moreIndented;
|
|
var match;
|
|
while (match = lineRe.exec(string)) {
|
|
var prefix = match[1], line = match[2];
|
|
moreIndented = line[0] === " ";
|
|
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
prevMoreIndented = moreIndented;
|
|
}
|
|
return result;
|
|
}
|
|
function foldLine(line, width) {
|
|
if (line === "" || line[0] === " ") return line;
|
|
var breakRe = / [^ ]/g;
|
|
var match;
|
|
var start = 0, end, curr = 0, next = 0;
|
|
var result = "";
|
|
while (match = breakRe.exec(line)) {
|
|
next = match.index;
|
|
if (next - start > width) {
|
|
end = curr > start ? curr : next;
|
|
result += "\n" + line.slice(start, end);
|
|
start = end + 1;
|
|
}
|
|
curr = next;
|
|
}
|
|
result += "\n";
|
|
if (line.length - start > width && curr > start) {
|
|
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
} else {
|
|
result += line.slice(start);
|
|
}
|
|
return result.slice(1);
|
|
}
|
|
function escapeString(string) {
|
|
var result = "";
|
|
var char, nextChar;
|
|
var escapeSeq;
|
|
for (var i = 0; i < string.length; i++) {
|
|
char = string.charCodeAt(i);
|
|
if (char >= 55296 && char <= 56319) {
|
|
nextChar = string.charCodeAt(i + 1);
|
|
if (nextChar >= 56320 && nextChar <= 57343) {
|
|
result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
|
|
i++;
|
|
continue;
|
|
}
|
|
}
|
|
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
|
|
}
|
|
return result;
|
|
}
|
|
function writeFlowSequence(state, level, object) {
|
|
var _result = "", _tag = state.tag, index, length;
|
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
if (writeNode(state, level, object[index], false, false)) {
|
|
if (index !== 0) _result += "," + (!state.condenseFlow ? " " : "");
|
|
_result += state.dump;
|
|
}
|
|
}
|
|
state.tag = _tag;
|
|
state.dump = "[" + _result + "]";
|
|
}
|
|
function writeBlockSequence(state, level, object, compact) {
|
|
var _result = "", _tag = state.tag, index, length;
|
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
if (writeNode(state, level + 1, object[index], true, true)) {
|
|
if (!compact || index !== 0) {
|
|
_result += generateNextLine(state, level);
|
|
}
|
|
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
_result += "-";
|
|
} else {
|
|
_result += "- ";
|
|
}
|
|
_result += state.dump;
|
|
}
|
|
}
|
|
state.tag = _tag;
|
|
state.dump = _result || "[]";
|
|
}
|
|
function writeFlowMapping(state, level, object) {
|
|
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
|
|
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
pairBuffer = "";
|
|
if (index !== 0) pairBuffer += ", ";
|
|
if (state.condenseFlow) pairBuffer += '"';
|
|
objectKey = objectKeyList[index];
|
|
objectValue = object[objectKey];
|
|
if (!writeNode(state, level, objectKey, false, false)) {
|
|
continue;
|
|
}
|
|
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
if (!writeNode(state, level, objectValue, false, false)) {
|
|
continue;
|
|
}
|
|
pairBuffer += state.dump;
|
|
_result += pairBuffer;
|
|
}
|
|
state.tag = _tag;
|
|
state.dump = "{" + _result + "}";
|
|
}
|
|
function writeBlockMapping(state, level, object, compact) {
|
|
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
if (state.sortKeys === true) {
|
|
objectKeyList.sort();
|
|
} else if (typeof state.sortKeys === "function") {
|
|
objectKeyList.sort(state.sortKeys);
|
|
} else if (state.sortKeys) {
|
|
throw new YAMLException("sortKeys must be a boolean or a function");
|
|
}
|
|
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
pairBuffer = "";
|
|
if (!compact || index !== 0) {
|
|
pairBuffer += generateNextLine(state, level);
|
|
}
|
|
objectKey = objectKeyList[index];
|
|
objectValue = object[objectKey];
|
|
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
continue;
|
|
}
|
|
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
if (explicitPair) {
|
|
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
pairBuffer += "?";
|
|
} else {
|
|
pairBuffer += "? ";
|
|
}
|
|
}
|
|
pairBuffer += state.dump;
|
|
if (explicitPair) {
|
|
pairBuffer += generateNextLine(state, level);
|
|
}
|
|
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
continue;
|
|
}
|
|
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
pairBuffer += ":";
|
|
} else {
|
|
pairBuffer += ": ";
|
|
}
|
|
pairBuffer += state.dump;
|
|
_result += pairBuffer;
|
|
}
|
|
state.tag = _tag;
|
|
state.dump = _result || "{}";
|
|
}
|
|
function detectType(state, object, explicit) {
|
|
var _result, typeList, index, length, type, style;
|
|
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
type = typeList[index];
|
|
if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
|
|
state.tag = explicit ? type.tag : "?";
|
|
if (type.represent) {
|
|
style = state.styleMap[type.tag] || type.defaultStyle;
|
|
if (_toString.call(type.represent) === "[object Function]") {
|
|
_result = type.represent(object, style);
|
|
} else if (_hasOwnProperty.call(type.represent, style)) {
|
|
_result = type.represent[style](object, style);
|
|
} else {
|
|
throw new YAMLException("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
|
|
}
|
|
state.dump = _result;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function writeNode(state, level, object, block, compact, iskey) {
|
|
state.tag = null;
|
|
state.dump = object;
|
|
if (!detectType(state, object, false)) {
|
|
detectType(state, object, true);
|
|
}
|
|
var type = _toString.call(state.dump);
|
|
if (block) {
|
|
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
}
|
|
var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
|
|
if (objectOrArray) {
|
|
duplicateIndex = state.duplicates.indexOf(object);
|
|
duplicate = duplicateIndex !== -1;
|
|
}
|
|
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
compact = false;
|
|
}
|
|
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
state.dump = "*ref_" + duplicateIndex;
|
|
} else {
|
|
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
state.usedDuplicates[duplicateIndex] = true;
|
|
}
|
|
if (type === "[object Object]") {
|
|
if (block && Object.keys(state.dump).length !== 0) {
|
|
writeBlockMapping(state, level, state.dump, compact);
|
|
if (duplicate) {
|
|
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
}
|
|
} else {
|
|
writeFlowMapping(state, level, state.dump);
|
|
if (duplicate) {
|
|
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
}
|
|
}
|
|
} else if (type === "[object Array]") {
|
|
var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level;
|
|
if (block && state.dump.length !== 0) {
|
|
writeBlockSequence(state, arrayLevel, state.dump, compact);
|
|
if (duplicate) {
|
|
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
}
|
|
} else {
|
|
writeFlowSequence(state, arrayLevel, state.dump);
|
|
if (duplicate) {
|
|
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
}
|
|
}
|
|
} else if (type === "[object String]") {
|
|
if (state.tag !== "?") {
|
|
writeScalar(state, state.dump, level, iskey);
|
|
}
|
|
} else {
|
|
if (state.skipInvalid) return false;
|
|
throw new YAMLException("unacceptable kind of an object to dump " + type);
|
|
}
|
|
if (state.tag !== null && state.tag !== "?") {
|
|
state.dump = "!<" + state.tag + "> " + state.dump;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function getDuplicateReferences(object, state) {
|
|
var objects = [], duplicatesIndexes = [], index, length;
|
|
inspectNode(object, objects, duplicatesIndexes);
|
|
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
|
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
}
|
|
state.usedDuplicates = new Array(length);
|
|
}
|
|
function inspectNode(object, objects, duplicatesIndexes) {
|
|
var objectKeyList, index, length;
|
|
if (object !== null && typeof object === "object") {
|
|
index = objects.indexOf(object);
|
|
if (index !== -1) {
|
|
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
duplicatesIndexes.push(index);
|
|
}
|
|
} else {
|
|
objects.push(object);
|
|
if (Array.isArray(object)) {
|
|
for (index = 0, length = object.length; index < length; index += 1) {
|
|
inspectNode(object[index], objects, duplicatesIndexes);
|
|
}
|
|
} else {
|
|
objectKeyList = Object.keys(object);
|
|
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function dump(input, options2) {
|
|
options2 = options2 || {};
|
|
var state = new State(options2);
|
|
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
if (writeNode(state, 0, input, true, true)) return state.dump + "\n";
|
|
return "";
|
|
}
|
|
function safeDump(input, options2) {
|
|
return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
|
|
}
|
|
module2.exports.dump = dump;
|
|
module2.exports.safeDump = safeDump;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml.js
|
|
var require_js_yaml = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/lib/js-yaml.js"(exports2, module2) {
|
|
"use strict";
|
|
var loader = require_loader();
|
|
var dumper = require_dumper();
|
|
function deprecated(name) {
|
|
return function() {
|
|
throw new Error("Function " + name + " is deprecated and cannot be used.");
|
|
};
|
|
}
|
|
module2.exports.Type = require_type();
|
|
module2.exports.Schema = require_schema();
|
|
module2.exports.FAILSAFE_SCHEMA = require_failsafe();
|
|
module2.exports.JSON_SCHEMA = require_json();
|
|
module2.exports.CORE_SCHEMA = require_core();
|
|
module2.exports.DEFAULT_SAFE_SCHEMA = require_default_safe();
|
|
module2.exports.DEFAULT_FULL_SCHEMA = require_default_full();
|
|
module2.exports.load = loader.load;
|
|
module2.exports.loadAll = loader.loadAll;
|
|
module2.exports.safeLoad = loader.safeLoad;
|
|
module2.exports.safeLoadAll = loader.safeLoadAll;
|
|
module2.exports.dump = dumper.dump;
|
|
module2.exports.safeDump = dumper.safeDump;
|
|
module2.exports.YAMLException = require_exception();
|
|
module2.exports.MINIMAL_SCHEMA = require_failsafe();
|
|
module2.exports.SAFE_SCHEMA = require_default_safe();
|
|
module2.exports.DEFAULT_SCHEMA = require_default_full();
|
|
module2.exports.scan = deprecated("scan");
|
|
module2.exports.parse = deprecated("parse");
|
|
module2.exports.compose = deprecated("compose");
|
|
module2.exports.addConstructor = deprecated("addConstructor");
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/node_modules/js-yaml/index.js
|
|
var require_js_yaml2 = __commonJS({
|
|
"node_modules/gray-matter/node_modules/js-yaml/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var yaml2 = require_js_yaml();
|
|
module2.exports = yaml2;
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/engines.js
|
|
var require_engines = __commonJS({
|
|
"node_modules/gray-matter/lib/engines.js"(exports, module) {
|
|
"use strict";
|
|
var yaml = require_js_yaml2();
|
|
var engines = exports = module.exports;
|
|
engines.yaml = {
|
|
parse: yaml.safeLoad.bind(yaml),
|
|
stringify: yaml.safeDump.bind(yaml)
|
|
};
|
|
engines.json = {
|
|
parse: JSON.parse.bind(JSON),
|
|
stringify: function(obj, options2) {
|
|
const opts = Object.assign({ replacer: null, space: 2 }, options2);
|
|
return JSON.stringify(obj, opts.replacer, opts.space);
|
|
}
|
|
};
|
|
engines.javascript = {
|
|
parse: function parse(str, options, wrap) {
|
|
try {
|
|
if (wrap !== false) {
|
|
str = "(function() {\nreturn " + str.trim() + ";\n}());";
|
|
}
|
|
return eval(str) || {};
|
|
} catch (err) {
|
|
if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) {
|
|
return parse(str, options, false);
|
|
}
|
|
throw new SyntaxError(err);
|
|
}
|
|
},
|
|
stringify: function() {
|
|
throw new Error("stringifying JavaScript is not supported");
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/strip-bom-string/index.js
|
|
var require_strip_bom_string = __commonJS({
|
|
"node_modules/strip-bom-string/index.js"(exports2, module2) {
|
|
"use strict";
|
|
module2.exports = function(str2) {
|
|
if (typeof str2 === "string" && str2.charAt(0) === "\uFEFF") {
|
|
return str2.slice(1);
|
|
}
|
|
return str2;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/utils.js
|
|
var require_utils = __commonJS({
|
|
"node_modules/gray-matter/lib/utils.js"(exports2) {
|
|
"use strict";
|
|
var stripBom = require_strip_bom_string();
|
|
var typeOf = require_kind_of();
|
|
exports2.define = function(obj, key, val) {
|
|
Reflect.defineProperty(obj, key, {
|
|
enumerable: false,
|
|
configurable: true,
|
|
writable: true,
|
|
value: val
|
|
});
|
|
};
|
|
exports2.isBuffer = function(val) {
|
|
return typeOf(val) === "buffer";
|
|
};
|
|
exports2.isObject = function(val) {
|
|
return typeOf(val) === "object";
|
|
};
|
|
exports2.toBuffer = function(input) {
|
|
return typeof input === "string" ? Buffer.from(input) : input;
|
|
};
|
|
exports2.toString = function(input) {
|
|
if (exports2.isBuffer(input)) return stripBom(String(input));
|
|
if (typeof input !== "string") {
|
|
throw new TypeError("expected input to be a string or buffer");
|
|
}
|
|
return stripBom(input);
|
|
};
|
|
exports2.arrayify = function(val) {
|
|
return val ? Array.isArray(val) ? val : [val] : [];
|
|
};
|
|
exports2.startsWith = function(str2, substr, len) {
|
|
if (typeof len !== "number") len = substr.length;
|
|
return str2.slice(0, len) === substr;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/defaults.js
|
|
var require_defaults = __commonJS({
|
|
"node_modules/gray-matter/lib/defaults.js"(exports2, module2) {
|
|
"use strict";
|
|
var engines2 = require_engines();
|
|
var utils = require_utils();
|
|
module2.exports = function(options2) {
|
|
const opts = Object.assign({}, options2);
|
|
opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || "---");
|
|
if (opts.delimiters.length === 1) {
|
|
opts.delimiters.push(opts.delimiters[0]);
|
|
}
|
|
opts.language = (opts.language || opts.lang || "yaml").toLowerCase();
|
|
opts.engines = Object.assign({}, engines2, opts.parsers, opts.engines);
|
|
return opts;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/engine.js
|
|
var require_engine = __commonJS({
|
|
"node_modules/gray-matter/lib/engine.js"(exports2, module2) {
|
|
"use strict";
|
|
module2.exports = function(name, options2) {
|
|
let engine = options2.engines[name] || options2.engines[aliase(name)];
|
|
if (typeof engine === "undefined") {
|
|
throw new Error('gray-matter engine "' + name + '" is not registered');
|
|
}
|
|
if (typeof engine === "function") {
|
|
engine = { parse: engine };
|
|
}
|
|
return engine;
|
|
};
|
|
function aliase(name) {
|
|
switch (name.toLowerCase()) {
|
|
case "js":
|
|
case "javascript":
|
|
return "javascript";
|
|
case "coffee":
|
|
case "coffeescript":
|
|
case "cson":
|
|
return "coffee";
|
|
case "yaml":
|
|
case "yml":
|
|
return "yaml";
|
|
default: {
|
|
return name;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/stringify.js
|
|
var require_stringify = __commonJS({
|
|
"node_modules/gray-matter/lib/stringify.js"(exports2, module2) {
|
|
"use strict";
|
|
var typeOf = require_kind_of();
|
|
var getEngine = require_engine();
|
|
var defaults = require_defaults();
|
|
module2.exports = function(file, data, options2) {
|
|
if (data == null && options2 == null) {
|
|
switch (typeOf(file)) {
|
|
case "object":
|
|
data = file.data;
|
|
options2 = {};
|
|
break;
|
|
case "string":
|
|
return file;
|
|
default: {
|
|
throw new TypeError("expected file to be a string or object");
|
|
}
|
|
}
|
|
}
|
|
const str2 = file.content;
|
|
const opts = defaults(options2);
|
|
if (data == null) {
|
|
if (!opts.data) return file;
|
|
data = opts.data;
|
|
}
|
|
const language = file.language || opts.language;
|
|
const engine = getEngine(language, opts);
|
|
if (typeof engine.stringify !== "function") {
|
|
throw new TypeError('expected "' + language + '.stringify" to be a function');
|
|
}
|
|
data = Object.assign({}, file.data, data);
|
|
const open = opts.delimiters[0];
|
|
const close = opts.delimiters[1];
|
|
const matter3 = engine.stringify(data, options2).trim();
|
|
let buf = "";
|
|
if (matter3 !== "{}") {
|
|
buf = newline(open) + newline(matter3) + newline(close);
|
|
}
|
|
if (typeof file.excerpt === "string" && file.excerpt !== "") {
|
|
if (str2.indexOf(file.excerpt.trim()) === -1) {
|
|
buf += newline(file.excerpt) + newline(close);
|
|
}
|
|
}
|
|
return buf + newline(str2);
|
|
};
|
|
function newline(str2) {
|
|
return str2.slice(-1) !== "\n" ? str2 + "\n" : str2;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/excerpt.js
|
|
var require_excerpt = __commonJS({
|
|
"node_modules/gray-matter/lib/excerpt.js"(exports2, module2) {
|
|
"use strict";
|
|
var defaults = require_defaults();
|
|
module2.exports = function(file, options2) {
|
|
const opts = defaults(options2);
|
|
if (file.data == null) {
|
|
file.data = {};
|
|
}
|
|
if (typeof opts.excerpt === "function") {
|
|
return opts.excerpt(file, opts);
|
|
}
|
|
const sep = file.data.excerpt_separator || opts.excerpt_separator;
|
|
if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
|
|
return file;
|
|
}
|
|
const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep || opts.delimiters[0];
|
|
const idx = file.content.indexOf(delimiter);
|
|
if (idx !== -1) {
|
|
file.excerpt = file.content.slice(0, idx);
|
|
}
|
|
return file;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/to-file.js
|
|
var require_to_file = __commonJS({
|
|
"node_modules/gray-matter/lib/to-file.js"(exports2, module2) {
|
|
"use strict";
|
|
var typeOf = require_kind_of();
|
|
var stringify = require_stringify();
|
|
var utils = require_utils();
|
|
module2.exports = function(file) {
|
|
if (typeOf(file) !== "object") {
|
|
file = { content: file };
|
|
}
|
|
if (typeOf(file.data) !== "object") {
|
|
file.data = {};
|
|
}
|
|
if (file.contents && file.content == null) {
|
|
file.content = file.contents;
|
|
}
|
|
utils.define(file, "orig", utils.toBuffer(file.content));
|
|
utils.define(file, "language", file.language || "");
|
|
utils.define(file, "matter", file.matter || "");
|
|
utils.define(file, "stringify", function(data, options2) {
|
|
if (options2 && options2.language) {
|
|
file.language = options2.language;
|
|
}
|
|
return stringify(file, data, options2);
|
|
});
|
|
file.content = utils.toString(file.content);
|
|
file.isEmpty = false;
|
|
file.excerpt = "";
|
|
return file;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/lib/parse.js
|
|
var require_parse = __commonJS({
|
|
"node_modules/gray-matter/lib/parse.js"(exports2, module2) {
|
|
"use strict";
|
|
var getEngine = require_engine();
|
|
var defaults = require_defaults();
|
|
module2.exports = function(language, str2, options2) {
|
|
const opts = defaults(options2);
|
|
const engine = getEngine(language, opts);
|
|
if (typeof engine.parse !== "function") {
|
|
throw new TypeError('expected "' + language + '.parse" to be a function');
|
|
}
|
|
return engine.parse(str2, opts);
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/gray-matter/index.js
|
|
var require_gray_matter = __commonJS({
|
|
"node_modules/gray-matter/index.js"(exports2, module2) {
|
|
"use strict";
|
|
var fs = require("fs");
|
|
var sections = require_section_matter();
|
|
var defaults = require_defaults();
|
|
var stringify = require_stringify();
|
|
var excerpt = require_excerpt();
|
|
var engines2 = require_engines();
|
|
var toFile = require_to_file();
|
|
var parse3 = require_parse();
|
|
var utils = require_utils();
|
|
function matter3(input, options2) {
|
|
if (input === "") {
|
|
return { data: {}, content: input, excerpt: "", orig: input };
|
|
}
|
|
let file = toFile(input);
|
|
const cached = matter3.cache[file.content];
|
|
if (!options2) {
|
|
if (cached) {
|
|
file = Object.assign({}, cached);
|
|
file.orig = cached.orig;
|
|
return file;
|
|
}
|
|
matter3.cache[file.content] = file;
|
|
}
|
|
return parseMatter(file, options2);
|
|
}
|
|
function parseMatter(file, options2) {
|
|
const opts = defaults(options2);
|
|
const open = opts.delimiters[0];
|
|
const close = "\n" + opts.delimiters[1];
|
|
let str2 = file.content;
|
|
if (opts.language) {
|
|
file.language = opts.language;
|
|
}
|
|
const openLen = open.length;
|
|
if (!utils.startsWith(str2, open, openLen)) {
|
|
excerpt(file, opts);
|
|
return file;
|
|
}
|
|
if (str2.charAt(openLen) === open.slice(-1)) {
|
|
return file;
|
|
}
|
|
str2 = str2.slice(openLen);
|
|
const len = str2.length;
|
|
const language = matter3.language(str2, opts);
|
|
if (language.name) {
|
|
file.language = language.name;
|
|
str2 = str2.slice(language.raw.length);
|
|
}
|
|
let closeIndex = str2.indexOf(close);
|
|
if (closeIndex === -1) {
|
|
closeIndex = len;
|
|
}
|
|
file.matter = str2.slice(0, closeIndex);
|
|
const block = file.matter.replace(/^\s*#[^\n]+/gm, "").trim();
|
|
if (block === "") {
|
|
file.isEmpty = true;
|
|
file.empty = file.content;
|
|
file.data = {};
|
|
} else {
|
|
file.data = parse3(file.language, file.matter, opts);
|
|
}
|
|
if (closeIndex === len) {
|
|
file.content = "";
|
|
} else {
|
|
file.content = str2.slice(closeIndex + close.length);
|
|
if (file.content[0] === "\r") {
|
|
file.content = file.content.slice(1);
|
|
}
|
|
if (file.content[0] === "\n") {
|
|
file.content = file.content.slice(1);
|
|
}
|
|
}
|
|
excerpt(file, opts);
|
|
if (opts.sections === true || typeof opts.section === "function") {
|
|
sections(file, opts.section);
|
|
}
|
|
return file;
|
|
}
|
|
matter3.engines = engines2;
|
|
matter3.stringify = function(file, data, options2) {
|
|
if (typeof file === "string") file = matter3(file, options2);
|
|
return stringify(file, data, options2);
|
|
};
|
|
matter3.read = function(filepath, options2) {
|
|
const str2 = fs.readFileSync(filepath, "utf8");
|
|
const file = matter3(str2, options2);
|
|
file.path = filepath;
|
|
return file;
|
|
};
|
|
matter3.test = function(str2, options2) {
|
|
return utils.startsWith(str2, defaults(options2).delimiters[0]);
|
|
};
|
|
matter3.language = function(str2, options2) {
|
|
const opts = defaults(options2);
|
|
const open = opts.delimiters[0];
|
|
if (matter3.test(str2)) {
|
|
str2 = str2.slice(open.length);
|
|
}
|
|
const language = str2.slice(0, str2.search(/\r?\n/));
|
|
return {
|
|
raw: language,
|
|
name: language ? language.trim() : ""
|
|
};
|
|
};
|
|
matter3.cache = {};
|
|
matter3.clearCache = function() {
|
|
matter3.cache = {};
|
|
};
|
|
module2.exports = matter3;
|
|
}
|
|
});
|
|
|
|
// main.ts
|
|
var main_exports = {};
|
|
__export(main_exports, {
|
|
default: () => ShareAsGistPlugin
|
|
});
|
|
module.exports = __toCommonJS(main_exports);
|
|
var import_obsidian = require("obsidian");
|
|
var import_gray_matter2 = __toESM(require_gray_matter());
|
|
|
|
// node_modules/@octokit/rest/node_modules/universal-user-agent/index.js
|
|
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>";
|
|
}
|
|
|
|
// node_modules/@octokit/rest/node_modules/before-after-hook/lib/register.js
|
|
function register(state, name, method, options2) {
|
|
if (typeof method !== "function") {
|
|
throw new Error("method for before hook must be a function");
|
|
}
|
|
if (!options2) {
|
|
options2 = {};
|
|
}
|
|
if (Array.isArray(name)) {
|
|
return name.reverse().reduce((callback, name2) => {
|
|
return register.bind(null, state, name2, callback, options2);
|
|
}, method)();
|
|
}
|
|
return Promise.resolve().then(() => {
|
|
if (!state.registry[name]) {
|
|
return method(options2);
|
|
}
|
|
return state.registry[name].reduce((method2, registered) => {
|
|
return registered.hook.bind(null, method2, options2);
|
|
}, method)();
|
|
});
|
|
}
|
|
|
|
// node_modules/@octokit/rest/node_modules/before-after-hook/lib/add.js
|
|
function addHook(state, kind, name, hook2) {
|
|
const orig = hook2;
|
|
if (!state.registry[name]) {
|
|
state.registry[name] = [];
|
|
}
|
|
if (kind === "before") {
|
|
hook2 = (method, options2) => {
|
|
return Promise.resolve().then(orig.bind(null, options2)).then(method.bind(null, options2));
|
|
};
|
|
}
|
|
if (kind === "after") {
|
|
hook2 = (method, options2) => {
|
|
let result;
|
|
return Promise.resolve().then(method.bind(null, options2)).then((result_) => {
|
|
result = result_;
|
|
return orig(result, options2);
|
|
}).then(() => {
|
|
return result;
|
|
});
|
|
};
|
|
}
|
|
if (kind === "error") {
|
|
hook2 = (method, options2) => {
|
|
return Promise.resolve().then(method.bind(null, options2)).catch((error) => {
|
|
return orig(error, options2);
|
|
});
|
|
};
|
|
}
|
|
state.registry[name].push({
|
|
hook: hook2,
|
|
orig
|
|
});
|
|
}
|
|
|
|
// node_modules/@octokit/rest/node_modules/before-after-hook/lib/remove.js
|
|
function removeHook(state, name, method) {
|
|
if (!state.registry[name]) {
|
|
return;
|
|
}
|
|
const index = state.registry[name].map((registered) => {
|
|
return registered.orig;
|
|
}).indexOf(method);
|
|
if (index === -1) {
|
|
return;
|
|
}
|
|
state.registry[name].splice(index, 1);
|
|
}
|
|
|
|
// node_modules/@octokit/rest/node_modules/before-after-hook/index.js
|
|
var bind = Function.bind;
|
|
var bindable = bind.bind(bind);
|
|
function bindApi(hook2, state, name) {
|
|
const removeHookRef = bindable(removeHook, null).apply(
|
|
null,
|
|
name ? [state, name] : [state]
|
|
);
|
|
hook2.api = { remove: removeHookRef };
|
|
hook2.remove = removeHookRef;
|
|
["before", "error", "after", "wrap"].forEach((kind) => {
|
|
const args = name ? [state, kind, name] : [state, kind];
|
|
hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args);
|
|
});
|
|
}
|
|
function Singular() {
|
|
const singularHookName = Symbol("Singular");
|
|
const singularHookState = {
|
|
registry: {}
|
|
};
|
|
const singularHook = register.bind(null, singularHookState, singularHookName);
|
|
bindApi(singularHook, singularHookState, singularHookName);
|
|
return singularHook;
|
|
}
|
|
function Collection() {
|
|
const state = {
|
|
registry: {}
|
|
};
|
|
const hook2 = register.bind(null, state);
|
|
bindApi(hook2, state);
|
|
return hook2;
|
|
}
|
|
var before_after_hook_default = { Singular, Collection };
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/endpoint/dist-bundle/index.js
|
|
var VERSION = "0.0.0-development";
|
|
var userAgent = `octokit-endpoint.js/${VERSION} ${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 proto = Object.getPrototypeOf(value);
|
|
if (proto === null)
|
|
return true;
|
|
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
}
|
|
function mergeDeep(defaults, options2) {
|
|
const result = Object.assign({}, defaults);
|
|
Object.keys(options2).forEach((key) => {
|
|
if (isPlainObject(options2[key])) {
|
|
if (!(key in defaults))
|
|
Object.assign(result, { [key]: options2[key] });
|
|
else
|
|
result[key] = mergeDeep(defaults[key], options2[key]);
|
|
} else {
|
|
Object.assign(result, { [key]: options2[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, options2) {
|
|
var _a;
|
|
if (typeof route === "string") {
|
|
let [method, url] = route.split(" ");
|
|
options2 = Object.assign(url ? { method, url } : { url: method }, options2);
|
|
} else {
|
|
options2 = Object.assign({}, route);
|
|
}
|
|
options2.headers = lowercaseKeys(options2.headers);
|
|
removeUndefinedProperties(options2);
|
|
removeUndefinedProperties(options2.headers);
|
|
const mergedOptions = mergeDeep(defaults || {}, options2);
|
|
if (options2.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(str2) {
|
|
return str2.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(str2) {
|
|
return encodeURIComponent(str2).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(context, operator, key, modifier) {
|
|
var value = context[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, context) {
|
|
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(context, 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 parse2(options2) {
|
|
var _a;
|
|
let method = options2.method.toUpperCase();
|
|
let url = (options2.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
let headers = Object.assign({}, options2.headers);
|
|
let body;
|
|
let parameters = omit(options2, [
|
|
"method",
|
|
"baseUrl",
|
|
"url",
|
|
"headers",
|
|
"request",
|
|
"mediaType"
|
|
]);
|
|
const urlVariableNames = extractUrlVariableNames(url);
|
|
url = parseUrl(url).expand(parameters);
|
|
if (!/^http/.test(url)) {
|
|
url = options2.baseUrl + url;
|
|
}
|
|
const omittedParameters = Object.keys(options2).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
|
|
const remainingParameters = omit(parameters, omittedParameters);
|
|
const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
|
|
if (!isBinaryRequest) {
|
|
if (options2.mediaType.format) {
|
|
headers.accept = headers.accept.split(/,/).map(
|
|
(format) => format.replace(
|
|
/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
|
|
`application/vnd$1$2.${options2.mediaType.format}`
|
|
)
|
|
).join(",");
|
|
}
|
|
if (url.endsWith("/graphql")) {
|
|
if ((_a = options2.mediaType.previews) == null ? void 0 : _a.length) {
|
|
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
|
|
headers.accept = previewsFromAcceptHeader.concat(options2.mediaType.previews).map((preview) => {
|
|
const format = options2.mediaType.format ? `.${options2.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,
|
|
options2.request ? { request: options2.request } : null
|
|
);
|
|
}
|
|
function endpointWithDefaults(defaults, route, options2) {
|
|
return parse2(merge(defaults, route, options2));
|
|
}
|
|
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: parse2
|
|
});
|
|
}
|
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/request-error/dist-src/index.js
|
|
var RequestError = class extends Error {
|
|
constructor(message, statusCode, options2) {
|
|
super(message);
|
|
__publicField(this, "name");
|
|
/**
|
|
* http status code
|
|
*/
|
|
__publicField(this, "status");
|
|
/**
|
|
* Request options that lead to the error.
|
|
*/
|
|
__publicField(this, "request");
|
|
/**
|
|
* Response object if a response was received
|
|
*/
|
|
__publicField(this, "response");
|
|
this.name = "HttpError";
|
|
this.status = Number.parseInt(statusCode);
|
|
if (Number.isNaN(this.status)) {
|
|
this.status = 0;
|
|
}
|
|
if ("response" in options2) {
|
|
this.response = options2.response;
|
|
}
|
|
const requestCopy = Object.assign({}, options2.request);
|
|
if (options2.request.headers.authorization) {
|
|
requestCopy.headers = Object.assign({}, options2.request.headers, {
|
|
authorization: options2.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;
|
|
}
|
|
};
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/request/dist-bundle/index.js
|
|
var VERSION2 = "0.0.0-development";
|
|
var defaults_default = {
|
|
headers: {
|
|
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
}
|
|
};
|
|
function isPlainObject2(value) {
|
|
if (typeof value !== "object" || value === null) return false;
|
|
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
const proto = Object.getPrototypeOf(value);
|
|
if (proto === null) return true;
|
|
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
}
|
|
function fetchWrapper(requestOptions) {
|
|
return __async(this, null, function* () {
|
|
var _a, _b, _c, _d, _e;
|
|
const fetch = ((_a = requestOptions.request) == null ? void 0 : _a.fetch) || globalThis.fetch;
|
|
if (!fetch) {
|
|
throw new Error(
|
|
"fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing"
|
|
);
|
|
}
|
|
const log = ((_b = requestOptions.request) == null ? void 0 : _b.log) || console;
|
|
const parseSuccessResponseBody = ((_c = requestOptions.request) == null ? void 0 : _c.parseSuccessResponseBody) !== false;
|
|
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
|
|
const requestHeaders = Object.fromEntries(
|
|
Object.entries(requestOptions.headers).map(([name, value]) => [
|
|
name,
|
|
String(value)
|
|
])
|
|
);
|
|
let fetchResponse;
|
|
try {
|
|
fetchResponse = yield fetch(requestOptions.url, __spreadValues({
|
|
method: requestOptions.method,
|
|
body,
|
|
redirect: (_d = requestOptions.request) == null ? void 0 : _d.redirect,
|
|
headers: requestHeaders,
|
|
signal: (_e = requestOptions.request) == null ? void 0 : _e.signal
|
|
}, requestOptions.body && { duplex: "half" }));
|
|
} catch (error) {
|
|
let message = "Unknown Error";
|
|
if (error instanceof Error) {
|
|
if (error.name === "AbortError") {
|
|
error.status = 500;
|
|
throw error;
|
|
}
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
const requestError = new RequestError(message, 500, {
|
|
request: requestOptions
|
|
});
|
|
requestError.cause = error;
|
|
throw requestError;
|
|
}
|
|
const status = fetchResponse.status;
|
|
const url = fetchResponse.url;
|
|
const responseHeaders = {};
|
|
for (const [key, value] of fetchResponse.headers) {
|
|
responseHeaders[key] = value;
|
|
}
|
|
const octokitResponse = {
|
|
url,
|
|
status,
|
|
headers: responseHeaders,
|
|
data: ""
|
|
};
|
|
if ("deprecation" in responseHeaders) {
|
|
const matches = responseHeaders.link && responseHeaders.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 ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
|
|
);
|
|
}
|
|
if (status === 204 || status === 205) {
|
|
return octokitResponse;
|
|
}
|
|
if (requestOptions.method === "HEAD") {
|
|
if (status < 400) {
|
|
return octokitResponse;
|
|
}
|
|
throw new RequestError(fetchResponse.statusText, status, {
|
|
response: octokitResponse,
|
|
request: requestOptions
|
|
});
|
|
}
|
|
if (status === 304) {
|
|
octokitResponse.data = yield getResponseData(fetchResponse);
|
|
throw new RequestError("Not modified", status, {
|
|
response: octokitResponse,
|
|
request: requestOptions
|
|
});
|
|
}
|
|
if (status >= 400) {
|
|
octokitResponse.data = yield getResponseData(fetchResponse);
|
|
throw new RequestError(toErrorMessage(octokitResponse.data), status, {
|
|
response: octokitResponse,
|
|
request: requestOptions
|
|
});
|
|
}
|
|
octokitResponse.data = parseSuccessResponseBody ? yield getResponseData(fetchResponse) : fetchResponse.body;
|
|
return octokitResponse;
|
|
});
|
|
}
|
|
function getResponseData(response) {
|
|
return __async(this, null, function* () {
|
|
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 response.arrayBuffer();
|
|
});
|
|
}
|
|
function toErrorMessage(data) {
|
|
if (typeof data === "string") {
|
|
return data;
|
|
}
|
|
if (data instanceof ArrayBuffer) {
|
|
return "Unknown error";
|
|
}
|
|
if ("message" in data) {
|
|
const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : "";
|
|
return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`;
|
|
}
|
|
return `Unknown error: ${JSON.stringify(data)}`;
|
|
}
|
|
function withDefaults2(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: withDefaults2.bind(null, endpoint2)
|
|
});
|
|
return endpointOptions.request.hook(request2, endpointOptions);
|
|
};
|
|
return Object.assign(newApi, {
|
|
endpoint: endpoint2,
|
|
defaults: withDefaults2.bind(null, endpoint2)
|
|
});
|
|
}
|
|
var request = withDefaults2(endpoint, defaults_default);
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/graphql/dist-bundle/index.js
|
|
var VERSION3 = "0.0.0-development";
|
|
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));
|
|
__publicField(this, "name", "GraphqlResponseError");
|
|
__publicField(this, "errors");
|
|
__publicField(this, "data");
|
|
this.request = request2;
|
|
this.headers = headers;
|
|
this.response = response;
|
|
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, query, options2) {
|
|
if (options2) {
|
|
if (typeof query === "string" && "query" in options2) {
|
|
return Promise.reject(
|
|
new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
|
|
);
|
|
}
|
|
for (const key in options2) {
|
|
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
|
|
continue;
|
|
return Promise.reject(
|
|
new Error(
|
|
`[@octokit/graphql] "${key}" cannot be used as variable name`
|
|
)
|
|
);
|
|
}
|
|
}
|
|
const parsedOptions = typeof query === "string" ? Object.assign({ query }, options2) : query;
|
|
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 withDefaults3(request2, newDefaults) {
|
|
const newRequest = request2.defaults(newDefaults);
|
|
const newApi = (query, options2) => {
|
|
return graphql(newRequest, query, options2);
|
|
};
|
|
return Object.assign(newApi, {
|
|
defaults: withDefaults3.bind(null, newRequest),
|
|
endpoint: newRequest.endpoint
|
|
});
|
|
}
|
|
var graphql2 = withDefaults3(request, {
|
|
headers: {
|
|
"user-agent": `octokit-graphql.js/${VERSION3} ${getUserAgent()}`
|
|
},
|
|
method: "POST",
|
|
url: "/graphql"
|
|
});
|
|
function withCustomRequest(customRequest) {
|
|
return withDefaults3(customRequest, {
|
|
method: "POST",
|
|
url: "/graphql"
|
|
});
|
|
}
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/auth-token/dist-bundle/index.js
|
|
var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
|
var REGEX_IS_INSTALLATION = /^ghs_/;
|
|
var REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
|
function auth(token) {
|
|
return __async(this, null, function* () {
|
|
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}`;
|
|
}
|
|
function hook(token, request2, route, parameters) {
|
|
return __async(this, null, function* () {
|
|
const endpoint2 = request2.endpoint.merge(
|
|
route,
|
|
parameters
|
|
);
|
|
endpoint2.headers.authorization = withAuthorizationPrefix(token);
|
|
return request2(endpoint2);
|
|
});
|
|
}
|
|
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)
|
|
});
|
|
};
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/core/dist-src/version.js
|
|
var VERSION4 = "6.1.2";
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/core/dist-src/index.js
|
|
var noop = () => {
|
|
};
|
|
var consoleWarn = console.warn.bind(console);
|
|
var consoleError = console.error.bind(console);
|
|
var userAgentTrail = `octokit-core.js/${VERSION4} ${getUserAgent()}`;
|
|
var Octokit = class {
|
|
constructor(options2 = {}) {
|
|
// assigned during constructor
|
|
__publicField(this, "request");
|
|
__publicField(this, "graphql");
|
|
__publicField(this, "log");
|
|
__publicField(this, "hook");
|
|
// TODO: type `octokit.auth` based on passed options.authStrategy
|
|
__publicField(this, "auth");
|
|
const hook2 = new before_after_hook_default.Collection();
|
|
const requestDefaults = {
|
|
baseUrl: request.endpoint.DEFAULTS.baseUrl,
|
|
headers: {},
|
|
request: Object.assign({}, options2.request, {
|
|
// @ts-ignore internal usage only, no need to type
|
|
hook: hook2.bind(null, "request")
|
|
}),
|
|
mediaType: {
|
|
previews: [],
|
|
format: ""
|
|
}
|
|
};
|
|
requestDefaults.headers["user-agent"] = options2.userAgent ? `${options2.userAgent} ${userAgentTrail}` : userAgentTrail;
|
|
if (options2.baseUrl) {
|
|
requestDefaults.baseUrl = options2.baseUrl;
|
|
}
|
|
if (options2.previews) {
|
|
requestDefaults.mediaType.previews = options2.previews;
|
|
}
|
|
if (options2.timeZone) {
|
|
requestDefaults.headers["time-zone"] = options2.timeZone;
|
|
}
|
|
this.request = request.defaults(requestDefaults);
|
|
this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
|
|
this.log = Object.assign(
|
|
{
|
|
debug: noop,
|
|
info: noop,
|
|
warn: consoleWarn,
|
|
error: consoleError
|
|
},
|
|
options2.log
|
|
);
|
|
this.hook = hook2;
|
|
if (!options2.authStrategy) {
|
|
if (!options2.auth) {
|
|
this.auth = () => __async(this, null, function* () {
|
|
return {
|
|
type: "unauthenticated"
|
|
};
|
|
});
|
|
} else {
|
|
const auth2 = createTokenAuth(options2.auth);
|
|
hook2.wrap("request", auth2.hook);
|
|
this.auth = auth2;
|
|
}
|
|
} else {
|
|
const _a = options2, { authStrategy } = _a, otherOptions = __objRest(_a, ["authStrategy"]);
|
|
const auth2 = authStrategy(
|
|
Object.assign(
|
|
{
|
|
request: this.request,
|
|
log: this.log,
|
|
// we pass the current octokit instance as well as its constructor options
|
|
// to allow for authentication strategies that return a new octokit instance
|
|
// that shares the same internal state as the current one. The original
|
|
// requirement for this was the "event-octokit" authentication strategy
|
|
// of https://github.com/probot/octokit-auth-probot.
|
|
octokit: this,
|
|
octokitOptions: otherOptions
|
|
},
|
|
options2.auth
|
|
)
|
|
);
|
|
hook2.wrap("request", auth2.hook);
|
|
this.auth = auth2;
|
|
}
|
|
const classConstructor = this.constructor;
|
|
for (let i = 0; i < classConstructor.plugins.length; ++i) {
|
|
Object.assign(this, classConstructor.plugins[i](this, options2));
|
|
}
|
|
}
|
|
static defaults(defaults) {
|
|
const OctokitWithDefaults = class extends this {
|
|
constructor(...args) {
|
|
const options2 = args[0] || {};
|
|
if (typeof defaults === "function") {
|
|
super(defaults(options2));
|
|
return;
|
|
}
|
|
super(
|
|
Object.assign(
|
|
{},
|
|
defaults,
|
|
options2,
|
|
options2.userAgent && defaults.userAgent ? {
|
|
userAgent: `${options2.userAgent} ${defaults.userAgent}`
|
|
} : null
|
|
)
|
|
);
|
|
}
|
|
};
|
|
return OctokitWithDefaults;
|
|
}
|
|
/**
|
|
* Attach a plugin (or many) to your Octokit instance.
|
|
*
|
|
* @example
|
|
* const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
|
|
*/
|
|
static plugin(...newPlugins) {
|
|
var _a;
|
|
const currentPlugins = this.plugins;
|
|
const NewOctokit = (_a = class extends this {
|
|
}, __publicField(_a, "plugins", currentPlugins.concat(
|
|
newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
|
|
)), _a);
|
|
return NewOctokit;
|
|
}
|
|
};
|
|
__publicField(Octokit, "VERSION", VERSION4);
|
|
__publicField(Octokit, "plugins", []);
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/plugin-request-log/dist-src/version.js
|
|
var VERSION5 = "5.3.1";
|
|
|
|
// node_modules/@octokit/rest/node_modules/@octokit/plugin-request-log/dist-src/index.js
|
|
function requestLog(octokit) {
|
|
octokit.hook.wrap("request", (request2, options2) => {
|
|
octokit.log.debug("request", options2);
|
|
const start = Date.now();
|
|
const requestOptions = octokit.request.endpoint.parse(options2);
|
|
const path = requestOptions.url.replace(options2.baseUrl, "");
|
|
return request2(options2).then((response) => {
|
|
const requestId = response.headers["x-github-request-id"];
|
|
octokit.log.info(
|
|
`${requestOptions.method} ${path} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`
|
|
);
|
|
return response;
|
|
}).catch((error) => {
|
|
var _a;
|
|
const requestId = ((_a = error.response) == null ? void 0 : _a.headers["x-github-request-id"]) || "UNKNOWN";
|
|
octokit.log.error(
|
|
`${requestOptions.method} ${path} - ${error.status} with id ${requestId} in ${Date.now() - start}ms`
|
|
);
|
|
throw error;
|
|
});
|
|
});
|
|
}
|
|
requestLog.VERSION = VERSION5;
|
|
|
|
// node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
|
|
var VERSION6 = "11.3.1";
|
|
function normalizePaginatedListResponse(response) {
|
|
if (!response.data) {
|
|
return __spreadProps(__spreadValues({}, 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 options2 = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
|
|
const requestMethod = typeof route === "function" ? route : octokit.request;
|
|
const method = options2.method;
|
|
const headers = options2.headers;
|
|
let url = options2.url;
|
|
return {
|
|
[Symbol.asyncIterator]: () => ({
|
|
next() {
|
|
return __async(this, null, function* () {
|
|
if (!url)
|
|
return { done: true };
|
|
try {
|
|
const response = yield 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
|
|
});
|
|
function paginateRest(octokit) {
|
|
return {
|
|
paginate: Object.assign(paginate.bind(null, octokit), {
|
|
iterator: iterator.bind(null, octokit)
|
|
})
|
|
};
|
|
}
|
|
paginateRest.VERSION = VERSION6;
|
|
|
|
// node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
|
|
var VERSION7 = "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, endpoint2] of Object.entries(endpoints)) {
|
|
const [route, defaults, decorations] = endpoint2;
|
|
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),
|
|
// ensures method is in the cache
|
|
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 options2 = requestWithDefaults.endpoint.merge(...args);
|
|
if (decorations.mapToData) {
|
|
options2 = Object.assign({}, options2, {
|
|
data: options2[decorations.mapToData],
|
|
[decorations.mapToData]: void 0
|
|
});
|
|
return requestWithDefaults(options2);
|
|
}
|
|
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 options22 = requestWithDefaults.endpoint.merge(...args);
|
|
for (const [name, alias] of Object.entries(
|
|
decorations.renamedParameters
|
|
)) {
|
|
if (name in options22) {
|
|
octokit.log.warn(
|
|
`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
|
|
);
|
|
if (!(alias in options22)) {
|
|
options22[alias] = options22[name];
|
|
}
|
|
delete options22[name];
|
|
}
|
|
}
|
|
return requestWithDefaults(options22);
|
|
}
|
|
return requestWithDefaults(...args);
|
|
}
|
|
return Object.assign(withDecorations, requestWithDefaults);
|
|
}
|
|
function restEndpointMethods(octokit) {
|
|
const api = endpointsToMethods(octokit);
|
|
return {
|
|
rest: api
|
|
};
|
|
}
|
|
restEndpointMethods.VERSION = VERSION7;
|
|
function legacyRestEndpointMethods(octokit) {
|
|
const api = endpointsToMethods(octokit);
|
|
return __spreadProps(__spreadValues({}, api), {
|
|
rest: api
|
|
});
|
|
}
|
|
legacyRestEndpointMethods.VERSION = VERSION7;
|
|
|
|
// node_modules/@octokit/rest/dist-src/version.js
|
|
var VERSION8 = "21.0.2";
|
|
|
|
// node_modules/@octokit/rest/dist-src/index.js
|
|
var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults(
|
|
{
|
|
userAgent: `octokit-rest.js/${VERSION8}`
|
|
}
|
|
);
|
|
|
|
// src/shared-gists.ts
|
|
var import_gray_matter = __toESM(require_gray_matter());
|
|
var getBaseUrlForSharedGist = (sharedGist) => sharedGist.baseUrl || DOTCOM_BASE_URL;
|
|
var getTargetForSharedGist = (sharedGist) => getBaseUrlForSharedGist(sharedGist) === DOTCOM_BASE_URL ? "dotcom" /* Dotcom */ : "github_enterprise_server" /* GitHubEnterpriseServer */;
|
|
var getSharedGistsForFile = (fileContents, target) => {
|
|
const { data } = (0, import_gray_matter.default)(fileContents);
|
|
const gists = data.gists || [];
|
|
return gists.filter((gist) => {
|
|
if (typeof target === "undefined") {
|
|
return true;
|
|
}
|
|
return getTargetForSharedGist(gist) === target;
|
|
});
|
|
};
|
|
var upsertSharedGistForFile = (sharedGist, fileContents) => {
|
|
const { data, content } = (0, import_gray_matter.default)(fileContents);
|
|
const existingSharedGists = data.gists || [];
|
|
const matchingGist = existingSharedGists.find(
|
|
(existingSharedGist) => existingSharedGist.id === sharedGist.id
|
|
);
|
|
if (matchingGist) {
|
|
const otherGists = existingSharedGists.filter(
|
|
(existingSharedGist) => existingSharedGist !== matchingGist
|
|
);
|
|
const gists = [...otherGists, sharedGist];
|
|
const updatedData = __spreadProps(__spreadValues({}, data), { gists });
|
|
return import_gray_matter.default.stringify(content, updatedData);
|
|
} else {
|
|
const gists = [...existingSharedGists, sharedGist];
|
|
const updatedData = __spreadProps(__spreadValues({}, data), { gists });
|
|
return import_gray_matter.default.stringify(content, updatedData);
|
|
}
|
|
};
|
|
var removeSharedGistForFile = (sharedGist, fileContents) => {
|
|
const { data, content } = (0, import_gray_matter.default)(fileContents);
|
|
const existingSharedGists = data.gists || [];
|
|
const sharedGistsWithGistRemoved = existingSharedGists.filter(
|
|
(existingSharedGist) => existingSharedGist.id !== sharedGist.id
|
|
);
|
|
const updatedData = __spreadProps(__spreadValues({}, data), { gists: sharedGistsWithGistRemoved });
|
|
if (sharedGistsWithGistRemoved.length === 0) delete updatedData.gists;
|
|
return import_gray_matter.default.stringify(content, updatedData);
|
|
};
|
|
|
|
// src/storage.ts
|
|
var DOTCOM_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "share_as_gist_dotcom_access_token";
|
|
var GHES_BASE_URL_LOCAL_STORAGE_KEY = "share_as_gist_ghes_base_url";
|
|
var GHES_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "share_as_gist_ghes_access_token";
|
|
var getDotcomAccessToken = () => localStorage.getItem(DOTCOM_ACCESS_TOKEN_LOCAL_STORAGE_KEY);
|
|
var setDotcomAccessToken = (accessToken) => localStorage.setItem(DOTCOM_ACCESS_TOKEN_LOCAL_STORAGE_KEY, accessToken);
|
|
var isDotcomEnabled = () => !!getDotcomAccessToken();
|
|
var getGhesBaseUrl = () => localStorage.getItem(GHES_BASE_URL_LOCAL_STORAGE_KEY);
|
|
var setGhesBaseUrl = (baseUrl) => localStorage.setItem(GHES_BASE_URL_LOCAL_STORAGE_KEY, baseUrl);
|
|
var getGhesAccessToken = () => localStorage.getItem(GHES_ACCESS_TOKEN_LOCAL_STORAGE_KEY);
|
|
var setGhesAccessToken = (accessToken) => localStorage.setItem(GHES_ACCESS_TOKEN_LOCAL_STORAGE_KEY, accessToken);
|
|
var isGhesEnabled = () => !!getGhesBaseUrl() && !!getGhesAccessToken();
|
|
var getTargetBaseUrl = (target) => {
|
|
switch (target) {
|
|
case "dotcom" /* Dotcom */:
|
|
return DOTCOM_BASE_URL;
|
|
case "github_enterprise_server" /* GitHubEnterpriseServer */:
|
|
return getGhesBaseUrl();
|
|
}
|
|
};
|
|
var getAccessTokenForBaseUrl = (baseUrl) => {
|
|
if (baseUrl === DOTCOM_BASE_URL) {
|
|
return getDotcomAccessToken();
|
|
} else {
|
|
return getGhesAccessToken();
|
|
}
|
|
};
|
|
|
|
// src/gists.ts
|
|
var DOTCOM_BASE_URL = "https://api.github.com";
|
|
var updateGist = (opts) => __async(void 0, null, function* () {
|
|
const { sharedGist, content } = opts;
|
|
const baseUrl = getBaseUrlForSharedGist(sharedGist);
|
|
const accessToken = getAccessTokenForBaseUrl(baseUrl);
|
|
if (!accessToken) {
|
|
return {
|
|
status: "failed" /* Failed */,
|
|
sharedGist,
|
|
errorMessage: `No access token found for the ${baseUrl} target.`
|
|
};
|
|
}
|
|
try {
|
|
const octokit = new Octokit2({
|
|
auth: accessToken,
|
|
baseUrl
|
|
});
|
|
const response = yield octokit.rest.gists.update({
|
|
gist_id: sharedGist.id,
|
|
files: {
|
|
[sharedGist.filename]: { content }
|
|
}
|
|
});
|
|
return {
|
|
status: "succeeded" /* Succeeded */,
|
|
sharedGist: __spreadProps(__spreadValues({}, sharedGist), { updatedAt: response.data.updated_at }),
|
|
errorMessage: null
|
|
};
|
|
} catch (e) {
|
|
return {
|
|
status: "failed" /* Failed */,
|
|
sharedGist,
|
|
errorMessage: e.message
|
|
};
|
|
}
|
|
});
|
|
var deleteGist = (opts) => __async(void 0, null, function* () {
|
|
const { sharedGist } = opts;
|
|
const baseUrl = getBaseUrlForSharedGist(sharedGist);
|
|
const accessToken = getAccessTokenForBaseUrl(baseUrl);
|
|
if (!accessToken) {
|
|
return {
|
|
status: "failed" /* Failed */,
|
|
errorMessage: `No access token found for the ${baseUrl} target.`
|
|
};
|
|
}
|
|
try {
|
|
const octokit = new Octokit2({
|
|
auth: accessToken,
|
|
baseUrl
|
|
});
|
|
yield octokit.rest.gists.delete({
|
|
gist_id: sharedGist.id
|
|
});
|
|
return {
|
|
status: "succeeded" /* Succeeded */,
|
|
errorMessage: null
|
|
};
|
|
} catch (e) {
|
|
let errorMessage = "An unknown error occurred.";
|
|
if (e instanceof Error) {
|
|
errorMessage = e.message;
|
|
}
|
|
return {
|
|
status: "failed" /* Failed */,
|
|
errorMessage
|
|
};
|
|
}
|
|
});
|
|
var createGist = (opts) => __async(void 0, null, function* () {
|
|
try {
|
|
const { content, description, filename, isPublic, target } = opts;
|
|
const baseUrl = getTargetBaseUrl(target);
|
|
const accessToken = getAccessTokenForBaseUrl(baseUrl);
|
|
const octokit = new Octokit2({
|
|
auth: accessToken,
|
|
baseUrl
|
|
});
|
|
const response = yield octokit.rest.gists.create({
|
|
description: description || filename,
|
|
public: isPublic,
|
|
files: {
|
|
[filename]: { content }
|
|
}
|
|
});
|
|
return {
|
|
status: "succeeded" /* Succeeded */,
|
|
sharedGist: {
|
|
id: response.data.id,
|
|
url: response.data.html_url,
|
|
createdAt: response.data.created_at,
|
|
updatedAt: response.data.updated_at,
|
|
filename,
|
|
isPublic,
|
|
baseUrl
|
|
},
|
|
errorMessage: null
|
|
};
|
|
} catch (e) {
|
|
return {
|
|
status: "failed" /* Failed */,
|
|
sharedGist: null,
|
|
errorMessage: e.message
|
|
};
|
|
}
|
|
});
|
|
|
|
// main.ts
|
|
var DEFAULT_SETTINGS = {
|
|
includeFrontMatter: false,
|
|
enableUpdatingGistsAfterCreation: true,
|
|
enableAutoSaving: false,
|
|
showAutoSaveNotice: false
|
|
};
|
|
var getLatestSettings = (plugin) => __async(void 0, null, function* () {
|
|
yield plugin.loadSettings();
|
|
return plugin.settings;
|
|
});
|
|
var stripFrontMatter = (content) => (0, import_gray_matter2.default)(content).content;
|
|
var copyGistUrlEditorCallback = (opts) => () => __async(void 0, null, function* () {
|
|
const { app, plugin } = opts;
|
|
const view = app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
|
if (!view) {
|
|
return new import_obsidian.Notice("No active file");
|
|
}
|
|
const editor = view.editor;
|
|
const originalContent = editor.getValue();
|
|
const existingSharedGists = getSharedGistsForFile(originalContent);
|
|
if (existingSharedGists.length === 0) {
|
|
const { enableUpdatingGistsAfterCreation } = yield getLatestSettings(plugin);
|
|
if (!enableUpdatingGistsAfterCreation) {
|
|
return new import_obsidian.Notice(
|
|
"You need to enable 'Update gists after creation' in Settings to use this command."
|
|
);
|
|
} else {
|
|
return new import_obsidian.Notice(
|
|
"You must share this note as a gist before you can copy its URL to the clipboard."
|
|
);
|
|
}
|
|
}
|
|
if (existingSharedGists.length > 1) {
|
|
new SelectExistingGistModal(
|
|
app,
|
|
existingSharedGists,
|
|
false,
|
|
(sharedGist) => __async(void 0, null, function* () {
|
|
navigator.clipboard.writeText(sharedGist.url);
|
|
new import_obsidian.Notice("Copied gist URL to clipboard.");
|
|
})
|
|
).open();
|
|
} else {
|
|
const sharedGist = existingSharedGists[0];
|
|
navigator.clipboard.writeText(sharedGist.url);
|
|
return new import_obsidian.Notice("Copied gist URL to clipboard.");
|
|
}
|
|
});
|
|
var openGistEditorCallback = (opts) => () => __async(void 0, null, function* () {
|
|
const { app, plugin } = opts;
|
|
const view = app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
|
if (!view) {
|
|
return new import_obsidian.Notice("No active file");
|
|
}
|
|
const editor = view.editor;
|
|
const originalContent = editor.getValue();
|
|
const existingSharedGists = getSharedGistsForFile(originalContent);
|
|
if (existingSharedGists.length === 0) {
|
|
const { enableUpdatingGistsAfterCreation } = yield getLatestSettings(plugin);
|
|
if (!enableUpdatingGistsAfterCreation) {
|
|
return new import_obsidian.Notice(
|
|
"You need to enable 'Update gists after creation' in Settings to use this command."
|
|
);
|
|
} else {
|
|
return new import_obsidian.Notice(
|
|
"You must share this note as a gist before you can open its gist."
|
|
);
|
|
}
|
|
}
|
|
if (existingSharedGists.length > 1) {
|
|
new SelectExistingGistModal(
|
|
app,
|
|
existingSharedGists,
|
|
false,
|
|
(sharedGist) => __async(void 0, null, function* () {
|
|
window.open(sharedGist.url, "_blank");
|
|
})
|
|
).open();
|
|
} else {
|
|
const sharedGist = existingSharedGists[0];
|
|
window.open(sharedGist.url, "_blank");
|
|
}
|
|
});
|
|
var deleteGistEditorCallback = (opts) => () => __async(void 0, null, function* () {
|
|
const { app, plugin } = opts;
|
|
const view = app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
|
if (!view) {
|
|
return new import_obsidian.Notice("No active file");
|
|
}
|
|
const editor = view.editor;
|
|
const originalContent = editor.getValue();
|
|
const existingSharedGists = getSharedGistsForFile(originalContent);
|
|
if (existingSharedGists.length === 0) {
|
|
const { enableUpdatingGistsAfterCreation } = yield getLatestSettings(plugin);
|
|
if (!enableUpdatingGistsAfterCreation) {
|
|
return new import_obsidian.Notice(
|
|
"You need to enable 'Update gists after creation' in Settings to use this command."
|
|
);
|
|
} else {
|
|
return new import_obsidian.Notice("There are no gists associated with this note.");
|
|
}
|
|
}
|
|
if (existingSharedGists.length > 1) {
|
|
new SelectExistingGistModal(
|
|
app,
|
|
existingSharedGists,
|
|
false,
|
|
(sharedGist) => __async(void 0, null, function* () {
|
|
const result = yield deleteGist({ sharedGist });
|
|
if (result.status === "succeeded" /* Succeeded */) {
|
|
const updatedContent = removeSharedGistForFile(
|
|
sharedGist,
|
|
originalContent
|
|
);
|
|
editor.setValue(updatedContent);
|
|
new import_obsidian.Notice("Gist deleted");
|
|
} else {
|
|
new import_obsidian.Notice(`Error: ${result.errorMessage}`);
|
|
}
|
|
})
|
|
).open();
|
|
} else {
|
|
const sharedGist = existingSharedGists[0];
|
|
const result = yield deleteGist({ sharedGist });
|
|
if (result.status === "succeeded" /* Succeeded */) {
|
|
const updatedContent = removeSharedGistForFile(
|
|
sharedGist,
|
|
originalContent
|
|
);
|
|
editor.setValue(updatedContent);
|
|
new import_obsidian.Notice("Gist deleted");
|
|
} else {
|
|
new import_obsidian.Notice(`Error: ${result.errorMessage}`);
|
|
}
|
|
}
|
|
});
|
|
var shareGistEditorCallback = (opts) => () => __async(void 0, null, function* () {
|
|
const { isPublic, app, plugin, target } = opts;
|
|
const { enableUpdatingGistsAfterCreation, includeFrontMatter } = yield getLatestSettings(plugin);
|
|
const view = app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
|
if (!view) {
|
|
return new import_obsidian.Notice("No active file");
|
|
}
|
|
const editor = view.editor;
|
|
const originalContent = editor.getValue();
|
|
const filename = view.file.name;
|
|
const existingSharedGists = getSharedGistsForFile(
|
|
originalContent,
|
|
target
|
|
).filter((sharedGist) => sharedGist.isPublic === isPublic);
|
|
const gistContent = includeFrontMatter ? originalContent : stripFrontMatter(originalContent);
|
|
if (enableUpdatingGistsAfterCreation && existingSharedGists.length) {
|
|
new SelectExistingGistModal(
|
|
app,
|
|
existingSharedGists,
|
|
true,
|
|
(sharedGist) => __async(void 0, null, function* () {
|
|
if (sharedGist) {
|
|
const result = yield updateGist({
|
|
sharedGist,
|
|
content: gistContent
|
|
});
|
|
if (result.status === "succeeded" /* Succeeded */) {
|
|
navigator.clipboard.writeText(result.sharedGist.url);
|
|
new import_obsidian.Notice(
|
|
`Copied ${isPublic ? "public" : "private"} gist URL to clipboard`
|
|
);
|
|
const updatedContent = upsertSharedGistForFile(
|
|
result.sharedGist,
|
|
originalContent
|
|
);
|
|
editor.setValue(updatedContent);
|
|
} else {
|
|
new import_obsidian.Notice(`Error: ${result.errorMessage}`);
|
|
}
|
|
} else {
|
|
new SetGistDescriptionModal(app, filename, (description) => __async(void 0, null, function* () {
|
|
const result = yield createGist({
|
|
target,
|
|
content: gistContent,
|
|
description,
|
|
filename,
|
|
isPublic
|
|
});
|
|
if (result.status === "succeeded" /* Succeeded */) {
|
|
navigator.clipboard.writeText(result.sharedGist.url);
|
|
new import_obsidian.Notice(
|
|
`Copied ${isPublic ? "public" : "private"} gist URL to clipboard`
|
|
);
|
|
const updatedContent = upsertSharedGistForFile(
|
|
result.sharedGist,
|
|
originalContent
|
|
);
|
|
editor.setValue(updatedContent);
|
|
} else {
|
|
new import_obsidian.Notice(`Error: ${result.errorMessage}`);
|
|
}
|
|
})).open();
|
|
}
|
|
})
|
|
).open();
|
|
} else {
|
|
new SetGistDescriptionModal(app, filename, (description) => __async(void 0, null, function* () {
|
|
const result = yield createGist({
|
|
target,
|
|
content: gistContent,
|
|
description,
|
|
filename,
|
|
isPublic
|
|
});
|
|
if (result.status === "succeeded" /* Succeeded */) {
|
|
navigator.clipboard.writeText(result.sharedGist.url);
|
|
new import_obsidian.Notice(
|
|
`Copied ${isPublic ? "public" : "private"} gist URL to clipboard`
|
|
);
|
|
if (enableUpdatingGistsAfterCreation) {
|
|
const updatedContent = upsertSharedGistForFile(
|
|
result.sharedGist,
|
|
originalContent
|
|
);
|
|
app.vault.modify(view.file, updatedContent);
|
|
editor.refresh();
|
|
}
|
|
} else {
|
|
new import_obsidian.Notice(`GitHub API error: ${result.errorMessage}`);
|
|
}
|
|
})).open();
|
|
}
|
|
});
|
|
var documentChangedAutoSaveCallback = (opts) => __async(void 0, null, function* () {
|
|
const { plugin, file, content: rawContent } = opts;
|
|
const { includeFrontMatter, showAutoSaveNotice } = yield getLatestSettings(plugin);
|
|
const existingSharedGists = getSharedGistsForFile(rawContent);
|
|
const content = includeFrontMatter ? rawContent : stripFrontMatter(rawContent);
|
|
if (existingSharedGists.length) {
|
|
for (const sharedGist of existingSharedGists) {
|
|
const result = yield updateGist({ sharedGist, content });
|
|
if (result.status === "succeeded" /* Succeeded */) {
|
|
const updatedContent = upsertSharedGistForFile(
|
|
result.sharedGist,
|
|
rawContent
|
|
);
|
|
yield file.vault.adapter.write(file.path, updatedContent);
|
|
if (showAutoSaveNotice) {
|
|
return new import_obsidian.Notice("Gist updated");
|
|
}
|
|
} else {
|
|
return new import_obsidian.Notice(`Error: ${result.errorMessage}`);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
var hasAtLeastOneSharedGist = (editor) => {
|
|
const originalContent = editor.getValue();
|
|
const existingSharedGists = getSharedGistsForFile(originalContent);
|
|
return existingSharedGists.length > 0;
|
|
};
|
|
var ShareAsGistPlugin = class extends import_obsidian.Plugin {
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
yield this.loadSettings();
|
|
this.registerCommands();
|
|
this.addModifyCallback();
|
|
this.addSettingTab(new ShareAsGistSettingTab(this.app, this));
|
|
});
|
|
}
|
|
addEditorCommandWithCheck(opts) {
|
|
const { id, name, performCheck, callback } = opts;
|
|
this.addCommand({
|
|
id,
|
|
name,
|
|
editorCheckCallback: (checking, editor, ctx) => {
|
|
if (performCheck(editor, ctx)) {
|
|
if (checking) {
|
|
return true;
|
|
}
|
|
callback(editor, ctx);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
registerCommands() {
|
|
this.addEditorCommandWithCheck({
|
|
id: "share-as-private-dotcom-gist",
|
|
name: "Share as private gist on GitHub.com",
|
|
callback: shareGistEditorCallback({
|
|
plugin: this,
|
|
app: this.app,
|
|
isPublic: false,
|
|
target: "dotcom" /* Dotcom */
|
|
}),
|
|
performCheck: isDotcomEnabled
|
|
});
|
|
this.addEditorCommandWithCheck({
|
|
id: "share-as-public-dotcom-gist",
|
|
name: "Share as public gist on GitHub.com",
|
|
callback: shareGistEditorCallback({
|
|
plugin: this,
|
|
app: this.app,
|
|
isPublic: true,
|
|
target: "dotcom" /* Dotcom */
|
|
}),
|
|
performCheck: isDotcomEnabled
|
|
});
|
|
this.addEditorCommandWithCheck({
|
|
id: "share-as-private-ghes-gist",
|
|
name: "Share as private gist on GitHub Enterprise Server",
|
|
callback: shareGistEditorCallback({
|
|
plugin: this,
|
|
app: this.app,
|
|
isPublic: false,
|
|
target: "github_enterprise_server" /* GitHubEnterpriseServer */
|
|
}),
|
|
performCheck: isGhesEnabled
|
|
});
|
|
this.addEditorCommandWithCheck({
|
|
id: "share-as-public-ghes-gist",
|
|
name: "Share as public gist on GitHub Enterprise Server",
|
|
callback: shareGistEditorCallback({
|
|
plugin: this,
|
|
app: this.app,
|
|
isPublic: true,
|
|
target: "github_enterprise_server" /* GitHubEnterpriseServer */
|
|
}),
|
|
performCheck: isGhesEnabled
|
|
});
|
|
this.addEditorCommandWithCheck({
|
|
id: "copy-gist-url",
|
|
name: "Copy gist URL",
|
|
callback: copyGistUrlEditorCallback({
|
|
plugin: this,
|
|
app: this.app
|
|
}),
|
|
performCheck: hasAtLeastOneSharedGist
|
|
});
|
|
this.addEditorCommandWithCheck({
|
|
id: "open-gist-url",
|
|
name: "Open gist",
|
|
callback: openGistEditorCallback({
|
|
plugin: this,
|
|
app: this.app
|
|
}),
|
|
performCheck: hasAtLeastOneSharedGist
|
|
});
|
|
this.addEditorCommandWithCheck({
|
|
id: "delete-gist",
|
|
name: "Delete gist",
|
|
callback: deleteGistEditorCallback({
|
|
plugin: this,
|
|
app: this.app
|
|
}),
|
|
performCheck: hasAtLeastOneSharedGist
|
|
});
|
|
}
|
|
addModifyCallback() {
|
|
const previousContents = {};
|
|
const debouncedCallbacks = {};
|
|
this.app.vault.on("modify", (file) => __async(this, null, function* () {
|
|
const content = yield file.vault.adapter.read(file.path);
|
|
if (stripFrontMatter(content) === previousContents[file.path]) {
|
|
return;
|
|
}
|
|
previousContents[file.path] = stripFrontMatter(content);
|
|
if (!debouncedCallbacks[file.path]) {
|
|
debouncedCallbacks[file.path] = (0, import_obsidian.debounce)(
|
|
(content2, file2) => __async(this, null, function* () {
|
|
return yield documentChangedAutoSaveCallback({
|
|
plugin: this,
|
|
app: this.app,
|
|
content: content2,
|
|
file: file2
|
|
});
|
|
}),
|
|
15 * 1e3,
|
|
true
|
|
);
|
|
}
|
|
const { enableAutoSaving } = yield getLatestSettings(this);
|
|
if (enableAutoSaving) {
|
|
yield debouncedCallbacks[file.path](content, file);
|
|
}
|
|
}));
|
|
}
|
|
loadSettings() {
|
|
return __async(this, null, function* () {
|
|
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
|
|
});
|
|
}
|
|
saveSettings() {
|
|
return __async(this, null, function* () {
|
|
yield this.saveData(this.settings);
|
|
});
|
|
}
|
|
};
|
|
var SelectExistingGistModal = class extends import_obsidian.SuggestModal {
|
|
constructor(app, sharedGists, allowCreatingNewGist, onSubmit) {
|
|
super(app);
|
|
this.sharedGists = sharedGists;
|
|
this.allowCreatingNewGist = allowCreatingNewGist;
|
|
this.onSubmit = onSubmit;
|
|
}
|
|
getSuggestions() {
|
|
if (this.allowCreatingNewGist) {
|
|
return this.sharedGists.concat(null);
|
|
} else {
|
|
return this.sharedGists;
|
|
}
|
|
}
|
|
renderSuggestion(sharedGist, el) {
|
|
if (sharedGist === null) {
|
|
el.createEl("div", { text: "Create new gist" });
|
|
} else {
|
|
const targetLabel = getTargetForSharedGist(sharedGist) === "dotcom" /* Dotcom */ ? "GitHub.com" : new URL(sharedGist.baseUrl).host;
|
|
el.createEl("div", {
|
|
text: (sharedGist.isPublic ? "Public gist" : "Private gist") + ` on ${targetLabel}`
|
|
});
|
|
el.createEl("small", { text: `Created at ${sharedGist.createdAt}` });
|
|
}
|
|
}
|
|
onChooseSuggestion(sharedGist) {
|
|
this.onSubmit(sharedGist).then(() => this.close());
|
|
}
|
|
};
|
|
var SetGistDescriptionModal = class extends import_obsidian.Modal {
|
|
constructor(app, filename, onSubmit) {
|
|
super(app);
|
|
this.description = null;
|
|
this.description = filename;
|
|
this.onSubmit = onSubmit;
|
|
}
|
|
onOpen() {
|
|
const { contentEl } = this;
|
|
contentEl.createEl("h1", { text: "Set a description for your gist" });
|
|
contentEl.createEl("p", {
|
|
text: "Hit the Return key to continue",
|
|
attr: { style: "font-style: italic" }
|
|
});
|
|
new import_obsidian.Setting(contentEl).setName("Description").addTextArea((text) => {
|
|
text.inputEl.setCssStyles({ width: "100%" });
|
|
text.setValue(this.description).onChange((value) => {
|
|
this.description = value;
|
|
});
|
|
});
|
|
new import_obsidian.Setting(contentEl).addButton(
|
|
(btn) => btn.setButtonText("Create gist").setCta().onClick(() => {
|
|
this.close();
|
|
this.onSubmit(this.description);
|
|
})
|
|
);
|
|
this.scope.register([], "Enter", (evt) => {
|
|
evt.preventDefault();
|
|
if (evt.isComposing) {
|
|
return;
|
|
}
|
|
this.close();
|
|
this.onSubmit(this.description);
|
|
});
|
|
}
|
|
onClose() {
|
|
const { contentEl } = this;
|
|
contentEl.empty();
|
|
}
|
|
};
|
|
var ShareAsGistSettingTab = class extends import_obsidian.PluginSettingTab {
|
|
constructor(app, plugin) {
|
|
super(app, plugin);
|
|
this.plugin = plugin;
|
|
}
|
|
display() {
|
|
const { containerEl } = this;
|
|
const dotcomAccessToken = getDotcomAccessToken();
|
|
const ghesBaseUrl = getGhesBaseUrl();
|
|
const ghesAccessToken = getGhesAccessToken();
|
|
containerEl.empty();
|
|
containerEl.createEl("h2", { text: "Share as Gist" });
|
|
containerEl.createEl("h3", { text: "GitHub.com" });
|
|
new import_obsidian.Setting(containerEl).setName("Personal access token").setDesc(
|
|
'An access token for GitHub.com with permission to write gists. You can create one from "Settings" in your GitHub account.'
|
|
).addText(
|
|
(text) => text.setPlaceholder("Your personal access token").setValue(dotcomAccessToken).onChange((value) => __async(this, null, function* () {
|
|
setDotcomAccessToken(value);
|
|
yield this.plugin.saveSettings();
|
|
}))
|
|
);
|
|
containerEl.createEl("h3", { text: "GitHub Enterprise Server" });
|
|
new import_obsidian.Setting(containerEl).setName("Base URL").setDesc(
|
|
"The base URL for the GitHub REST API on your GitHub Enterprise Server instance. This usually ends with `/api/v3`."
|
|
).addText(
|
|
(text) => text.setPlaceholder("https://github.example.com/api/v3").setValue(ghesBaseUrl).onChange((value) => __async(this, null, function* () {
|
|
setGhesBaseUrl(value);
|
|
yield this.plugin.saveSettings();
|
|
}))
|
|
);
|
|
new import_obsidian.Setting(containerEl).setName("Personal access token").setDesc(
|
|
'An access token for your GitHub Enterprise Server instance with permission to write gists. You can create one from "Settings" in your GitHub account.'
|
|
).addText(
|
|
(text) => text.setPlaceholder("Your personal access token").setValue(ghesAccessToken).onChange((value) => __async(this, null, function* () {
|
|
setGhesAccessToken(value);
|
|
yield this.plugin.saveSettings();
|
|
}))
|
|
);
|
|
containerEl.createEl("h3", { text: "Advanced options" });
|
|
new import_obsidian.Setting(containerEl).setName("Enable updating gists after creation").setDesc(
|
|
"Whether gists should be updateable through this plugin after creation. If this is turned on, when you create a gist, you will be able to choose to update an existing gist (if one exists) or create a brand new one. To make this possible, front matter will be added to your notes to track gists that you have created. If this is turned off, a brand new gist will always be created."
|
|
).addToggle(
|
|
(toggle) => toggle.setValue(this.plugin.settings.enableUpdatingGistsAfterCreation).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.enableUpdatingGistsAfterCreation = value;
|
|
yield this.plugin.saveSettings();
|
|
}))
|
|
);
|
|
new import_obsidian.Setting(containerEl).setName("Include front matter in gists").setDesc(
|
|
"Whether the front matter should be included or stripped away when a note is shared as a gist"
|
|
).addToggle(
|
|
(toggle) => toggle.setValue(this.plugin.settings.includeFrontMatter).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.includeFrontMatter = value;
|
|
yield this.plugin.saveSettings();
|
|
}))
|
|
);
|
|
new import_obsidian.Setting(containerEl).setName("Enable auto-saving Gists after edit").setDesc("Whether to update linked gists when the document is updated").addToggle(
|
|
(toggle) => toggle.setValue(this.plugin.settings.enableAutoSaving).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.enableAutoSaving = value;
|
|
yield this.plugin.saveSettings();
|
|
}))
|
|
);
|
|
new import_obsidian.Setting(containerEl).setName("Enable auto-save notice").setDesc("Whether to show a notice when a linked gist is auto-saved").addToggle(
|
|
(toggle) => toggle.setValue(this.plugin.settings.showAutoSaveNotice).onChange((value) => __async(this, null, function* () {
|
|
this.plugin.settings.showAutoSaveNotice = value;
|
|
yield this.plugin.saveSettings();
|
|
}))
|
|
);
|
|
}
|
|
};
|
|
/*! Bundled license information:
|
|
|
|
is-extendable/index.js:
|
|
(*!
|
|
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
*
|
|
* Copyright (c) 2015, Jon Schlinkert.
|
|
* Licensed under the MIT License.
|
|
*)
|
|
|
|
strip-bom-string/index.js:
|
|
(*!
|
|
* strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
|
|
*
|
|
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
* Released under the MIT License.
|
|
*)
|
|
*/
|
|
|
|
/* nosourcemap */ |