@bigbinary/neeto-playwright-commons 3.3.2 → 3.3.4

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