@@ -1909,56 +1909,43 @@ var request = __webpack_require__(234);
1909
1909
var graphql = __webpack_require__ ( 668 ) ;
1910
1910
var authToken = __webpack_require__ ( 334 ) ;
1911
1911
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 ] ;
1922
1922
}
1923
1923
1924
- return obj ;
1924
+ return target ;
1925
1925
}
1926
1926
1927
- function ownKeys ( object , enumerableOnly ) {
1928
- var keys = Object . keys ( object ) ;
1927
+ function _objectWithoutProperties ( source , excluded ) {
1928
+ if ( source == null ) return { } ;
1929
1929
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 ) ;
1937
1931
1938
- return keys ;
1939
- }
1932
+ var key , i ;
1940
1933
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 ) ;
1944
1936
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 ] ;
1955
1942
}
1956
1943
}
1957
1944
1958
1945
return target ;
1959
1946
}
1960
1947
1961
- const VERSION = "3.1.2 " ;
1948
+ const VERSION = "3.2.1 " ;
1962
1949
1963
1950
class Octokit {
1964
1951
constructor ( options = { } ) {
@@ -1990,17 +1977,15 @@ class Octokit {
1990
1977
}
1991
1978
1992
1979
this . request = request . request . defaults ( requestDefaults ) ;
1993
- this . graphql = graphql . withCustomRequest ( this . request ) . defaults ( _objectSpread2 ( _objectSpread2 ( { } , requestDefaults ) , { } , {
1994
- baseUrl : requestDefaults . baseUrl . replace ( / \/ a p i \/ v 3 $ / , "/api" )
1995
- } ) ) ;
1980
+ this . graphql = graphql . withCustomRequest ( this . request ) . defaults ( requestDefaults ) ;
1996
1981
this . log = Object . assign ( {
1997
1982
debug : ( ) => { } ,
1998
1983
info : ( ) => { } ,
1999
1984
warn : console . warn . bind ( console ) ,
2000
1985
error : console . error . bind ( console )
2001
1986
} , options . log ) ;
2002
1987
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 .
2004
1989
// (2) If only `options.auth` is set, use the default token authentication strategy.
2005
1990
// (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.
2006
1991
// TODO: type `options.auth` based on `options.authStrategy`.
@@ -2019,8 +2004,21 @@ class Octokit {
2019
2004
this . auth = auth ;
2020
2005
}
2021
2006
} 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
2024
2022
} , options . auth ) ) ; // @ts -ignore ¯\_(ツ)_/¯
2025
2023
2026
2024
hook . wrap ( "request" , auth . hook ) ;
@@ -2117,6 +2115,16 @@ function mergeDeep(defaults, options) {
2117
2115
return result ;
2118
2116
}
2119
2117
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
+
2120
2128
function merge ( defaults , route , options ) {
2121
2129
if ( typeof route === "string" ) {
2122
2130
let [ method , url ] = route . split ( " " ) ;
@@ -2131,7 +2139,10 @@ function merge(defaults, route, options) {
2131
2139
} // lowercase header names before merging with defaults to avoid duplicates
2132
2140
2133
2141
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 ) ;
2135
2146
const mergedOptions = mergeDeep ( defaults || { } , options ) ; // mediaType.previews arrays are merged, instead of overwritten
2136
2147
2137
2148
if ( defaults && defaults . mediaType . previews . length ) {
@@ -2353,7 +2364,7 @@ function parse(options) {
2353
2364
// https://fetch.spec.whatwg.org/#methods
2354
2365
let method = options . method . toUpperCase ( ) ; // replace :varname with {varname} to make it RFC 6570 compatible
2355
2366
2356
- let url = ( options . url || "/" ) . replace ( / : ( [ a - z ] \w + ) / g, "{+ $1}" ) ;
2367
+ let url = ( options . url || "/" ) . replace ( / : ( [ a - z ] \w + ) / g, "{$1}" ) ;
2357
2368
let headers = Object . assign ( { } , options . headers ) ;
2358
2369
let body ;
2359
2370
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) {
2438
2449
} ) ;
2439
2450
}
2440
2451
2441
- const VERSION = "6.0.6 " ;
2452
+ const VERSION = "6.0.9 " ;
2442
2453
2443
2454
const userAgent = `octokit-endpoint.js/${ VERSION } ${ universalUserAgent . getUserAgent ( ) } ` ; // DEFAULTS has all properties set that EndpointOptions has, except url.
2444
2455
// So we use RequestParameters and add method as additional required property.
@@ -2475,7 +2486,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
2475
2486
var request = __webpack_require__ ( 234 ) ;
2476
2487
var universalUserAgent = __webpack_require__ ( 429 ) ;
2477
2488
2478
- const VERSION = "4.5.6 " ;
2489
+ const VERSION = "4.5.7 " ;
2479
2490
2480
2491
class GraphqlError extends Error {
2481
2492
constructor ( request , response ) {
@@ -2588,7 +2599,7 @@ exports.withCustomRequest = withCustomRequest;
2588
2599
2589
2600
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
2590
2601
2591
- const VERSION = "2.4 .0" ;
2602
+ const VERSION = "2.6 .0" ;
2592
2603
2593
2604
/**
2594
2605
* Some “list” response that can be paginated have a different response structure
@@ -2641,26 +2652,23 @@ function iterator(octokit, route, parameters) {
2641
2652
let url = options . url ;
2642
2653
return {
2643
2654
[ 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 ( {
2652
2660
method,
2653
2661
url,
2654
2662
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 * r e l = " n e x t " / ) || [ ] ) [ 1 ] ;
2660
- return {
2661
- value : response
2662
- } ;
2663
2663
} ) ;
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 * r e l = " n e x t " / ) || [ ] ) [ 1 ] ;
2669
+ return {
2670
+ value : normalizedResponse
2671
+ } ;
2664
2672
}
2665
2673
2666
2674
} )
@@ -2698,6 +2706,10 @@ function gather(octokit, results, iterator, mapFn) {
2698
2706
} ) ;
2699
2707
}
2700
2708
2709
+ const composePaginateRest = Object . assign ( paginate , {
2710
+ iterator
2711
+ } ) ;
2712
+
2701
2713
/**
2702
2714
* @param octokit Octokit instance
2703
2715
* @param options Options passed to Octokit constructor
@@ -2712,6 +2724,7 @@ function paginateRest(octokit) {
2712
2724
}
2713
2725
paginateRest . VERSION = VERSION ;
2714
2726
2727
+ exports . composePaginateRest = composePaginateRest ;
2715
2728
exports . paginateRest = paginateRest ;
2716
2729
//# sourceMappingURL=index.js.map
2717
2730
@@ -3775,7 +3788,7 @@ const Endpoints = {
3775
3788
}
3776
3789
} ;
3777
3790
3778
- const VERSION = "4.2.0 " ;
3791
+ const VERSION = "4.2.1 " ;
3779
3792
3780
3793
function endpointsToMethods ( octokit , endpointsMap ) {
3781
3794
const newMethods = { } ;
@@ -3959,7 +3972,7 @@ var isPlainObject = __webpack_require__(287);
3959
3972
var nodeFetch = _interopDefault ( __webpack_require__ ( 467 ) ) ;
3960
3973
var requestError = __webpack_require__ ( 537 ) ;
3961
3974
3962
- const VERSION = "5.4.9 " ;
3975
+ const VERSION = "5.4.10 " ;
3963
3976
3964
3977
function getBufferResponse ( response ) {
3965
3978
return response . arrayBuffer ( ) ;
@@ -6413,103 +6426,103 @@ module.exports = eval("require")("encoding");
6413
6426
/***/ ( ( module ) => {
6414
6427
6415
6428
"use strict" ;
6416
- module . exports = require ( "assert" ) ;
6429
+ module . exports = require ( "assert" ) ; ;
6417
6430
6418
6431
/***/ } ) ,
6419
6432
6420
6433
/***/ 614 :
6421
6434
/***/ ( ( module ) => {
6422
6435
6423
6436
"use strict" ;
6424
- module . exports = require ( "events" ) ;
6437
+ module . exports = require ( "events" ) ; ;
6425
6438
6426
6439
/***/ } ) ,
6427
6440
6428
6441
/***/ 747 :
6429
6442
/***/ ( ( module ) => {
6430
6443
6431
6444
"use strict" ;
6432
- module . exports = require ( "fs" ) ;
6445
+ module . exports = require ( "fs" ) ; ;
6433
6446
6434
6447
/***/ } ) ,
6435
6448
6436
6449
/***/ 605 :
6437
6450
/***/ ( ( module ) => {
6438
6451
6439
6452
"use strict" ;
6440
- module . exports = require ( "http" ) ;
6453
+ module . exports = require ( "http" ) ; ;
6441
6454
6442
6455
/***/ } ) ,
6443
6456
6444
6457
/***/ 211 :
6445
6458
/***/ ( ( module ) => {
6446
6459
6447
6460
"use strict" ;
6448
- module . exports = require ( "https" ) ;
6461
+ module . exports = require ( "https" ) ; ;
6449
6462
6450
6463
/***/ } ) ,
6451
6464
6452
6465
/***/ 631 :
6453
6466
/***/ ( ( module ) => {
6454
6467
6455
6468
"use strict" ;
6456
- module . exports = require ( "net" ) ;
6469
+ module . exports = require ( "net" ) ; ;
6457
6470
6458
6471
/***/ } ) ,
6459
6472
6460
6473
/***/ 87 :
6461
6474
/***/ ( ( module ) => {
6462
6475
6463
6476
"use strict" ;
6464
- module . exports = require ( "os" ) ;
6477
+ module . exports = require ( "os" ) ; ;
6465
6478
6466
6479
/***/ } ) ,
6467
6480
6468
6481
/***/ 622 :
6469
6482
/***/ ( ( module ) => {
6470
6483
6471
6484
"use strict" ;
6472
- module . exports = require ( "path" ) ;
6485
+ module . exports = require ( "path" ) ; ;
6473
6486
6474
6487
/***/ } ) ,
6475
6488
6476
6489
/***/ 413 :
6477
6490
/***/ ( ( module ) => {
6478
6491
6479
6492
"use strict" ;
6480
- module . exports = require ( "stream" ) ;
6493
+ module . exports = require ( "stream" ) ; ;
6481
6494
6482
6495
/***/ } ) ,
6483
6496
6484
6497
/***/ 16 :
6485
6498
/***/ ( ( module ) => {
6486
6499
6487
6500
"use strict" ;
6488
- module . exports = require ( "tls" ) ;
6501
+ module . exports = require ( "tls" ) ; ;
6489
6502
6490
6503
/***/ } ) ,
6491
6504
6492
6505
/***/ 835 :
6493
6506
/***/ ( ( module ) => {
6494
6507
6495
6508
"use strict" ;
6496
- module . exports = require ( "url" ) ;
6509
+ module . exports = require ( "url" ) ; ;
6497
6510
6498
6511
/***/ } ) ,
6499
6512
6500
6513
/***/ 669 :
6501
6514
/***/ ( ( module ) => {
6502
6515
6503
6516
"use strict" ;
6504
- module . exports = require ( "util" ) ;
6517
+ module . exports = require ( "util" ) ; ;
6505
6518
6506
6519
/***/ } ) ,
6507
6520
6508
6521
/***/ 761 :
6509
6522
/***/ ( ( module ) => {
6510
6523
6511
6524
"use strict" ;
6512
- module . exports = require ( "zlib" ) ;
6525
+ module . exports = require ( "zlib" ) ; ;
6513
6526
6514
6527
/***/ } )
6515
6528
0 commit comments