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