Skip to content

Commit 41f3207

Browse files
authored
Merge pull request #46 from peter-evans/update-distribution
Update distribution
2 parents 2a38a6b + f1bebe1 commit 41f3207

File tree

1 file changed

+71
-78
lines changed

1 file changed

+71
-78
lines changed

dist/index.js

Lines changed: 71 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ module.exports =
1919
/******/ };
2020
/******/
2121
/******/ // Execute the module function
22-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22+
/******/ var threw = true;
23+
/******/ try {
24+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
25+
/******/ threw = false;
26+
/******/ } finally {
27+
/******/ if(threw) delete installedModules[moduleId];
28+
/******/ }
2329
/******/
2430
/******/ // Flag the module as loaded
2531
/******/ module.l = true;
@@ -386,13 +392,6 @@ module.exports._parse = parse;
386392
module.exports._enoent = enoent;
387393

388394

389-
/***/ }),
390-
391-
/***/ 34:
392-
/***/ (function(module) {
393-
394-
module.exports = require("https");
395-
396395
/***/ }),
397396

398397
/***/ 39:
@@ -1628,7 +1627,7 @@ module.exports = require("child_process");
16281627
var net = __webpack_require__(631);
16291628
var tls = __webpack_require__(16);
16301629
var http = __webpack_require__(605);
1631-
var https = __webpack_require__(34);
1630+
var https = __webpack_require__(211);
16321631
var events = __webpack_require__(614);
16331632
var assert = __webpack_require__(357);
16341633
var util = __webpack_require__(669);
@@ -2174,32 +2173,9 @@ function checkMode (stat, options) {
21742173
/***/ }),
21752174

21762175
/***/ 211:
2177-
/***/ (function(__unusedmodule, exports, __webpack_require__) {
2178-
2179-
"use strict";
2180-
2181-
2182-
Object.defineProperty(exports, '__esModule', { value: true });
2183-
2184-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
2185-
2186-
var osName = _interopDefault(__webpack_require__(2));
2187-
2188-
function getUserAgent() {
2189-
try {
2190-
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
2191-
} catch (error) {
2192-
if (/wmic os get Caption/.test(error.message)) {
2193-
return "Windows <version undetectable>";
2194-
}
2195-
2196-
return "<environment undetectable>";
2197-
}
2198-
}
2199-
2200-
exports.getUserAgent = getUserAgent;
2201-
//# sourceMappingURL=index.js.map
2176+
/***/ (function(module) {
22022177

2178+
module.exports = require("https");
22032179

22042180
/***/ }),
22052181

@@ -4036,7 +4012,7 @@ function authenticationRequestError(state, error, options) {
40364012
module.exports = parseOptions;
40374013

40384014
const { Deprecation } = __webpack_require__(692);
4039-
const { getUserAgent } = __webpack_require__(796);
4015+
const { getUserAgent } = __webpack_require__(619);
40404016
const once = __webpack_require__(969);
40414017

40424018
const pkg = __webpack_require__(215);
@@ -4646,7 +4622,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
46464622
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
46474623

46484624
var isPlainObject = _interopDefault(__webpack_require__(696));
4649-
var universalUserAgent = __webpack_require__(562);
4625+
var universalUserAgent = __webpack_require__(796);
46504626

46514627
function lowercaseKeys(object) {
46524628
if (!object) {
@@ -5367,7 +5343,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
53675343
var Stream = _interopDefault(__webpack_require__(413));
53685344
var http = _interopDefault(__webpack_require__(605));
53695345
var Url = _interopDefault(__webpack_require__(835));
5370-
var https = _interopDefault(__webpack_require__(34));
5346+
var https = _interopDefault(__webpack_require__(211));
53715347
var zlib = _interopDefault(__webpack_require__(761));
53725348

53735349
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
@@ -7158,13 +7134,15 @@ class GitHub extends rest_1.Octokit {
71587134
static getOctokitOptions(args) {
71597135
const token = args[0];
71607136
const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
7137+
// Base URL - GHES or Dotcom
7138+
options.baseUrl = options.baseUrl || this.getApiBaseUrl();
71617139
// Auth
71627140
const auth = GitHub.getAuthString(token, options);
71637141
if (auth) {
71647142
options.auth = auth;
71657143
}
71667144
// Proxy
7167-
const agent = GitHub.getProxyAgent(options);
7145+
const agent = GitHub.getProxyAgent(options.baseUrl, options);
71687146
if (agent) {
71697147
// Shallow clone - don't mutate the object provided by the caller
71707148
options.request = options.request ? Object.assign({}, options.request) : {};
@@ -7175,6 +7153,7 @@ class GitHub extends rest_1.Octokit {
71757153
}
71767154
static getGraphQL(args) {
71777155
const defaults = {};
7156+
defaults.baseUrl = this.getGraphQLBaseUrl();
71787157
const token = args[0];
71797158
const options = args[1];
71807159
// Authorization
@@ -7185,7 +7164,7 @@ class GitHub extends rest_1.Octokit {
71857164
};
71867165
}
71877166
// Proxy
7188-
const agent = GitHub.getProxyAgent(options);
7167+
const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
71897168
if (agent) {
71907169
defaults.request = { agent };
71917170
}
@@ -7201,17 +7180,31 @@ class GitHub extends rest_1.Octokit {
72017180
}
72027181
return typeof options.auth === 'string' ? options.auth : `token ${token}`;
72037182
}
7204-
static getProxyAgent(options) {
7183+
static getProxyAgent(destinationUrl, options) {
72057184
var _a;
72067185
if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
7207-
const serverUrl = 'https://api.github.com';
7208-
if (httpClient.getProxyUrl(serverUrl)) {
7186+
if (httpClient.getProxyUrl(destinationUrl)) {
72097187
const hc = new httpClient.HttpClient();
7210-
return hc.getAgent(serverUrl);
7188+
return hc.getAgent(destinationUrl);
72117189
}
72127190
}
72137191
return undefined;
72147192
}
7193+
static getApiBaseUrl() {
7194+
return process.env['GITHUB_API_URL'] || 'https://api.github.com';
7195+
}
7196+
static getGraphQLBaseUrl() {
7197+
let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
7198+
// Shouldn't be a trailing slash, but remove if so
7199+
if (url.endsWith('/')) {
7200+
url = url.substr(0, url.length - 1);
7201+
}
7202+
// Remove trailing "/graphql"
7203+
if (url.toUpperCase().endsWith('/GRAPHQL')) {
7204+
url = url.substr(0, url.length - '/graphql'.length);
7205+
}
7206+
return url;
7207+
}
72157208
}
72167209
exports.GitHub = GitHub;
72177210
//# sourceMappingURL=github.js.map
@@ -7766,7 +7759,7 @@ function hasFirstPage (link) {
77667759
Object.defineProperty(exports, "__esModule", { value: true });
77677760
const url = __webpack_require__(835);
77687761
const http = __webpack_require__(605);
7769-
const https = __webpack_require__(34);
7762+
const https = __webpack_require__(211);
77707763
const pm = __webpack_require__(950);
77717764
let tunnel;
77727765
var HttpCodes;
@@ -8325,36 +8318,6 @@ function hasPreviousPage (link) {
83258318
}
83268319

83278320

8328-
/***/ }),
8329-
8330-
/***/ 562:
8331-
/***/ (function(__unusedmodule, exports, __webpack_require__) {
8332-
8333-
"use strict";
8334-
8335-
8336-
Object.defineProperty(exports, '__esModule', { value: true });
8337-
8338-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
8339-
8340-
var osName = _interopDefault(__webpack_require__(2));
8341-
8342-
function getUserAgent() {
8343-
try {
8344-
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
8345-
} catch (error) {
8346-
if (/wmic os get Caption/.test(error.message)) {
8347-
return "Windows <version undetectable>";
8348-
}
8349-
8350-
return "<environment undetectable>";
8351-
}
8352-
}
8353-
8354-
exports.getUserAgent = getUserAgent;
8355-
//# sourceMappingURL=index.js.map
8356-
8357-
83588321
/***/ }),
83598322

83608323
/***/ 563:
@@ -8538,6 +8501,36 @@ module.exports = require("http");
85388501

85398502
module.exports = require("events");
85408503

8504+
/***/ }),
8505+
8506+
/***/ 619:
8507+
/***/ (function(__unusedmodule, exports, __webpack_require__) {
8508+
8509+
"use strict";
8510+
8511+
8512+
Object.defineProperty(exports, '__esModule', { value: true });
8513+
8514+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
8515+
8516+
var osName = _interopDefault(__webpack_require__(2));
8517+
8518+
function getUserAgent() {
8519+
try {
8520+
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
8521+
} catch (error) {
8522+
if (/wmic os get Caption/.test(error.message)) {
8523+
return "Windows <version undetectable>";
8524+
}
8525+
8526+
throw error;
8527+
}
8528+
}
8529+
8530+
exports.getUserAgent = getUserAgent;
8531+
//# sourceMappingURL=index.js.map
8532+
8533+
85418534
/***/ }),
85428535

85438536
/***/ 621:
@@ -8940,7 +8933,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
89408933
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
89418934

89428935
var endpoint = __webpack_require__(385);
8943-
var universalUserAgent = __webpack_require__(211);
8936+
var universalUserAgent = __webpack_require__(796);
89448937
var isPlainObject = _interopDefault(__webpack_require__(696));
89458938
var nodeFetch = _interopDefault(__webpack_require__(454));
89468939
var requestError = __webpack_require__(463);
@@ -9173,7 +9166,7 @@ function getUserAgent() {
91739166
return "Windows <version undetectable>";
91749167
}
91759168

9176-
throw error;
9169+
return "<environment undetectable>";
91779170
}
91789171
}
91799172

@@ -24795,7 +24788,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
2479524788
var request = __webpack_require__(753);
2479624789
var universalUserAgent = __webpack_require__(796);
2479724790

24798-
const VERSION = "4.3.1";
24791+
const VERSION = "4.5.0";
2479924792

2480024793
class GraphqlError extends Error {
2480124794
constructor(request, response) {
@@ -24814,7 +24807,7 @@ class GraphqlError extends Error {
2481424807

2481524808
}
2481624809

24817-
const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
24810+
const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"];
2481824811
function graphql(request, query, options) {
2481924812
options = typeof query === "string" ? options = Object.assign({
2482024813
query

0 commit comments

Comments
 (0)