@socketsecurity/cli-with-sentry 0.15.12 → 0.15.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/cli.js +9 -1
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/vendor.js +782 -118
- package/dist/vendor.js.map +1 -1
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +1 -1
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js.map +1 -1
- package/external/@socketsecurity/registry/lib/constants/skip-tests-by-ecosystem.js +5 -1
- package/external/@socketsecurity/registry/lib/logger.js +6 -4
- package/external/@socketsecurity/registry/lib/packages.d.ts +18 -2
- package/external/@socketsecurity/registry/lib/packages.js +47 -23
- package/external/@socketsecurity/registry/package.json +2 -2
- package/package.json +8 -8
package/dist/vendor.js
CHANGED
|
@@ -9869,11 +9869,11 @@ function requireLog() {
|
|
|
9869
9869
|
return log;
|
|
9870
9870
|
}
|
|
9871
9871
|
|
|
9872
|
-
var merge$
|
|
9872
|
+
var merge$3 = {};
|
|
9873
9873
|
|
|
9874
9874
|
var hasRequiredMerge;
|
|
9875
9875
|
function requireMerge() {
|
|
9876
|
-
if (hasRequiredMerge) return merge$
|
|
9876
|
+
if (hasRequiredMerge) return merge$3;
|
|
9877
9877
|
hasRequiredMerge = 1;
|
|
9878
9878
|
var identity = requireIdentity();
|
|
9879
9879
|
var Scalar = requireScalar();
|
|
@@ -9921,10 +9921,10 @@ function requireMerge() {
|
|
|
9921
9921
|
}
|
|
9922
9922
|
return map;
|
|
9923
9923
|
}
|
|
9924
|
-
merge$
|
|
9925
|
-
merge$
|
|
9926
|
-
merge$
|
|
9927
|
-
return merge$
|
|
9924
|
+
merge$3.addMergeToJSMap = addMergeToJSMap;
|
|
9925
|
+
merge$3.isMergeKey = isMergeKey;
|
|
9926
|
+
merge$3.merge = merge;
|
|
9927
|
+
return merge$3;
|
|
9928
9928
|
}
|
|
9929
9929
|
|
|
9930
9930
|
var hasRequiredAddPairToJSMap;
|
|
@@ -27454,9 +27454,9 @@ var parse$3 = function (tokens) {
|
|
|
27454
27454
|
return node;
|
|
27455
27455
|
};
|
|
27456
27456
|
var scan = scan$1;
|
|
27457
|
-
var parse$2 = parse$3;
|
|
27457
|
+
var parse$2$1 = parse$3;
|
|
27458
27458
|
var spdxExpressionParse = function (source) {
|
|
27459
|
-
return parse$2(scan(source));
|
|
27459
|
+
return parse$2$1(scan(source));
|
|
27460
27460
|
};
|
|
27461
27461
|
var parse$1$1 = spdxExpressionParse;
|
|
27462
27462
|
var spdxLicenseIds = require$$1$3;
|
|
@@ -29225,11 +29225,11 @@ const correctUrl = giturl => {
|
|
|
29225
29225
|
}
|
|
29226
29226
|
return giturl;
|
|
29227
29227
|
};
|
|
29228
|
-
var parseUrl$2 = (giturl, protocols) => {
|
|
29228
|
+
var parseUrl$2$1 = (giturl, protocols) => {
|
|
29229
29229
|
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
|
|
29230
29230
|
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
|
|
29231
29231
|
};
|
|
29232
|
-
const parseUrl$1$1 = parseUrl$2;
|
|
29232
|
+
const parseUrl$1$1 = parseUrl$2$1;
|
|
29233
29233
|
const isGitHubShorthand = arg => {
|
|
29234
29234
|
const firstHash = arg.indexOf('#');
|
|
29235
29235
|
const firstSlash = arg.indexOf('/');
|
|
@@ -29324,7 +29324,7 @@ const {
|
|
|
29324
29324
|
} = commonjs$1;
|
|
29325
29325
|
const hosts = hosts_1$1;
|
|
29326
29326
|
const fromUrl$2 = fromUrl$1;
|
|
29327
|
-
const parseUrl$3 = parseUrl$2;
|
|
29327
|
+
const parseUrl$3 = parseUrl$2$1;
|
|
29328
29328
|
const cache$1 = new LRUCache({
|
|
29329
29329
|
max: 1000
|
|
29330
29330
|
});
|
|
@@ -33268,7 +33268,7 @@ function isBuffer(val) {
|
|
|
33268
33268
|
}
|
|
33269
33269
|
return false;
|
|
33270
33270
|
}
|
|
33271
|
-
const isPlainObject$
|
|
33271
|
+
const isPlainObject$4 = isPlainObj;
|
|
33272
33272
|
const arrify = arrify$1;
|
|
33273
33273
|
const kindOf = kindOf$1;
|
|
33274
33274
|
const push = (obj, prop, value) => {
|
|
@@ -33325,7 +33325,7 @@ const buildOptions$1 = options => {
|
|
|
33325
33325
|
type: value
|
|
33326
33326
|
};
|
|
33327
33327
|
}
|
|
33328
|
-
if (isPlainObject$
|
|
33328
|
+
if (isPlainObject$4(value)) {
|
|
33329
33329
|
const props = value;
|
|
33330
33330
|
const {
|
|
33331
33331
|
type
|
|
@@ -44857,16 +44857,16 @@ function getUserAgent() {
|
|
|
44857
44857
|
// pkg/dist-src/defaults.js
|
|
44858
44858
|
|
|
44859
44859
|
// pkg/dist-src/version.js
|
|
44860
|
-
var VERSION$
|
|
44860
|
+
var VERSION$9 = "0.0.0-development";
|
|
44861
44861
|
|
|
44862
44862
|
// pkg/dist-src/defaults.js
|
|
44863
|
-
var userAgent = `octokit-endpoint.js/${VERSION$
|
|
44864
|
-
var DEFAULTS = {
|
|
44863
|
+
var userAgent$1 = `octokit-endpoint.js/${VERSION$9} ${getUserAgent()}`;
|
|
44864
|
+
var DEFAULTS$1 = {
|
|
44865
44865
|
method: "GET",
|
|
44866
44866
|
baseUrl: "https://api.github.com",
|
|
44867
44867
|
headers: {
|
|
44868
44868
|
accept: "application/vnd.github.v3+json",
|
|
44869
|
-
"user-agent": userAgent
|
|
44869
|
+
"user-agent": userAgent$1
|
|
44870
44870
|
},
|
|
44871
44871
|
mediaType: {
|
|
44872
44872
|
format: ""
|
|
@@ -44874,7 +44874,7 @@ var DEFAULTS = {
|
|
|
44874
44874
|
};
|
|
44875
44875
|
|
|
44876
44876
|
// pkg/dist-src/util/lowercase-keys.js
|
|
44877
|
-
function lowercaseKeys(object) {
|
|
44877
|
+
function lowercaseKeys$1(object) {
|
|
44878
44878
|
if (!object) {
|
|
44879
44879
|
return {};
|
|
44880
44880
|
}
|
|
@@ -44885,7 +44885,7 @@ function lowercaseKeys(object) {
|
|
|
44885
44885
|
}
|
|
44886
44886
|
|
|
44887
44887
|
// pkg/dist-src/util/is-plain-object.js
|
|
44888
|
-
function isPlainObject$
|
|
44888
|
+
function isPlainObject$3(value) {
|
|
44889
44889
|
if (typeof value !== "object" || value === null) return false;
|
|
44890
44890
|
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
44891
44891
|
const proto = Object.getPrototypeOf(value);
|
|
@@ -44895,13 +44895,13 @@ function isPlainObject$1(value) {
|
|
|
44895
44895
|
}
|
|
44896
44896
|
|
|
44897
44897
|
// pkg/dist-src/util/merge-deep.js
|
|
44898
|
-
function mergeDeep(defaults, options) {
|
|
44898
|
+
function mergeDeep$1(defaults, options) {
|
|
44899
44899
|
const result = Object.assign({}, defaults);
|
|
44900
44900
|
Object.keys(options).forEach(key => {
|
|
44901
|
-
if (isPlainObject$
|
|
44901
|
+
if (isPlainObject$3(options[key])) {
|
|
44902
44902
|
if (!(key in defaults)) Object.assign(result, {
|
|
44903
44903
|
[key]: options[key]
|
|
44904
|
-
});else result[key] = mergeDeep(defaults[key], options[key]);
|
|
44904
|
+
});else result[key] = mergeDeep$1(defaults[key], options[key]);
|
|
44905
44905
|
} else {
|
|
44906
44906
|
Object.assign(result, {
|
|
44907
44907
|
[key]: options[key]
|
|
@@ -44912,7 +44912,7 @@ function mergeDeep(defaults, options) {
|
|
|
44912
44912
|
}
|
|
44913
44913
|
|
|
44914
44914
|
// pkg/dist-src/util/remove-undefined-properties.js
|
|
44915
|
-
function removeUndefinedProperties(obj) {
|
|
44915
|
+
function removeUndefinedProperties$1(obj) {
|
|
44916
44916
|
for (const key in obj) {
|
|
44917
44917
|
if (obj[key] === void 0) {
|
|
44918
44918
|
delete obj[key];
|
|
@@ -44922,7 +44922,7 @@ function removeUndefinedProperties(obj) {
|
|
|
44922
44922
|
}
|
|
44923
44923
|
|
|
44924
44924
|
// pkg/dist-src/merge.js
|
|
44925
|
-
function merge$
|
|
44925
|
+
function merge$2(defaults, route, options) {
|
|
44926
44926
|
if (typeof route === "string") {
|
|
44927
44927
|
let [method, url] = route.split(" ");
|
|
44928
44928
|
options = Object.assign(url ? {
|
|
@@ -44934,10 +44934,10 @@ function merge$1(defaults, route, options) {
|
|
|
44934
44934
|
} else {
|
|
44935
44935
|
options = Object.assign({}, route);
|
|
44936
44936
|
}
|
|
44937
|
-
options.headers = lowercaseKeys(options.headers);
|
|
44938
|
-
removeUndefinedProperties(options);
|
|
44939
|
-
removeUndefinedProperties(options.headers);
|
|
44940
|
-
const mergedOptions = mergeDeep(defaults || {}, options);
|
|
44937
|
+
options.headers = lowercaseKeys$1(options.headers);
|
|
44938
|
+
removeUndefinedProperties$1(options);
|
|
44939
|
+
removeUndefinedProperties$1(options.headers);
|
|
44940
|
+
const mergedOptions = mergeDeep$1(defaults || {}, options);
|
|
44941
44941
|
if (options.url === "/graphql") {
|
|
44942
44942
|
if (defaults && defaults.mediaType.previews?.length) {
|
|
44943
44943
|
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
|
|
@@ -44948,7 +44948,7 @@ function merge$1(defaults, route, options) {
|
|
|
44948
44948
|
}
|
|
44949
44949
|
|
|
44950
44950
|
// pkg/dist-src/util/add-query-parameters.js
|
|
44951
|
-
function addQueryParameters(url, parameters) {
|
|
44951
|
+
function addQueryParameters$1(url, parameters) {
|
|
44952
44952
|
const separator = /\?/.test(url) ? "&" : "?";
|
|
44953
44953
|
const names = Object.keys(parameters);
|
|
44954
44954
|
if (names.length === 0) {
|
|
@@ -44963,20 +44963,20 @@ function addQueryParameters(url, parameters) {
|
|
|
44963
44963
|
}
|
|
44964
44964
|
|
|
44965
44965
|
// pkg/dist-src/util/extract-url-variable-names.js
|
|
44966
|
-
var urlVariableRegex = /\{[^{}}]+\}/g;
|
|
44967
|
-
function removeNonChars(variableName) {
|
|
44966
|
+
var urlVariableRegex$1 = /\{[^{}}]+\}/g;
|
|
44967
|
+
function removeNonChars$1(variableName) {
|
|
44968
44968
|
return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
|
|
44969
44969
|
}
|
|
44970
|
-
function extractUrlVariableNames(url) {
|
|
44971
|
-
const matches = url.match(urlVariableRegex);
|
|
44970
|
+
function extractUrlVariableNames$1(url) {
|
|
44971
|
+
const matches = url.match(urlVariableRegex$1);
|
|
44972
44972
|
if (!matches) {
|
|
44973
44973
|
return [];
|
|
44974
44974
|
}
|
|
44975
|
-
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
|
44975
|
+
return matches.map(removeNonChars$1).reduce((a, b) => a.concat(b), []);
|
|
44976
44976
|
}
|
|
44977
44977
|
|
|
44978
44978
|
// pkg/dist-src/util/omit.js
|
|
44979
|
-
function omit(object, keysToOmit) {
|
|
44979
|
+
function omit$1(object, keysToOmit) {
|
|
44980
44980
|
const result = {
|
|
44981
44981
|
__proto__: null
|
|
44982
44982
|
};
|
|
@@ -44989,7 +44989,7 @@ function omit(object, keysToOmit) {
|
|
|
44989
44989
|
}
|
|
44990
44990
|
|
|
44991
44991
|
// pkg/dist-src/util/url-template.js
|
|
44992
|
-
function encodeReserved(str) {
|
|
44992
|
+
function encodeReserved$1(str) {
|
|
44993
44993
|
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
|
|
44994
44994
|
if (!/%[0-9A-Fa-f]/.test(part)) {
|
|
44995
44995
|
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
@@ -44997,64 +44997,64 @@ function encodeReserved(str) {
|
|
|
44997
44997
|
return part;
|
|
44998
44998
|
}).join("");
|
|
44999
44999
|
}
|
|
45000
|
-
function encodeUnreserved(str) {
|
|
45000
|
+
function encodeUnreserved$1(str) {
|
|
45001
45001
|
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
|
45002
45002
|
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
45003
45003
|
});
|
|
45004
45004
|
}
|
|
45005
|
-
function encodeValue(operator, value, key) {
|
|
45006
|
-
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
|
|
45005
|
+
function encodeValue$1(operator, value, key) {
|
|
45006
|
+
value = operator === "+" || operator === "#" ? encodeReserved$1(value) : encodeUnreserved$1(value);
|
|
45007
45007
|
if (key) {
|
|
45008
|
-
return encodeUnreserved(key) + "=" + value;
|
|
45008
|
+
return encodeUnreserved$1(key) + "=" + value;
|
|
45009
45009
|
} else {
|
|
45010
45010
|
return value;
|
|
45011
45011
|
}
|
|
45012
45012
|
}
|
|
45013
|
-
function isDefined(value) {
|
|
45013
|
+
function isDefined$1(value) {
|
|
45014
45014
|
return value !== void 0 && value !== null;
|
|
45015
45015
|
}
|
|
45016
|
-
function isKeyOperator(operator) {
|
|
45016
|
+
function isKeyOperator$1(operator) {
|
|
45017
45017
|
return operator === ";" || operator === "&" || operator === "?";
|
|
45018
45018
|
}
|
|
45019
|
-
function getValues(context, operator, key, modifier) {
|
|
45019
|
+
function getValues$1(context, operator, key, modifier) {
|
|
45020
45020
|
var value = context[key],
|
|
45021
45021
|
result = [];
|
|
45022
|
-
if (isDefined(value) && value !== "") {
|
|
45022
|
+
if (isDefined$1(value) && value !== "") {
|
|
45023
45023
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
45024
45024
|
value = value.toString();
|
|
45025
45025
|
if (modifier && modifier !== "*") {
|
|
45026
45026
|
value = value.substring(0, parseInt(modifier, 10));
|
|
45027
45027
|
}
|
|
45028
|
-
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
|
45028
|
+
result.push(encodeValue$1(operator, value, isKeyOperator$1(operator) ? key : ""));
|
|
45029
45029
|
} else {
|
|
45030
45030
|
if (modifier === "*") {
|
|
45031
45031
|
if (Array.isArray(value)) {
|
|
45032
|
-
value.filter(isDefined).forEach(function (value2) {
|
|
45033
|
-
result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : ""));
|
|
45032
|
+
value.filter(isDefined$1).forEach(function (value2) {
|
|
45033
|
+
result.push(encodeValue$1(operator, value2, isKeyOperator$1(operator) ? key : ""));
|
|
45034
45034
|
});
|
|
45035
45035
|
} else {
|
|
45036
45036
|
Object.keys(value).forEach(function (k) {
|
|
45037
|
-
if (isDefined(value[k])) {
|
|
45038
|
-
result.push(encodeValue(operator, value[k], k));
|
|
45037
|
+
if (isDefined$1(value[k])) {
|
|
45038
|
+
result.push(encodeValue$1(operator, value[k], k));
|
|
45039
45039
|
}
|
|
45040
45040
|
});
|
|
45041
45041
|
}
|
|
45042
45042
|
} else {
|
|
45043
45043
|
const tmp = [];
|
|
45044
45044
|
if (Array.isArray(value)) {
|
|
45045
|
-
value.filter(isDefined).forEach(function (value2) {
|
|
45046
|
-
tmp.push(encodeValue(operator, value2));
|
|
45045
|
+
value.filter(isDefined$1).forEach(function (value2) {
|
|
45046
|
+
tmp.push(encodeValue$1(operator, value2));
|
|
45047
45047
|
});
|
|
45048
45048
|
} else {
|
|
45049
45049
|
Object.keys(value).forEach(function (k) {
|
|
45050
|
-
if (isDefined(value[k])) {
|
|
45051
|
-
tmp.push(encodeUnreserved(k));
|
|
45052
|
-
tmp.push(encodeValue(operator, value[k].toString()));
|
|
45050
|
+
if (isDefined$1(value[k])) {
|
|
45051
|
+
tmp.push(encodeUnreserved$1(k));
|
|
45052
|
+
tmp.push(encodeValue$1(operator, value[k].toString()));
|
|
45053
45053
|
}
|
|
45054
45054
|
});
|
|
45055
45055
|
}
|
|
45056
|
-
if (isKeyOperator(operator)) {
|
|
45057
|
-
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
|
45056
|
+
if (isKeyOperator$1(operator)) {
|
|
45057
|
+
result.push(encodeUnreserved$1(key) + "=" + tmp.join(","));
|
|
45058
45058
|
} else if (tmp.length !== 0) {
|
|
45059
45059
|
result.push(tmp.join(","));
|
|
45060
45060
|
}
|
|
@@ -45062,23 +45062,23 @@ function getValues(context, operator, key, modifier) {
|
|
|
45062
45062
|
}
|
|
45063
45063
|
} else {
|
|
45064
45064
|
if (operator === ";") {
|
|
45065
|
-
if (isDefined(value)) {
|
|
45066
|
-
result.push(encodeUnreserved(key));
|
|
45065
|
+
if (isDefined$1(value)) {
|
|
45066
|
+
result.push(encodeUnreserved$1(key));
|
|
45067
45067
|
}
|
|
45068
45068
|
} else if (value === "" && (operator === "&" || operator === "?")) {
|
|
45069
|
-
result.push(encodeUnreserved(key) + "=");
|
|
45069
|
+
result.push(encodeUnreserved$1(key) + "=");
|
|
45070
45070
|
} else if (value === "") {
|
|
45071
45071
|
result.push("");
|
|
45072
45072
|
}
|
|
45073
45073
|
}
|
|
45074
45074
|
return result;
|
|
45075
45075
|
}
|
|
45076
|
-
function parseUrl$
|
|
45076
|
+
function parseUrl$2(template) {
|
|
45077
45077
|
return {
|
|
45078
|
-
expand: expand.bind(null, template)
|
|
45078
|
+
expand: expand$1.bind(null, template)
|
|
45079
45079
|
};
|
|
45080
45080
|
}
|
|
45081
|
-
function expand(template, context) {
|
|
45081
|
+
function expand$1(template, context) {
|
|
45082
45082
|
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
|
45083
45083
|
template = template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
|
45084
45084
|
if (expression) {
|
|
@@ -45090,7 +45090,7 @@ function expand(template, context) {
|
|
|
45090
45090
|
}
|
|
45091
45091
|
expression.split(/,/g).forEach(function (variable) {
|
|
45092
45092
|
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
|
45093
|
-
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
|
45093
|
+
values.push(getValues$1(context, operator, tmp[1], tmp[2] || tmp[3]));
|
|
45094
45094
|
});
|
|
45095
45095
|
if (operator && operator !== "+") {
|
|
45096
45096
|
var separator = ",";
|
|
@@ -45104,7 +45104,7 @@ function expand(template, context) {
|
|
|
45104
45104
|
return values.join(",");
|
|
45105
45105
|
}
|
|
45106
45106
|
} else {
|
|
45107
|
-
return encodeReserved(literal);
|
|
45107
|
+
return encodeReserved$1(literal);
|
|
45108
45108
|
}
|
|
45109
45109
|
});
|
|
45110
45110
|
if (template === "/") {
|
|
@@ -45115,19 +45115,19 @@ function expand(template, context) {
|
|
|
45115
45115
|
}
|
|
45116
45116
|
|
|
45117
45117
|
// pkg/dist-src/parse.js
|
|
45118
|
-
function parse$
|
|
45118
|
+
function parse$2(options) {
|
|
45119
45119
|
let method = options.method.toUpperCase();
|
|
45120
45120
|
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
45121
45121
|
let headers = Object.assign({}, options.headers);
|
|
45122
45122
|
let body;
|
|
45123
|
-
let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]);
|
|
45124
|
-
const urlVariableNames = extractUrlVariableNames(url);
|
|
45125
|
-
url = parseUrl$
|
|
45123
|
+
let parameters = omit$1(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]);
|
|
45124
|
+
const urlVariableNames = extractUrlVariableNames$1(url);
|
|
45125
|
+
url = parseUrl$2(url).expand(parameters);
|
|
45126
45126
|
if (!/^http/.test(url)) {
|
|
45127
45127
|
url = options.baseUrl + url;
|
|
45128
45128
|
}
|
|
45129
45129
|
const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
|
|
45130
|
-
const remainingParameters = omit(parameters, omittedParameters);
|
|
45130
|
+
const remainingParameters = omit$1(parameters, omittedParameters);
|
|
45131
45131
|
const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
|
|
45132
45132
|
if (!isBinaryRequest) {
|
|
45133
45133
|
if (options.mediaType.format) {
|
|
@@ -45144,7 +45144,7 @@ function parse$1(options) {
|
|
|
45144
45144
|
}
|
|
45145
45145
|
}
|
|
45146
45146
|
if (["GET", "HEAD"].includes(method)) {
|
|
45147
|
-
url = addQueryParameters(url, remainingParameters);
|
|
45147
|
+
url = addQueryParameters$1(url, remainingParameters);
|
|
45148
45148
|
} else {
|
|
45149
45149
|
if ("data" in remainingParameters) {
|
|
45150
45150
|
body = remainingParameters.data;
|
|
@@ -45172,31 +45172,31 @@ function parse$1(options) {
|
|
|
45172
45172
|
}
|
|
45173
45173
|
|
|
45174
45174
|
// pkg/dist-src/endpoint-with-defaults.js
|
|
45175
|
-
function endpointWithDefaults(defaults, route, options) {
|
|
45176
|
-
return parse$
|
|
45175
|
+
function endpointWithDefaults$1(defaults, route, options) {
|
|
45176
|
+
return parse$2(merge$2(defaults, route, options));
|
|
45177
45177
|
}
|
|
45178
45178
|
|
|
45179
45179
|
// pkg/dist-src/with-defaults.js
|
|
45180
|
-
function withDefaults$
|
|
45181
|
-
const DEFAULTS2 = merge$
|
|
45182
|
-
const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
|
|
45180
|
+
function withDefaults$4(oldDefaults, newDefaults) {
|
|
45181
|
+
const DEFAULTS2 = merge$2(oldDefaults, newDefaults);
|
|
45182
|
+
const endpoint2 = endpointWithDefaults$1.bind(null, DEFAULTS2);
|
|
45183
45183
|
return Object.assign(endpoint2, {
|
|
45184
45184
|
DEFAULTS: DEFAULTS2,
|
|
45185
|
-
defaults: withDefaults$
|
|
45186
|
-
merge: merge$
|
|
45187
|
-
parse: parse$
|
|
45185
|
+
defaults: withDefaults$4.bind(null, DEFAULTS2),
|
|
45186
|
+
merge: merge$2.bind(null, DEFAULTS2),
|
|
45187
|
+
parse: parse$2
|
|
45188
45188
|
});
|
|
45189
45189
|
}
|
|
45190
45190
|
|
|
45191
45191
|
// pkg/dist-src/index.js
|
|
45192
|
-
var endpoint = withDefaults$
|
|
45192
|
+
var endpoint$1 = withDefaults$4(null, DEFAULTS$1);
|
|
45193
45193
|
|
|
45194
|
-
var fastContentTypeParse = {};
|
|
45194
|
+
var fastContentTypeParse$1 = {};
|
|
45195
45195
|
|
|
45196
|
-
var hasRequiredFastContentTypeParse;
|
|
45197
|
-
function requireFastContentTypeParse() {
|
|
45198
|
-
if (hasRequiredFastContentTypeParse) return fastContentTypeParse;
|
|
45199
|
-
hasRequiredFastContentTypeParse = 1;
|
|
45196
|
+
var hasRequiredFastContentTypeParse$1;
|
|
45197
|
+
function requireFastContentTypeParse$1() {
|
|
45198
|
+
if (hasRequiredFastContentTypeParse$1) return fastContentTypeParse$1;
|
|
45199
|
+
hasRequiredFastContentTypeParse$1 = 1;
|
|
45200
45200
|
const NullObject = function NullObject() {};
|
|
45201
45201
|
NullObject.prototype = Object.create(null);
|
|
45202
45202
|
|
|
@@ -45331,17 +45331,17 @@ function requireFastContentTypeParse() {
|
|
|
45331
45331
|
}
|
|
45332
45332
|
return result;
|
|
45333
45333
|
}
|
|
45334
|
-
fastContentTypeParse.default = {
|
|
45334
|
+
fastContentTypeParse$1.default = {
|
|
45335
45335
|
parse,
|
|
45336
45336
|
safeParse
|
|
45337
45337
|
};
|
|
45338
|
-
fastContentTypeParse.parse = parse;
|
|
45339
|
-
fastContentTypeParse.safeParse = safeParse;
|
|
45340
|
-
fastContentTypeParse.defaultContentType = defaultContentType;
|
|
45341
|
-
return fastContentTypeParse;
|
|
45338
|
+
fastContentTypeParse$1.parse = parse;
|
|
45339
|
+
fastContentTypeParse$1.safeParse = safeParse;
|
|
45340
|
+
fastContentTypeParse$1.defaultContentType = defaultContentType;
|
|
45341
|
+
return fastContentTypeParse$1;
|
|
45342
45342
|
}
|
|
45343
45343
|
|
|
45344
|
-
var fastContentTypeParseExports = requireFastContentTypeParse();
|
|
45344
|
+
var fastContentTypeParseExports$1 = requireFastContentTypeParse$1();
|
|
45345
45345
|
|
|
45346
45346
|
class RequestError extends Error {
|
|
45347
45347
|
name;
|
|
@@ -45381,17 +45381,17 @@ class RequestError extends Error {
|
|
|
45381
45381
|
// pkg/dist-src/index.js
|
|
45382
45382
|
|
|
45383
45383
|
// pkg/dist-src/version.js
|
|
45384
|
-
var VERSION$
|
|
45384
|
+
var VERSION$8 = "0.0.0-development";
|
|
45385
45385
|
|
|
45386
45386
|
// pkg/dist-src/defaults.js
|
|
45387
|
-
var defaults_default = {
|
|
45387
|
+
var defaults_default$1 = {
|
|
45388
45388
|
headers: {
|
|
45389
|
-
"user-agent": `octokit-request.js/${VERSION$
|
|
45389
|
+
"user-agent": `octokit-request.js/${VERSION$8} ${getUserAgent()}`
|
|
45390
45390
|
}
|
|
45391
45391
|
};
|
|
45392
45392
|
|
|
45393
45393
|
// pkg/dist-src/is-plain-object.js
|
|
45394
|
-
function isPlainObject(value) {
|
|
45394
|
+
function isPlainObject$2(value) {
|
|
45395
45395
|
if (typeof value !== "object" || value === null) return false;
|
|
45396
45396
|
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
45397
45397
|
const proto = Object.getPrototypeOf(value);
|
|
@@ -45399,14 +45399,14 @@ function isPlainObject(value) {
|
|
|
45399
45399
|
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
45400
45400
|
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
45401
45401
|
}
|
|
45402
|
-
async function fetchWrapper(requestOptions) {
|
|
45402
|
+
async function fetchWrapper$1(requestOptions) {
|
|
45403
45403
|
const fetch = requestOptions.request?.fetch || globalThis.fetch;
|
|
45404
45404
|
if (!fetch) {
|
|
45405
45405
|
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");
|
|
45406
45406
|
}
|
|
45407
45407
|
const log = requestOptions.request?.log || console;
|
|
45408
45408
|
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
45409
|
-
const body = isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
|
|
45409
|
+
const body = isPlainObject$2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
|
|
45410
45410
|
const requestHeaders = Object.fromEntries(Object.entries(requestOptions.headers).map(([name, value]) => [name, String(value)]));
|
|
45411
45411
|
let fetchResponse;
|
|
45412
45412
|
try {
|
|
@@ -45474,29 +45474,29 @@ async function fetchWrapper(requestOptions) {
|
|
|
45474
45474
|
});
|
|
45475
45475
|
}
|
|
45476
45476
|
if (status === 304) {
|
|
45477
|
-
octokitResponse.data = await getResponseData(fetchResponse);
|
|
45477
|
+
octokitResponse.data = await getResponseData$1(fetchResponse);
|
|
45478
45478
|
throw new RequestError("Not modified", status, {
|
|
45479
45479
|
response: octokitResponse,
|
|
45480
45480
|
request: requestOptions
|
|
45481
45481
|
});
|
|
45482
45482
|
}
|
|
45483
45483
|
if (status >= 400) {
|
|
45484
|
-
octokitResponse.data = await getResponseData(fetchResponse);
|
|
45485
|
-
throw new RequestError(toErrorMessage(octokitResponse.data), status, {
|
|
45484
|
+
octokitResponse.data = await getResponseData$1(fetchResponse);
|
|
45485
|
+
throw new RequestError(toErrorMessage$1(octokitResponse.data), status, {
|
|
45486
45486
|
response: octokitResponse,
|
|
45487
45487
|
request: requestOptions
|
|
45488
45488
|
});
|
|
45489
45489
|
}
|
|
45490
|
-
octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
|
|
45490
|
+
octokitResponse.data = parseSuccessResponseBody ? await getResponseData$1(fetchResponse) : fetchResponse.body;
|
|
45491
45491
|
return octokitResponse;
|
|
45492
45492
|
}
|
|
45493
|
-
async function getResponseData(response) {
|
|
45493
|
+
async function getResponseData$1(response) {
|
|
45494
45494
|
const contentType = response.headers.get("content-type");
|
|
45495
45495
|
if (!contentType) {
|
|
45496
45496
|
return response.text().catch(() => "");
|
|
45497
45497
|
}
|
|
45498
|
-
const mimetype = fastContentTypeParseExports.safeParse(contentType);
|
|
45499
|
-
if (isJSONResponse(mimetype)) {
|
|
45498
|
+
const mimetype = fastContentTypeParseExports$1.safeParse(contentType);
|
|
45499
|
+
if (isJSONResponse$1(mimetype)) {
|
|
45500
45500
|
let text = "";
|
|
45501
45501
|
try {
|
|
45502
45502
|
text = await response.text();
|
|
@@ -45510,10 +45510,10 @@ async function getResponseData(response) {
|
|
|
45510
45510
|
return response.arrayBuffer().catch(() => new ArrayBuffer(0));
|
|
45511
45511
|
}
|
|
45512
45512
|
}
|
|
45513
|
-
function isJSONResponse(mimetype) {
|
|
45513
|
+
function isJSONResponse$1(mimetype) {
|
|
45514
45514
|
return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
|
|
45515
45515
|
}
|
|
45516
|
-
function toErrorMessage(data) {
|
|
45516
|
+
function toErrorMessage$1(data) {
|
|
45517
45517
|
if (typeof data === "string") {
|
|
45518
45518
|
return data;
|
|
45519
45519
|
}
|
|
@@ -45528,35 +45528,35 @@ function toErrorMessage(data) {
|
|
|
45528
45528
|
}
|
|
45529
45529
|
|
|
45530
45530
|
// pkg/dist-src/with-defaults.js
|
|
45531
|
-
function withDefaults$
|
|
45531
|
+
function withDefaults$3(oldEndpoint, newDefaults) {
|
|
45532
45532
|
const endpoint2 = oldEndpoint.defaults(newDefaults);
|
|
45533
45533
|
const newApi = function (route, parameters) {
|
|
45534
45534
|
const endpointOptions = endpoint2.merge(route, parameters);
|
|
45535
45535
|
if (!endpointOptions.request || !endpointOptions.request.hook) {
|
|
45536
|
-
return fetchWrapper(endpoint2.parse(endpointOptions));
|
|
45536
|
+
return fetchWrapper$1(endpoint2.parse(endpointOptions));
|
|
45537
45537
|
}
|
|
45538
45538
|
const request2 = (route2, parameters2) => {
|
|
45539
|
-
return fetchWrapper(endpoint2.parse(endpoint2.merge(route2, parameters2)));
|
|
45539
|
+
return fetchWrapper$1(endpoint2.parse(endpoint2.merge(route2, parameters2)));
|
|
45540
45540
|
};
|
|
45541
45541
|
Object.assign(request2, {
|
|
45542
45542
|
endpoint: endpoint2,
|
|
45543
|
-
defaults: withDefaults$
|
|
45543
|
+
defaults: withDefaults$3.bind(null, endpoint2)
|
|
45544
45544
|
});
|
|
45545
45545
|
return endpointOptions.request.hook(request2, endpointOptions);
|
|
45546
45546
|
};
|
|
45547
45547
|
return Object.assign(newApi, {
|
|
45548
45548
|
endpoint: endpoint2,
|
|
45549
|
-
defaults: withDefaults$
|
|
45549
|
+
defaults: withDefaults$3.bind(null, endpoint2)
|
|
45550
45550
|
});
|
|
45551
45551
|
}
|
|
45552
45552
|
|
|
45553
45553
|
// pkg/dist-src/index.js
|
|
45554
|
-
var request = withDefaults$
|
|
45554
|
+
var request$1 = withDefaults$3(endpoint$1, defaults_default$1);
|
|
45555
45555
|
|
|
45556
45556
|
// pkg/dist-src/index.js
|
|
45557
45557
|
|
|
45558
45558
|
// pkg/dist-src/version.js
|
|
45559
|
-
var VERSION$
|
|
45559
|
+
var VERSION$7 = "0.0.0-development";
|
|
45560
45560
|
|
|
45561
45561
|
// pkg/dist-src/error.js
|
|
45562
45562
|
function _buildMessageForResponseErrors(data) {
|
|
@@ -45625,27 +45625,27 @@ function graphql(request2, query, options) {
|
|
|
45625
45625
|
}
|
|
45626
45626
|
|
|
45627
45627
|
// pkg/dist-src/with-defaults.js
|
|
45628
|
-
function withDefaults(request2, newDefaults) {
|
|
45628
|
+
function withDefaults$2(request2, newDefaults) {
|
|
45629
45629
|
const newRequest = request2.defaults(newDefaults);
|
|
45630
45630
|
const newApi = (query, options) => {
|
|
45631
45631
|
return graphql(newRequest, query, options);
|
|
45632
45632
|
};
|
|
45633
45633
|
return Object.assign(newApi, {
|
|
45634
|
-
defaults: withDefaults.bind(null, newRequest),
|
|
45634
|
+
defaults: withDefaults$2.bind(null, newRequest),
|
|
45635
45635
|
endpoint: newRequest.endpoint
|
|
45636
45636
|
});
|
|
45637
45637
|
}
|
|
45638
45638
|
|
|
45639
45639
|
// pkg/dist-src/index.js
|
|
45640
|
-
var graphql2 = withDefaults(request, {
|
|
45640
|
+
var graphql2 = withDefaults$2(request$1, {
|
|
45641
45641
|
headers: {
|
|
45642
|
-
"user-agent": `octokit-graphql.js/${VERSION$
|
|
45642
|
+
"user-agent": `octokit-graphql.js/${VERSION$7} ${getUserAgent()}`
|
|
45643
45643
|
},
|
|
45644
45644
|
method: "POST",
|
|
45645
45645
|
url: "/graphql"
|
|
45646
45646
|
});
|
|
45647
45647
|
function withCustomRequest(customRequest) {
|
|
45648
|
-
return withDefaults(customRequest, {
|
|
45648
|
+
return withDefaults$2(customRequest, {
|
|
45649
45649
|
method: "POST",
|
|
45650
45650
|
url: "/graphql"
|
|
45651
45651
|
});
|
|
@@ -45755,6 +45755,670 @@ var Hook = {
|
|
|
45755
45755
|
Collection
|
|
45756
45756
|
};
|
|
45757
45757
|
|
|
45758
|
+
// pkg/dist-src/defaults.js
|
|
45759
|
+
|
|
45760
|
+
// pkg/dist-src/version.js
|
|
45761
|
+
var VERSION$6 = "0.0.0-development";
|
|
45762
|
+
|
|
45763
|
+
// pkg/dist-src/defaults.js
|
|
45764
|
+
var userAgent = `octokit-endpoint.js/${VERSION$6} ${getUserAgent()}`;
|
|
45765
|
+
var DEFAULTS = {
|
|
45766
|
+
method: "GET",
|
|
45767
|
+
baseUrl: "https://api.github.com",
|
|
45768
|
+
headers: {
|
|
45769
|
+
accept: "application/vnd.github.v3+json",
|
|
45770
|
+
"user-agent": userAgent
|
|
45771
|
+
},
|
|
45772
|
+
mediaType: {
|
|
45773
|
+
format: ""
|
|
45774
|
+
}
|
|
45775
|
+
};
|
|
45776
|
+
|
|
45777
|
+
// pkg/dist-src/util/lowercase-keys.js
|
|
45778
|
+
function lowercaseKeys(object) {
|
|
45779
|
+
if (!object) {
|
|
45780
|
+
return {};
|
|
45781
|
+
}
|
|
45782
|
+
return Object.keys(object).reduce((newObj, key) => {
|
|
45783
|
+
newObj[key.toLowerCase()] = object[key];
|
|
45784
|
+
return newObj;
|
|
45785
|
+
}, {});
|
|
45786
|
+
}
|
|
45787
|
+
|
|
45788
|
+
// pkg/dist-src/util/is-plain-object.js
|
|
45789
|
+
function isPlainObject$1(value) {
|
|
45790
|
+
if (typeof value !== "object" || value === null) return false;
|
|
45791
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
45792
|
+
const proto = Object.getPrototypeOf(value);
|
|
45793
|
+
if (proto === null) return true;
|
|
45794
|
+
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
45795
|
+
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
45796
|
+
}
|
|
45797
|
+
|
|
45798
|
+
// pkg/dist-src/util/merge-deep.js
|
|
45799
|
+
function mergeDeep(defaults, options) {
|
|
45800
|
+
const result = Object.assign({}, defaults);
|
|
45801
|
+
Object.keys(options).forEach(key => {
|
|
45802
|
+
if (isPlainObject$1(options[key])) {
|
|
45803
|
+
if (!(key in defaults)) Object.assign(result, {
|
|
45804
|
+
[key]: options[key]
|
|
45805
|
+
});else result[key] = mergeDeep(defaults[key], options[key]);
|
|
45806
|
+
} else {
|
|
45807
|
+
Object.assign(result, {
|
|
45808
|
+
[key]: options[key]
|
|
45809
|
+
});
|
|
45810
|
+
}
|
|
45811
|
+
});
|
|
45812
|
+
return result;
|
|
45813
|
+
}
|
|
45814
|
+
|
|
45815
|
+
// pkg/dist-src/util/remove-undefined-properties.js
|
|
45816
|
+
function removeUndefinedProperties(obj) {
|
|
45817
|
+
for (const key in obj) {
|
|
45818
|
+
if (obj[key] === void 0) {
|
|
45819
|
+
delete obj[key];
|
|
45820
|
+
}
|
|
45821
|
+
}
|
|
45822
|
+
return obj;
|
|
45823
|
+
}
|
|
45824
|
+
|
|
45825
|
+
// pkg/dist-src/merge.js
|
|
45826
|
+
function merge$1(defaults, route, options) {
|
|
45827
|
+
if (typeof route === "string") {
|
|
45828
|
+
let [method, url] = route.split(" ");
|
|
45829
|
+
options = Object.assign(url ? {
|
|
45830
|
+
method,
|
|
45831
|
+
url
|
|
45832
|
+
} : {
|
|
45833
|
+
url: method
|
|
45834
|
+
}, options);
|
|
45835
|
+
} else {
|
|
45836
|
+
options = Object.assign({}, route);
|
|
45837
|
+
}
|
|
45838
|
+
options.headers = lowercaseKeys(options.headers);
|
|
45839
|
+
removeUndefinedProperties(options);
|
|
45840
|
+
removeUndefinedProperties(options.headers);
|
|
45841
|
+
const mergedOptions = mergeDeep(defaults || {}, options);
|
|
45842
|
+
if (options.url === "/graphql") {
|
|
45843
|
+
if (defaults && defaults.mediaType.previews?.length) {
|
|
45844
|
+
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
|
|
45845
|
+
}
|
|
45846
|
+
mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map(preview => preview.replace(/-preview/, ""));
|
|
45847
|
+
}
|
|
45848
|
+
return mergedOptions;
|
|
45849
|
+
}
|
|
45850
|
+
|
|
45851
|
+
// pkg/dist-src/util/add-query-parameters.js
|
|
45852
|
+
function addQueryParameters(url, parameters) {
|
|
45853
|
+
const separator = /\?/.test(url) ? "&" : "?";
|
|
45854
|
+
const names = Object.keys(parameters);
|
|
45855
|
+
if (names.length === 0) {
|
|
45856
|
+
return url;
|
|
45857
|
+
}
|
|
45858
|
+
return url + separator + names.map(name => {
|
|
45859
|
+
if (name === "q") {
|
|
45860
|
+
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
|
|
45861
|
+
}
|
|
45862
|
+
return `${name}=${encodeURIComponent(parameters[name])}`;
|
|
45863
|
+
}).join("&");
|
|
45864
|
+
}
|
|
45865
|
+
|
|
45866
|
+
// pkg/dist-src/util/extract-url-variable-names.js
|
|
45867
|
+
var urlVariableRegex = /\{[^{}}]+\}/g;
|
|
45868
|
+
function removeNonChars(variableName) {
|
|
45869
|
+
return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
|
|
45870
|
+
}
|
|
45871
|
+
function extractUrlVariableNames(url) {
|
|
45872
|
+
const matches = url.match(urlVariableRegex);
|
|
45873
|
+
if (!matches) {
|
|
45874
|
+
return [];
|
|
45875
|
+
}
|
|
45876
|
+
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
|
45877
|
+
}
|
|
45878
|
+
|
|
45879
|
+
// pkg/dist-src/util/omit.js
|
|
45880
|
+
function omit(object, keysToOmit) {
|
|
45881
|
+
const result = {
|
|
45882
|
+
__proto__: null
|
|
45883
|
+
};
|
|
45884
|
+
for (const key of Object.keys(object)) {
|
|
45885
|
+
if (keysToOmit.indexOf(key) === -1) {
|
|
45886
|
+
result[key] = object[key];
|
|
45887
|
+
}
|
|
45888
|
+
}
|
|
45889
|
+
return result;
|
|
45890
|
+
}
|
|
45891
|
+
|
|
45892
|
+
// pkg/dist-src/util/url-template.js
|
|
45893
|
+
function encodeReserved(str) {
|
|
45894
|
+
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
|
|
45895
|
+
if (!/%[0-9A-Fa-f]/.test(part)) {
|
|
45896
|
+
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
45897
|
+
}
|
|
45898
|
+
return part;
|
|
45899
|
+
}).join("");
|
|
45900
|
+
}
|
|
45901
|
+
function encodeUnreserved(str) {
|
|
45902
|
+
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
|
45903
|
+
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
45904
|
+
});
|
|
45905
|
+
}
|
|
45906
|
+
function encodeValue(operator, value, key) {
|
|
45907
|
+
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
|
|
45908
|
+
if (key) {
|
|
45909
|
+
return encodeUnreserved(key) + "=" + value;
|
|
45910
|
+
} else {
|
|
45911
|
+
return value;
|
|
45912
|
+
}
|
|
45913
|
+
}
|
|
45914
|
+
function isDefined(value) {
|
|
45915
|
+
return value !== void 0 && value !== null;
|
|
45916
|
+
}
|
|
45917
|
+
function isKeyOperator(operator) {
|
|
45918
|
+
return operator === ";" || operator === "&" || operator === "?";
|
|
45919
|
+
}
|
|
45920
|
+
function getValues(context, operator, key, modifier) {
|
|
45921
|
+
var value = context[key],
|
|
45922
|
+
result = [];
|
|
45923
|
+
if (isDefined(value) && value !== "") {
|
|
45924
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
45925
|
+
value = value.toString();
|
|
45926
|
+
if (modifier && modifier !== "*") {
|
|
45927
|
+
value = value.substring(0, parseInt(modifier, 10));
|
|
45928
|
+
}
|
|
45929
|
+
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
|
|
45930
|
+
} else {
|
|
45931
|
+
if (modifier === "*") {
|
|
45932
|
+
if (Array.isArray(value)) {
|
|
45933
|
+
value.filter(isDefined).forEach(function (value2) {
|
|
45934
|
+
result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : ""));
|
|
45935
|
+
});
|
|
45936
|
+
} else {
|
|
45937
|
+
Object.keys(value).forEach(function (k) {
|
|
45938
|
+
if (isDefined(value[k])) {
|
|
45939
|
+
result.push(encodeValue(operator, value[k], k));
|
|
45940
|
+
}
|
|
45941
|
+
});
|
|
45942
|
+
}
|
|
45943
|
+
} else {
|
|
45944
|
+
const tmp = [];
|
|
45945
|
+
if (Array.isArray(value)) {
|
|
45946
|
+
value.filter(isDefined).forEach(function (value2) {
|
|
45947
|
+
tmp.push(encodeValue(operator, value2));
|
|
45948
|
+
});
|
|
45949
|
+
} else {
|
|
45950
|
+
Object.keys(value).forEach(function (k) {
|
|
45951
|
+
if (isDefined(value[k])) {
|
|
45952
|
+
tmp.push(encodeUnreserved(k));
|
|
45953
|
+
tmp.push(encodeValue(operator, value[k].toString()));
|
|
45954
|
+
}
|
|
45955
|
+
});
|
|
45956
|
+
}
|
|
45957
|
+
if (isKeyOperator(operator)) {
|
|
45958
|
+
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
|
45959
|
+
} else if (tmp.length !== 0) {
|
|
45960
|
+
result.push(tmp.join(","));
|
|
45961
|
+
}
|
|
45962
|
+
}
|
|
45963
|
+
}
|
|
45964
|
+
} else {
|
|
45965
|
+
if (operator === ";") {
|
|
45966
|
+
if (isDefined(value)) {
|
|
45967
|
+
result.push(encodeUnreserved(key));
|
|
45968
|
+
}
|
|
45969
|
+
} else if (value === "" && (operator === "&" || operator === "?")) {
|
|
45970
|
+
result.push(encodeUnreserved(key) + "=");
|
|
45971
|
+
} else if (value === "") {
|
|
45972
|
+
result.push("");
|
|
45973
|
+
}
|
|
45974
|
+
}
|
|
45975
|
+
return result;
|
|
45976
|
+
}
|
|
45977
|
+
function parseUrl$1(template) {
|
|
45978
|
+
return {
|
|
45979
|
+
expand: expand.bind(null, template)
|
|
45980
|
+
};
|
|
45981
|
+
}
|
|
45982
|
+
function expand(template, context) {
|
|
45983
|
+
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
|
45984
|
+
template = template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
|
|
45985
|
+
if (expression) {
|
|
45986
|
+
let operator = "";
|
|
45987
|
+
const values = [];
|
|
45988
|
+
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
|
45989
|
+
operator = expression.charAt(0);
|
|
45990
|
+
expression = expression.substr(1);
|
|
45991
|
+
}
|
|
45992
|
+
expression.split(/,/g).forEach(function (variable) {
|
|
45993
|
+
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
|
45994
|
+
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
|
45995
|
+
});
|
|
45996
|
+
if (operator && operator !== "+") {
|
|
45997
|
+
var separator = ",";
|
|
45998
|
+
if (operator === "?") {
|
|
45999
|
+
separator = "&";
|
|
46000
|
+
} else if (operator !== "#") {
|
|
46001
|
+
separator = operator;
|
|
46002
|
+
}
|
|
46003
|
+
return (values.length !== 0 ? operator : "") + values.join(separator);
|
|
46004
|
+
} else {
|
|
46005
|
+
return values.join(",");
|
|
46006
|
+
}
|
|
46007
|
+
} else {
|
|
46008
|
+
return encodeReserved(literal);
|
|
46009
|
+
}
|
|
46010
|
+
});
|
|
46011
|
+
if (template === "/") {
|
|
46012
|
+
return template;
|
|
46013
|
+
} else {
|
|
46014
|
+
return template.replace(/\/$/, "");
|
|
46015
|
+
}
|
|
46016
|
+
}
|
|
46017
|
+
|
|
46018
|
+
// pkg/dist-src/parse.js
|
|
46019
|
+
function parse$1(options) {
|
|
46020
|
+
let method = options.method.toUpperCase();
|
|
46021
|
+
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
46022
|
+
let headers = Object.assign({}, options.headers);
|
|
46023
|
+
let body;
|
|
46024
|
+
let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]);
|
|
46025
|
+
const urlVariableNames = extractUrlVariableNames(url);
|
|
46026
|
+
url = parseUrl$1(url).expand(parameters);
|
|
46027
|
+
if (!/^http/.test(url)) {
|
|
46028
|
+
url = options.baseUrl + url;
|
|
46029
|
+
}
|
|
46030
|
+
const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
|
|
46031
|
+
const remainingParameters = omit(parameters, omittedParameters);
|
|
46032
|
+
const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
|
|
46033
|
+
if (!isBinaryRequest) {
|
|
46034
|
+
if (options.mediaType.format) {
|
|
46035
|
+
headers.accept = headers.accept.split(/,/).map(format => format.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
|
|
46036
|
+
}
|
|
46037
|
+
if (url.endsWith("/graphql")) {
|
|
46038
|
+
if (options.mediaType.previews?.length) {
|
|
46039
|
+
const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
|
|
46040
|
+
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
|
|
46041
|
+
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
|
|
46042
|
+
return `application/vnd.github.${preview}-preview${format}`;
|
|
46043
|
+
}).join(",");
|
|
46044
|
+
}
|
|
46045
|
+
}
|
|
46046
|
+
}
|
|
46047
|
+
if (["GET", "HEAD"].includes(method)) {
|
|
46048
|
+
url = addQueryParameters(url, remainingParameters);
|
|
46049
|
+
} else {
|
|
46050
|
+
if ("data" in remainingParameters) {
|
|
46051
|
+
body = remainingParameters.data;
|
|
46052
|
+
} else {
|
|
46053
|
+
if (Object.keys(remainingParameters).length) {
|
|
46054
|
+
body = remainingParameters;
|
|
46055
|
+
}
|
|
46056
|
+
}
|
|
46057
|
+
}
|
|
46058
|
+
if (!headers["content-type"] && typeof body !== "undefined") {
|
|
46059
|
+
headers["content-type"] = "application/json; charset=utf-8";
|
|
46060
|
+
}
|
|
46061
|
+
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
|
46062
|
+
body = "";
|
|
46063
|
+
}
|
|
46064
|
+
return Object.assign({
|
|
46065
|
+
method,
|
|
46066
|
+
url,
|
|
46067
|
+
headers
|
|
46068
|
+
}, typeof body !== "undefined" ? {
|
|
46069
|
+
body
|
|
46070
|
+
} : null, options.request ? {
|
|
46071
|
+
request: options.request
|
|
46072
|
+
} : null);
|
|
46073
|
+
}
|
|
46074
|
+
|
|
46075
|
+
// pkg/dist-src/endpoint-with-defaults.js
|
|
46076
|
+
function endpointWithDefaults(defaults, route, options) {
|
|
46077
|
+
return parse$1(merge$1(defaults, route, options));
|
|
46078
|
+
}
|
|
46079
|
+
|
|
46080
|
+
// pkg/dist-src/with-defaults.js
|
|
46081
|
+
function withDefaults$1(oldDefaults, newDefaults) {
|
|
46082
|
+
const DEFAULTS2 = merge$1(oldDefaults, newDefaults);
|
|
46083
|
+
const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
|
|
46084
|
+
return Object.assign(endpoint2, {
|
|
46085
|
+
DEFAULTS: DEFAULTS2,
|
|
46086
|
+
defaults: withDefaults$1.bind(null, DEFAULTS2),
|
|
46087
|
+
merge: merge$1.bind(null, DEFAULTS2),
|
|
46088
|
+
parse: parse$1
|
|
46089
|
+
});
|
|
46090
|
+
}
|
|
46091
|
+
|
|
46092
|
+
// pkg/dist-src/index.js
|
|
46093
|
+
var endpoint = withDefaults$1(null, DEFAULTS);
|
|
46094
|
+
|
|
46095
|
+
var fastContentTypeParse = {};
|
|
46096
|
+
|
|
46097
|
+
var hasRequiredFastContentTypeParse;
|
|
46098
|
+
function requireFastContentTypeParse() {
|
|
46099
|
+
if (hasRequiredFastContentTypeParse) return fastContentTypeParse;
|
|
46100
|
+
hasRequiredFastContentTypeParse = 1;
|
|
46101
|
+
const NullObject = function NullObject() {};
|
|
46102
|
+
NullObject.prototype = Object.create(null);
|
|
46103
|
+
|
|
46104
|
+
/**
|
|
46105
|
+
* RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
|
|
46106
|
+
*
|
|
46107
|
+
* parameter = token "=" ( token / quoted-string )
|
|
46108
|
+
* token = 1*tchar
|
|
46109
|
+
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
|
|
46110
|
+
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
|
|
46111
|
+
* / DIGIT / ALPHA
|
|
46112
|
+
* ; any VCHAR, except delimiters
|
|
46113
|
+
* quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
|
|
46114
|
+
* qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
|
|
46115
|
+
* obs-text = %x80-FF
|
|
46116
|
+
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
|
|
46117
|
+
*/
|
|
46118
|
+
const paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
46119
|
+
|
|
46120
|
+
/**
|
|
46121
|
+
* RegExp to match quoted-pair in RFC 7230 sec 3.2.6
|
|
46122
|
+
*
|
|
46123
|
+
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
|
|
46124
|
+
* obs-text = %x80-FF
|
|
46125
|
+
*/
|
|
46126
|
+
const quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
46127
|
+
|
|
46128
|
+
/**
|
|
46129
|
+
* RegExp to match type in RFC 7231 sec 3.1.1.1
|
|
46130
|
+
*
|
|
46131
|
+
* media-type = type "/" subtype
|
|
46132
|
+
* type = token
|
|
46133
|
+
* subtype = token
|
|
46134
|
+
*/
|
|
46135
|
+
const mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
|
|
46136
|
+
|
|
46137
|
+
// default ContentType to prevent repeated object creation
|
|
46138
|
+
const defaultContentType = {
|
|
46139
|
+
type: '',
|
|
46140
|
+
parameters: new NullObject()
|
|
46141
|
+
};
|
|
46142
|
+
Object.freeze(defaultContentType.parameters);
|
|
46143
|
+
Object.freeze(defaultContentType);
|
|
46144
|
+
|
|
46145
|
+
/**
|
|
46146
|
+
* Parse media type to object.
|
|
46147
|
+
*
|
|
46148
|
+
* @param {string|object} header
|
|
46149
|
+
* @return {Object}
|
|
46150
|
+
* @public
|
|
46151
|
+
*/
|
|
46152
|
+
|
|
46153
|
+
function parse(header) {
|
|
46154
|
+
if (typeof header !== 'string') {
|
|
46155
|
+
throw new TypeError('argument header is required and must be a string');
|
|
46156
|
+
}
|
|
46157
|
+
let index = header.indexOf(';');
|
|
46158
|
+
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
46159
|
+
if (mediaTypeRE.test(type) === false) {
|
|
46160
|
+
throw new TypeError('invalid media type');
|
|
46161
|
+
}
|
|
46162
|
+
const result = {
|
|
46163
|
+
type: type.toLowerCase(),
|
|
46164
|
+
parameters: new NullObject()
|
|
46165
|
+
};
|
|
46166
|
+
|
|
46167
|
+
// parse parameters
|
|
46168
|
+
if (index === -1) {
|
|
46169
|
+
return result;
|
|
46170
|
+
}
|
|
46171
|
+
let key;
|
|
46172
|
+
let match;
|
|
46173
|
+
let value;
|
|
46174
|
+
paramRE.lastIndex = index;
|
|
46175
|
+
while (match = paramRE.exec(header)) {
|
|
46176
|
+
if (match.index !== index) {
|
|
46177
|
+
throw new TypeError('invalid parameter format');
|
|
46178
|
+
}
|
|
46179
|
+
index += match[0].length;
|
|
46180
|
+
key = match[1].toLowerCase();
|
|
46181
|
+
value = match[2];
|
|
46182
|
+
if (value[0] === '"') {
|
|
46183
|
+
// remove quotes and escapes
|
|
46184
|
+
value = value.slice(1, value.length - 1);
|
|
46185
|
+
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'));
|
|
46186
|
+
}
|
|
46187
|
+
result.parameters[key] = value;
|
|
46188
|
+
}
|
|
46189
|
+
if (index !== header.length) {
|
|
46190
|
+
throw new TypeError('invalid parameter format');
|
|
46191
|
+
}
|
|
46192
|
+
return result;
|
|
46193
|
+
}
|
|
46194
|
+
function safeParse(header) {
|
|
46195
|
+
if (typeof header !== 'string') {
|
|
46196
|
+
return defaultContentType;
|
|
46197
|
+
}
|
|
46198
|
+
let index = header.indexOf(';');
|
|
46199
|
+
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
46200
|
+
if (mediaTypeRE.test(type) === false) {
|
|
46201
|
+
return defaultContentType;
|
|
46202
|
+
}
|
|
46203
|
+
const result = {
|
|
46204
|
+
type: type.toLowerCase(),
|
|
46205
|
+
parameters: new NullObject()
|
|
46206
|
+
};
|
|
46207
|
+
|
|
46208
|
+
// parse parameters
|
|
46209
|
+
if (index === -1) {
|
|
46210
|
+
return result;
|
|
46211
|
+
}
|
|
46212
|
+
let key;
|
|
46213
|
+
let match;
|
|
46214
|
+
let value;
|
|
46215
|
+
paramRE.lastIndex = index;
|
|
46216
|
+
while (match = paramRE.exec(header)) {
|
|
46217
|
+
if (match.index !== index) {
|
|
46218
|
+
return defaultContentType;
|
|
46219
|
+
}
|
|
46220
|
+
index += match[0].length;
|
|
46221
|
+
key = match[1].toLowerCase();
|
|
46222
|
+
value = match[2];
|
|
46223
|
+
if (value[0] === '"') {
|
|
46224
|
+
// remove quotes and escapes
|
|
46225
|
+
value = value.slice(1, value.length - 1);
|
|
46226
|
+
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'));
|
|
46227
|
+
}
|
|
46228
|
+
result.parameters[key] = value;
|
|
46229
|
+
}
|
|
46230
|
+
if (index !== header.length) {
|
|
46231
|
+
return defaultContentType;
|
|
46232
|
+
}
|
|
46233
|
+
return result;
|
|
46234
|
+
}
|
|
46235
|
+
fastContentTypeParse.default = {
|
|
46236
|
+
parse,
|
|
46237
|
+
safeParse
|
|
46238
|
+
};
|
|
46239
|
+
fastContentTypeParse.parse = parse;
|
|
46240
|
+
fastContentTypeParse.safeParse = safeParse;
|
|
46241
|
+
fastContentTypeParse.defaultContentType = defaultContentType;
|
|
46242
|
+
return fastContentTypeParse;
|
|
46243
|
+
}
|
|
46244
|
+
|
|
46245
|
+
var fastContentTypeParseExports = requireFastContentTypeParse();
|
|
46246
|
+
|
|
46247
|
+
// pkg/dist-src/index.js
|
|
46248
|
+
|
|
46249
|
+
// pkg/dist-src/version.js
|
|
46250
|
+
var VERSION$5 = "0.0.0-development";
|
|
46251
|
+
|
|
46252
|
+
// pkg/dist-src/defaults.js
|
|
46253
|
+
var defaults_default = {
|
|
46254
|
+
headers: {
|
|
46255
|
+
"user-agent": `octokit-request.js/${VERSION$5} ${getUserAgent()}`
|
|
46256
|
+
}
|
|
46257
|
+
};
|
|
46258
|
+
|
|
46259
|
+
// pkg/dist-src/is-plain-object.js
|
|
46260
|
+
function isPlainObject(value) {
|
|
46261
|
+
if (typeof value !== "object" || value === null) return false;
|
|
46262
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
46263
|
+
const proto = Object.getPrototypeOf(value);
|
|
46264
|
+
if (proto === null) return true;
|
|
46265
|
+
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
46266
|
+
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
46267
|
+
}
|
|
46268
|
+
async function fetchWrapper(requestOptions) {
|
|
46269
|
+
const fetch = requestOptions.request?.fetch || globalThis.fetch;
|
|
46270
|
+
if (!fetch) {
|
|
46271
|
+
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");
|
|
46272
|
+
}
|
|
46273
|
+
const log = requestOptions.request?.log || console;
|
|
46274
|
+
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
46275
|
+
const body = isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
|
|
46276
|
+
const requestHeaders = Object.fromEntries(Object.entries(requestOptions.headers).map(([name, value]) => [name, String(value)]));
|
|
46277
|
+
let fetchResponse;
|
|
46278
|
+
try {
|
|
46279
|
+
fetchResponse = await fetch(requestOptions.url, {
|
|
46280
|
+
method: requestOptions.method,
|
|
46281
|
+
body,
|
|
46282
|
+
redirect: requestOptions.request?.redirect,
|
|
46283
|
+
headers: requestHeaders,
|
|
46284
|
+
signal: requestOptions.request?.signal,
|
|
46285
|
+
// duplex must be set if request.body is ReadableStream or Async Iterables.
|
|
46286
|
+
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
|
|
46287
|
+
...(requestOptions.body && {
|
|
46288
|
+
duplex: "half"
|
|
46289
|
+
})
|
|
46290
|
+
});
|
|
46291
|
+
} catch (error) {
|
|
46292
|
+
let message = "Unknown Error";
|
|
46293
|
+
if (error instanceof Error) {
|
|
46294
|
+
if (error.name === "AbortError") {
|
|
46295
|
+
error.status = 500;
|
|
46296
|
+
throw error;
|
|
46297
|
+
}
|
|
46298
|
+
message = error.message;
|
|
46299
|
+
if (error.name === "TypeError" && "cause" in error) {
|
|
46300
|
+
if (error.cause instanceof Error) {
|
|
46301
|
+
message = error.cause.message;
|
|
46302
|
+
} else if (typeof error.cause === "string") {
|
|
46303
|
+
message = error.cause;
|
|
46304
|
+
}
|
|
46305
|
+
}
|
|
46306
|
+
}
|
|
46307
|
+
const requestError = new RequestError(message, 500, {
|
|
46308
|
+
request: requestOptions
|
|
46309
|
+
});
|
|
46310
|
+
requestError.cause = error;
|
|
46311
|
+
throw requestError;
|
|
46312
|
+
}
|
|
46313
|
+
const status = fetchResponse.status;
|
|
46314
|
+
const url = fetchResponse.url;
|
|
46315
|
+
const responseHeaders = {};
|
|
46316
|
+
for (const [key, value] of fetchResponse.headers) {
|
|
46317
|
+
responseHeaders[key] = value;
|
|
46318
|
+
}
|
|
46319
|
+
const octokitResponse = {
|
|
46320
|
+
url,
|
|
46321
|
+
status,
|
|
46322
|
+
headers: responseHeaders,
|
|
46323
|
+
data: ""
|
|
46324
|
+
};
|
|
46325
|
+
if ("deprecation" in responseHeaders) {
|
|
46326
|
+
const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
|
|
46327
|
+
const deprecationLink = matches && matches.pop();
|
|
46328
|
+
log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`);
|
|
46329
|
+
}
|
|
46330
|
+
if (status === 204 || status === 205) {
|
|
46331
|
+
return octokitResponse;
|
|
46332
|
+
}
|
|
46333
|
+
if (requestOptions.method === "HEAD") {
|
|
46334
|
+
if (status < 400) {
|
|
46335
|
+
return octokitResponse;
|
|
46336
|
+
}
|
|
46337
|
+
throw new RequestError(fetchResponse.statusText, status, {
|
|
46338
|
+
response: octokitResponse,
|
|
46339
|
+
request: requestOptions
|
|
46340
|
+
});
|
|
46341
|
+
}
|
|
46342
|
+
if (status === 304) {
|
|
46343
|
+
octokitResponse.data = await getResponseData(fetchResponse);
|
|
46344
|
+
throw new RequestError("Not modified", status, {
|
|
46345
|
+
response: octokitResponse,
|
|
46346
|
+
request: requestOptions
|
|
46347
|
+
});
|
|
46348
|
+
}
|
|
46349
|
+
if (status >= 400) {
|
|
46350
|
+
octokitResponse.data = await getResponseData(fetchResponse);
|
|
46351
|
+
throw new RequestError(toErrorMessage(octokitResponse.data), status, {
|
|
46352
|
+
response: octokitResponse,
|
|
46353
|
+
request: requestOptions
|
|
46354
|
+
});
|
|
46355
|
+
}
|
|
46356
|
+
octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
|
|
46357
|
+
return octokitResponse;
|
|
46358
|
+
}
|
|
46359
|
+
async function getResponseData(response) {
|
|
46360
|
+
const contentType = response.headers.get("content-type");
|
|
46361
|
+
if (!contentType) {
|
|
46362
|
+
return response.text().catch(() => "");
|
|
46363
|
+
}
|
|
46364
|
+
const mimetype = fastContentTypeParseExports.safeParse(contentType);
|
|
46365
|
+
if (isJSONResponse(mimetype)) {
|
|
46366
|
+
let text = "";
|
|
46367
|
+
try {
|
|
46368
|
+
text = await response.text();
|
|
46369
|
+
return JSON.parse(text);
|
|
46370
|
+
} catch (err) {
|
|
46371
|
+
return text;
|
|
46372
|
+
}
|
|
46373
|
+
} else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
|
|
46374
|
+
return response.text().catch(() => "");
|
|
46375
|
+
} else {
|
|
46376
|
+
return response.arrayBuffer().catch(() => new ArrayBuffer(0));
|
|
46377
|
+
}
|
|
46378
|
+
}
|
|
46379
|
+
function isJSONResponse(mimetype) {
|
|
46380
|
+
return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
|
|
46381
|
+
}
|
|
46382
|
+
function toErrorMessage(data) {
|
|
46383
|
+
if (typeof data === "string") {
|
|
46384
|
+
return data;
|
|
46385
|
+
}
|
|
46386
|
+
if (data instanceof ArrayBuffer) {
|
|
46387
|
+
return "Unknown error";
|
|
46388
|
+
}
|
|
46389
|
+
if ("message" in data) {
|
|
46390
|
+
const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : "";
|
|
46391
|
+
return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map(v => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`;
|
|
46392
|
+
}
|
|
46393
|
+
return `Unknown error: ${JSON.stringify(data)}`;
|
|
46394
|
+
}
|
|
46395
|
+
|
|
46396
|
+
// pkg/dist-src/with-defaults.js
|
|
46397
|
+
function withDefaults(oldEndpoint, newDefaults) {
|
|
46398
|
+
const endpoint2 = oldEndpoint.defaults(newDefaults);
|
|
46399
|
+
const newApi = function (route, parameters) {
|
|
46400
|
+
const endpointOptions = endpoint2.merge(route, parameters);
|
|
46401
|
+
if (!endpointOptions.request || !endpointOptions.request.hook) {
|
|
46402
|
+
return fetchWrapper(endpoint2.parse(endpointOptions));
|
|
46403
|
+
}
|
|
46404
|
+
const request2 = (route2, parameters2) => {
|
|
46405
|
+
return fetchWrapper(endpoint2.parse(endpoint2.merge(route2, parameters2)));
|
|
46406
|
+
};
|
|
46407
|
+
Object.assign(request2, {
|
|
46408
|
+
endpoint: endpoint2,
|
|
46409
|
+
defaults: withDefaults.bind(null, endpoint2)
|
|
46410
|
+
});
|
|
46411
|
+
return endpointOptions.request.hook(request2, endpointOptions);
|
|
46412
|
+
};
|
|
46413
|
+
return Object.assign(newApi, {
|
|
46414
|
+
endpoint: endpoint2,
|
|
46415
|
+
defaults: withDefaults.bind(null, endpoint2)
|
|
46416
|
+
});
|
|
46417
|
+
}
|
|
46418
|
+
|
|
46419
|
+
// pkg/dist-src/index.js
|
|
46420
|
+
var request = withDefaults(endpoint, defaults_default);
|
|
46421
|
+
|
|
45758
46422
|
// pkg/dist-src/is-jwt.js
|
|
45759
46423
|
var b64url = "(?:[a-zA-Z0-9_-]+)";
|
|
45760
46424
|
var sep = "\\.";
|
|
@@ -60424,5 +61088,5 @@ exports.terminalLinkExports = terminalLinkExports;
|
|
|
60424
61088
|
exports.updater = updater;
|
|
60425
61089
|
exports.yargsParser = yargsParser;
|
|
60426
61090
|
exports.yoctocolorsCjsExports = yoctocolorsCjsExports;
|
|
60427
|
-
//# debugId=
|
|
61091
|
+
//# debugId=ceb8af78-9544-4fe4-9d74-e114be55f208
|
|
60428
61092
|
//# sourceMappingURL=vendor.js.map
|