@bigbinary/neeto-playwright-commons 3.3.4 → 3.3.5
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/README.md +10 -1
- package/configs/eslint/common.js +7 -9
- package/configs/eslint/host.js +1 -1
- package/index.cjs.js +1496 -42
- package/index.cjs.js.map +1 -1
- package/index.js +1500 -46
- package/index.js.map +1 -1
- package/package.json +5 -2
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { keysToSnakeCase, isPresent, hyphenate, isNotPresent, noop, humanize, findBy, dynamicArray, truncate, isNotEmpty, isNotEqualDeep, randomPick } from '@bigbinary/neeto-cist';
|
|
1
|
+
import { keysToSnakeCase, isPresent, hyphenate, isNotPresent, noop as noop$2, humanize, findBy, dynamicArray, truncate, isNotEmpty, isNotEqualDeep, randomPick } from '@bigbinary/neeto-cist';
|
|
2
2
|
import { faker } from '@faker-js/faker';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import fs__default, { readFileSync, promises, existsSync, writeFileSync, unlinkSync, mkdirSync, rmSync, createWriteStream } from 'fs';
|
|
@@ -4421,7 +4421,7 @@ var asking = {
|
|
|
4421
4421
|
keyStop: 0,
|
|
4422
4422
|
step: 0
|
|
4423
4423
|
};
|
|
4424
|
-
var auth = {
|
|
4424
|
+
var auth$1 = {
|
|
4425
4425
|
arity: -2,
|
|
4426
4426
|
flags: [
|
|
4427
4427
|
"noscript",
|
|
@@ -6955,7 +6955,7 @@ var require$$0$3 = {
|
|
|
6955
6955
|
acl: acl,
|
|
6956
6956
|
append: append,
|
|
6957
6957
|
asking: asking,
|
|
6958
|
-
auth: auth,
|
|
6958
|
+
auth: auth$1,
|
|
6959
6959
|
bgrewriteaof: bgrewriteaof,
|
|
6960
6960
|
bgsave: bgsave,
|
|
6961
6961
|
bitcount: bitcount,
|
|
@@ -17382,12 +17382,12 @@ const restoreCookies = async (redis, provider, context) => {
|
|
|
17382
17382
|
}
|
|
17383
17383
|
catch {
|
|
17384
17384
|
log$2(`Cache entry for "${provider}" is corrupt — falling back to login`);
|
|
17385
|
-
await redis.del(cookieKey(provider)).catch(noop);
|
|
17385
|
+
await redis.del(cookieKey(provider)).catch(noop$2);
|
|
17386
17386
|
return false;
|
|
17387
17387
|
}
|
|
17388
17388
|
};
|
|
17389
17389
|
const acquireLock = (redis, provider) => redis.set(lockKey(provider), "1", "EX", LOCK_TTL_SECONDS, "NX");
|
|
17390
|
-
const releaseLock = (redis, provider) => redis.del(lockKey(provider)).catch(noop);
|
|
17390
|
+
const releaseLock = (redis, provider) => redis.del(lockKey(provider)).catch(noop$2);
|
|
17391
17391
|
const startLockRefresh = (redis, provider) => {
|
|
17392
17392
|
const interval = setInterval(() => {
|
|
17393
17393
|
redis
|
|
@@ -17396,7 +17396,7 @@ const startLockRefresh = (redis, provider) => {
|
|
|
17396
17396
|
if (success)
|
|
17397
17397
|
log$2(`Refreshed lock TTL for "${provider}"`);
|
|
17398
17398
|
})
|
|
17399
|
-
.catch(noop);
|
|
17399
|
+
.catch(noop$2);
|
|
17400
17400
|
}, LOCK_REFRESH_INTERVAL_MS);
|
|
17401
17401
|
return () => clearInterval(interval);
|
|
17402
17402
|
};
|
|
@@ -65774,7 +65774,7 @@ function isWhitespace(c) {
|
|
|
65774
65774
|
* The first dimension represents selectors separated by commas (eg. `sub1, sub2`),
|
|
65775
65775
|
* the second contains the relevant tokens for that selector.
|
|
65776
65776
|
*/
|
|
65777
|
-
function parse$
|
|
65777
|
+
function parse$4(selector) {
|
|
65778
65778
|
const subselects = [];
|
|
65779
65779
|
const endIndex = parseSelector(subselects, `${selector}`, 0);
|
|
65780
65780
|
if (endIndex < selector.length) {
|
|
@@ -66251,7 +66251,7 @@ var es = /*#__PURE__*/Object.freeze({
|
|
|
66251
66251
|
IgnoreCaseMode: IgnoreCaseMode,
|
|
66252
66252
|
get SelectorType () { return SelectorType; },
|
|
66253
66253
|
isTraversal: isTraversal,
|
|
66254
|
-
parse: parse$
|
|
66254
|
+
parse: parse$4,
|
|
66255
66255
|
stringify: stringify
|
|
66256
66256
|
});
|
|
66257
66257
|
|
|
@@ -66603,16 +66603,16 @@ var filters = {};
|
|
|
66603
66603
|
|
|
66604
66604
|
var lib$2 = {};
|
|
66605
66605
|
|
|
66606
|
-
var parse$
|
|
66606
|
+
var parse$3 = {};
|
|
66607
66607
|
|
|
66608
66608
|
var hasRequiredParse$1;
|
|
66609
66609
|
|
|
66610
66610
|
function requireParse$1 () {
|
|
66611
|
-
if (hasRequiredParse$1) return parse$
|
|
66611
|
+
if (hasRequiredParse$1) return parse$3;
|
|
66612
66612
|
hasRequiredParse$1 = 1;
|
|
66613
66613
|
// Following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo
|
|
66614
|
-
Object.defineProperty(parse$
|
|
66615
|
-
parse$
|
|
66614
|
+
Object.defineProperty(parse$3, "__esModule", { value: true });
|
|
66615
|
+
parse$3.parse = void 0;
|
|
66616
66616
|
// Whitespace as per https://www.w3.org/TR/selectors-3/#lex is " \t\r\n\f"
|
|
66617
66617
|
var whitespace = new Set([9, 10, 12, 13, 32]);
|
|
66618
66618
|
var ZERO = "0".charCodeAt(0);
|
|
@@ -66684,9 +66684,9 @@ function requireParse$1 () {
|
|
|
66684
66684
|
}
|
|
66685
66685
|
}
|
|
66686
66686
|
}
|
|
66687
|
-
parse$
|
|
66687
|
+
parse$3.parse = parse;
|
|
66688
66688
|
|
|
66689
|
-
return parse$
|
|
66689
|
+
return parse$3;
|
|
66690
66690
|
}
|
|
66691
66691
|
|
|
66692
66692
|
var compile = {};
|
|
@@ -69329,20 +69329,20 @@ function requireHtml () {
|
|
|
69329
69329
|
return html;
|
|
69330
69330
|
}
|
|
69331
69331
|
|
|
69332
|
-
var parse$
|
|
69332
|
+
var parse$2 = {};
|
|
69333
69333
|
|
|
69334
69334
|
var hasRequiredParse;
|
|
69335
69335
|
|
|
69336
69336
|
function requireParse () {
|
|
69337
|
-
if (hasRequiredParse) return parse$
|
|
69337
|
+
if (hasRequiredParse) return parse$2;
|
|
69338
69338
|
hasRequiredParse = 1;
|
|
69339
69339
|
(function (exports$1) {
|
|
69340
69340
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
69341
69341
|
exports$1.default = void 0;
|
|
69342
69342
|
var html_1 = /*@__PURE__*/ requireHtml();
|
|
69343
69343
|
Object.defineProperty(exports$1, "default", { enumerable: true, get: function () { return html_1.parse; } });
|
|
69344
|
-
} (parse$
|
|
69345
|
-
return parse$
|
|
69344
|
+
} (parse$2));
|
|
69345
|
+
return parse$2;
|
|
69346
69346
|
}
|
|
69347
69347
|
|
|
69348
69348
|
var valid = {};
|
|
@@ -117796,27 +117796,1371 @@ const getBasicInfoTestData = () => ({
|
|
|
117796
117796
|
imageName: "sample.png",
|
|
117797
117797
|
});
|
|
117798
117798
|
|
|
117799
|
+
function getUserAgent() {
|
|
117800
|
+
if (typeof navigator === "object" && "userAgent" in navigator) {
|
|
117801
|
+
return navigator.userAgent;
|
|
117802
|
+
}
|
|
117803
|
+
|
|
117804
|
+
if (typeof process === "object" && process.version !== undefined) {
|
|
117805
|
+
return `Node.js/${process.version.substr(1)} (${process.platform}; ${
|
|
117806
|
+
process.arch
|
|
117807
|
+
})`;
|
|
117808
|
+
}
|
|
117809
|
+
|
|
117810
|
+
return "<environment undetectable>";
|
|
117811
|
+
}
|
|
117812
|
+
|
|
117813
|
+
// @ts-check
|
|
117814
|
+
|
|
117815
|
+
function register(state, name, method, options) {
|
|
117816
|
+
if (typeof method !== "function") {
|
|
117817
|
+
throw new Error("method for before hook must be a function");
|
|
117818
|
+
}
|
|
117819
|
+
|
|
117820
|
+
if (!options) {
|
|
117821
|
+
options = {};
|
|
117822
|
+
}
|
|
117823
|
+
|
|
117824
|
+
if (Array.isArray(name)) {
|
|
117825
|
+
return name.reverse().reduce((callback, name) => {
|
|
117826
|
+
return register.bind(null, state, name, callback, options);
|
|
117827
|
+
}, method)();
|
|
117828
|
+
}
|
|
117829
|
+
|
|
117830
|
+
return Promise.resolve().then(() => {
|
|
117831
|
+
if (!state.registry[name]) {
|
|
117832
|
+
return method(options);
|
|
117833
|
+
}
|
|
117834
|
+
|
|
117835
|
+
return state.registry[name].reduce((method, registered) => {
|
|
117836
|
+
return registered.hook.bind(null, method, options);
|
|
117837
|
+
}, method)();
|
|
117838
|
+
});
|
|
117839
|
+
}
|
|
117840
|
+
|
|
117841
|
+
// @ts-check
|
|
117842
|
+
|
|
117843
|
+
function addHook(state, kind, name, hook) {
|
|
117844
|
+
const orig = hook;
|
|
117845
|
+
if (!state.registry[name]) {
|
|
117846
|
+
state.registry[name] = [];
|
|
117847
|
+
}
|
|
117848
|
+
|
|
117849
|
+
if (kind === "before") {
|
|
117850
|
+
hook = (method, options) => {
|
|
117851
|
+
return Promise.resolve()
|
|
117852
|
+
.then(orig.bind(null, options))
|
|
117853
|
+
.then(method.bind(null, options));
|
|
117854
|
+
};
|
|
117855
|
+
}
|
|
117856
|
+
|
|
117857
|
+
if (kind === "after") {
|
|
117858
|
+
hook = (method, options) => {
|
|
117859
|
+
let result;
|
|
117860
|
+
return Promise.resolve()
|
|
117861
|
+
.then(method.bind(null, options))
|
|
117862
|
+
.then((result_) => {
|
|
117863
|
+
result = result_;
|
|
117864
|
+
return orig(result, options);
|
|
117865
|
+
})
|
|
117866
|
+
.then(() => {
|
|
117867
|
+
return result;
|
|
117868
|
+
});
|
|
117869
|
+
};
|
|
117870
|
+
}
|
|
117871
|
+
|
|
117872
|
+
if (kind === "error") {
|
|
117873
|
+
hook = (method, options) => {
|
|
117874
|
+
return Promise.resolve()
|
|
117875
|
+
.then(method.bind(null, options))
|
|
117876
|
+
.catch((error) => {
|
|
117877
|
+
return orig(error, options);
|
|
117878
|
+
});
|
|
117879
|
+
};
|
|
117880
|
+
}
|
|
117881
|
+
|
|
117882
|
+
state.registry[name].push({
|
|
117883
|
+
hook: hook,
|
|
117884
|
+
orig: orig,
|
|
117885
|
+
});
|
|
117886
|
+
}
|
|
117887
|
+
|
|
117888
|
+
// @ts-check
|
|
117889
|
+
|
|
117890
|
+
function removeHook(state, name, method) {
|
|
117891
|
+
if (!state.registry[name]) {
|
|
117892
|
+
return;
|
|
117893
|
+
}
|
|
117894
|
+
|
|
117895
|
+
const index = state.registry[name]
|
|
117896
|
+
.map((registered) => {
|
|
117897
|
+
return registered.orig;
|
|
117898
|
+
})
|
|
117899
|
+
.indexOf(method);
|
|
117900
|
+
|
|
117901
|
+
if (index === -1) {
|
|
117902
|
+
return;
|
|
117903
|
+
}
|
|
117904
|
+
|
|
117905
|
+
state.registry[name].splice(index, 1);
|
|
117906
|
+
}
|
|
117907
|
+
|
|
117908
|
+
// @ts-check
|
|
117909
|
+
|
|
117910
|
+
|
|
117911
|
+
// bind with array of arguments: https://stackoverflow.com/a/21792913
|
|
117912
|
+
const bind = Function.bind;
|
|
117913
|
+
const bindable = bind.bind(bind);
|
|
117914
|
+
|
|
117915
|
+
function bindApi(hook, state, name) {
|
|
117916
|
+
const removeHookRef = bindable(removeHook, null).apply(
|
|
117917
|
+
null,
|
|
117918
|
+
[state]
|
|
117919
|
+
);
|
|
117920
|
+
hook.api = { remove: removeHookRef };
|
|
117921
|
+
hook.remove = removeHookRef;
|
|
117922
|
+
["before", "error", "after", "wrap"].forEach((kind) => {
|
|
117923
|
+
const args = [state, kind];
|
|
117924
|
+
hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
|
|
117925
|
+
});
|
|
117926
|
+
}
|
|
117927
|
+
|
|
117928
|
+
function Collection() {
|
|
117929
|
+
const state = {
|
|
117930
|
+
registry: {},
|
|
117931
|
+
};
|
|
117932
|
+
|
|
117933
|
+
const hook = register.bind(null, state);
|
|
117934
|
+
bindApi(hook, state);
|
|
117935
|
+
|
|
117936
|
+
return hook;
|
|
117937
|
+
}
|
|
117938
|
+
|
|
117939
|
+
var Hook = { Collection };
|
|
117940
|
+
|
|
117941
|
+
// pkg/dist-src/defaults.js
|
|
117942
|
+
|
|
117943
|
+
// pkg/dist-src/version.js
|
|
117944
|
+
var VERSION$3 = "0.0.0-development";
|
|
117945
|
+
|
|
117946
|
+
// pkg/dist-src/defaults.js
|
|
117947
|
+
var userAgent = `octokit-endpoint.js/${VERSION$3} ${getUserAgent()}`;
|
|
117948
|
+
var DEFAULTS = {
|
|
117949
|
+
method: "GET",
|
|
117950
|
+
baseUrl: "https://api.github.com",
|
|
117951
|
+
headers: {
|
|
117952
|
+
accept: "application/vnd.github.v3+json",
|
|
117953
|
+
"user-agent": userAgent
|
|
117954
|
+
},
|
|
117955
|
+
mediaType: {
|
|
117956
|
+
format: ""
|
|
117957
|
+
}
|
|
117958
|
+
};
|
|
117959
|
+
|
|
117960
|
+
// pkg/dist-src/util/lowercase-keys.js
|
|
117961
|
+
function lowercaseKeys(object) {
|
|
117962
|
+
if (!object) {
|
|
117963
|
+
return {};
|
|
117964
|
+
}
|
|
117965
|
+
return Object.keys(object).reduce((newObj, key) => {
|
|
117966
|
+
newObj[key.toLowerCase()] = object[key];
|
|
117967
|
+
return newObj;
|
|
117968
|
+
}, {});
|
|
117969
|
+
}
|
|
117970
|
+
|
|
117971
|
+
// pkg/dist-src/util/is-plain-object.js
|
|
117972
|
+
function isPlainObject$1(value) {
|
|
117973
|
+
if (typeof value !== "object" || value === null) return false;
|
|
117974
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
117975
|
+
const proto = Object.getPrototypeOf(value);
|
|
117976
|
+
if (proto === null) return true;
|
|
117977
|
+
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
117978
|
+
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
117979
|
+
}
|
|
117980
|
+
|
|
117981
|
+
// pkg/dist-src/util/merge-deep.js
|
|
117982
|
+
function mergeDeep(defaults, options) {
|
|
117983
|
+
const result = Object.assign({}, defaults);
|
|
117984
|
+
Object.keys(options).forEach((key) => {
|
|
117985
|
+
if (isPlainObject$1(options[key])) {
|
|
117986
|
+
if (!(key in defaults)) Object.assign(result, { [key]: options[key] });
|
|
117987
|
+
else result[key] = mergeDeep(defaults[key], options[key]);
|
|
117988
|
+
} else {
|
|
117989
|
+
Object.assign(result, { [key]: options[key] });
|
|
117990
|
+
}
|
|
117991
|
+
});
|
|
117992
|
+
return result;
|
|
117993
|
+
}
|
|
117994
|
+
|
|
117995
|
+
// pkg/dist-src/util/remove-undefined-properties.js
|
|
117996
|
+
function removeUndefinedProperties(obj) {
|
|
117997
|
+
for (const key in obj) {
|
|
117998
|
+
if (obj[key] === void 0) {
|
|
117999
|
+
delete obj[key];
|
|
118000
|
+
}
|
|
118001
|
+
}
|
|
118002
|
+
return obj;
|
|
118003
|
+
}
|
|
118004
|
+
|
|
118005
|
+
// pkg/dist-src/merge.js
|
|
118006
|
+
function merge$1(defaults, route, options) {
|
|
118007
|
+
if (typeof route === "string") {
|
|
118008
|
+
let [method, url] = route.split(" ");
|
|
118009
|
+
options = Object.assign(url ? { method, url } : { url: method }, options);
|
|
118010
|
+
} else {
|
|
118011
|
+
options = Object.assign({}, route);
|
|
118012
|
+
}
|
|
118013
|
+
options.headers = lowercaseKeys(options.headers);
|
|
118014
|
+
removeUndefinedProperties(options);
|
|
118015
|
+
removeUndefinedProperties(options.headers);
|
|
118016
|
+
const mergedOptions = mergeDeep(defaults || {}, options);
|
|
118017
|
+
if (options.url === "/graphql") {
|
|
118018
|
+
if (defaults && defaults.mediaType.previews?.length) {
|
|
118019
|
+
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
|
|
118020
|
+
(preview) => !mergedOptions.mediaType.previews.includes(preview)
|
|
118021
|
+
).concat(mergedOptions.mediaType.previews);
|
|
118022
|
+
}
|
|
118023
|
+
mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
|
|
118024
|
+
}
|
|
118025
|
+
return mergedOptions;
|
|
118026
|
+
}
|
|
118027
|
+
|
|
118028
|
+
// pkg/dist-src/util/add-query-parameters.js
|
|
118029
|
+
function addQueryParameters(url, parameters) {
|
|
118030
|
+
const separator = /\?/.test(url) ? "&" : "?";
|
|
118031
|
+
const names = Object.keys(parameters);
|
|
118032
|
+
if (names.length === 0) {
|
|
118033
|
+
return url;
|
|
118034
|
+
}
|
|
118035
|
+
return url + separator + names.map((name) => {
|
|
118036
|
+
if (name === "q") {
|
|
118037
|
+
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
|
|
118038
|
+
}
|
|
118039
|
+
return `${name}=${encodeURIComponent(parameters[name])}`;
|
|
118040
|
+
}).join("&");
|
|
118041
|
+
}
|
|
118042
|
+
|
|
118043
|
+
// pkg/dist-src/util/extract-url-variable-names.js
|
|
118044
|
+
var urlVariableRegex = /\{[^{}}]+\}/g;
|
|
118045
|
+
function removeNonChars(variableName) {
|
|
118046
|
+
return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
|
|
118047
|
+
}
|
|
118048
|
+
function extractUrlVariableNames(url) {
|
|
118049
|
+
const matches = url.match(urlVariableRegex);
|
|
118050
|
+
if (!matches) {
|
|
118051
|
+
return [];
|
|
118052
|
+
}
|
|
118053
|
+
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
|
|
118054
|
+
}
|
|
118055
|
+
|
|
118056
|
+
// pkg/dist-src/util/omit.js
|
|
118057
|
+
function omit(object, keysToOmit) {
|
|
118058
|
+
const result = { __proto__: null };
|
|
118059
|
+
for (const key of Object.keys(object)) {
|
|
118060
|
+
if (keysToOmit.indexOf(key) === -1) {
|
|
118061
|
+
result[key] = object[key];
|
|
118062
|
+
}
|
|
118063
|
+
}
|
|
118064
|
+
return result;
|
|
118065
|
+
}
|
|
118066
|
+
|
|
118067
|
+
// pkg/dist-src/util/url-template.js
|
|
118068
|
+
function encodeReserved(str) {
|
|
118069
|
+
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
|
|
118070
|
+
if (!/%[0-9A-Fa-f]/.test(part)) {
|
|
118071
|
+
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
118072
|
+
}
|
|
118073
|
+
return part;
|
|
118074
|
+
}).join("");
|
|
118075
|
+
}
|
|
118076
|
+
function encodeUnreserved(str) {
|
|
118077
|
+
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
|
|
118078
|
+
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
118079
|
+
});
|
|
118080
|
+
}
|
|
118081
|
+
function encodeValue(operator, value, key) {
|
|
118082
|
+
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
|
|
118083
|
+
if (key) {
|
|
118084
|
+
return encodeUnreserved(key) + "=" + value;
|
|
118085
|
+
} else {
|
|
118086
|
+
return value;
|
|
118087
|
+
}
|
|
118088
|
+
}
|
|
118089
|
+
function isDefined(value) {
|
|
118090
|
+
return value !== void 0 && value !== null;
|
|
118091
|
+
}
|
|
118092
|
+
function isKeyOperator(operator) {
|
|
118093
|
+
return operator === ";" || operator === "&" || operator === "?";
|
|
118094
|
+
}
|
|
118095
|
+
function getValues(context, operator, key, modifier) {
|
|
118096
|
+
var value = context[key], result = [];
|
|
118097
|
+
if (isDefined(value) && value !== "") {
|
|
118098
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") {
|
|
118099
|
+
value = value.toString();
|
|
118100
|
+
if (modifier && modifier !== "*") {
|
|
118101
|
+
value = value.substring(0, parseInt(modifier, 10));
|
|
118102
|
+
}
|
|
118103
|
+
result.push(
|
|
118104
|
+
encodeValue(operator, value, isKeyOperator(operator) ? key : "")
|
|
118105
|
+
);
|
|
118106
|
+
} else {
|
|
118107
|
+
if (modifier === "*") {
|
|
118108
|
+
if (Array.isArray(value)) {
|
|
118109
|
+
value.filter(isDefined).forEach(function(value2) {
|
|
118110
|
+
result.push(
|
|
118111
|
+
encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
|
|
118112
|
+
);
|
|
118113
|
+
});
|
|
118114
|
+
} else {
|
|
118115
|
+
Object.keys(value).forEach(function(k) {
|
|
118116
|
+
if (isDefined(value[k])) {
|
|
118117
|
+
result.push(encodeValue(operator, value[k], k));
|
|
118118
|
+
}
|
|
118119
|
+
});
|
|
118120
|
+
}
|
|
118121
|
+
} else {
|
|
118122
|
+
const tmp = [];
|
|
118123
|
+
if (Array.isArray(value)) {
|
|
118124
|
+
value.filter(isDefined).forEach(function(value2) {
|
|
118125
|
+
tmp.push(encodeValue(operator, value2));
|
|
118126
|
+
});
|
|
118127
|
+
} else {
|
|
118128
|
+
Object.keys(value).forEach(function(k) {
|
|
118129
|
+
if (isDefined(value[k])) {
|
|
118130
|
+
tmp.push(encodeUnreserved(k));
|
|
118131
|
+
tmp.push(encodeValue(operator, value[k].toString()));
|
|
118132
|
+
}
|
|
118133
|
+
});
|
|
118134
|
+
}
|
|
118135
|
+
if (isKeyOperator(operator)) {
|
|
118136
|
+
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
|
|
118137
|
+
} else if (tmp.length !== 0) {
|
|
118138
|
+
result.push(tmp.join(","));
|
|
118139
|
+
}
|
|
118140
|
+
}
|
|
118141
|
+
}
|
|
118142
|
+
} else {
|
|
118143
|
+
if (operator === ";") {
|
|
118144
|
+
if (isDefined(value)) {
|
|
118145
|
+
result.push(encodeUnreserved(key));
|
|
118146
|
+
}
|
|
118147
|
+
} else if (value === "" && (operator === "&" || operator === "?")) {
|
|
118148
|
+
result.push(encodeUnreserved(key) + "=");
|
|
118149
|
+
} else if (value === "") {
|
|
118150
|
+
result.push("");
|
|
118151
|
+
}
|
|
118152
|
+
}
|
|
118153
|
+
return result;
|
|
118154
|
+
}
|
|
118155
|
+
function parseUrl(template) {
|
|
118156
|
+
return {
|
|
118157
|
+
expand: expand.bind(null, template)
|
|
118158
|
+
};
|
|
118159
|
+
}
|
|
118160
|
+
function expand(template, context) {
|
|
118161
|
+
var operators = ["+", "#", ".", "/", ";", "?", "&"];
|
|
118162
|
+
template = template.replace(
|
|
118163
|
+
/\{([^\{\}]+)\}|([^\{\}]+)/g,
|
|
118164
|
+
function(_, expression, literal) {
|
|
118165
|
+
if (expression) {
|
|
118166
|
+
let operator = "";
|
|
118167
|
+
const values = [];
|
|
118168
|
+
if (operators.indexOf(expression.charAt(0)) !== -1) {
|
|
118169
|
+
operator = expression.charAt(0);
|
|
118170
|
+
expression = expression.substr(1);
|
|
118171
|
+
}
|
|
118172
|
+
expression.split(/,/g).forEach(function(variable) {
|
|
118173
|
+
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
|
|
118174
|
+
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
|
|
118175
|
+
});
|
|
118176
|
+
if (operator && operator !== "+") {
|
|
118177
|
+
var separator = ",";
|
|
118178
|
+
if (operator === "?") {
|
|
118179
|
+
separator = "&";
|
|
118180
|
+
} else if (operator !== "#") {
|
|
118181
|
+
separator = operator;
|
|
118182
|
+
}
|
|
118183
|
+
return (values.length !== 0 ? operator : "") + values.join(separator);
|
|
118184
|
+
} else {
|
|
118185
|
+
return values.join(",");
|
|
118186
|
+
}
|
|
118187
|
+
} else {
|
|
118188
|
+
return encodeReserved(literal);
|
|
118189
|
+
}
|
|
118190
|
+
}
|
|
118191
|
+
);
|
|
118192
|
+
if (template === "/") {
|
|
118193
|
+
return template;
|
|
118194
|
+
} else {
|
|
118195
|
+
return template.replace(/\/$/, "");
|
|
118196
|
+
}
|
|
118197
|
+
}
|
|
118198
|
+
|
|
118199
|
+
// pkg/dist-src/parse.js
|
|
118200
|
+
function parse$1(options) {
|
|
118201
|
+
let method = options.method.toUpperCase();
|
|
118202
|
+
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
|
|
118203
|
+
let headers = Object.assign({}, options.headers);
|
|
118204
|
+
let body;
|
|
118205
|
+
let parameters = omit(options, [
|
|
118206
|
+
"method",
|
|
118207
|
+
"baseUrl",
|
|
118208
|
+
"url",
|
|
118209
|
+
"headers",
|
|
118210
|
+
"request",
|
|
118211
|
+
"mediaType"
|
|
118212
|
+
]);
|
|
118213
|
+
const urlVariableNames = extractUrlVariableNames(url);
|
|
118214
|
+
url = parseUrl(url).expand(parameters);
|
|
118215
|
+
if (!/^http/.test(url)) {
|
|
118216
|
+
url = options.baseUrl + url;
|
|
118217
|
+
}
|
|
118218
|
+
const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
|
|
118219
|
+
const remainingParameters = omit(parameters, omittedParameters);
|
|
118220
|
+
const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
|
|
118221
|
+
if (!isBinaryRequest) {
|
|
118222
|
+
if (options.mediaType.format) {
|
|
118223
|
+
headers.accept = headers.accept.split(/,/).map(
|
|
118224
|
+
(format) => format.replace(
|
|
118225
|
+
/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
|
|
118226
|
+
`application/vnd$1$2.${options.mediaType.format}`
|
|
118227
|
+
)
|
|
118228
|
+
).join(",");
|
|
118229
|
+
}
|
|
118230
|
+
if (url.endsWith("/graphql")) {
|
|
118231
|
+
if (options.mediaType.previews?.length) {
|
|
118232
|
+
const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
|
|
118233
|
+
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
|
|
118234
|
+
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
|
|
118235
|
+
return `application/vnd.github.${preview}-preview${format}`;
|
|
118236
|
+
}).join(",");
|
|
118237
|
+
}
|
|
118238
|
+
}
|
|
118239
|
+
}
|
|
118240
|
+
if (["GET", "HEAD"].includes(method)) {
|
|
118241
|
+
url = addQueryParameters(url, remainingParameters);
|
|
118242
|
+
} else {
|
|
118243
|
+
if ("data" in remainingParameters) {
|
|
118244
|
+
body = remainingParameters.data;
|
|
118245
|
+
} else {
|
|
118246
|
+
if (Object.keys(remainingParameters).length) {
|
|
118247
|
+
body = remainingParameters;
|
|
118248
|
+
}
|
|
118249
|
+
}
|
|
118250
|
+
}
|
|
118251
|
+
if (!headers["content-type"] && typeof body !== "undefined") {
|
|
118252
|
+
headers["content-type"] = "application/json; charset=utf-8";
|
|
118253
|
+
}
|
|
118254
|
+
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
|
|
118255
|
+
body = "";
|
|
118256
|
+
}
|
|
118257
|
+
return Object.assign(
|
|
118258
|
+
{ method, url, headers },
|
|
118259
|
+
typeof body !== "undefined" ? { body } : null,
|
|
118260
|
+
options.request ? { request: options.request } : null
|
|
118261
|
+
);
|
|
118262
|
+
}
|
|
118263
|
+
|
|
118264
|
+
// pkg/dist-src/endpoint-with-defaults.js
|
|
118265
|
+
function endpointWithDefaults(defaults, route, options) {
|
|
118266
|
+
return parse$1(merge$1(defaults, route, options));
|
|
118267
|
+
}
|
|
118268
|
+
|
|
118269
|
+
// pkg/dist-src/with-defaults.js
|
|
118270
|
+
function withDefaults$2(oldDefaults, newDefaults) {
|
|
118271
|
+
const DEFAULTS2 = merge$1(oldDefaults, newDefaults);
|
|
118272
|
+
const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
|
|
118273
|
+
return Object.assign(endpoint2, {
|
|
118274
|
+
DEFAULTS: DEFAULTS2,
|
|
118275
|
+
defaults: withDefaults$2.bind(null, DEFAULTS2),
|
|
118276
|
+
merge: merge$1.bind(null, DEFAULTS2),
|
|
118277
|
+
parse: parse$1
|
|
118278
|
+
});
|
|
118279
|
+
}
|
|
118280
|
+
|
|
118281
|
+
// pkg/dist-src/index.js
|
|
118282
|
+
var endpoint = withDefaults$2(null, DEFAULTS);
|
|
118283
|
+
|
|
118284
|
+
var fastContentTypeParse = {};
|
|
118285
|
+
|
|
118286
|
+
var hasRequiredFastContentTypeParse;
|
|
118287
|
+
|
|
118288
|
+
function requireFastContentTypeParse () {
|
|
118289
|
+
if (hasRequiredFastContentTypeParse) return fastContentTypeParse;
|
|
118290
|
+
hasRequiredFastContentTypeParse = 1;
|
|
118291
|
+
|
|
118292
|
+
const NullObject = function NullObject () { };
|
|
118293
|
+
NullObject.prototype = Object.create(null);
|
|
118294
|
+
|
|
118295
|
+
/**
|
|
118296
|
+
* RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
|
|
118297
|
+
*
|
|
118298
|
+
* parameter = token "=" ( token / quoted-string )
|
|
118299
|
+
* token = 1*tchar
|
|
118300
|
+
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
|
|
118301
|
+
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
|
|
118302
|
+
* / DIGIT / ALPHA
|
|
118303
|
+
* ; any VCHAR, except delimiters
|
|
118304
|
+
* quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
|
|
118305
|
+
* qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
|
|
118306
|
+
* obs-text = %x80-FF
|
|
118307
|
+
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
|
|
118308
|
+
*/
|
|
118309
|
+
const paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
118310
|
+
|
|
118311
|
+
/**
|
|
118312
|
+
* RegExp to match quoted-pair in RFC 7230 sec 3.2.6
|
|
118313
|
+
*
|
|
118314
|
+
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
|
|
118315
|
+
* obs-text = %x80-FF
|
|
118316
|
+
*/
|
|
118317
|
+
const quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
118318
|
+
|
|
118319
|
+
/**
|
|
118320
|
+
* RegExp to match type in RFC 7231 sec 3.1.1.1
|
|
118321
|
+
*
|
|
118322
|
+
* media-type = type "/" subtype
|
|
118323
|
+
* type = token
|
|
118324
|
+
* subtype = token
|
|
118325
|
+
*/
|
|
118326
|
+
const mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
|
|
118327
|
+
|
|
118328
|
+
// default ContentType to prevent repeated object creation
|
|
118329
|
+
const defaultContentType = { type: '', parameters: new NullObject() };
|
|
118330
|
+
Object.freeze(defaultContentType.parameters);
|
|
118331
|
+
Object.freeze(defaultContentType);
|
|
118332
|
+
|
|
118333
|
+
/**
|
|
118334
|
+
* Parse media type to object.
|
|
118335
|
+
*
|
|
118336
|
+
* @param {string|object} header
|
|
118337
|
+
* @return {Object}
|
|
118338
|
+
* @public
|
|
118339
|
+
*/
|
|
118340
|
+
|
|
118341
|
+
function parse (header) {
|
|
118342
|
+
if (typeof header !== 'string') {
|
|
118343
|
+
throw new TypeError('argument header is required and must be a string')
|
|
118344
|
+
}
|
|
118345
|
+
|
|
118346
|
+
let index = header.indexOf(';');
|
|
118347
|
+
const type = index !== -1
|
|
118348
|
+
? header.slice(0, index).trim()
|
|
118349
|
+
: header.trim();
|
|
118350
|
+
|
|
118351
|
+
if (mediaTypeRE.test(type) === false) {
|
|
118352
|
+
throw new TypeError('invalid media type')
|
|
118353
|
+
}
|
|
118354
|
+
|
|
118355
|
+
const result = {
|
|
118356
|
+
type: type.toLowerCase(),
|
|
118357
|
+
parameters: new NullObject()
|
|
118358
|
+
};
|
|
118359
|
+
|
|
118360
|
+
// parse parameters
|
|
118361
|
+
if (index === -1) {
|
|
118362
|
+
return result
|
|
118363
|
+
}
|
|
118364
|
+
|
|
118365
|
+
let key;
|
|
118366
|
+
let match;
|
|
118367
|
+
let value;
|
|
118368
|
+
|
|
118369
|
+
paramRE.lastIndex = index;
|
|
118370
|
+
|
|
118371
|
+
while ((match = paramRE.exec(header))) {
|
|
118372
|
+
if (match.index !== index) {
|
|
118373
|
+
throw new TypeError('invalid parameter format')
|
|
118374
|
+
}
|
|
118375
|
+
|
|
118376
|
+
index += match[0].length;
|
|
118377
|
+
key = match[1].toLowerCase();
|
|
118378
|
+
value = match[2];
|
|
118379
|
+
|
|
118380
|
+
if (value[0] === '"') {
|
|
118381
|
+
// remove quotes and escapes
|
|
118382
|
+
value = value
|
|
118383
|
+
.slice(1, value.length - 1);
|
|
118384
|
+
|
|
118385
|
+
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'));
|
|
118386
|
+
}
|
|
118387
|
+
|
|
118388
|
+
result.parameters[key] = value;
|
|
118389
|
+
}
|
|
118390
|
+
|
|
118391
|
+
if (index !== header.length) {
|
|
118392
|
+
throw new TypeError('invalid parameter format')
|
|
118393
|
+
}
|
|
118394
|
+
|
|
118395
|
+
return result
|
|
118396
|
+
}
|
|
118397
|
+
|
|
118398
|
+
function safeParse (header) {
|
|
118399
|
+
if (typeof header !== 'string') {
|
|
118400
|
+
return defaultContentType
|
|
118401
|
+
}
|
|
118402
|
+
|
|
118403
|
+
let index = header.indexOf(';');
|
|
118404
|
+
const type = index !== -1
|
|
118405
|
+
? header.slice(0, index).trim()
|
|
118406
|
+
: header.trim();
|
|
118407
|
+
|
|
118408
|
+
if (mediaTypeRE.test(type) === false) {
|
|
118409
|
+
return defaultContentType
|
|
118410
|
+
}
|
|
118411
|
+
|
|
118412
|
+
const result = {
|
|
118413
|
+
type: type.toLowerCase(),
|
|
118414
|
+
parameters: new NullObject()
|
|
118415
|
+
};
|
|
118416
|
+
|
|
118417
|
+
// parse parameters
|
|
118418
|
+
if (index === -1) {
|
|
118419
|
+
return result
|
|
118420
|
+
}
|
|
118421
|
+
|
|
118422
|
+
let key;
|
|
118423
|
+
let match;
|
|
118424
|
+
let value;
|
|
118425
|
+
|
|
118426
|
+
paramRE.lastIndex = index;
|
|
118427
|
+
|
|
118428
|
+
while ((match = paramRE.exec(header))) {
|
|
118429
|
+
if (match.index !== index) {
|
|
118430
|
+
return defaultContentType
|
|
118431
|
+
}
|
|
118432
|
+
|
|
118433
|
+
index += match[0].length;
|
|
118434
|
+
key = match[1].toLowerCase();
|
|
118435
|
+
value = match[2];
|
|
118436
|
+
|
|
118437
|
+
if (value[0] === '"') {
|
|
118438
|
+
// remove quotes and escapes
|
|
118439
|
+
value = value
|
|
118440
|
+
.slice(1, value.length - 1);
|
|
118441
|
+
|
|
118442
|
+
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, '$1'));
|
|
118443
|
+
}
|
|
118444
|
+
|
|
118445
|
+
result.parameters[key] = value;
|
|
118446
|
+
}
|
|
118447
|
+
|
|
118448
|
+
if (index !== header.length) {
|
|
118449
|
+
return defaultContentType
|
|
118450
|
+
}
|
|
118451
|
+
|
|
118452
|
+
return result
|
|
118453
|
+
}
|
|
118454
|
+
|
|
118455
|
+
fastContentTypeParse.default = { parse, safeParse };
|
|
118456
|
+
fastContentTypeParse.parse = parse;
|
|
118457
|
+
fastContentTypeParse.safeParse = safeParse;
|
|
118458
|
+
fastContentTypeParse.defaultContentType = defaultContentType;
|
|
118459
|
+
return fastContentTypeParse;
|
|
118460
|
+
}
|
|
118461
|
+
|
|
118462
|
+
var fastContentTypeParseExports = requireFastContentTypeParse();
|
|
118463
|
+
|
|
118464
|
+
const intRegex = /^-?\d+$/;
|
|
118465
|
+
const noiseValue = /^-?\d+n+$/; // Noise - strings that match the custom format before being converted to it
|
|
118466
|
+
const originalStringify = JSON.stringify;
|
|
118467
|
+
const originalParse = JSON.parse;
|
|
118468
|
+
const customFormat = /^-?\d+n$/;
|
|
118469
|
+
|
|
118470
|
+
const bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
|
|
118471
|
+
const noiseStringify =
|
|
118472
|
+
/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
|
|
118473
|
+
|
|
118474
|
+
/** @typedef {(key: string, value: any, context?: { source: string }) => any} Reviver */
|
|
118475
|
+
|
|
118476
|
+
/**
|
|
118477
|
+
* Function to serialize value to a JSON string.
|
|
118478
|
+
* Converts BigInt values to a custom format (strings with digits and "n" at the end) and then converts them to proper big integers in a JSON string.
|
|
118479
|
+
* @param {*} value - The value to convert to a JSON string.
|
|
118480
|
+
* @param {(Function|Array<string>|null)} [replacer] - A function that alters the behavior of the stringification process, or an array of strings to indicate properties to exclude.
|
|
118481
|
+
* @param {(string|number)} [space] - A string or number to specify indentation or pretty-printing.
|
|
118482
|
+
* @returns {string} The JSON string representation.
|
|
118483
|
+
*/
|
|
118484
|
+
const JSONStringify = (value, replacer, space) => {
|
|
118485
|
+
if ("rawJSON" in JSON) {
|
|
118486
|
+
return originalStringify(
|
|
118487
|
+
value,
|
|
118488
|
+
(key, value) => {
|
|
118489
|
+
if (typeof value === "bigint") return JSON.rawJSON(value.toString());
|
|
118490
|
+
|
|
118491
|
+
if (Array.isArray(replacer) && replacer.includes(key)) return value;
|
|
118492
|
+
|
|
118493
|
+
return value;
|
|
118494
|
+
},
|
|
118495
|
+
space,
|
|
118496
|
+
);
|
|
118497
|
+
}
|
|
118498
|
+
|
|
118499
|
+
if (!value) return originalStringify(value, replacer, space);
|
|
118500
|
+
|
|
118501
|
+
const convertedToCustomJSON = originalStringify(
|
|
118502
|
+
value,
|
|
118503
|
+
(key, value) => {
|
|
118504
|
+
const isNoise =
|
|
118505
|
+
typeof value === "string" && Boolean(value.match(noiseValue));
|
|
118506
|
+
|
|
118507
|
+
if (isNoise) return value.toString() + "n"; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing
|
|
118508
|
+
|
|
118509
|
+
if (typeof value === "bigint") return value.toString() + "n";
|
|
118510
|
+
|
|
118511
|
+
if (Array.isArray(replacer) && replacer.includes(key)) return value;
|
|
118512
|
+
|
|
118513
|
+
return value;
|
|
118514
|
+
},
|
|
118515
|
+
space,
|
|
118516
|
+
);
|
|
118517
|
+
const processedJSON = convertedToCustomJSON.replace(
|
|
118518
|
+
bigIntsStringify,
|
|
118519
|
+
"$1$2$3",
|
|
118520
|
+
); // Delete one "n" off the end of every BigInt value
|
|
118521
|
+
const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3"); // Remove one "n" off the end of every noisy string
|
|
118522
|
+
|
|
118523
|
+
return denoisedJSON;
|
|
118524
|
+
};
|
|
118525
|
+
|
|
118526
|
+
/**
|
|
118527
|
+
* Support for JSON.parse's context.source feature detection.
|
|
118528
|
+
* @type {boolean}
|
|
118529
|
+
*/
|
|
118530
|
+
const isContextSourceSupported = () =>
|
|
118531
|
+
JSON.parse("1", (_, __, context) => !!context && context.source === "1");
|
|
118532
|
+
|
|
118533
|
+
/**
|
|
118534
|
+
* Convert marked big numbers to BigInt
|
|
118535
|
+
* @type {Reviver}
|
|
118536
|
+
*/
|
|
118537
|
+
const convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
|
|
118538
|
+
const isCustomFormatBigInt =
|
|
118539
|
+
typeof value === "string" && value.match(customFormat);
|
|
118540
|
+
if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
|
|
118541
|
+
|
|
118542
|
+
const isNoiseValue = typeof value === "string" && value.match(noiseValue);
|
|
118543
|
+
if (isNoiseValue) return value.slice(0, -1);
|
|
118544
|
+
|
|
118545
|
+
return value;
|
|
118546
|
+
};
|
|
118547
|
+
|
|
118548
|
+
/**
|
|
118549
|
+
* Faster (2x) and simpler function to parse JSON.
|
|
118550
|
+
* Based on JSON.parse's context.source feature, which is not universally available now.
|
|
118551
|
+
* Does not support the legacy custom format, used in the first version of this library.
|
|
118552
|
+
*/
|
|
118553
|
+
const JSONParseV2 = (text, reviver) => {
|
|
118554
|
+
return JSON.parse(text, (key, value, context) => {
|
|
118555
|
+
const isBigNumber =
|
|
118556
|
+
typeof value === "number" &&
|
|
118557
|
+
(value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
|
|
118558
|
+
const isInt = context && intRegex.test(context.source);
|
|
118559
|
+
const isBigInt = isBigNumber && isInt;
|
|
118560
|
+
|
|
118561
|
+
if (isBigInt) return BigInt(context.source);
|
|
118562
|
+
|
|
118563
|
+
return value;
|
|
118564
|
+
});
|
|
118565
|
+
};
|
|
118566
|
+
|
|
118567
|
+
const MAX_INT = Number.MAX_SAFE_INTEGER.toString();
|
|
118568
|
+
const MAX_DIGITS = MAX_INT.length;
|
|
118569
|
+
const stringsOrLargeNumbers =
|
|
118570
|
+
/"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
|
|
118571
|
+
const noiseValueWithQuotes = /^"-?\d+n+"$/; // Noise - strings that match the custom format before being converted to it
|
|
118572
|
+
|
|
118573
|
+
/**
|
|
118574
|
+
* Function to parse JSON.
|
|
118575
|
+
* If JSON has number values greater than Number.MAX_SAFE_INTEGER, we convert those values to a custom format, then parse them to BigInt values.
|
|
118576
|
+
* Other types of values are not affected and parsed as native JSON.parse() would parse them.
|
|
118577
|
+
*/
|
|
118578
|
+
const JSONParse = (text, reviver) => {
|
|
118579
|
+
if (!text) return originalParse(text, reviver);
|
|
118580
|
+
|
|
118581
|
+
if (isContextSourceSupported()) return JSONParseV2(text); // Shortcut to a faster (2x) and simpler version
|
|
118582
|
+
|
|
118583
|
+
// Find and mark big numbers with "n"
|
|
118584
|
+
const serializedData = text.replace(
|
|
118585
|
+
stringsOrLargeNumbers,
|
|
118586
|
+
(text, digits, fractional, exponential) => {
|
|
118587
|
+
const isString = text[0] === '"';
|
|
118588
|
+
const isNoise = isString && Boolean(text.match(noiseValueWithQuotes));
|
|
118589
|
+
|
|
118590
|
+
if (isNoise) return text.substring(0, text.length - 1) + 'n"'; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing
|
|
118591
|
+
|
|
118592
|
+
const isFractionalOrExponential = fractional || exponential;
|
|
118593
|
+
const isLessThanMaxSafeInt =
|
|
118594
|
+
digits &&
|
|
118595
|
+
(digits.length < MAX_DIGITS ||
|
|
118596
|
+
(digits.length === MAX_DIGITS && digits <= MAX_INT)); // With a fixed number of digits, we can correctly use lexicographical comparison to do a numeric comparison
|
|
118597
|
+
|
|
118598
|
+
if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
|
|
118599
|
+
return text;
|
|
118600
|
+
|
|
118601
|
+
return '"' + text + 'n"';
|
|
118602
|
+
},
|
|
118603
|
+
);
|
|
118604
|
+
|
|
118605
|
+
return originalParse(serializedData, (key, value, context) =>
|
|
118606
|
+
convertMarkedBigIntsReviver(key, value),
|
|
118607
|
+
);
|
|
118608
|
+
};
|
|
118609
|
+
|
|
118610
|
+
class RequestError extends Error {
|
|
118611
|
+
name;
|
|
118612
|
+
/**
|
|
118613
|
+
* http status code
|
|
118614
|
+
*/
|
|
118615
|
+
status;
|
|
118616
|
+
/**
|
|
118617
|
+
* Request options that lead to the error.
|
|
118618
|
+
*/
|
|
118619
|
+
request;
|
|
118620
|
+
/**
|
|
118621
|
+
* Response object if a response was received
|
|
118622
|
+
*/
|
|
118623
|
+
response;
|
|
118624
|
+
constructor(message, statusCode, options) {
|
|
118625
|
+
super(message, { cause: options.cause });
|
|
118626
|
+
this.name = "HttpError";
|
|
118627
|
+
this.status = Number.parseInt(statusCode);
|
|
118628
|
+
if (Number.isNaN(this.status)) {
|
|
118629
|
+
this.status = 0;
|
|
118630
|
+
}
|
|
118631
|
+
/* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */
|
|
118632
|
+
if ("response" in options) {
|
|
118633
|
+
this.response = options.response;
|
|
118634
|
+
}
|
|
118635
|
+
const requestCopy = Object.assign({}, options.request);
|
|
118636
|
+
if (options.request.headers.authorization) {
|
|
118637
|
+
requestCopy.headers = Object.assign({}, options.request.headers, {
|
|
118638
|
+
authorization: options.request.headers.authorization.replace(
|
|
118639
|
+
/(?<! ) .*$/,
|
|
118640
|
+
" [REDACTED]"
|
|
118641
|
+
)
|
|
118642
|
+
});
|
|
118643
|
+
}
|
|
118644
|
+
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
|
118645
|
+
this.request = requestCopy;
|
|
118646
|
+
}
|
|
118647
|
+
}
|
|
118648
|
+
|
|
118649
|
+
// pkg/dist-src/index.js
|
|
118650
|
+
|
|
118651
|
+
// pkg/dist-src/version.js
|
|
118652
|
+
var VERSION$2 = "10.0.8";
|
|
118653
|
+
|
|
118654
|
+
// pkg/dist-src/defaults.js
|
|
118655
|
+
var defaults_default = {
|
|
118656
|
+
headers: {
|
|
118657
|
+
"user-agent": `octokit-request.js/${VERSION$2} ${getUserAgent()}`
|
|
118658
|
+
}
|
|
118659
|
+
};
|
|
118660
|
+
|
|
118661
|
+
// pkg/dist-src/is-plain-object.js
|
|
118662
|
+
function isPlainObject(value) {
|
|
118663
|
+
if (typeof value !== "object" || value === null) return false;
|
|
118664
|
+
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
|
|
118665
|
+
const proto = Object.getPrototypeOf(value);
|
|
118666
|
+
if (proto === null) return true;
|
|
118667
|
+
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
118668
|
+
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
|
118669
|
+
}
|
|
118670
|
+
var noop$1 = () => "";
|
|
118671
|
+
async function fetchWrapper(requestOptions) {
|
|
118672
|
+
const fetch = requestOptions.request?.fetch || globalThis.fetch;
|
|
118673
|
+
if (!fetch) {
|
|
118674
|
+
throw new Error(
|
|
118675
|
+
"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"
|
|
118676
|
+
);
|
|
118677
|
+
}
|
|
118678
|
+
const log = requestOptions.request?.log || console;
|
|
118679
|
+
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
118680
|
+
const body = isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
|
|
118681
|
+
const requestHeaders = Object.fromEntries(
|
|
118682
|
+
Object.entries(requestOptions.headers).map(([name, value]) => [
|
|
118683
|
+
name,
|
|
118684
|
+
String(value)
|
|
118685
|
+
])
|
|
118686
|
+
);
|
|
118687
|
+
let fetchResponse;
|
|
118688
|
+
try {
|
|
118689
|
+
fetchResponse = await fetch(requestOptions.url, {
|
|
118690
|
+
method: requestOptions.method,
|
|
118691
|
+
body,
|
|
118692
|
+
redirect: requestOptions.request?.redirect,
|
|
118693
|
+
headers: requestHeaders,
|
|
118694
|
+
signal: requestOptions.request?.signal,
|
|
118695
|
+
// duplex must be set if request.body is ReadableStream or Async Iterables.
|
|
118696
|
+
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
|
|
118697
|
+
...requestOptions.body && { duplex: "half" }
|
|
118698
|
+
});
|
|
118699
|
+
} catch (error) {
|
|
118700
|
+
let message = "Unknown Error";
|
|
118701
|
+
if (error instanceof Error) {
|
|
118702
|
+
if (error.name === "AbortError") {
|
|
118703
|
+
error.status = 500;
|
|
118704
|
+
throw error;
|
|
118705
|
+
}
|
|
118706
|
+
message = error.message;
|
|
118707
|
+
if (error.name === "TypeError" && "cause" in error) {
|
|
118708
|
+
if (error.cause instanceof Error) {
|
|
118709
|
+
message = error.cause.message;
|
|
118710
|
+
} else if (typeof error.cause === "string") {
|
|
118711
|
+
message = error.cause;
|
|
118712
|
+
}
|
|
118713
|
+
}
|
|
118714
|
+
}
|
|
118715
|
+
const requestError = new RequestError(message, 500, {
|
|
118716
|
+
request: requestOptions
|
|
118717
|
+
});
|
|
118718
|
+
requestError.cause = error;
|
|
118719
|
+
throw requestError;
|
|
118720
|
+
}
|
|
118721
|
+
const status = fetchResponse.status;
|
|
118722
|
+
const url = fetchResponse.url;
|
|
118723
|
+
const responseHeaders = {};
|
|
118724
|
+
for (const [key, value] of fetchResponse.headers) {
|
|
118725
|
+
responseHeaders[key] = value;
|
|
118726
|
+
}
|
|
118727
|
+
const octokitResponse = {
|
|
118728
|
+
url,
|
|
118729
|
+
status,
|
|
118730
|
+
headers: responseHeaders,
|
|
118731
|
+
data: ""
|
|
118732
|
+
};
|
|
118733
|
+
if ("deprecation" in responseHeaders) {
|
|
118734
|
+
const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
|
|
118735
|
+
const deprecationLink = matches && matches.pop();
|
|
118736
|
+
log.warn(
|
|
118737
|
+
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
|
|
118738
|
+
);
|
|
118739
|
+
}
|
|
118740
|
+
if (status === 204 || status === 205) {
|
|
118741
|
+
return octokitResponse;
|
|
118742
|
+
}
|
|
118743
|
+
if (requestOptions.method === "HEAD") {
|
|
118744
|
+
if (status < 400) {
|
|
118745
|
+
return octokitResponse;
|
|
118746
|
+
}
|
|
118747
|
+
throw new RequestError(fetchResponse.statusText, status, {
|
|
118748
|
+
response: octokitResponse,
|
|
118749
|
+
request: requestOptions
|
|
118750
|
+
});
|
|
118751
|
+
}
|
|
118752
|
+
if (status === 304) {
|
|
118753
|
+
octokitResponse.data = await getResponseData(fetchResponse);
|
|
118754
|
+
throw new RequestError("Not modified", status, {
|
|
118755
|
+
response: octokitResponse,
|
|
118756
|
+
request: requestOptions
|
|
118757
|
+
});
|
|
118758
|
+
}
|
|
118759
|
+
if (status >= 400) {
|
|
118760
|
+
octokitResponse.data = await getResponseData(fetchResponse);
|
|
118761
|
+
throw new RequestError(toErrorMessage(octokitResponse.data), status, {
|
|
118762
|
+
response: octokitResponse,
|
|
118763
|
+
request: requestOptions
|
|
118764
|
+
});
|
|
118765
|
+
}
|
|
118766
|
+
octokitResponse.data = parseSuccessResponseBody ? await getResponseData(fetchResponse) : fetchResponse.body;
|
|
118767
|
+
return octokitResponse;
|
|
118768
|
+
}
|
|
118769
|
+
async function getResponseData(response) {
|
|
118770
|
+
const contentType = response.headers.get("content-type");
|
|
118771
|
+
if (!contentType) {
|
|
118772
|
+
return response.text().catch(noop$1);
|
|
118773
|
+
}
|
|
118774
|
+
const mimetype = fastContentTypeParseExports.safeParse(contentType);
|
|
118775
|
+
if (isJSONResponse(mimetype)) {
|
|
118776
|
+
let text = "";
|
|
118777
|
+
try {
|
|
118778
|
+
text = await response.text();
|
|
118779
|
+
return JSONParse(text);
|
|
118780
|
+
} catch (err) {
|
|
118781
|
+
return text;
|
|
118782
|
+
}
|
|
118783
|
+
} else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
|
|
118784
|
+
return response.text().catch(noop$1);
|
|
118785
|
+
} else {
|
|
118786
|
+
return response.arrayBuffer().catch(
|
|
118787
|
+
/* v8 ignore next -- @preserve */
|
|
118788
|
+
() => new ArrayBuffer(0)
|
|
118789
|
+
);
|
|
118790
|
+
}
|
|
118791
|
+
}
|
|
118792
|
+
function isJSONResponse(mimetype) {
|
|
118793
|
+
return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
|
|
118794
|
+
}
|
|
118795
|
+
function toErrorMessage(data) {
|
|
118796
|
+
if (typeof data === "string") {
|
|
118797
|
+
return data;
|
|
118798
|
+
}
|
|
118799
|
+
if (data instanceof ArrayBuffer) {
|
|
118800
|
+
return "Unknown error";
|
|
118801
|
+
}
|
|
118802
|
+
if ("message" in data) {
|
|
118803
|
+
const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : "";
|
|
118804
|
+
return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`;
|
|
118805
|
+
}
|
|
118806
|
+
return `Unknown error: ${JSON.stringify(data)}`;
|
|
118807
|
+
}
|
|
118808
|
+
|
|
118809
|
+
// pkg/dist-src/with-defaults.js
|
|
118810
|
+
function withDefaults$1(oldEndpoint, newDefaults) {
|
|
118811
|
+
const endpoint2 = oldEndpoint.defaults(newDefaults);
|
|
118812
|
+
const newApi = function(route, parameters) {
|
|
118813
|
+
const endpointOptions = endpoint2.merge(route, parameters);
|
|
118814
|
+
if (!endpointOptions.request || !endpointOptions.request.hook) {
|
|
118815
|
+
return fetchWrapper(endpoint2.parse(endpointOptions));
|
|
118816
|
+
}
|
|
118817
|
+
const request2 = (route2, parameters2) => {
|
|
118818
|
+
return fetchWrapper(
|
|
118819
|
+
endpoint2.parse(endpoint2.merge(route2, parameters2))
|
|
118820
|
+
);
|
|
118821
|
+
};
|
|
118822
|
+
Object.assign(request2, {
|
|
118823
|
+
endpoint: endpoint2,
|
|
118824
|
+
defaults: withDefaults$1.bind(null, endpoint2)
|
|
118825
|
+
});
|
|
118826
|
+
return endpointOptions.request.hook(request2, endpointOptions);
|
|
118827
|
+
};
|
|
118828
|
+
return Object.assign(newApi, {
|
|
118829
|
+
endpoint: endpoint2,
|
|
118830
|
+
defaults: withDefaults$1.bind(null, endpoint2)
|
|
118831
|
+
});
|
|
118832
|
+
}
|
|
118833
|
+
|
|
118834
|
+
// pkg/dist-src/index.js
|
|
118835
|
+
var request = withDefaults$1(endpoint, defaults_default);
|
|
118836
|
+
/* v8 ignore next -- @preserve */
|
|
118837
|
+
/* v8 ignore else -- @preserve */
|
|
118838
|
+
|
|
118839
|
+
// pkg/dist-src/index.js
|
|
118840
|
+
|
|
118841
|
+
// pkg/dist-src/version.js
|
|
118842
|
+
var VERSION$1 = "0.0.0-development";
|
|
118843
|
+
|
|
118844
|
+
// pkg/dist-src/error.js
|
|
118845
|
+
function _buildMessageForResponseErrors(data) {
|
|
118846
|
+
return `Request failed due to following response errors:
|
|
118847
|
+
` + data.errors.map((e) => ` - ${e.message}`).join("\n");
|
|
118848
|
+
}
|
|
118849
|
+
var GraphqlResponseError = class extends Error {
|
|
118850
|
+
constructor(request2, headers, response) {
|
|
118851
|
+
super(_buildMessageForResponseErrors(response));
|
|
118852
|
+
this.request = request2;
|
|
118853
|
+
this.headers = headers;
|
|
118854
|
+
this.response = response;
|
|
118855
|
+
this.errors = response.errors;
|
|
118856
|
+
this.data = response.data;
|
|
118857
|
+
if (Error.captureStackTrace) {
|
|
118858
|
+
Error.captureStackTrace(this, this.constructor);
|
|
118859
|
+
}
|
|
118860
|
+
}
|
|
118861
|
+
name = "GraphqlResponseError";
|
|
118862
|
+
errors;
|
|
118863
|
+
data;
|
|
118864
|
+
};
|
|
118865
|
+
|
|
118866
|
+
// pkg/dist-src/graphql.js
|
|
118867
|
+
var NON_VARIABLE_OPTIONS = [
|
|
118868
|
+
"method",
|
|
118869
|
+
"baseUrl",
|
|
118870
|
+
"url",
|
|
118871
|
+
"headers",
|
|
118872
|
+
"request",
|
|
118873
|
+
"query",
|
|
118874
|
+
"mediaType",
|
|
118875
|
+
"operationName"
|
|
118876
|
+
];
|
|
118877
|
+
var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
|
|
118878
|
+
var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
|
118879
|
+
function graphql(request2, query, options) {
|
|
118880
|
+
if (options) {
|
|
118881
|
+
if (typeof query === "string" && "query" in options) {
|
|
118882
|
+
return Promise.reject(
|
|
118883
|
+
new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
|
|
118884
|
+
);
|
|
118885
|
+
}
|
|
118886
|
+
for (const key in options) {
|
|
118887
|
+
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
|
|
118888
|
+
return Promise.reject(
|
|
118889
|
+
new Error(
|
|
118890
|
+
`[@octokit/graphql] "${key}" cannot be used as variable name`
|
|
118891
|
+
)
|
|
118892
|
+
);
|
|
118893
|
+
}
|
|
118894
|
+
}
|
|
118895
|
+
const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
|
|
118896
|
+
const requestOptions = Object.keys(
|
|
118897
|
+
parsedOptions
|
|
118898
|
+
).reduce((result, key) => {
|
|
118899
|
+
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
|
118900
|
+
result[key] = parsedOptions[key];
|
|
118901
|
+
return result;
|
|
118902
|
+
}
|
|
118903
|
+
if (!result.variables) {
|
|
118904
|
+
result.variables = {};
|
|
118905
|
+
}
|
|
118906
|
+
result.variables[key] = parsedOptions[key];
|
|
118907
|
+
return result;
|
|
118908
|
+
}, {});
|
|
118909
|
+
const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
|
|
118910
|
+
if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
|
|
118911
|
+
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
|
|
118912
|
+
}
|
|
118913
|
+
return request2(requestOptions).then((response) => {
|
|
118914
|
+
if (response.data.errors) {
|
|
118915
|
+
const headers = {};
|
|
118916
|
+
for (const key of Object.keys(response.headers)) {
|
|
118917
|
+
headers[key] = response.headers[key];
|
|
118918
|
+
}
|
|
118919
|
+
throw new GraphqlResponseError(
|
|
118920
|
+
requestOptions,
|
|
118921
|
+
headers,
|
|
118922
|
+
response.data
|
|
118923
|
+
);
|
|
118924
|
+
}
|
|
118925
|
+
return response.data.data;
|
|
118926
|
+
});
|
|
118927
|
+
}
|
|
118928
|
+
|
|
118929
|
+
// pkg/dist-src/with-defaults.js
|
|
118930
|
+
function withDefaults(request2, newDefaults) {
|
|
118931
|
+
const newRequest = request2.defaults(newDefaults);
|
|
118932
|
+
const newApi = (query, options) => {
|
|
118933
|
+
return graphql(newRequest, query, options);
|
|
118934
|
+
};
|
|
118935
|
+
return Object.assign(newApi, {
|
|
118936
|
+
defaults: withDefaults.bind(null, newRequest),
|
|
118937
|
+
endpoint: newRequest.endpoint
|
|
118938
|
+
});
|
|
118939
|
+
}
|
|
118940
|
+
|
|
118941
|
+
// pkg/dist-src/index.js
|
|
118942
|
+
withDefaults(request, {
|
|
118943
|
+
headers: {
|
|
118944
|
+
"user-agent": `octokit-graphql.js/${VERSION$1} ${getUserAgent()}`
|
|
118945
|
+
},
|
|
118946
|
+
method: "POST",
|
|
118947
|
+
url: "/graphql"
|
|
118948
|
+
});
|
|
118949
|
+
function withCustomRequest(customRequest) {
|
|
118950
|
+
return withDefaults(customRequest, {
|
|
118951
|
+
method: "POST",
|
|
118952
|
+
url: "/graphql"
|
|
118953
|
+
});
|
|
118954
|
+
}
|
|
118955
|
+
|
|
118956
|
+
// pkg/dist-src/is-jwt.js
|
|
118957
|
+
var b64url = "(?:[a-zA-Z0-9_-]+)";
|
|
118958
|
+
var sep = "\\.";
|
|
118959
|
+
var jwtRE = new RegExp(`^${b64url}${sep}${b64url}${sep}${b64url}$`);
|
|
118960
|
+
var isJWT = jwtRE.test.bind(jwtRE);
|
|
118961
|
+
|
|
118962
|
+
// pkg/dist-src/auth.js
|
|
118963
|
+
async function auth(token) {
|
|
118964
|
+
const isApp = isJWT(token);
|
|
118965
|
+
const isInstallation = token.startsWith("v1.") || token.startsWith("ghs_");
|
|
118966
|
+
const isUserToServer = token.startsWith("ghu_");
|
|
118967
|
+
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
|
118968
|
+
return {
|
|
118969
|
+
type: "token",
|
|
118970
|
+
token,
|
|
118971
|
+
tokenType
|
|
118972
|
+
};
|
|
118973
|
+
}
|
|
118974
|
+
|
|
118975
|
+
// pkg/dist-src/with-authorization-prefix.js
|
|
118976
|
+
function withAuthorizationPrefix(token) {
|
|
118977
|
+
if (token.split(/\./).length === 3) {
|
|
118978
|
+
return `bearer ${token}`;
|
|
118979
|
+
}
|
|
118980
|
+
return `token ${token}`;
|
|
118981
|
+
}
|
|
118982
|
+
|
|
118983
|
+
// pkg/dist-src/hook.js
|
|
118984
|
+
async function hook(token, request, route, parameters) {
|
|
118985
|
+
const endpoint = request.endpoint.merge(
|
|
118986
|
+
route,
|
|
118987
|
+
parameters
|
|
118988
|
+
);
|
|
118989
|
+
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
|
118990
|
+
return request(endpoint);
|
|
118991
|
+
}
|
|
118992
|
+
|
|
118993
|
+
// pkg/dist-src/index.js
|
|
118994
|
+
var createTokenAuth = function createTokenAuth2(token) {
|
|
118995
|
+
if (!token) {
|
|
118996
|
+
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
|
118997
|
+
}
|
|
118998
|
+
if (typeof token !== "string") {
|
|
118999
|
+
throw new Error(
|
|
119000
|
+
"[@octokit/auth-token] Token passed to createTokenAuth is not a string"
|
|
119001
|
+
);
|
|
119002
|
+
}
|
|
119003
|
+
token = token.replace(/^(token|bearer) +/i, "");
|
|
119004
|
+
return Object.assign(auth.bind(null, token), {
|
|
119005
|
+
hook: hook.bind(null, token)
|
|
119006
|
+
});
|
|
119007
|
+
};
|
|
119008
|
+
|
|
119009
|
+
const VERSION = "7.0.6";
|
|
119010
|
+
|
|
119011
|
+
const noop = () => {
|
|
119012
|
+
};
|
|
119013
|
+
const consoleWarn = console.warn.bind(console);
|
|
119014
|
+
const consoleError = console.error.bind(console);
|
|
119015
|
+
function createLogger(logger = {}) {
|
|
119016
|
+
if (typeof logger.debug !== "function") {
|
|
119017
|
+
logger.debug = noop;
|
|
119018
|
+
}
|
|
119019
|
+
if (typeof logger.info !== "function") {
|
|
119020
|
+
logger.info = noop;
|
|
119021
|
+
}
|
|
119022
|
+
if (typeof logger.warn !== "function") {
|
|
119023
|
+
logger.warn = consoleWarn;
|
|
119024
|
+
}
|
|
119025
|
+
if (typeof logger.error !== "function") {
|
|
119026
|
+
logger.error = consoleError;
|
|
119027
|
+
}
|
|
119028
|
+
return logger;
|
|
119029
|
+
}
|
|
119030
|
+
const userAgentTrail = `octokit-core.js/${VERSION} ${getUserAgent()}`;
|
|
119031
|
+
class Octokit {
|
|
119032
|
+
static VERSION = VERSION;
|
|
119033
|
+
static defaults(defaults) {
|
|
119034
|
+
const OctokitWithDefaults = class extends this {
|
|
119035
|
+
constructor(...args) {
|
|
119036
|
+
const options = args[0] || {};
|
|
119037
|
+
if (typeof defaults === "function") {
|
|
119038
|
+
super(defaults(options));
|
|
119039
|
+
return;
|
|
119040
|
+
}
|
|
119041
|
+
super(
|
|
119042
|
+
Object.assign(
|
|
119043
|
+
{},
|
|
119044
|
+
defaults,
|
|
119045
|
+
options,
|
|
119046
|
+
options.userAgent && defaults.userAgent ? {
|
|
119047
|
+
userAgent: `${options.userAgent} ${defaults.userAgent}`
|
|
119048
|
+
} : null
|
|
119049
|
+
)
|
|
119050
|
+
);
|
|
119051
|
+
}
|
|
119052
|
+
};
|
|
119053
|
+
return OctokitWithDefaults;
|
|
119054
|
+
}
|
|
119055
|
+
static plugins = [];
|
|
119056
|
+
/**
|
|
119057
|
+
* Attach a plugin (or many) to your Octokit instance.
|
|
119058
|
+
*
|
|
119059
|
+
* @example
|
|
119060
|
+
* const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
|
|
119061
|
+
*/
|
|
119062
|
+
static plugin(...newPlugins) {
|
|
119063
|
+
const currentPlugins = this.plugins;
|
|
119064
|
+
const NewOctokit = class extends this {
|
|
119065
|
+
static plugins = currentPlugins.concat(
|
|
119066
|
+
newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
|
|
119067
|
+
);
|
|
119068
|
+
};
|
|
119069
|
+
return NewOctokit;
|
|
119070
|
+
}
|
|
119071
|
+
constructor(options = {}) {
|
|
119072
|
+
const hook = new Hook.Collection();
|
|
119073
|
+
const requestDefaults = {
|
|
119074
|
+
baseUrl: request.endpoint.DEFAULTS.baseUrl,
|
|
119075
|
+
headers: {},
|
|
119076
|
+
request: Object.assign({}, options.request, {
|
|
119077
|
+
// @ts-ignore internal usage only, no need to type
|
|
119078
|
+
hook: hook.bind(null, "request")
|
|
119079
|
+
}),
|
|
119080
|
+
mediaType: {
|
|
119081
|
+
previews: [],
|
|
119082
|
+
format: ""
|
|
119083
|
+
}
|
|
119084
|
+
};
|
|
119085
|
+
requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
|
|
119086
|
+
if (options.baseUrl) {
|
|
119087
|
+
requestDefaults.baseUrl = options.baseUrl;
|
|
119088
|
+
}
|
|
119089
|
+
if (options.previews) {
|
|
119090
|
+
requestDefaults.mediaType.previews = options.previews;
|
|
119091
|
+
}
|
|
119092
|
+
if (options.timeZone) {
|
|
119093
|
+
requestDefaults.headers["time-zone"] = options.timeZone;
|
|
119094
|
+
}
|
|
119095
|
+
this.request = request.defaults(requestDefaults);
|
|
119096
|
+
this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
|
|
119097
|
+
this.log = createLogger(options.log);
|
|
119098
|
+
this.hook = hook;
|
|
119099
|
+
if (!options.authStrategy) {
|
|
119100
|
+
if (!options.auth) {
|
|
119101
|
+
this.auth = async () => ({
|
|
119102
|
+
type: "unauthenticated"
|
|
119103
|
+
});
|
|
119104
|
+
} else {
|
|
119105
|
+
const auth = createTokenAuth(options.auth);
|
|
119106
|
+
hook.wrap("request", auth.hook);
|
|
119107
|
+
this.auth = auth;
|
|
119108
|
+
}
|
|
119109
|
+
} else {
|
|
119110
|
+
const { authStrategy, ...otherOptions } = options;
|
|
119111
|
+
const auth = authStrategy(
|
|
119112
|
+
Object.assign(
|
|
119113
|
+
{
|
|
119114
|
+
request: this.request,
|
|
119115
|
+
log: this.log,
|
|
119116
|
+
// we pass the current octokit instance as well as its constructor options
|
|
119117
|
+
// to allow for authentication strategies that return a new octokit instance
|
|
119118
|
+
// that shares the same internal state as the current one. The original
|
|
119119
|
+
// requirement for this was the "event-octokit" authentication strategy
|
|
119120
|
+
// of https://github.com/probot/octokit-auth-probot.
|
|
119121
|
+
octokit: this,
|
|
119122
|
+
octokitOptions: otherOptions
|
|
119123
|
+
},
|
|
119124
|
+
options.auth
|
|
119125
|
+
)
|
|
119126
|
+
);
|
|
119127
|
+
hook.wrap("request", auth.hook);
|
|
119128
|
+
this.auth = auth;
|
|
119129
|
+
}
|
|
119130
|
+
const classConstructor = this.constructor;
|
|
119131
|
+
for (let i = 0; i < classConstructor.plugins.length; ++i) {
|
|
119132
|
+
Object.assign(this, classConstructor.plugins[i](this, options));
|
|
119133
|
+
}
|
|
119134
|
+
}
|
|
119135
|
+
// assigned during constructor
|
|
119136
|
+
request;
|
|
119137
|
+
graphql;
|
|
119138
|
+
log;
|
|
119139
|
+
hook;
|
|
119140
|
+
// TODO: type `octokit.auth` based on passed options.authStrategy
|
|
119141
|
+
auth;
|
|
119142
|
+
}
|
|
119143
|
+
|
|
117799
119144
|
const isGithubIssueOpen = async (issueLinks) => {
|
|
117800
|
-
const
|
|
119145
|
+
const octokit = new Octokit({
|
|
119146
|
+
auth: process.env.GITHUB_TOKEN,
|
|
119147
|
+
});
|
|
119148
|
+
const issueStatuses = await Promise.all(issueLinks.map(issueLink => {
|
|
117801
119149
|
const issueSuffix = issueLink.split("github.com/").at(-1);
|
|
119150
|
+
console.log(issueSuffix);
|
|
117802
119151
|
if (!issueSuffix)
|
|
117803
119152
|
return null;
|
|
117804
119153
|
const [owner, repo, _, issueNumber] = issueSuffix.split("/");
|
|
117805
|
-
|
|
117806
|
-
|
|
117807
|
-
|
|
119154
|
+
return octokit.request(`GET /repos/{owner}/{repo}/issues/{issueNumber}`, {
|
|
119155
|
+
owner,
|
|
119156
|
+
repo,
|
|
119157
|
+
issueNumber,
|
|
117808
119158
|
headers: {
|
|
117809
|
-
|
|
117810
|
-
authorization: `token ${process.env.GITHUB_TOKEN}`,
|
|
117811
|
-
"x-github-api-version": "2022-11-28",
|
|
119159
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
117812
119160
|
},
|
|
117813
119161
|
});
|
|
117814
|
-
if (!response.ok)
|
|
117815
|
-
return null;
|
|
117816
|
-
const issue = await response.json();
|
|
117817
|
-
return issue.state;
|
|
117818
119162
|
}));
|
|
117819
|
-
return
|
|
119163
|
+
return issueStatuses.some(issueStatus => issueStatus?.data?.state === "open");
|
|
117820
119164
|
};
|
|
117821
119165
|
|
|
117822
119166
|
class HelpAndProfilePage {
|
|
@@ -124878,17 +126222,17 @@ class EmailDeliveryUtils {
|
|
|
124878
126222
|
};
|
|
124879
126223
|
}
|
|
124880
126224
|
|
|
124881
|
-
var main = {exports: {}};
|
|
126225
|
+
var main$1 = {exports: {}};
|
|
124882
126226
|
|
|
124883
126227
|
var version = "17.3.1";
|
|
124884
126228
|
var require$$4 = {
|
|
124885
126229
|
version: version};
|
|
124886
126230
|
|
|
124887
|
-
var hasRequiredMain;
|
|
126231
|
+
var hasRequiredMain$1;
|
|
124888
126232
|
|
|
124889
|
-
function requireMain () {
|
|
124890
|
-
if (hasRequiredMain) return main.exports;
|
|
124891
|
-
hasRequiredMain = 1;
|
|
126233
|
+
function requireMain$1 () {
|
|
126234
|
+
if (hasRequiredMain$1) return main$1.exports;
|
|
126235
|
+
hasRequiredMain$1 = 1;
|
|
124892
126236
|
const fs = fs__default;
|
|
124893
126237
|
const path = path__default;
|
|
124894
126238
|
const os$1 = os;
|
|
@@ -125311,20 +126655,130 @@ function requireMain () {
|
|
|
125311
126655
|
populate
|
|
125312
126656
|
};
|
|
125313
126657
|
|
|
125314
|
-
main.exports.configDotenv = DotenvModule.configDotenv;
|
|
125315
|
-
main.exports._configVault = DotenvModule._configVault;
|
|
125316
|
-
main.exports._parseVault = DotenvModule._parseVault;
|
|
125317
|
-
main.exports.config = DotenvModule.config;
|
|
125318
|
-
main.exports.decrypt = DotenvModule.decrypt;
|
|
125319
|
-
main.exports.parse = DotenvModule.parse;
|
|
125320
|
-
main.exports.populate = DotenvModule.populate;
|
|
126658
|
+
main$1.exports.configDotenv = DotenvModule.configDotenv;
|
|
126659
|
+
main$1.exports._configVault = DotenvModule._configVault;
|
|
126660
|
+
main$1.exports._parseVault = DotenvModule._parseVault;
|
|
126661
|
+
main$1.exports.config = DotenvModule.config;
|
|
126662
|
+
main$1.exports.decrypt = DotenvModule.decrypt;
|
|
126663
|
+
main$1.exports.parse = DotenvModule.parse;
|
|
126664
|
+
main$1.exports.populate = DotenvModule.populate;
|
|
126665
|
+
|
|
126666
|
+
main$1.exports = DotenvModule;
|
|
126667
|
+
return main$1.exports;
|
|
126668
|
+
}
|
|
126669
|
+
|
|
126670
|
+
var mainExports$1 = requireMain$1();
|
|
126671
|
+
var dotenv = /*@__PURE__*/getDefaultExportFromCjs(mainExports$1);
|
|
126672
|
+
|
|
126673
|
+
var main = {};
|
|
126674
|
+
|
|
126675
|
+
var hasRequiredMain;
|
|
126676
|
+
|
|
126677
|
+
function requireMain () {
|
|
126678
|
+
if (hasRequiredMain) return main;
|
|
126679
|
+
hasRequiredMain = 1;
|
|
126680
|
+
|
|
126681
|
+
function _resolveEscapeSequences (value) {
|
|
126682
|
+
return value.replace(/\\\$/g, '$')
|
|
126683
|
+
}
|
|
126684
|
+
|
|
126685
|
+
function expandValue (value, processEnv, runningParsed) {
|
|
126686
|
+
const env = { ...runningParsed, ...processEnv }; // process.env wins
|
|
126687
|
+
|
|
126688
|
+
const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
126689
|
+
|
|
126690
|
+
let result = value;
|
|
126691
|
+
let match;
|
|
126692
|
+
const seen = new Set(); // self-referential checker
|
|
126693
|
+
|
|
126694
|
+
while ((match = regex.exec(result)) !== null) {
|
|
126695
|
+
seen.add(result);
|
|
126696
|
+
|
|
126697
|
+
const [template, bracedExpression, unbracedExpression] = match;
|
|
126698
|
+
const expression = bracedExpression || unbracedExpression;
|
|
126699
|
+
|
|
126700
|
+
// match the operators `:+`, `+`, `:-`, and `-`
|
|
126701
|
+
const opRegex = /(:\+|\+|:-|-)/;
|
|
126702
|
+
// find first match
|
|
126703
|
+
const opMatch = expression.match(opRegex);
|
|
126704
|
+
const splitter = opMatch ? opMatch[0] : null;
|
|
126705
|
+
|
|
126706
|
+
const r = expression.split(splitter);
|
|
126707
|
+
|
|
126708
|
+
let defaultValue;
|
|
126709
|
+
let value;
|
|
126710
|
+
|
|
126711
|
+
const key = r.shift();
|
|
126712
|
+
|
|
126713
|
+
if ([':+', '+'].includes(splitter)) {
|
|
126714
|
+
defaultValue = env[key] ? r.join(splitter) : '';
|
|
126715
|
+
value = null;
|
|
126716
|
+
} else {
|
|
126717
|
+
defaultValue = r.join(splitter);
|
|
126718
|
+
value = env[key];
|
|
126719
|
+
}
|
|
126720
|
+
|
|
126721
|
+
if (value) {
|
|
126722
|
+
// self-referential check
|
|
126723
|
+
if (seen.has(value)) {
|
|
126724
|
+
result = result.replace(template, defaultValue);
|
|
126725
|
+
} else {
|
|
126726
|
+
result = result.replace(template, value);
|
|
126727
|
+
}
|
|
126728
|
+
} else {
|
|
126729
|
+
result = result.replace(template, defaultValue);
|
|
126730
|
+
}
|
|
126731
|
+
|
|
126732
|
+
// if the result equaled what was in process.env and runningParsed then stop expanding
|
|
126733
|
+
if (result === runningParsed[key]) {
|
|
126734
|
+
break
|
|
126735
|
+
}
|
|
126736
|
+
|
|
126737
|
+
regex.lastIndex = 0; // reset regex search position to re-evaluate after each replacement
|
|
126738
|
+
}
|
|
126739
|
+
|
|
126740
|
+
return result
|
|
126741
|
+
}
|
|
126742
|
+
|
|
126743
|
+
function expand (options) {
|
|
126744
|
+
// for use with progressive expansion
|
|
126745
|
+
const runningParsed = {};
|
|
126746
|
+
|
|
126747
|
+
let processEnv = process.env;
|
|
126748
|
+
if (options && options.processEnv != null) {
|
|
126749
|
+
processEnv = options.processEnv;
|
|
126750
|
+
}
|
|
126751
|
+
|
|
126752
|
+
// dotenv.config() ran before this so the assumption is process.env has already been set
|
|
126753
|
+
for (const key in options.parsed) {
|
|
126754
|
+
let value = options.parsed[key];
|
|
126755
|
+
|
|
126756
|
+
// short-circuit scenario: process.env was already set prior to the file value
|
|
126757
|
+
if (processEnv[key] && processEnv[key] !== value) {
|
|
126758
|
+
value = processEnv[key];
|
|
126759
|
+
} else {
|
|
126760
|
+
value = expandValue(value, processEnv, runningParsed);
|
|
126761
|
+
}
|
|
126762
|
+
|
|
126763
|
+
options.parsed[key] = _resolveEscapeSequences(value);
|
|
126764
|
+
|
|
126765
|
+
// for use with progressive expansion
|
|
126766
|
+
runningParsed[key] = _resolveEscapeSequences(value);
|
|
126767
|
+
}
|
|
126768
|
+
|
|
126769
|
+
for (const processKey in options.parsed) {
|
|
126770
|
+
processEnv[processKey] = options.parsed[processKey];
|
|
126771
|
+
}
|
|
126772
|
+
|
|
126773
|
+
return options
|
|
126774
|
+
}
|
|
125321
126775
|
|
|
125322
|
-
main.
|
|
125323
|
-
return main
|
|
126776
|
+
main.expand = expand;
|
|
126777
|
+
return main;
|
|
125324
126778
|
}
|
|
125325
126779
|
|
|
125326
126780
|
var mainExports = requireMain();
|
|
125327
|
-
var
|
|
126781
|
+
var dotenvExpand = /*@__PURE__*/getDefaultExportFromCjs(mainExports);
|
|
125328
126782
|
|
|
125329
126783
|
const E2E_TEST_DIR = "e2e/tests";
|
|
125330
126784
|
const LOG_PREFIX = "[playwright.config]";
|
|
@@ -125385,11 +126839,11 @@ const parseSpecPatterns = () => {
|
|
|
125385
126839
|
};
|
|
125386
126840
|
|
|
125387
126841
|
// @ts-check
|
|
126842
|
+
const loadEnv = (path) => dotenvExpand.expand(dotenv.config({ path, quiet: true }));
|
|
125388
126843
|
const envBasePath = "./e2e/config/.env";
|
|
125389
126844
|
const envLocalPath = `${envBasePath}.local`;
|
|
125390
126845
|
const reporterPackageName = "@bigbinary/neeto-playwright-reporter";
|
|
125391
126846
|
process.env.TEST_ENV = process.env.TEST_ENV ?? ENVIRONMENT.development;
|
|
125392
|
-
const loadEnv = (path) => dotenv.config({ path, quiet: true });
|
|
125393
126847
|
loadEnv(`${envBasePath}.${process.env.TEST_ENV}`);
|
|
125394
126848
|
fs.existsSync(envLocalPath) && loadEnv(envLocalPath);
|
|
125395
126849
|
const playdashStagingConfig = {
|