From 46323b8608b5e13033edf947c20327cb6eb3d0cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 12 Dec 2022 01:20:01 +0000 Subject: [PATCH] [CI] test committed --- dist/index.js | 122 ++++++++++++++++---------------------------------- report.txt | 1 + 2 files changed, 40 insertions(+), 83 deletions(-) create mode 100644 report.txt diff --git a/dist/index.js b/dist/index.js index ee1b989..d7370f0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5024,8 +5024,14 @@ function copyFile(srcFile, destFile, force) { Object.defineProperty(exports, "__esModule", ({ value: true })); +const REGEX_IS_INSTALLATION_LEGACY = /^v1\./; +const REGEX_IS_INSTALLATION = /^ghs_/; +const REGEX_IS_USER_TO_SERVER = /^ghu_/; async function auth(token) { - const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth"; + const isApp = token.split(/\./).length === 3; + const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); + const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); + const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; return { type: "token", token: token, @@ -5087,45 +5093,8 @@ var request = __nccwpck_require__(6234); var graphql = __nccwpck_require__(8467); var authToken = __nccwpck_require__(334); -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; +const VERSION = "4.1.0"; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } - - return target; -} - -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; - - var target = _objectWithoutPropertiesLoose(source, excluded); - - var key, i; - - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; - } - } - - return target; -} - -const VERSION = "3.5.1"; - -const _excluded = ["authStrategy"]; class Octokit { constructor(options = {}) { const hook = new beforeAfterHook.Collection(); @@ -5185,10 +5154,9 @@ class Octokit { } } else { const { - authStrategy - } = options, - otherOptions = _objectWithoutProperties(options, _excluded); - + authStrategy, + ...otherOptions + } = options; const auth = authStrategy(Object.assign({ request: this.request, log: this.log, @@ -5585,8 +5553,6 @@ function parse(options) { } else { if (Object.keys(remainingParameters).length) { body = remainingParameters; - } else { - headers["content-length"] = 0; } } } // default content-type for JSON if body is set @@ -5629,7 +5595,7 @@ function withDefaults(oldDefaults, newDefaults) { }); } -const VERSION = "6.0.12"; +const VERSION = "7.0.3"; const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. // So we use RequestParameters and add method as additional required property. @@ -5666,26 +5632,27 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); var request = __nccwpck_require__(6234); var universalUserAgent = __nccwpck_require__(5030); -const VERSION = "4.6.4"; - -class GraphqlError extends Error { - constructor(request, response) { - const message = response.data.errors[0].message; - super(message); - Object.assign(this, response.data); - Object.assign(this, { - headers: response.headers - }); - this.name = "GraphqlError"; - this.request = request; // Maintains proper stack trace (only available on V8) +const VERSION = "5.0.4"; +function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors:\n` + data.errors.map(e => ` - ${e.message}`).join("\n"); +} +class GraphqlResponseError extends Error { + constructor(request, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request; + this.headers = headers; + this.response = response; + this.name = "GraphqlResponseError"; + // Expose the errors and response data in their shorthand properties. + this.errors = response.errors; + this.data = response.data; + // Maintains proper stack trace (only available on V8) /* istanbul ignore next */ - if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } - } const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; @@ -5696,13 +5663,11 @@ function graphql(request, query, options) { if (typeof query === "string" && "query" in options) { return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); } - for (const key in options) { if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); } } - const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; @@ -5711,50 +5676,38 @@ function graphql(request, query, options) { result[key] = parsedOptions[key]; return result; } - if (!result.variables) { result.variables = {}; } - result.variables[key] = parsedOptions[key]; return result; - }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix + }, {}); + // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 - const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); } - return request(requestOptions).then(response => { if (response.data.errors) { const headers = {}; - for (const key of Object.keys(response.headers)) { headers[key] = response.headers[key]; } - - throw new GraphqlError(requestOptions, { - headers, - data: response.data - }); + throw new GraphqlResponseError(requestOptions, headers, response.data); } - return response.data.data; }); } -function withDefaults(request$1, newDefaults) { - const newRequest = request$1.defaults(newDefaults); - +function withDefaults(request, newDefaults) { + const newRequest = request.defaults(newDefaults); const newApi = (query, options) => { return graphql(newRequest, query, options); }; - return Object.assign(newApi, { defaults: withDefaults.bind(null, newRequest), - endpoint: request.request.endpoint + endpoint: newRequest.endpoint }); } @@ -5772,6 +5725,7 @@ function withCustomRequest(customRequest) { }); } +exports.GraphqlResponseError = GraphqlResponseError; exports.graphql = graphql$1; exports.withCustomRequest = withCustomRequest; //# sourceMappingURL=index.js.map @@ -7135,7 +7089,7 @@ var isPlainObject = __nccwpck_require__(3287); var nodeFetch = _interopDefault(__nccwpck_require__(467)); var requestError = __nccwpck_require__(537); -const VERSION = "5.6.0"; +const VERSION = "6.2.2"; function getBufferResponse(response) { return response.arrayBuffer(); @@ -7151,7 +7105,9 @@ function fetchWrapper(requestOptions) { let headers = {}; let status; let url; - const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; + const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || + /* istanbul ignore next */ + nodeFetch; return fetch(requestOptions.url, Object.assign({ method: requestOptions.method, body: requestOptions.body, @@ -7229,7 +7185,7 @@ function fetchWrapper(requestOptions) { data }; }).catch(error => { - if (error instanceof requestError.RequestError) throw error; + if (error instanceof requestError.RequestError) throw error;else if (error.name === "AbortError") throw error; throw new requestError.RequestError(error.message, 500, { request: requestOptions }); diff --git a/report.txt b/report.txt new file mode 100644 index 0000000..f7691c0 --- /dev/null +++ b/report.txt @@ -0,0 +1 @@ +1670808000