Skip to content

Commit 72ab5a2

Browse files
authored
Merge pull request #90 from peter-evans/update-distribution
Update distribution
2 parents f29c35e + 6c5fc38 commit 72ab5a2

File tree

1 file changed

+91
-78
lines changed

1 file changed

+91
-78
lines changed

dist/index.js

Lines changed: 91 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,56 +1909,43 @@ var request = __webpack_require__(234);
19091909
var graphql = __webpack_require__(668);
19101910
var authToken = __webpack_require__(334);
19111911

1912-
function _defineProperty(obj, key, value) {
1913-
if (key in obj) {
1914-
Object.defineProperty(obj, key, {
1915-
value: value,
1916-
enumerable: true,
1917-
configurable: true,
1918-
writable: true
1919-
});
1920-
} else {
1921-
obj[key] = value;
1912+
function _objectWithoutPropertiesLoose(source, excluded) {
1913+
if (source == null) return {};
1914+
var target = {};
1915+
var sourceKeys = Object.keys(source);
1916+
var key, i;
1917+
1918+
for (i = 0; i < sourceKeys.length; i++) {
1919+
key = sourceKeys[i];
1920+
if (excluded.indexOf(key) >= 0) continue;
1921+
target[key] = source[key];
19221922
}
19231923

1924-
return obj;
1924+
return target;
19251925
}
19261926

1927-
function ownKeys(object, enumerableOnly) {
1928-
var keys = Object.keys(object);
1927+
function _objectWithoutProperties(source, excluded) {
1928+
if (source == null) return {};
19291929

1930-
if (Object.getOwnPropertySymbols) {
1931-
var symbols = Object.getOwnPropertySymbols(object);
1932-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
1933-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1934-
});
1935-
keys.push.apply(keys, symbols);
1936-
}
1930+
var target = _objectWithoutPropertiesLoose(source, excluded);
19371931

1938-
return keys;
1939-
}
1932+
var key, i;
19401933

1941-
function _objectSpread2(target) {
1942-
for (var i = 1; i < arguments.length; i++) {
1943-
var source = arguments[i] != null ? arguments[i] : {};
1934+
if (Object.getOwnPropertySymbols) {
1935+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
19441936

1945-
if (i % 2) {
1946-
ownKeys(Object(source), true).forEach(function (key) {
1947-
_defineProperty(target, key, source[key]);
1948-
});
1949-
} else if (Object.getOwnPropertyDescriptors) {
1950-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1951-
} else {
1952-
ownKeys(Object(source)).forEach(function (key) {
1953-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1954-
});
1937+
for (i = 0; i < sourceSymbolKeys.length; i++) {
1938+
key = sourceSymbolKeys[i];
1939+
if (excluded.indexOf(key) >= 0) continue;
1940+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1941+
target[key] = source[key];
19551942
}
19561943
}
19571944

19581945
return target;
19591946
}
19601947

1961-
const VERSION = "3.1.2";
1948+
const VERSION = "3.2.1";
19621949

19631950
class Octokit {
19641951
constructor(options = {}) {
@@ -1990,17 +1977,15 @@ class Octokit {
19901977
}
19911978

19921979
this.request = request.request.defaults(requestDefaults);
1993-
this.graphql = graphql.withCustomRequest(this.request).defaults(_objectSpread2(_objectSpread2({}, requestDefaults), {}, {
1994-
baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api")
1995-
}));
1980+
this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);
19961981
this.log = Object.assign({
19971982
debug: () => {},
19981983
info: () => {},
19991984
warn: console.warn.bind(console),
20001985
error: console.error.bind(console)
20011986
}, options.log);
20021987
this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
2003-
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred.
1988+
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.
20041989
// (2) If only `options.auth` is set, use the default token authentication strategy.
20051990
// (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.
20061991
// TODO: type `options.auth` based on `options.authStrategy`.
@@ -2019,8 +2004,21 @@ class Octokit {
20192004
this.auth = auth;
20202005
}
20212006
} else {
2022-
const auth = options.authStrategy(Object.assign({
2023-
request: this.request
2007+
const {
2008+
authStrategy
2009+
} = options,
2010+
otherOptions = _objectWithoutProperties(options, ["authStrategy"]);
2011+
2012+
const auth = authStrategy(Object.assign({
2013+
request: this.request,
2014+
log: this.log,
2015+
// we pass the current octokit instance as well as its constructor options
2016+
// to allow for authentication strategies that return a new octokit instance
2017+
// that shares the same internal state as the current one. The original
2018+
// requirement for this was the "event-octokit" authentication strategy
2019+
// of https://github.com/probot/octokit-auth-probot.
2020+
octokit: this,
2021+
octokitOptions: otherOptions
20242022
}, options.auth)); // @ts-ignore ¯\_(ツ)_/¯
20252023

20262024
hook.wrap("request", auth.hook);
@@ -2117,6 +2115,16 @@ function mergeDeep(defaults, options) {
21172115
return result;
21182116
}
21192117

2118+
function removeUndefinedProperties(obj) {
2119+
for (const key in obj) {
2120+
if (obj[key] === undefined) {
2121+
delete obj[key];
2122+
}
2123+
}
2124+
2125+
return obj;
2126+
}
2127+
21202128
function merge(defaults, route, options) {
21212129
if (typeof route === "string") {
21222130
let [method, url] = route.split(" ");
@@ -2131,7 +2139,10 @@ function merge(defaults, route, options) {
21312139
} // lowercase header names before merging with defaults to avoid duplicates
21322140

21332141

2134-
options.headers = lowercaseKeys(options.headers);
2142+
options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging
2143+
2144+
removeUndefinedProperties(options);
2145+
removeUndefinedProperties(options.headers);
21352146
const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
21362147

21372148
if (defaults && defaults.mediaType.previews.length) {
@@ -2353,7 +2364,7 @@ function parse(options) {
23532364
// https://fetch.spec.whatwg.org/#methods
23542365
let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
23552366

2356-
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
2367+
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
23572368
let headers = Object.assign({}, options.headers);
23582369
let body;
23592370
let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
@@ -2438,7 +2449,7 @@ function withDefaults(oldDefaults, newDefaults) {
24382449
});
24392450
}
24402451

2441-
const VERSION = "6.0.6";
2452+
const VERSION = "6.0.9";
24422453

24432454
const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
24442455
// So we use RequestParameters and add method as additional required property.
@@ -2475,7 +2486,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
24752486
var request = __webpack_require__(234);
24762487
var universalUserAgent = __webpack_require__(429);
24772488

2478-
const VERSION = "4.5.6";
2489+
const VERSION = "4.5.7";
24792490

24802491
class GraphqlError extends Error {
24812492
constructor(request, response) {
@@ -2588,7 +2599,7 @@ exports.withCustomRequest = withCustomRequest;
25882599

25892600
Object.defineProperty(exports, "__esModule", ({ value: true }));
25902601

2591-
const VERSION = "2.4.0";
2602+
const VERSION = "2.6.0";
25922603

25932604
/**
25942605
* Some “list” response that can be paginated have a different response structure
@@ -2641,26 +2652,23 @@ function iterator(octokit, route, parameters) {
26412652
let url = options.url;
26422653
return {
26432654
[Symbol.asyncIterator]: () => ({
2644-
next() {
2645-
if (!url) {
2646-
return Promise.resolve({
2647-
done: true
2648-
});
2649-
}
2650-
2651-
return requestMethod({
2655+
async next() {
2656+
if (!url) return {
2657+
done: true
2658+
};
2659+
const response = await requestMethod({
26522660
method,
26532661
url,
26542662
headers
2655-
}).then(normalizePaginatedListResponse).then(response => {
2656-
// `response.headers.link` format:
2657-
// '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
2658-
// sets `url` to undefined if "next" URL is not present or `link` header is not set
2659-
url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
2660-
return {
2661-
value: response
2662-
};
26632663
});
2664+
const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:
2665+
// '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
2666+
// sets `url` to undefined if "next" URL is not present or `link` header is not set
2667+
2668+
url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
2669+
return {
2670+
value: normalizedResponse
2671+
};
26642672
}
26652673

26662674
})
@@ -2698,6 +2706,10 @@ function gather(octokit, results, iterator, mapFn) {
26982706
});
26992707
}
27002708

2709+
const composePaginateRest = Object.assign(paginate, {
2710+
iterator
2711+
});
2712+
27012713
/**
27022714
* @param octokit Octokit instance
27032715
* @param options Options passed to Octokit constructor
@@ -2712,6 +2724,7 @@ function paginateRest(octokit) {
27122724
}
27132725
paginateRest.VERSION = VERSION;
27142726

2727+
exports.composePaginateRest = composePaginateRest;
27152728
exports.paginateRest = paginateRest;
27162729
//# sourceMappingURL=index.js.map
27172730

@@ -3775,7 +3788,7 @@ const Endpoints = {
37753788
}
37763789
};
37773790

3778-
const VERSION = "4.2.0";
3791+
const VERSION = "4.2.1";
37793792

37803793
function endpointsToMethods(octokit, endpointsMap) {
37813794
const newMethods = {};
@@ -3959,7 +3972,7 @@ var isPlainObject = __webpack_require__(287);
39593972
var nodeFetch = _interopDefault(__webpack_require__(467));
39603973
var requestError = __webpack_require__(537);
39613974

3962-
const VERSION = "5.4.9";
3975+
const VERSION = "5.4.10";
39633976

39643977
function getBufferResponse(response) {
39653978
return response.arrayBuffer();
@@ -6413,103 +6426,103 @@ module.exports = eval("require")("encoding");
64136426
/***/ ((module) => {
64146427

64156428
"use strict";
6416-
module.exports = require("assert");
6429+
module.exports = require("assert");;
64176430

64186431
/***/ }),
64196432

64206433
/***/ 614:
64216434
/***/ ((module) => {
64226435

64236436
"use strict";
6424-
module.exports = require("events");
6437+
module.exports = require("events");;
64256438

64266439
/***/ }),
64276440

64286441
/***/ 747:
64296442
/***/ ((module) => {
64306443

64316444
"use strict";
6432-
module.exports = require("fs");
6445+
module.exports = require("fs");;
64336446

64346447
/***/ }),
64356448

64366449
/***/ 605:
64376450
/***/ ((module) => {
64386451

64396452
"use strict";
6440-
module.exports = require("http");
6453+
module.exports = require("http");;
64416454

64426455
/***/ }),
64436456

64446457
/***/ 211:
64456458
/***/ ((module) => {
64466459

64476460
"use strict";
6448-
module.exports = require("https");
6461+
module.exports = require("https");;
64496462

64506463
/***/ }),
64516464

64526465
/***/ 631:
64536466
/***/ ((module) => {
64546467

64556468
"use strict";
6456-
module.exports = require("net");
6469+
module.exports = require("net");;
64576470

64586471
/***/ }),
64596472

64606473
/***/ 87:
64616474
/***/ ((module) => {
64626475

64636476
"use strict";
6464-
module.exports = require("os");
6477+
module.exports = require("os");;
64656478

64666479
/***/ }),
64676480

64686481
/***/ 622:
64696482
/***/ ((module) => {
64706483

64716484
"use strict";
6472-
module.exports = require("path");
6485+
module.exports = require("path");;
64736486

64746487
/***/ }),
64756488

64766489
/***/ 413:
64776490
/***/ ((module) => {
64786491

64796492
"use strict";
6480-
module.exports = require("stream");
6493+
module.exports = require("stream");;
64816494

64826495
/***/ }),
64836496

64846497
/***/ 16:
64856498
/***/ ((module) => {
64866499

64876500
"use strict";
6488-
module.exports = require("tls");
6501+
module.exports = require("tls");;
64896502

64906503
/***/ }),
64916504

64926505
/***/ 835:
64936506
/***/ ((module) => {
64946507

64956508
"use strict";
6496-
module.exports = require("url");
6509+
module.exports = require("url");;
64976510

64986511
/***/ }),
64996512

65006513
/***/ 669:
65016514
/***/ ((module) => {
65026515

65036516
"use strict";
6504-
module.exports = require("util");
6517+
module.exports = require("util");;
65056518

65066519
/***/ }),
65076520

65086521
/***/ 761:
65096522
/***/ ((module) => {
65106523

65116524
"use strict";
6512-
module.exports = require("zlib");
6525+
module.exports = require("zlib");;
65136526

65146527
/***/ })
65156528

0 commit comments

Comments
 (0)