File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
lib/interface/cli/helpers Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -26,18 +26,23 @@ const wrapHandler = (handler, requiresAuthentication) => {
2626 }
2727
2828 if ( process . env . NODE_ENV !== 'test' ) {
29- const { url, token : apiKey } = currentContext || { } ;
30- sdk . configure ( {
29+ const { url, token } = currentContext || { } ;
30+ const sdkConfig = {
3131 url,
32- apiKey,
3332 cache : {
3433 disableCache : ! ! ( process . env . DISABLE_SDK_CACHE || process . argv . includes ( '--disable-cache' ) ) ,
3534 forceRefresh : ! ! ( process . env . FORCE_REFRESH_SDK_CACHE || process . argv . includes ( '--force-refresh-cache' ) ) ,
3635 } ,
3736 request : {
3837 ...config . request ,
3938 } ,
40- } ) ;
39+ } ;
40+
41+ // todo: move to openapi.json
42+ const tokenKey = currentContext . type === 'APIKey' ? 'apiKey' : 'accessToken' ;
43+ sdkConfig [ tokenKey ] = token ;
44+
45+ sdk . configure ( sdkConfig ) ;
4146 }
4247
4348 if ( ! argv . watch ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.15.0 " ,
3+ "version" : " 0.15.1 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
3434 "cf-errors" : " ^0.1.11" ,
3535 "chalk" : " ^1.1.3" ,
3636 "cli-progress" : " ^1.6.1" ,
37- "codefresh-sdk" : " ^0.2.6 " ,
37+ "codefresh-sdk" : " ^0.2.7 " ,
3838 "colors" : " ^1.1.2" ,
3939 "columnify" : " ^1.5.4" ,
4040 "compare-versions" : " ^3.4.0" ,
Original file line number Diff line number Diff line change @@ -911,10 +911,10 @@ code-point-at@^1.0.0:
911911 version "1.1.0"
912912 resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
913913
914- codefresh-sdk@^0.2.6 :
915- version "0.2.6 "
916- resolved "https://registry.yarnpkg.com/codefresh-sdk/-/codefresh-sdk-0.2.6 .tgz#3dbf2f95f55938fbb37f1556f1cc7c454e771db1 "
917- integrity sha512-LJsj0U03PNX/S9o40J0cy8HoCMNSmHByMXnWu/GiJYOCTQqIdZVkyH7jFfF1G8rzAgWYuoTsneETXaZHZ+81qg ==
914+ codefresh-sdk@^0.2.7 :
915+ version "0.2.7 "
916+ resolved "https://registry.yarnpkg.com/codefresh-sdk/-/codefresh-sdk-0.2.7 .tgz#03ac2eb890e213866527550792be77f7ebb2a34d "
917+ integrity sha512-/My5NDlEQscg2GG6HDj+71ELeh6cdZOM/mc1Cn98tOKVyDJ4C4Jmh+/o3sXA+E29WcN+bCIqfGK/VUH5+eDrIQ ==
918918 dependencies :
919919 bluebird "^3.5.3"
920920 cf-errors "^0.1.11"
You can’t perform that action at this time.
0 commit comments