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