@bigbinary/neeto-playwright-commons 3.3.4 → 3.3.6

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