@northflank/cli 0.9.25 → 0.9.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use strict';const a12N=a12e;(function(F,e){const C=a12e,G=F();while(!![]){try{const u=parseInt(C(0x1ab))/0x1+-parseInt(C(0x12e))/0x2*(-parseInt(C(0x15b))/0x3)+parseInt(C(0x1b9))/0x4+parseInt(C(0x152))/0x5*(parseInt(C(0x1b7))/0x6)+-parseInt(C(0x16d))/0x7+-parseInt(C(0x13b))/0x8+-parseInt(C(0x1b5))/0x9;if(u===e)break;else G['push'](G['shift']());}catch(R){G['push'](G['shift']());}}}(a12F,0x4ff52));var __awaiter=this&&this[a12N(0x13c)]||function(F,e,G,u){function R(b){return b instanceof G?b:new G(function(W){W(b);});}return new(G||(G=Promise))(function(b,W){const g=a12e;function V(t){try{m(u['next'](t));}catch(T){W(T);}}function a(t){const I=a12e;try{m(u[I(0x199)](t));}catch(T){W(T);}}function m(t){const Y=a12e;t[Y(0x19e)]?b(t[Y(0x153)]):R(t['value'])['then'](V,a);}m((u=u[g(0x192)](F,e||[]))[g(0x171)]());});},__importDefault=this&&this[a12N(0x1b1)]||function(F){const Q=a12N;return F&&F[Q(0x194)]?F:{'default':F};};Object[a12N(0x1b8)](exports,a12N(0x194),{'value':!![]}),exports[a12N(0x164)]=void 0x0;function a12e(F,e){const G=a12F();return a12e=function(u,R){u=u-0x12a;let b=G[u];return b;},a12e(F,e);}function a12F(){const FF=['2953552vssSxr','printMetricsSingle','slice','askForContainer','next','apiClient','getCommand','rows','toFixed','map','toUpperCase','--container\x20--containerId\x20[NAME]','charAt','getMetricsCommand','filter','Option','askForJobRun','service','Deployment\x20id,\x20example:\x20my-service-54785f4','assertContextExisting','name','getPaddingDataStart','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','clear','time','job','length','Get\x20metrics\x20for\x20the\x20specified\x20',',\x20volume:\x20','\x20to\x20get\x20logs\x20from','noDefaults','Error\x20while\x20fetching\x20metrics\x20entries:\x20','metrics','getCurrentServiceName','pct','toISOString','metric','apply','getTime','__esModule','keys',',\x20to:\x20','refreshInterval','parseDateInput','throw',',\x20metric\x20types:\x20','chalk','error','Get\x20metrics\x20before\x20this\x20timestamp,\x20','done',',\x20from:\x20','getCurrentProjectName','../utils','conflicts','toTimeString','metricUnit','containerId','stdout','-o,\x20--output\x20[output]','min','deploymentId','Get\x20metrics\x20after\x20this\x20timestamp,\x20','608688xCDCpm','printInitInfo','all\x20containers','flatMap','addon','--deployment\x20--deploymentId\x20[deploymentId]','__importDefault','commander','\x20seconds','details','10975824lDWudN','buildId','129612jxCDUw','defineProperty','2095148NIFtuE','bold','Build\x20to\x20get\x20logs\x20from','printMetricsTable','default','InquirerHelper','data','argParser','Project\x20for\x20logs','tsHint','jobId','yaml','getStandardMetricsCommand','14GMqxgm','--build\x20--buildId\x20[buildId]','addonId','askForAddon','askForJob','addOption','printAsTable','yml','description','log','printMetricsGraph','format','\x20--','1441416KoVGsV','__awaiter','metricsSingle','Metrics\x20for\x20','container\x20','values','handleError','assign','\x20for\x20container:\x20','exit','getPaddingDataEnd','choices','\x20of\x20','push','json','../inquirer-helper','ApiClient','metricsApiClient','Id\x20[NAME]','forEach','--duration\x20[duration]','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','metricId','95iylZXZ','value','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','max','printResponse','unshift','isNaN','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','metadata','259818BOUsFB','customUserAgent','metricsRange','message','-t,\x20--metricTypes\x20<metricTypes...>','inquirerHelper','build-','N/A','askForService','CliMetrics','--noDefaults','Which\x20metric\x20type\x20to\x20fetch','runId','--run\x20--runId\x20[runId]','@northflank/js-client','apiContext','option','--project\x20--projectId\x20[NAME]'];a12F=function(){return FF;};return a12F();}const js_client_1=require(a12N(0x169)),utils_1=require(a12N(0x1a1)),inquirer_helper_1=require(a12N(0x14a)),commander_1=require(a12N(0x1b2)),terminal_chart_1=require('../formatting/terminal-chart'),console_format_helpers_1=require('../formatting/console-format-helpers'),chalk_1=__importDefault(require(a12N(0x19b)));class CliMetrics{constructor(F){const S=a12N;this[S(0x16a)]=F,this[S(0x197)]=0x2710,this[S(0x12d)]=(e,G)=>{const j=S,u=(0x0,utils_1[j(0x173)])(!![])[j(0x181)]((G?j(0x161):'')+j(0x18d))['alias']((G?j(0x161):'')+j(0x191))[j(0x136)](j(0x188)+e)[j(0x16b)](j(0x16c),j(0x1c1))['option']('--'+e+j(0x13a)+e+j(0x14d),e[j(0x179)](0x0)[j(0x177)]()+e[j(0x16f)](0x1)+j(0x18a))[j(0x16b)](j(0x178),j(0x183))[j(0x16b)]('--startTime\x20<timestamp>',j(0x1aa)+utils_1[j(0x12a)],utils_1[j(0x198)])[j(0x16b)]('--endTime\x20<timestamp>',j(0x19d)+utils_1['tsHint'],utils_1['parseDateInput'])[j(0x16b)](j(0x14f),j(0x154))[j(0x133)](new commander_1[(j(0x17c))](j(0x1a7),j(0x159))['choices'](Object[j(0x140)]([j(0x139),j(0x149),j(0x12c)])))[j(0x133)](new commander_1[(j(0x17c))](j(0x15f),j(0x166))[j(0x146)](Object[j(0x140)](js_client_1['MetricType'])))[j(0x133)](new commander_1[(j(0x17c))]('--timestamp\x20[timestamp]','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20'+utils_1[j(0x12a)])[j(0x1c0)](utils_1['parseDateInput'])[j(0x1a2)](['startTime','endTime']))[j(0x16b)](j(0x165),'Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])['addOption'](new commander_1['Option'](j(0x1a7),j(0x159))[j(0x146)](Object['values']([j(0x139),j(0x149),'yaml'])));if(G)u[j(0x16b)](j(0x12f),j(0x1bb));if(e==='job')u[j(0x16b)](j(0x168),j(0x150));if(e==='service')u[j(0x16b)](j(0x1b0),j(0x17f));return u;},this[S(0x138)]=(e,G)=>{return u=>{const q=a12e,R=Object['keys'](u)[q(0x1ae)](b=>{const f=q,{values:W,metricInfo:V}=u[b],{metricUnit:a,metricResolution:m}=V;return W[f(0x176)](t=>{const H=f;var T,Z;const {metadata:n,data:v}=t,A=G?(G===null||G===void 0x0?void 0x0:G[H(0x193)]())>new Date()['getTime']()?new Date():G:undefined,w=new Date((T=v===null||v===void 0x0?void 0x0:v[0x0])===null||T===void 0x0?void 0x0:T['ts']),o=new Date((Z=v===null||v===void 0x0?void 0x0:v[v[H(0x187)]-0x1])===null||Z===void 0x0?void 0x0:Z['ts']),i=this[H(0x182)](e,w,m),c=this[H(0x145)](A,o,m),l=[...i,...v,...c],X=l[H(0x176)](p=>[new Date(p['ts'])['valueOf'](),Number(p[H(0x153)])])[H(0x17b)](p=>!Number[H(0x158)](p[0x0])),h=Math[H(0x1a8)](Math[H(0x155)](process['stdout']['columns']-0xa,0xa),0x64),d=Math[H(0x1a8)](Math[H(0x155)](process[H(0x1a6)][H(0x174)]-0x9,0xa),0xf),B=a==='pct'?0x64:undefined,x=a===H(0x18f)?'%':a,r=(0x0,terminal_chart_1['downSampleData'])(X,h),k=r[H(0x176)](p=>p[0x1]),K={'min':0x0,'height':d,'max':B,'unit':x,'startTs':e!==null&&e!==void 0x0?e:w,'endTs':A!==null&&A!==void 0x0?A:o};return{'dataSeries':k,'metadata':n,'chartOpts':K,'metricInfo':V};});})['flat']();if(R[q(0x187)]===0x0)(0x0,utils_1['warning'])('No\x20metrics\x20found\x20for\x20this\x20query');else R[q(0x14e)](b=>{const s=q,{dataSeries:W,metadata:V,chartOpts:a,metricInfo:m}=b,{containerId:t,volumeId:T}=V,Z=T?s(0x189)+T:'';console[s(0x137)](m[s(0x151)]+s(0x143)+chalk_1['default'][s(0x1ba)](t)+Z),console[s(0x137)]((0x0,terminal_chart_1['getAsciiChart'])(W,a));});};},this['printMetricsTable']=(e,G,u)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=S;try{const R=yield this['metricsApiClient'][y(0x18d)]['metricsSingle'](e,G,u);console[y(0x184)]();if(R[y(0x19c)])(0x0,utils_1[y(0x19c)])('Error\x20while\x20fetching\x20metrics\x20entries:\x20'+R[y(0x19c)][y(0x15e)]);else this[y(0x16e)](R[y(0x1bf)]);}catch(b){console[y(0x184)](),(0x0,utils_1[y(0x19c)])(y(0x18c)+b['message']);}}),this[S(0x141)]=e=>{const E=S;if(e[E(0x19c)]){const G=JSON['stringify'](e[E(0x19c)][E(0x1b4)]);throw new Error('Error\x20while\x20fetching\x20metrics\x20entries:\x20'+e[E(0x19c)][E(0x15e)]+'\x20'+G);}},this[S(0x1ac)]=(e,G,u,R,b)=>{const J=S;if(b===!![])return;const {metricTypes:W,endTime:V,startTime:a,duration:m,containerId:t}=R,T=a?J(0x19f)+a[J(0x190)]():'',Z=V?J(0x196)+V[J(0x190)]():'',n=m?',\x20duration:\x20'+m+J(0x1b3):'',v=t?J(0x13f)+chalk_1[J(0x1bd)][J(0x1ba)](t):J(0x1ad),A=e+'\x20'+chalk_1[J(0x1bd)]['bold'](G)+'\x20in\x20project\x20'+chalk_1[J(0x1bd)]['bold'](u),w=''+T+Z+n,o=W?J(0x19a)+(W===null||W===void 0x0?void 0x0:W['join'](',')):'';console['log'](J(0x13e)+v+J(0x147)+A+o+w);},this['apiClient']=new js_client_1[(S(0x14b))](F,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[S(0x15c)]}),this[S(0x14c)]=this[S(0x172)],this[S(0x160)]=new inquirer_helper_1[(S(0x1be))](this[S(0x172)]);}[a12N(0x17a)](F,e=![]){const F1=a12N,G=(V,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const M=a12e,m=a[M(0x18b)],{apiContext:t,inquirerHelper:T}=this;switch(F){case M(0x17e):{const Z=m?undefined:t[M(0x18e)]();return a['serviceId']||Z||(yield T[M(0x163)](V)());}case M(0x186):{const n=m?undefined:t[M(0x18e)]();return a[M(0x12b)]||n||(yield T[M(0x132)](V)());}case M(0x1af):{const v=m?undefined:t[M(0x18e)]();return a[M(0x130)]||v||(yield T[M(0x131)](V)());}}}),u=(V,a,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const L=a12e;if(e)return m[L(0x1b6)]||(yield this['inquirerHelper']['askForBuild'](V,F==='service'?a:undefined,F==='job'?a:undefined,!![])());return undefined;}),R=(V,a,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const P=a12e;if(!e&&m[P(0x1a5)]!==undefined){if(m[P(0x1a5)]!==!![])return m['containerId'];return yield this[P(0x160)][P(0x170)](V,F===P(0x17e)?a:undefined,F===P(0x186)?a:undefined,!![])();}return undefined;}),b=(V,a,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const U=a12e;if(F===U(0x186))return m[U(0x167)]||(yield this[U(0x160)][U(0x17d)](a,V,!![])());return undefined;}),W=(V,a,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const F0=a12e;if(F===F0(0x17e)){if(m[F0(0x1a9)]!==!![])return m[F0(0x1a9)];return m[F0(0x1a9)];}return undefined;});return this[F1(0x12d)](F,e)['action'](V=>__awaiter(this,void 0x0,void 0x0,function*(){const F2=F1,{noDefaults:a,projectId:m,duration:t,timestamp:T,output:Z,startTime:n,endTime:v,metricTypes:A,quiet:w}=V;(0x0,utils_1[F2(0x180)])(this[F2(0x172)]);if(n&&v&&t)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const {apiContext:o,inquirerHelper:i,metricsApiClient:c}=this,l=a?undefined:o[F2(0x1a0)](),X=m||l||(yield i['askForProject']()),h=yield G(X,V),d=yield u(X,h,V),B=yield b(X,h,V),x=yield W(X,h,V),r=yield R(X,h,V),k={'projectId':X,'entityId':h},K={'containerName':r,'startTime':n,'endTime':v,'duration':t,'timestamp':T,'metricTypes':A,'runId':B,'buildId':d,'deploymentId':x,'isBuild':e!==null&&e!==void 0x0?e:![]},p=!(n||v||t);if(!w&&Z!==F2(0x12c)&&Z!==F2(0x135)&&Z!==F2(0x149))this['printInitInfo'](F,h,X,K,w);if(p){if(Z!==undefined){const O=yield c['metrics'][F2(0x13d)](k,K,F);this['handleError'](O),(0x0,console_format_helpers_1[F2(0x156)])(Z,O['data']);}else[...Array(process[F2(0x1a6)]['rows']-0x1)][F2(0x14e)]((D,z)=>z===0x0?console['log']('Fetching\x20data..'):console[F2(0x137)]()),yield this[F2(0x1bc)](k,K,F)(),setInterval(this[F2(0x1bc)](k,K,F),this[F2(0x197)]),yield new Promise(D=>setTimeout(D,this[F2(0x197)]*0x64));}else{const D=yield c[F2(0x18d)][F2(0x15d)](k,K,F);this[F2(0x141)](D),Z!==undefined?(0x0,console_format_helpers_1[F2(0x156)])(Z,D[F2(0x1bf)]):this[F2(0x138)](n,v!==null&&v!==void 0x0?v:new Date())(D['data']);}process[F2(0x144)]();}));}[a12N(0x16e)](F){const F5=a12N,e=(R,b)=>{const F3=a12e;if(!(b===null||b===void 0x0?void 0x0:b[F3(0x153)]))F3(0x162);const W=R[F3(0x1a4)]===F3(0x18f)?'%':R[F3(0x1a4)];return''+Number(b===null||b===void 0x0?void 0x0:b[F3(0x153)])[F3(0x175)](0x3)+W;},G=R=>{const F4=a12e;if(!(R===null||R===void 0x0?void 0x0:R['ts']))F4(0x162);return R['ts'][F4(0x1a3)]()['split']('\x20')[0x0];},u={};Object[F5(0x195)](F)['forEach'](R=>{const F6=F5,{values:b,metricInfo:W}=F[R];return b[F6(0x14e)](V=>{const F7=F6;var a,t;const T=V[F7(0x15a)][F7(0x1a5)];Object[F7(0x142)](u,{[T]:Object['assign'](Object[F7(0x142)]({},u===null||u===void 0x0?void 0x0:u[T]),{[F7(0x185)]:G((a=V['data'])===null||a===void 0x0?void 0x0:a[0x0]),'containerId':T,[W[F7(0x151)]]:e(W,(t=V[F7(0x1bf)])===null||t===void 0x0?void 0x0:t[0x0])})});});}),(0x0,console_format_helpers_1[F5(0x134)])(Object[F5(0x140)](u),'Metrics\x20overview');}[a12N(0x182)](F,e,G){const F8=a12N,u=W=>new Date(W[F8(0x193)]()-R),R=G*0x3e8;if(!F)return[];if(!e)return[];if(u(e)[F8(0x193)]()<F[F8(0x193)]())return[];const b=[{'ts':u(e),'value':0x0}];while(u(b[b[F8(0x187)]-0x1]['ts'])[F8(0x193)]()<=F['getTime']()){b[F8(0x157)]({'ts':u(b[b[F8(0x187)]-0x1]['ts']),'value':0x0});}return b;}[a12N(0x145)](F,e,G){const F9=a12N,u=W=>new Date(W[F9(0x193)]()+R),R=G*0x3e8;if(!F)return[];if(!e)return[];if(u(e)[F9(0x193)]()>F[F9(0x193)]())return[];const b=[{'ts':u(e),'value':0x0}];while(u(b[b['length']-0x1]['ts'])['getTime']()<=F['getTime']()){b[F9(0x148)]({'ts':u(b[b['length']-0x1]['ts']),'value':0x0});}return b;}}exports[a12N(0x164)]=CliMetrics;
1
+ 'use strict';const a12z=a12k;(function(Y,k){const L=a12k,X=Y();while(!![]){try{const B=parseInt(L(0xe6))/0x1+parseInt(L(0x109))/0x2*(-parseInt(L(0xf1))/0x3)+parseInt(L(0x147))/0x4+parseInt(L(0x167))/0x5*(-parseInt(L(0x16c))/0x6)+parseInt(L(0x136))/0x7+parseInt(L(0x11f))/0x8+-parseInt(L(0x146))/0x9;if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a12Y,0x720fb));function a12k(Y,k){const X=a12Y();return a12k=function(B,l){B=B-0xe3;let S=X[B];return S;},a12k(Y,k);}function a12Y(){const Y8=['getPaddingDataStart','stdout','Get\x20metrics\x20before\x20this\x20timestamp,\x20','metricsRange','jobId','forEach','length','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','warning','json','getTime','Error\x20while\x20fetching\x20metrics\x20entries:\x20','askForJob','Deployment\x20id,\x20example:\x20my-service-54785f4','printMetricsSingle','255Qoejxe','printInitInfo','CliMetrics','-o,\x20--output\x20[output]','--noDefaults','15534WGTWFf','unshift','tsHint','askForContainer','commander','action',',\x20to:\x20','--build\x20--buildId\x20[buildId]','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','container\x20','354751mBJLpU','serviceId','metricsApiClient','refreshInterval',',\x20duration:\x20','No\x20metrics\x20found\x20for\x20this\x20query','Get\x20metrics\x20after\x20this\x20timestamp,\x20','metricId','printAsTable','time','toISOString','42zjCrRP','description','getStandardMetricsCommand','Build\x20to\x20get\x20logs\x20from','values','--deployment\x20--deploymentId\x20[deploymentId]','MetricType','done','service','--container\x20--containerId\x20[NAME]','\x20--','printMetricsTable','slice','-t,\x20--metricTypes\x20<metricTypes...>','printResponse','startTime','option','Metrics\x20for\x20','choices','clear','max','InquirerHelper','--timestamp\x20[timestamp]','getPaddingDataEnd','63106DHOols','Option','metricUnit','apiContext','pct','flatMap','bold','chalk','keys','exit','format','\x20for\x20container:\x20','throw','addOption','alias','message','getCommand','flat','name','containerId','stringify','--run\x20--runId\x20[runId]','3494304VbonAJ','../formatting/console-format-helpers','value','buildId','apiClient','askForAddon','rows','noDefaults','ApiClient','toFixed','default','runId','assign','charAt','getCurrentServiceName','--duration\x20[duration]','__awaiter','addon','data','askForBuild','N/A','Metrics\x20overview','min','2868012LEpwFt','yml','assertContextExisting','deploymentId','filter','push','__esModule',',\x20from:\x20','Id\x20[NAME]','handleError','getMetricsCommand','map','endTime','job','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','columns','4050990IXHRhG','1159324epyvFJ','--startTime\x20<timestamp>','log','__importDefault','inquirerHelper','--endTime\x20<timestamp>','metrics','metricsSingle','\x20of\x20','metric','--project\x20--projectId\x20[NAME]','parseDateInput','build-','error','customUserAgent','../utils','askForService'];a12Y=function(){return Y8;};return a12Y();}var __awaiter=this&&this[a12z(0x12f)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){function j(O){try{e(B['next'](O));}catch(T){C(T);}}function o(O){const A=a12k;try{e(B[A(0x115)](O));}catch(T){C(T);}}function e(O){const D=a12k;O[D(0xf8)]?S(O[D(0x121)]):l(O[D(0x121)])['then'](j,o);}e((B=B['apply'](Y,k||[]))['next']());});},__importDefault=this&&this[a12z(0x14a)]||function(Y){const E=a12z;return Y&&Y[E(0x13c)]?Y:{'default':Y};};Object['defineProperty'](exports,a12z(0x13c),{'value':!![]}),exports[a12z(0x169)]=void 0x0;const js_client_1=require('@northflank/js-client'),utils_1=require(a12z(0x156)),inquirer_helper_1=require('../inquirer-helper'),commander_1=require(a12z(0x170)),terminal_chart_1=require('../formatting/terminal-chart'),console_format_helpers_1=require(a12z(0x120)),chalk_1=__importDefault(require(a12z(0x110)));class CliMetrics{constructor(Y,k){const b=a12z;this[b(0x10c)]=Y,this['refreshInterval']=0x2710,this['getStandardMetricsCommand']=(X,B)=>{const a=b,l=(0x0,utils_1[a(0x119)])(!![])[a(0x11b)]((B?a(0x153):'')+a(0x14d))[a(0x117)]((B?a(0x153):'')+a(0x150))[a(0xf2)]('Get\x20metrics\x20for\x20the\x20specified\x20'+X)[a(0x101)](a(0x151),'Project\x20for\x20logs')['option']('--'+X+a(0xfb)+X+a(0x13e),X[a(0x12c)](0x0)['toUpperCase']()+X[a(0xfd)](0x1)+'\x20to\x20get\x20logs\x20from')['option'](a(0xfa),a(0x15f))[a(0x101)](a(0x148),a(0xec)+utils_1[a(0x16e)],utils_1[a(0x152)])[a(0x101)](a(0x14c),a(0x15a)+utils_1[a(0x16e)],utils_1[a(0x152)])['option'](a(0x12e),a(0x144))['addOption'](new commander_1['Option'](a(0x16a),'Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[a(0x103)](Object[a(0xf5)](['format',a(0x161),'yaml'])))[a(0x116)](new commander_1[(a(0x10a))](a(0xfe),'Which\x20metric\x20type\x20to\x20fetch')['choices'](Object[a(0xf5)](js_client_1[a(0xf7)])))[a(0x116)](new commander_1[(a(0x10a))](a(0x107),'Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20'+utils_1[a(0x16e)])['argParser'](utils_1[a(0x152)])['conflicts']([a(0x100),a(0x142)]))[a(0x101)](a(0x16b),a(0xe4),![])[a(0x116)](new commander_1['Option'](a(0x16a),'Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[a(0x103)](Object[a(0xf5)]([a(0x113),'json','yaml'])));if(B)l['option'](a(0xe3),a(0xf4));if(X==='job')l[a(0x101)](a(0x11e),'Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0');if(X===a(0xf9))l['option'](a(0xf6),a(0x165));return l;},this['printMetricsGraph']=(X,B)=>{return l=>{const Z=a12k,S=Object[Z(0x111)](l)[Z(0x10e)](C=>{const c=Z,{values:j,metricInfo:o}=l[C],{metricUnit:e,metricResolution:O}=o;return j[c(0x141)](T=>{const V=c;var v,F;const {metadata:x,data:t}=T,Q=B?(B===null||B===void 0x0?void 0x0:B[V(0x162)]())>new Date()[V(0x162)]()?new Date():B:undefined,n=new Date((v=t===null||t===void 0x0?void 0x0:t[0x0])===null||v===void 0x0?void 0x0:v['ts']),M=new Date((F=t===null||t===void 0x0?void 0x0:t[t[V(0x15e)]-0x1])===null||F===void 0x0?void 0x0:F['ts']),p=this[V(0x158)](X,n,O),d=this[V(0x108)](Q,M,O),P=[...p,...t,...d],f=P['map'](R=>[new Date(R['ts'])['valueOf'](),Number(R[V(0x121)])])[V(0x13a)](R=>!Number['isNaN'](R[0x0])),N=Math['min'](Math[V(0x105)](process['stdout'][V(0x145)]-0xa,0xa),0x64),K=Math[V(0x135)](Math[V(0x105)](process[V(0x159)][V(0x125)]-0x9,0xa),0xf),r=e===V(0x10d)?0x64:undefined,w=e===V(0x10d)?'%':e,h=(0x0,terminal_chart_1['downSampleData'])(f,N),g=h[V(0x141)](R=>R[0x1]),y={'min':0x0,'height':K,'max':r,'unit':w,'startTs':X!==null&&X!==void 0x0?X:n,'endTs':Q!==null&&Q!==void 0x0?Q:M};return{'dataSeries':g,'metadata':x,'chartOpts':y,'metricInfo':o};});})[Z(0x11a)]();if(S[Z(0x15e)]===0x0)(0x0,utils_1[Z(0x160)])(Z(0xeb));else S[Z(0x15d)](C=>{const m=Z,{dataSeries:j,metadata:o,chartOpts:e,metricInfo:O}=C,{containerId:T,volumeId:v}=o,F=v?',\x20volume:\x20'+v:'';console[m(0x149)](O[m(0xed)]+m(0x114)+chalk_1[m(0x129)]['bold'](T)+F),console[m(0x149)]((0x0,terminal_chart_1['getAsciiChart'])(j,e));});};},this[b(0xfc)]=(X,B,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=b;try{const S=yield this[J(0xe8)][J(0x14d)][J(0x14e)](X,B,l);console[J(0x104)]();if(S[J(0x154)])(0x0,utils_1[J(0x154)])(J(0x163)+S[J(0x154)][J(0x118)]);else this[J(0x166)](S[J(0x131)]);}catch(C){console[J(0x104)](),(0x0,utils_1[J(0x154)])(J(0x163)+C[J(0x118)]);}}),this[b(0x13f)]=X=>{const H=b;if(X[H(0x154)]){const B=JSON[H(0x11d)](X[H(0x154)]['details']);throw new Error(H(0x163)+X['error'][H(0x118)]+'\x20'+B);}},this[b(0x168)]=(X,B,l,S,C)=>{const G=b;if(C===!![])return;const {metricTypes:j,endTime:o,startTime:e,duration:O,containerId:T}=S,v=e?G(0x13d)+e[G(0xf0)]():'',F=o?G(0x172)+o[G(0xf0)]():'',x=O?G(0xea)+O+'\x20seconds':'',t=T?G(0xe5)+chalk_1[G(0x129)][G(0x10f)](T):'all\x20containers',Q=X+'\x20'+chalk_1[G(0x129)][G(0x10f)](B)+'\x20in\x20project\x20'+chalk_1[G(0x129)][G(0x10f)](l),n=''+v+F+x,M=j?',\x20metric\x20types:\x20'+(j===null||j===void 0x0?void 0x0:j['join'](',')):'';console[G(0x149)](G(0x102)+t+G(0x14f)+Q+M+n);},this[b(0x123)]=new js_client_1[(b(0x127))](Y,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[b(0x155)],'agent':k}),this['metricsApiClient']=this[b(0x123)],this[b(0x14b)]=new inquirer_helper_1[(b(0x106))](this['apiClient']);}[a12z(0x140)](Y,k=![]){const Y0=a12z,X=(j,o)=>__awaiter(this,void 0x0,void 0x0,function*(){const s=a12k,e=o[s(0x126)],{apiContext:O,inquirerHelper:T}=this;switch(Y){case'service':{const v=e?undefined:O[s(0x12d)]();return o[s(0xe7)]||v||(yield T[s(0x157)](j)());}case s(0x143):{const F=e?undefined:O[s(0x12d)]();return o[s(0x15c)]||F||(yield T[s(0x164)](j)());}case s(0x130):{const x=e?undefined:O[s(0x12d)]();return o['addonId']||x||(yield T[s(0x124)](j)());}}}),B=(j,o,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const I=a12k;if(k)return e[I(0x122)]||(yield this['inquirerHelper'][I(0x132)](j,Y===I(0xf9)?o:undefined,Y===I(0x143)?o:undefined,!![])());return undefined;}),l=(j,o,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const u=a12k;if(!k&&e[u(0x11c)]!==undefined){if(e[u(0x11c)]!==!![])return e[u(0x11c)];return yield this[u(0x14b)][u(0x16f)](j,Y===u(0xf9)?o:undefined,Y==='job'?o:undefined,!![])();}return undefined;}),S=(j,o,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const i=a12k;if(Y===i(0x143))return e[i(0x12a)]||(yield this[i(0x14b)]['askForJobRun'](o,j,!![])());return undefined;}),C=(j,o,e)=>__awaiter(this,void 0x0,void 0x0,function*(){const W=a12k;if(Y==='service'){if(e[W(0x139)]!==!![])return e[W(0x139)];return e[W(0x139)];}return undefined;});return this[Y0(0xf3)](Y,k)[Y0(0x171)](j=>__awaiter(this,void 0x0,void 0x0,function*(){const Y1=Y0,{noDefaults:o,projectId:e,duration:O,timestamp:T,output:v,startTime:F,endTime:x,metricTypes:t,quiet:Q}=j;(0x0,utils_1[Y1(0x138)])(this[Y1(0x123)]);if(F&&x&&O)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const {apiContext:n,inquirerHelper:M,metricsApiClient:p}=this,d=o?undefined:n['getCurrentProjectName'](),P=e||d||(yield M['askForProject']()),f=yield X(P,j),N=yield B(P,f,j),K=yield S(P,f,j),r=yield C(P,f,j),w=yield l(P,f,j),h={'projectId':P,'entityId':f},g={'containerName':w,'startTime':F,'endTime':x,'duration':O,'timestamp':T,'metricTypes':t,'runId':K,'buildId':N,'deploymentId':r,'isBuild':k!==null&&k!==void 0x0?k:![]},y=!(F||x||O);if(!Q&&v!=='yaml'&&v!==Y1(0x137)&&v!==Y1(0x161))this['printInitInfo'](Y,f,P,g,Q);if(y){if(v!==undefined){const R=yield p[Y1(0x14d)]['metricsSingle'](h,g,Y);this[Y1(0x13f)](R),(0x0,console_format_helpers_1[Y1(0xff)])(v,R['data']);}else[...Array(process[Y1(0x159)][Y1(0x125)]-0x1)]['forEach']((q,U)=>U===0x0?console['log']('Fetching\x20data..'):console[Y1(0x149)]()),yield this['printMetricsTable'](h,g,Y)(),setInterval(this[Y1(0xfc)](h,g,Y),this[Y1(0xe9)]),yield new Promise(q=>setTimeout(q,this[Y1(0xe9)]*0x64));}else{const q=yield p[Y1(0x14d)][Y1(0x15b)](h,g,Y);this[Y1(0x13f)](q),v!==undefined?(0x0,console_format_helpers_1[Y1(0xff)])(v,q['data']):this['printMetricsGraph'](F,x!==null&&x!==void 0x0?x:new Date())(q[Y1(0x131)]);}process[Y1(0x112)]();}));}[a12z(0x166)](Y){const Y3=a12z,k=(S,C)=>{const Y2=a12k;if(!(C===null||C===void 0x0?void 0x0:C[Y2(0x121)]))Y2(0x133);const j=S[Y2(0x10b)]==='pct'?'%':S['metricUnit'];return''+Number(C===null||C===void 0x0?void 0x0:C[Y2(0x121)])[Y2(0x128)](0x3)+j;},X=l=>{if(!(l===null||l===void 0x0?void 0x0:l['ts']))'N/A';return l['ts']['toTimeString']()['split']('\x20')[0x0];},B={};Object[Y3(0x111)](Y)['forEach'](l=>{const Y4=Y3,{values:S,metricInfo:C}=Y[l];return S[Y4(0x15d)](j=>{const Y5=Y4;var o,e;const O=j['metadata'][Y5(0x11c)];Object[Y5(0x12b)](B,{[O]:Object[Y5(0x12b)](Object[Y5(0x12b)]({},B===null||B===void 0x0?void 0x0:B[O]),{[Y5(0xef)]:X((o=j['data'])===null||o===void 0x0?void 0x0:o[0x0]),'containerId':O,[C[Y5(0xed)]]:k(C,(e=j['data'])===null||e===void 0x0?void 0x0:e[0x0])})});});}),(0x0,console_format_helpers_1[Y3(0xee)])(Object[Y3(0xf5)](B),Y3(0x134));}[a12z(0x158)](Y,k,X){const Y6=a12z,B=C=>new Date(C[Y6(0x162)]()-l),l=X*0x3e8;if(!Y)return[];if(!k)return[];if(B(k)[Y6(0x162)]()<Y['getTime']())return[];const S=[{'ts':B(k),'value':0x0}];while(B(S[S['length']-0x1]['ts'])[Y6(0x162)]()<=Y[Y6(0x162)]()){S[Y6(0x16d)]({'ts':B(S[S['length']-0x1]['ts']),'value':0x0});}return S;}['getPaddingDataEnd'](Y,k,X){const Y7=a12z,B=C=>new Date(C[Y7(0x162)]()+l),l=X*0x3e8;if(!Y)return[];if(!k)return[];if(B(k)['getTime']()>Y[Y7(0x162)]())return[];const S=[{'ts':B(k),'value':0x0}];while(B(S[S[Y7(0x15e)]-0x1]['ts'])['getTime']()<=Y[Y7(0x162)]()){S[Y7(0x13b)]({'ts':B(S[S[Y7(0x15e)]-0x1]['ts']),'value':0x0});}return S;}}exports['CliMetrics']=CliMetrics;
@@ -1 +1 @@
1
- 'use strict';const a13n=a13e;function a13e(F,e){const G=a13F();return a13e=function(u,R){u=u-0x1b0;let b=G[u];return b;},a13e(F,e);}(function(F,e){const Z=a13e,G=F();while(!![]){try{const u=-parseInt(Z(0x1db))/0x1*(parseInt(Z(0x1b4))/0x2)+-parseInt(Z(0x1d4))/0x3+-parseInt(Z(0x1b3))/0x4+parseInt(Z(0x1d5))/0x5*(parseInt(Z(0x1b6))/0x6)+-parseInt(Z(0x1b8))/0x7*(-parseInt(Z(0x1ce))/0x8)+-parseInt(Z(0x1da))/0x9+-parseInt(Z(0x1bb))/0xa*(-parseInt(Z(0x1c6))/0xb);if(u===e)break;else G['push'](G['shift']());}catch(R){G['push'](G['shift']());}}}(a13F,0xf2eeb));var __awaiter=this&&this[a13n(0x1cb)]||function(F,e,G,u){function R(b){return b instanceof G?b:new G(function(W){W(b);});}return new(G||(G=Promise))(function(b,W){const w=a13e;function V(t){const v=a13e;try{m(u[v(0x1d6)](t));}catch(T){W(T);}}function a(t){try{m(u['throw'](t));}catch(T){W(T);}}function m(t){const A=a13e;t[A(0x1bc)]?b(t[A(0x1ca)]):R(t[A(0x1ca)])[A(0x1d9)](V,a);}m((u=u[w(0x1d8)](F,e||[]))[w(0x1d6)]());});},__importDefault=this&&this['__importDefault']||function(F){return F&&F['__esModule']?F:{'default':F};};function a13F(){const d=['55nsKPIq','next','realLength','apply','then','6571737lcsLVr','7219fngUqN','name','loading','default','291236uxWdXn','470iXuXWz','dir\x20must\x20be\x20up\x20or\x20down','587040iBQJTu','reloadText','7XPjgCI','loadMore','DynamicReloadPaginationPrompt','90seDKfe','done','loop','handleDynamicPageLoad','push','italic','pagOpt','nextPageCursor','selected','onDownKey','inquirer/lib/prompts/list','3442032pOSRBD','choices','length','\x20Loading\x20more\x20options','value','__awaiter','down','chalk','2777688HXwkWA','opt','render','onUpKey','..\x20Load\x20more\x20options\x20..','inquirer/lib/objects/choice','2235423YCsVjK'];a13F=function(){return d;};return a13F();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a13n(0x1ba)]=void 0x0;const list_1=__importDefault(require(a13n(0x1c5))),choice_1=__importDefault(require(a13n(0x1d3))),chalk_1=__importDefault(require(a13n(0x1cd)));function incrementListIndex(F,e,G){const o=a13n,u=G[o(0x1c7)][o(0x1d7)],R='loop'in G?Boolean(G[o(0x1bd)]):!![];if(e==='up'){if(F>0x0)return F-0x1;return R?u-0x1:F;}if(e===o(0x1cc)){if(F<u-0x1)return F+0x1;return R?0x0:F;}throw new Error(o(0x1b5));}class DynamicReloadPaginationPrompt extends list_1[a13n(0x1b2)]{constructor(F,e,G){const i=a13n;super(F,e,G),this[i(0x1b7)]=chalk_1[i(0x1b2)][i(0x1c0)](i(0x1d2)),this[i(0x1b1)]=![],this[i(0x1c1)]=this[i(0x1cf)],this[i(0x1c2)]=this[i(0x1c1)]['nextPageCursor'],this[i(0x1c2)]!==undefined&&this[i(0x1cf)]['choices'][i(0x1bf)](new choice_1['default'](this[i(0x1b7)],this[i(0x1b7)]));}[a13n(0x1d1)](){const c=a13n;if(this[c(0x1b1)])return;this['selected']=incrementListIndex(this[c(0x1c3)],'up',this['opt']),this[c(0x1d0)]();}[a13n(0x1c4)](){return __awaiter(this,void 0x0,void 0x0,function*(){const l=a13e;if(this['loading'])return;this['selected']=incrementListIndex(this[l(0x1c3)],l(0x1cc),this[l(0x1cf)]),yield this[l(0x1be)](),this['render']();});}[a13n(0x1be)](){return __awaiter(this,void 0x0,void 0x0,function*(){const X=a13e;if(this['selected']>=this['opt'][X(0x1c7)][X(0x1c8)]-0x1){if(this[X(0x1c2)]===undefined)return;this['loading']=!![];let F=0x0;const e=setInterval(()=>{const h=X,b=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],W=chalk_1['default']['italic'](b[F%b[h(0x1c8)]]+h(0x1c9));this[h(0x1cf)][h(0x1c7)][h(0x1c7)][this[h(0x1c3)]][h(0x1b0)]=''+W,F+=0x1,this['render']();},0x50),{elements:G,nextPageCursor:u}=yield this[X(0x1c1)][X(0x1b9)]({'nextPageCursor':this['nextPageCursor']})['catch'](()=>({'elements':[],'nextPageCursor':undefined}));this[X(0x1c2)]=u;const R=G['map'](b=>new choice_1[(X(0x1b2))](b,b));this[X(0x1cf)][X(0x1c7)][X(0x1c7)]['splice'](this[X(0x1c3)],0x1),this[X(0x1cf)]['choices'][X(0x1bf)](...R),u!==undefined&&this[X(0x1cf)]['choices']['push'](new choice_1[(X(0x1b2))](this['reloadText'],this[X(0x1b7)])),clearInterval(e),this['loading']=![];}});}}exports[a13n(0x1ba)]=DynamicReloadPaginationPrompt;
1
+ 'use strict';const a13F=a13k;(function(Y,k){const v=a13k,X=Y();while(!![]){try{const B=-parseInt(v(0xe9))/0x1*(parseInt(v(0x103))/0x2)+-parseInt(v(0xe4))/0x3*(-parseInt(v(0xe8))/0x4)+-parseInt(v(0x107))/0x5+-parseInt(v(0x101))/0x6+parseInt(v(0xff))/0x7+-parseInt(v(0xe6))/0x8*(-parseInt(v(0xf7))/0x9)+-parseInt(v(0xf3))/0xa*(-parseInt(v(0xee))/0xb);if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a13Y,0x7b0d7));function a13k(Y,k){const X=a13Y();return a13k=function(B,l){B=B-0xe3;let S=X[B];return S;},a13k(Y,k);}var __awaiter=this&&this[a13F(0xf4)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const n=a13k;function j(O){const x=a13k;try{e(B[x(0xe5)](O));}catch(T){C(T);}}function o(O){const t=a13k;try{e(B[t(0xf2)](O));}catch(T){C(T);}}function e(O){const Q=a13k;O[Q(0x10b)]?S(O[Q(0xef)]):l(O[Q(0xef)])[Q(0x10a)](j,o);}e((B=B[n(0x108)](Y,k||[]))[n(0xe5)]());});},__importDefault=this&&this[a13F(0x100)]||function(Y){const M=a13F;return Y&&Y[M(0xfb)]?Y:{'default':Y};};Object[a13F(0xfa)](exports,'__esModule',{'value':!![]}),exports['DynamicReloadPaginationPrompt']=void 0x0;const list_1=__importDefault(require('inquirer/lib/prompts/list')),choice_1=__importDefault(require('inquirer/lib/objects/choice')),chalk_1=__importDefault(require(a13F(0xe3)));function incrementListIndex(Y,k,X){const p=a13F,B=X['choices']['realLength'],l=p(0x104)in X?Boolean(X[p(0x104)]):!![];if(k==='up'){if(Y>0x0)return Y-0x1;return l?B-0x1:Y;}if(k===p(0xed)){if(Y<B-0x1)return Y+0x1;return l?0x0:Y;}throw new Error('dir\x20must\x20be\x20up\x20or\x20down');}class DynamicReloadPaginationPrompt extends list_1[a13F(0xf6)]{constructor(Y,k,X){const d=a13F;super(Y,k,X),this[d(0x105)]=chalk_1['default'][d(0xf5)]('..\x20Load\x20more\x20options\x20..'),this['loading']=![],this[d(0x102)]=this['opt'],this[d(0xf9)]=this[d(0x102)][d(0xf9)],this[d(0xf9)]!==undefined&&this[d(0xf8)][d(0xea)][d(0x10c)](new choice_1[(d(0xf6))](this[d(0x105)],this['reloadText']));}[a13F(0xec)](){const P=a13F;if(this[P(0xf1)])return;this['selected']=incrementListIndex(this[P(0xfd)],'up',this['opt']),this[P(0x106)]();}[a13F(0x109)](){return __awaiter(this,void 0x0,void 0x0,function*(){const f=a13k;if(this[f(0xf1)])return;this[f(0xfd)]=incrementListIndex(this[f(0xfd)],f(0xed),this[f(0xf8)]),yield this[f(0xeb)](),this[f(0x106)]();});}[a13F(0xeb)](){return __awaiter(this,void 0x0,void 0x0,function*(){const N=a13k;if(this[N(0xfd)]>=this[N(0xf8)][N(0xea)]['length']-0x1){if(this['nextPageCursor']===undefined)return;this[N(0xf1)]=!![];let Y=0x0;const k=setInterval(()=>{const K=N,S=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],C=chalk_1['default'][K(0xf5)](S[Y%S['length']]+'\x20Loading\x20more\x20options');this[K(0xf8)][K(0xea)]['choices'][this[K(0xfd)]][K(0xfc)]=''+C,Y+=0x1,this[K(0x106)]();},0x50),{elements:X,nextPageCursor:B}=yield this['pagOpt'][N(0xe7)]({'nextPageCursor':this['nextPageCursor']})['catch'](()=>({'elements':[],'nextPageCursor':undefined}));this[N(0xf9)]=B;const l=X['map'](S=>new choice_1[(N(0xf6))](S,S));this['opt'][N(0xea)][N(0xea)][N(0xfe)](this[N(0xfd)],0x1),this[N(0xf8)][N(0xea)][N(0x10c)](...l),B!==undefined&&this[N(0xf8)]['choices']['push'](new choice_1[(N(0xf6))](this[N(0x105)],this[N(0x105)])),clearInterval(k),this['loading']=![];}});}}exports[a13F(0xf0)]=DynamicReloadPaginationPrompt;function a13Y(){const r=['chalk','391863xosqcZ','next','153064botFKd','loadMore','8YGFBEI','74225auXSsj','choices','handleDynamicPageLoad','onUpKey','down','55FxjscT','value','DynamicReloadPaginationPrompt','loading','throw','3446510jLPWJC','__awaiter','italic','default','63tmnTCu','opt','nextPageCursor','defineProperty','__esModule','name','selected','splice','593047PHRTEV','__importDefault','3604188zZSotC','pagOpt','24UhJSnL','loop','reloadText','render','1038640cJnlDL','apply','onDownKey','then','done','push'];a13Y=function(){return r;};return a13Y();}
@@ -1 +1 @@
1
- 'use strict';const a14x=a14e;(function(F,e){const B=a14e,G=F();while(!![]){try{const u=-parseInt(B(0x230))/0x1+-parseInt(B(0x1fd))/0x2+parseInt(B(0x236))/0x3+-parseInt(B(0x218))/0x4*(parseInt(B(0x1cd))/0x5)+-parseInt(B(0x1e0))/0x6+-parseInt(B(0x220))/0x7*(-parseInt(B(0x238))/0x8)+parseInt(B(0x1e2))/0x9*(parseInt(B(0x1db))/0xa);if(u===e)break;else G['push'](G['shift']());}catch(R){G['push'](G['shift']());}}}(a14F,0x8aaa8));function a14F(){const F1=['Service\x20to\x20forward','uniq','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','lodash','chalk','assertContextExisting','/etc/hosts','InquirerHelper','port','exit','hostnames','5GJOzGa','forward','skipHostnamesText','message','Addons:','--skipHostnames','forEach','getCurrentProjectName','throw','get','address','askForAddon','map','CliPortForward','890YAtKxH','forwarding','bold','prototype','tunnel-close','2256126gjtakc','then','72837ofjtUj','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','Please\x20ensure\x20the\x20','C:/Windows/System32/drivers/etc/hosts','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','apiClient','\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20with\x20multiple\x20ports:','description','\x20is\x20exposed\x20with\x20multiple\x20',',\x20hostname:\x20','ports','option','flat','name','portFwdCmd','Failed:\x20','Port-forwarding\x20for\x20the\x20specified\x20addon','type','warning','\x20and\x20','next','action','\x20is\x20running\x20and\x20reachable.','connection-error','--project\x20--projectId\x20[NAME]','@northflank/js-client','278514aoZLRK','printForwardingInfo','Running\x20in\x20','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','defineProperty','--addon\x20--addonId\x20[NAME]','platform','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','noDefaultsText','all','Cleaning\x20up\x20open\x20connections\x20failed:\x20','--service\x20--serviceId\x20[NAME]','__awaiter','http://','service','Stop\x20forwarding\x20traffic\x20from\x20','with\x20hostname:\x20','askForService','configurable','addon','filter','join','length','getCurrentServiceName','create','printHostsFileHint','log','2618192iVsRrP','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','value','__importStar','reset','askForProject','getProxyForwarder','done','5995871PEfASR','repeat','../utils','Project\x20for\x20forwarding','groupBy','protocol','project\x20for\x20forwarding','--noDefaults','\x20service\x20ports','error','data.id','green','success','uniqBy','forwardService','\x20addon\x20ports','857146RGPNPt','__esModule','ApiClient','hosts','win32','__createBinding','3054354tTlOTM','Forwarding\x20','8jMnEKo','default','greenBright','apply','\x20in\x20project\x20','data','\x20with\x20these\x20hostnames:','__setModuleDefault','\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20(','Port-forwarding\x20for\x20the\x20specified\x20service','\x20\x20-\x20port\x20','\x20\x20-\x20Address:\x20','Addon\x20to\x20forward','alias','portName','\x20is\x20exposed\x20on\x20','getCommand','fwd','skipHostnames'];a14F=function(){return F1;};return a14F();}var __createBinding=this&&this[a14x(0x235)]||(Object[a14x(0x215)]?function(F,e,G,u){const r=a14x;if(u===undefined)u=G;var R=Object['getOwnPropertyDescriptor'](e,G);(!R||(r(0x1d6)in R?!e[r(0x231)]:R['writable']||R[r(0x20f)]))&&(R={'enumerable':!![],'get':function(){return e[G];}}),Object[r(0x201)](F,u,R);}:function(F,e,G,u){if(u===undefined)u=G;F[u]=e[G];}),__setModuleDefault=this&&this[a14x(0x23f)]||(Object[a14x(0x215)]?function(F,e){const k=a14x;Object[k(0x201)](F,'default',{'enumerable':!![],'value':e});}:function(F,e){const K=a14x;F[K(0x239)]=e;}),__importStar=this&&this[a14x(0x21b)]||function(F){const p=a14x;if(F&&F[p(0x231)])return F;var e={};if(F!=null){for(var G in F)if(G!==p(0x239)&&Object[p(0x1de)]['hasOwnProperty']['call'](F,G))__createBinding(e,F,G);}return __setModuleDefault(e,F),e;},__awaiter=this&&this[a14x(0x209)]||function(F,e,G,u){function R(b){return b instanceof G?b:new G(function(W){W(b);});}return new(G||(G=Promise))(function(b,W){const C=a14e;function V(t){const O=a14e;try{m(u[O(0x1f7)](t));}catch(T){W(T);}}function a(t){const D=a14e;try{m(u[D(0x1d5)](t));}catch(T){W(T);}}function m(t){const z=a14e;t[z(0x21f)]?b(t['value']):R(t[z(0x21a)])[z(0x1e1)](V,a);}m((u=u[C(0x23b)](F,e||[]))[C(0x1f7)]());});},__importDefault=this&&this['__importDefault']||function(F){const N=a14x;return F&&F[N(0x231)]?F:{'default':F};};Object[a14x(0x201)](exports,'__esModule',{'value':!![]}),exports[a14x(0x1da)]=void 0x0;function a14e(F,e){const G=a14F();return a14e=function(u,R){u=u-0x1b9;let b=G[u];return b;},a14e(F,e);}const js_client_1=require(a14x(0x1fc)),chalk_1=__importDefault(require(a14x(0x1c6))),utils_1=require(a14x(0x222)),inquirer_helper_1=require('../inquirer-helper'),os=__importStar(require('os')),lodash_1=require(a14x(0x1c5)),{EOL}=require('os');class CliPortForward{constructor(F){const I=a14x;this[I(0x205)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this[I(0x1cf)]=I(0x204),this[I(0x1e7)]=new js_client_1[(I(0x232))](F,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']});const e=new inquirer_helper_1[(I(0x1c9))](this[I(0x1e7)]);this[I(0x1f1)]=(0x0,utils_1[I(0x1bf)])()[I(0x1f0)](I(0x1ce))[I(0x1bc)](I(0x1c0))['description']('Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.');const G=(0x0,utils_1[I(0x1bf)])(!![])['name'](I(0x206))[I(0x1ea)]('Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project')[I(0x1ee)](I(0x1fb),I(0x226))[I(0x1ee)](I(0x227),this[I(0x205)],![])[I(0x1ee)](I(0x1d2),this[I(0x1cf)],![])[I(0x1f8)](({noDefaults:b,projectId:W,skipHostnames:V})=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=I;(0x0,utils_1[Y(0x1c7)])(this[Y(0x1e7)]);const a=this[Y(0x21e)](V),m=b?undefined:F['getCurrentProjectName'](),t=W||m||(yield e[Y(0x21d)]());try{const {services:T,addons:Z}=yield a['forwardProject']({'projectId':t},V);if(T[Y(0x213)]+Z[Y(0x213)]<=0x0)(0x0,utils_1[Y(0x1f5)])('No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20'+chalk_1[Y(0x239)][Y(0x1dd)](t));else{const n=T['filter'](w=>w[Y(0x213)]>0x0)[Y(0x213)],v=Z['filter'](w=>w[Y(0x213)]>0x0)[Y(0x213)],A='\x20in\x20project\x20'+chalk_1[Y(0x239)][Y(0x1dd)](t);console[Y(0x217)](Y(0x237)+chalk_1[Y(0x239)]['green']['bold'](n+Y(0x228))+Y(0x1f6)+chalk_1[Y(0x239)][Y(0x22b)][Y(0x1dd)](v+Y(0x22f))+A),console['log'](),console[Y(0x217)](chalk_1[Y(0x239)][Y(0x1dd)]('Services:')),T['forEach'](w=>{const g=Y;if(w[g(0x213)]>=0x1&&!w[0x0][g(0x229)])this[g(0x1fe)](w,{'type':'service','name':w[0x0][g(0x23d)]['id']},V);}),console[Y(0x217)](chalk_1[Y(0x239)][Y(0x1dd)](Y(0x1d1))),Z[Y(0x1d3)](w=>{const Q=Y;if(w[Q(0x213)]>=0x1&&!w[0x0][Q(0x229)])this[Q(0x1fe)](w,{'type':'addon','name':w[0x0][Q(0x23d)]['id']},V);}),this[Y(0x216)]([...T[Y(0x1ef)](),...Z[Y(0x1ef)]()],V);}}catch(w){(0x0,utils_1[Y(0x229)])('Failed:\x20'+w[Y(0x1d0)]);}})),u=(0x0,utils_1['getCommand'])(!![])['name']('service')[I(0x1ea)](I(0x241))['option'](I(0x1fb),I(0x223))['option'](I(0x208),I(0x1c2))[I(0x1ee)]('--noDefaults',this[I(0x205)],![])[I(0x1ee)]('--skipHostnames',this[I(0x1cf)],![])['action'](({noDefaults:b,projectId:W,serviceId:V,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const S=I;(0x0,utils_1['assertContextExisting'])(this[S(0x1e7)]);const m=this[S(0x21e)](a),t=b?undefined:F[S(0x1d4)](),T=W||t||(yield e['askForProject']()),Z=b?undefined:F[S(0x214)](),n=V||Z||(yield e[S(0x20e)](T)());console['log']('Forwarding\x20service\x20'+chalk_1[S(0x239)][S(0x1dd)](n)+S(0x23c)+chalk_1['default'][S(0x1dd)](T));try{const v=yield m[S(0x22e)]({'projectId':T,'serviceId':n},a);this[S(0x1fe)](v,{'name':n,'type':'service'},a),this[S(0x216)](v,a);}catch(A){(0x0,utils_1['error'])(S(0x1f2)+A['message']);}})),R=(0x0,utils_1[I(0x1bf)])(!![])[I(0x1f0)](I(0x210))[I(0x1ea)](I(0x1f3))[I(0x1ee)](I(0x1fb),I(0x223))[I(0x1ee)](I(0x202),I(0x1bb))[I(0x1ee)](I(0x1d2),this[I(0x1cf)],![])[I(0x1f8)](({noDefaults:b,projectId:W,addonId:V,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const j=I;(0x0,utils_1[j(0x1c7)])(this[j(0x1e7)]);const m=this[j(0x21e)](a),t=b?undefined:F['getCurrentProjectName'](),T=W||t||(yield e[j(0x21d)]()),Z=V||(yield e[j(0x1d8)](T)());console[j(0x217)]('Forwarding\x20addon\x20'+chalk_1['default'][j(0x1dd)](Z)+j(0x23c)+chalk_1['default'][j(0x1dd)](T));try{const n={'projectId':T,'addonId':Z},v=yield m['forwardAddon'](n,a);this['printForwardingInfo'](v,{'name':Z,'type':j(0x210)},a),this['printHostsFileHint'](v,a);}catch(A){(0x0,utils_1[j(0x229)])('Failed:\x20'+A['message']);}}));this[I(0x1f1)]['addCommand'](G),this[I(0x1f1)]['addCommand'](u),this[I(0x1f1)]['addCommand'](R);}['getProxyForwarder'](F=![]){const q=a14x,e=this[q(0x1e7)][q(0x1dc)];if(!F){const G=e['canExecuteWithHostnames']();if(G[q(0x229)])throw new Error(G[q(0x1d0)]);}return e['on'](q(0x1df),(u,R)=>{const f=q,b=chalk_1[f(0x239)][f(0x1dd)](R[f(0x1f4)]+'\x20\x27'+R['id']+'\x27'),W=R[f(0x1cc)][f(0x213)]>0x0;(0x0,utils_1[f(0x1f5)])(f(0x20c)+R[f(0x1d7)]+':'+R[f(0x1ca)]+'\x20to\x20'+b),F&&W&&(0x0,utils_1[f(0x1f5)])(f(0x1e3));}),e['on'](q(0x1fa),(u,R,b)=>{const H=q;(0x0,utils_1[H(0x1f5)])(H(0x200)+R[H(0x1d7)]+':'+R[H(0x1ca)]+'\x27:\x20\x22'+(b===null||b===void 0x0?void 0x0:b[H(0x1d0)])+'\x22');}),process['on']('SIGINT',()=>__awaiter(this,void 0x0,void 0x0,function*(){const s=q;try{yield e['stop']();}catch(u){(0x0,utils_1[s(0x229)])(s(0x207)+u['message']);}finally{process[s(0x1cb)]();}})),e;}[a14x(0x1fe)](F,e,G=![]){const y=a14x,{type:u,name:R}=e;if(F['length']<=0x0){const a=y(0x1e4)+e[y(0x1f4)]+y(0x1f9);(0x0,utils_1[y(0x1f5)])(y(0x1e6)+u+'\x20'+chalk_1[y(0x239)][y(0x1dd)](R)+'.\x20'+a);return;}const b=(0x0,lodash_1[y(0x224)])(F,y(0x22a)),W=m=>'\x20('+(m['portName']?m[y(0x1bd)]+'\x20-\x20':'')+m[y(0x225)]+')';function V(m,t=0x2){const E=y;if(!G){const T=m[E(0x225)]==='HTTP'?E(0x20a):'';m['hostnames'][E(0x1d3)](Z=>{const J=E;console[J(0x217)]((0x0,lodash_1[J(0x221)])('\x20',t)+'-\x20'+T+Z+':'+m[J(0x1ca)]);});}}Object['entries'](b)[y(0x1d3)](([m,t])=>{const M=y;var T,Z;const n='>\x20'+(0x0,lodash_1['capitalize'])(u)+'\x20\x27'+chalk_1[M(0x239)][M(0x23a)]['bold'](m)+'\x27';if(u===M(0x210)){if(t[M(0x213)]===0x1){const v=t[0x0];if(v[M(0x229)]){(0x0,utils_1[M(0x229)])(M(0x219)+m+':\x20'+v[M(0x229)][M(0x1d0)]);return;}const A=v[M(0x23d)],w=!G?'\x20'+chalk_1['default'][M(0x21c)](M(0x20d)+A[M(0x1cc)][M(0x212)](',')):'';(0x0,utils_1['success'])(n+M(0x1be)+A['address']+':'+A[M(0x1ca)]+W(A)+w);}else{const o=(0x0,lodash_1[M(0x22d)])(t,i=>{const L=M;var c,l;return(l=(c=i===null||i===void 0x0?void 0x0:i[L(0x23d)])===null||c===void 0x0?void 0x0:c['hostnames'])===null||l===void 0x0?void 0x0:l['join'](',');})[M(0x213)]>0x1;(0x0,utils_1[M(0x22c)])(n+M(0x1eb)+(o?M(0x233):M(0x1ed))+':'),t['forEach'](i=>{const P=M;if(i[P(0x229)]){(0x0,utils_1[P(0x229)])(P(0x219)+m+':\x20'+i[P(0x229)]['message']);return;}const c=i[P(0x23d)],l=!G?P(0x1ec)+c[P(0x1cc)]['join'](','):'';console['log'](P(0x1ba)+c[P(0x1d7)]+':'+c[P(0x1ca)]+W(c)+l);});}}if(u===M(0x20b)){if(t[M(0x213)]===0x1){const i=t[0x0];if(i[M(0x229)]){(0x0,utils_1[M(0x229)])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+m+':\x20'+i[M(0x229)][M(0x1d0)]);return;}const c=i[M(0x23d)],l=!G?M(0x23e):':',X=c[M(0x1d7)]+':'+c['port']+W(c);(0x0,utils_1[M(0x22c)])(n+'\x20is\x20exposed\x20on\x20'+X+l),V(c);}else(0x0,utils_1[M(0x22c)])(n+M(0x1be)+((Z=(T=t[0x0])===null||T===void 0x0?void 0x0:T['data'])===null||Z===void 0x0?void 0x0:Z[M(0x1d7)])+M(0x1e9)),t['forEach'](h=>{const U=M;if(h[U(0x229)]){(0x0,utils_1[U(0x229)])(U(0x219)+m+':\x20'+h['error'][U(0x1d0)]);return;}const d=h['data'];(0x0,utils_1[U(0x22c)])(U(0x1b9)+d[U(0x1ca)]+W(d)),V(d,0x4);});}});}['printHostsFileHint'](F,e=![]){const F0=a14x;if(e){const G=F['flatMap'](t=>t[F0(0x23d)])[F0(0x211)](t=>t!==undefined),u=(process===null||process===void 0x0?void 0x0:process[F0(0x203)])===F0(0x234),R=os['platform']()==='darwin',b=u?F0(0x1e5):F0(0x1c8),W=chalk_1[F0(0x239)][F0(0x1dd)](F0(0x1c1)),V=R?EOL+'Running\x20on\x20macOS\x20in\x20'+W+F0(0x1c4):undefined;let a=F0(0x1ff)+W+'\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20'+F0(0x1d2)+F0(0x240)+b+'):';V!==undefined&&(0x0,utils_1['warning'])(V!==null&&V!==void 0x0?V:'');(0x0,utils_1[F0(0x1f5)])(a);const m=G[F0(0x1d9)](t=>t['address']+F0(0x1e8)+t[F0(0x1cc)][F0(0x212)]('\x20'));console[F0(0x217)]((0x0,lodash_1[F0(0x1c3)])(m)[F0(0x212)](EOL)),console[F0(0x217)]();}}}exports[a14x(0x1da)]=CliPortForward;
1
+ 'use strict';const a14r=a14k;(function(Y,k){const K=a14k,X=Y();while(!![]){try{const B=parseInt(K(0x1a6))/0x1*(parseInt(K(0x122))/0x2)+parseInt(K(0x12c))/0x3+-parseInt(K(0x173))/0x4+-parseInt(K(0x189))/0x5*(parseInt(K(0x174))/0x6)+-parseInt(K(0x179))/0x7+parseInt(K(0x158))/0x8*(parseInt(K(0x141))/0x9)+-parseInt(K(0x178))/0xa;if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a14Y,0xc1953));function a14k(Y,k){const X=a14Y();return a14k=function(B,l){B=B-0x121;let S=X[B];return S;},a14k(Y,k);}var __createBinding=this&&this[a14r(0x133)]||(Object[a14r(0x14b)]?function(Y,X,B,l){const w=a14r;if(l===undefined)l=B;var S=Object[w(0x13a)](X,B);(!S||(w(0x163)in S?!X[w(0x16e)]:S[w(0x19a)]||S[w(0x152)]))&&(S={'enumerable':!![],'get':function(){return X[B];}}),Object['defineProperty'](Y,l,S);}:function(Y,X,B,l){if(l===undefined)l=B;Y[l]=X[B];}),__setModuleDefault=this&&this[a14r(0x198)]||(Object[a14r(0x14b)]?function(Y,k){const h=a14r;Object['defineProperty'](Y,h(0x1a4),{'enumerable':!![],'value':k});}:function(Y,k){Y['default']=k;}),__importStar=this&&this[a14r(0x18e)]||function(Y){const g=a14r;if(Y&&Y['__esModule'])return Y;var X={};if(Y!=null){for(var B in Y)if(B!=='default'&&Object[g(0x162)][g(0x146)][g(0x18c)](Y,B))__createBinding(X,Y,B);}return __setModuleDefault(X,Y),X;},__awaiter=this&&this[a14r(0x1b2)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const q=a14k;function j(O){try{e(B['next'](O));}catch(T){C(T);}}function o(O){const y=a14k;try{e(B[y(0x121)](O));}catch(T){C(T);}}function e(O){const R=a14k;O['done']?S(O['value']):l(O[R(0x140)])[R(0x124)](j,o);}e((B=B[q(0x128)](Y,k||[]))[q(0x194)]());});},__importDefault=this&&this[a14r(0x19b)]||function(Y){const U=a14r;return Y&&Y[U(0x16e)]?Y:{'default':Y};};Object[a14r(0x16a)](exports,a14r(0x16e),{'value':!![]}),exports[a14r(0x14c)]=void 0x0;const js_client_1=require(a14r(0x190)),chalk_1=__importDefault(require('chalk')),utils_1=require(a14r(0x1a8)),inquirer_helper_1=require(a14r(0x172)),os=__importStar(require('os')),lodash_1=require(a14r(0x182)),{EOL}=require('os');class CliPortForward{constructor(Y,k){const L=a14r;this[L(0x16c)]=L(0x143),this[L(0x150)]=L(0x187),this['apiClient']=new js_client_1[(L(0x18f))](Y,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[L(0x131)],'agent':k});const X=new inquirer_helper_1[(L(0x168))](this[L(0x12d)]);this['portFwdCmd']=(0x0,utils_1['getCommand'])()[L(0x1b0)](L(0x1a1))[L(0x149)](L(0x18d))[L(0x17d)]('Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.');const B=(0x0,utils_1['getCommand'])(!![])[L(0x1b0)]('all')[L(0x17d)](L(0x16b))[L(0x126)]('--project\x20--projectId\x20[NAME]',L(0x139))['option']('--noDefaults',this[L(0x16c)],![])[L(0x126)]('--skipHostnames',this[L(0x150)],![])['action'](({noDefaults:C,projectId:j,skipHostnames:o})=>__awaiter(this,void 0x0,void 0x0,function*(){const z=L;(0x0,utils_1['assertContextExisting'])(this[z(0x12d)]);const O=this[z(0x15d)](o),T=C?undefined:Y['getCurrentProjectName'](),v=j||T||(yield X[z(0x1b3)]());try{const {services:F,addons:x}=yield O['forwardProject']({'projectId':v},o);if(F[z(0x1a3)]+x[z(0x1a3)]<=0x0)(0x0,utils_1[z(0x15f)])(z(0x180)+chalk_1['default'][z(0x196)](v));else{const t=F[z(0x155)](M=>M[z(0x1a3)]>0x0)[z(0x1a3)],Q=x[z(0x155)](M=>M[z(0x1a3)]>0x0)[z(0x1a3)],n='\x20in\x20project\x20'+chalk_1['default'][z(0x196)](v);console[z(0x15c)](z(0x12a)+chalk_1[z(0x1a4)][z(0x17a)][z(0x196)](t+z(0x14d))+z(0x1a9)+chalk_1[z(0x1a4)]['green'][z(0x196)](Q+z(0x1af))+n),console[z(0x15c)](),console[z(0x15c)](chalk_1[z(0x1a4)][z(0x196)](z(0x195))),F['forEach'](M=>{const A=z;if(M[A(0x1a3)]>=0x1&&!M[0x0][A(0x18a)])this[A(0x1ac)](M,{'type':A(0x142),'name':M[0x0][A(0x164)]['id']},o);}),console[z(0x15c)](chalk_1[z(0x1a4)][z(0x196)](z(0x134))),x[z(0x166)](M=>{const D=z;if(M[D(0x1a3)]>=0x1&&!M[0x0][D(0x18a)])this[D(0x1ac)](M,{'type':D(0x16f),'name':M[0x0]['data']['id']},o);}),this[z(0x170)]([...F['flat'](),...x[z(0x13d)]()],o);}}catch(M){(0x0,utils_1[z(0x18a)])(z(0x147)+M[z(0x1aa)]);}})),l=(0x0,utils_1[L(0x145)])(!![])[L(0x1b0)](L(0x142))[L(0x17d)](L(0x14e))[L(0x126)](L(0x12e),'Project\x20for\x20forwarding')[L(0x126)](L(0x127),L(0x17c))['option']('--noDefaults',this[L(0x16c)],![])[L(0x126)](L(0x129),this['skipHostnamesText'],![])[L(0x176)](({noDefaults:C,projectId:j,serviceId:o,skipHostnames:e})=>__awaiter(this,void 0x0,void 0x0,function*(){const E=L;(0x0,utils_1[E(0x12f)])(this[E(0x12d)]);const O=this[E(0x15d)](e),T=C?undefined:Y[E(0x1ab)](),v=j||T||(yield X[E(0x1b3)]()),F=C?undefined:Y[E(0x169)](),x=o||F||(yield X['askForService'](v)());console[E(0x15c)](E(0x191)+chalk_1[E(0x1a4)][E(0x196)](x)+E(0x197)+chalk_1[E(0x1a4)][E(0x196)](v));try{const t=yield O[E(0x153)]({'projectId':v,'serviceId':x},e);this[E(0x1ac)](t,{'name':x,'type':E(0x142)},e),this[E(0x170)](t,e);}catch(Q){(0x0,utils_1[E(0x18a)])('Failed:\x20'+Q[E(0x1aa)]);}})),S=(0x0,utils_1['getCommand'])(!![])[L(0x1b0)](L(0x16f))[L(0x17d)](L(0x13f))[L(0x126)]('--project\x20--projectId\x20[NAME]','Project\x20for\x20forwarding')[L(0x126)](L(0x17f),'Addon\x20to\x20forward')[L(0x126)](L(0x129),this['skipHostnamesText'],![])['action'](({noDefaults:C,projectId:j,addonId:o,skipHostnames:e})=>__awaiter(this,void 0x0,void 0x0,function*(){const b=L;(0x0,utils_1[b(0x12f)])(this[b(0x12d)]);const O=this[b(0x15d)](e),T=C?undefined:Y['getCurrentProjectName'](),v=j||T||(yield X[b(0x1b3)]()),F=o||(yield X[b(0x136)](v)());console[b(0x15c)](b(0x19d)+chalk_1[b(0x1a4)]['bold'](F)+b(0x197)+chalk_1[b(0x1a4)][b(0x196)](v));try{const x={'projectId':v,'addonId':F},t=yield O['forwardAddon'](x,e);this[b(0x1ac)](t,{'name':F,'type':b(0x16f)},e),this[b(0x170)](t,e);}catch(Q){(0x0,utils_1[b(0x18a)])(b(0x147)+Q['message']);}}));this[L(0x13c)]['addCommand'](B),this[L(0x13c)][L(0x1a2)](l),this[L(0x13c)][L(0x1a2)](S);}['getProxyForwarder'](Y=![]){const a=a14r,k=this['apiClient'][a(0x17e)];if(!Y){const X=k[a(0x13b)]();if(X[a(0x18a)])throw new Error(X['message']);}return k['on'](a(0x132),(B,l)=>{const Z=a,S=chalk_1[Z(0x1a4)][Z(0x196)](l[Z(0x192)]+'\x20\x27'+l['id']+'\x27'),C=l[Z(0x1ad)]['length']>0x0;(0x0,utils_1[Z(0x15f)])(Z(0x167)+l[Z(0x188)]+':'+l[Z(0x15b)]+'\x20to\x20'+S),Y&&C&&(0x0,utils_1['warning'])(Z(0x1b1));}),k['on'](a(0x130),(B,l,S)=>{const c=a;(0x0,utils_1[c(0x15f)])(c(0x1a5)+l[c(0x188)]+':'+l[c(0x15b)]+c(0x193)+(S===null||S===void 0x0?void 0x0:S[c(0x1aa)])+'\x22');}),process['on'](a(0x15a),()=>__awaiter(this,void 0x0,void 0x0,function*(){const V=a;try{yield k[V(0x19f)]();}catch(B){(0x0,utils_1[V(0x18a)])(V(0x183)+B[V(0x1aa)]);}finally{process[V(0x151)]();}})),k;}[a14r(0x1ac)](Y,k,X=![]){const m=a14r,{type:B,name:l}=k;if(Y[m(0x1a3)]<=0x0){const o=m(0x177)+k['type']+m(0x19e);(0x0,utils_1['warning'])('\x20\x20\x20No\x20running\x20container\x20found\x20for\x20'+B+'\x20'+chalk_1[m(0x1a4)]['bold'](l)+'.\x20'+o);return;}const S=(0x0,lodash_1['groupBy'])(Y,m(0x199)),C=e=>'\x20('+(e[m(0x159)]?e[m(0x159)]+m(0x148):'')+e[m(0x156)]+')';function j(e,O=0x2){const J=m;if(!X){const T=e[J(0x156)]==='HTTP'?J(0x184):'';e[J(0x1ad)]['forEach'](v=>{const H=J;console[H(0x15c)]((0x0,lodash_1['repeat'])('\x20',O)+'-\x20'+T+v+':'+e[H(0x15b)]);});}}Object[m(0x14a)](S)[m(0x166)](([e,O])=>{const G=m;var T,v;const F='>\x20'+(0x0,lodash_1[G(0x186)])(B)+'\x20\x27'+chalk_1[G(0x1a4)]['greenBright'][G(0x196)](e)+'\x27';if(B===G(0x16f)){if(O[G(0x1a3)]===0x1){const x=O[0x0];if(x[G(0x18a)]){(0x0,utils_1[G(0x18a)])(G(0x144)+e+':\x20'+x[G(0x18a)][G(0x1aa)]);return;}const t=x['data'],Q=!X?'\x20'+chalk_1[G(0x1a4)][G(0x125)]('with\x20hostname:\x20'+t[G(0x1ad)][G(0x157)](',')):'';(0x0,utils_1[G(0x18b)])(F+G(0x19c)+t['address']+':'+t[G(0x15b)]+C(t)+Q);}else{const n=(0x0,lodash_1[G(0x160)])(O,M=>{const s=G;var d,P;return(P=(d=M===null||M===void 0x0?void 0x0:M[s(0x164)])===null||d===void 0x0?void 0x0:d[s(0x1ad)])===null||P===void 0x0?void 0x0:P[s(0x157)](',');})[G(0x1a3)]>0x1;(0x0,utils_1[G(0x18b)])(F+G(0x154)+(n?'hosts':G(0x12b))+':'),O['forEach'](M=>{const I=G;if(M['error']){(0x0,utils_1[I(0x18a)])(I(0x144)+e+':\x20'+M[I(0x18a)][I(0x1aa)]);return;}const d=M['data'],P=!X?I(0x14f)+d[I(0x1ad)][I(0x157)](','):'';console['log'](I(0x171)+d[I(0x188)]+':'+d[I(0x15b)]+C(d)+P);});}}if(B===G(0x142)){if(O[G(0x1a3)]===0x1){const M=O[0x0];if(M[G(0x18a)]){(0x0,utils_1['error'])(G(0x144)+e+':\x20'+M['error'][G(0x1aa)]);return;}const p=M[G(0x164)],d=!X?G(0x165):':',P=p[G(0x188)]+':'+p['port']+C(p);(0x0,utils_1['success'])(F+G(0x19c)+P+d),j(p);}else(0x0,utils_1[G(0x18b)])(F+G(0x19c)+((v=(T=O[0x0])===null||T===void 0x0?void 0x0:T[G(0x164)])===null||v===void 0x0?void 0x0:v['address'])+G(0x161)),O[G(0x166)](f=>{const u=G;if(f[u(0x18a)]){(0x0,utils_1[u(0x18a)])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+e+':\x20'+f[u(0x18a)]['message']);return;}const N=f[u(0x164)];(0x0,utils_1[u(0x18b)])(u(0x181)+N['port']+C(N)),j(N,0x4);});}});}[a14r(0x170)](Y,k=![]){const i=a14r;if(k){const X=Y[i(0x1a0)](O=>O['data'])[i(0x155)](O=>O!==undefined),B=(process===null||process===void 0x0?void 0x0:process[i(0x137)])===i(0x135),l=os[i(0x137)]()===i(0x16d),S=B?'C:/Windows/System32/drivers/etc/hosts':i(0x185),C=chalk_1[i(0x1a4)]['bold'](i(0x13e)),j=l?EOL+i(0x17b)+C+i(0x138):undefined;let o=i(0x1a7)+C+i(0x175)+'--skipHostnames'+i(0x123)+S+'):';j!==undefined&&(0x0,utils_1[i(0x15f)])(j!==null&&j!==void 0x0?j:'');(0x0,utils_1[i(0x15f)])(o);const e=X['map'](O=>O[i(0x188)]+i(0x1ae)+O['hostnames']['join']('\x20'));console[i(0x15c)]((0x0,lodash_1[i(0x15e)])(e)[i(0x157)](EOL)),console[i(0x15c)]();}}}exports[a14r(0x14c)]=CliPortForward;function a14Y(){const W=['forward','addCommand','length','default','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','71IRqYMU','Running\x20in\x20','../utils','\x20and\x20','message','getCurrentProjectName','printForwardingInfo','hostnames','\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20addon\x20ports','name','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','__awaiter','askForProject','throw','16020wCkfsv','\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20(','then','reset','option','--service\x20--serviceId\x20[NAME]','apply','--skipHostnames','Forwarding\x20','ports','2564442YJvfMw','apiClient','--project\x20--projectId\x20[NAME]','assertContextExisting','connection-error','customUserAgent','tunnel-close','__createBinding','Addons:','win32','askForAddon','platform','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','project\x20for\x20forwarding','getOwnPropertyDescriptor','canExecuteWithHostnames','portFwdCmd','flat','skipHostnames','Port-forwarding\x20for\x20the\x20specified\x20addon','value','27YrZJOo','service','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','getCommand','hasOwnProperty','Failed:\x20','\x20-\x20','alias','entries','create','CliPortForward','\x20service\x20ports','Port-forwarding\x20for\x20the\x20specified\x20service',',\x20hostname:\x20','skipHostnamesText','exit','configurable','forwardService','\x20is\x20exposed\x20with\x20multiple\x20','filter','protocol','join','3124336kAOkgB','portName','SIGINT','port','log','getProxyForwarder','uniq','warning','uniqBy','\x20with\x20multiple\x20ports:','prototype','get','data','\x20with\x20these\x20hostnames:','forEach','Stop\x20forwarding\x20traffic\x20from\x20','InquirerHelper','getCurrentServiceName','defineProperty','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','noDefaultsText','darwin','__esModule','addon','printHostsFileHint','\x20\x20-\x20Address:\x20','../inquirer-helper','1721448DfkXxl','164088sRXXET','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','action','Please\x20ensure\x20the\x20','2674070RBTxNK','7539826tJjOoM','green','Running\x20on\x20macOS\x20in\x20','Service\x20to\x20forward','description','forwarding','--addon\x20--addonId\x20[NAME]','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','\x20\x20-\x20port\x20','lodash','Cleaning\x20up\x20open\x20connections\x20failed:\x20','http://','/etc/hosts','capitalize','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','address','5fDqIsd','error','success','call','fwd','__importStar','ApiClient','@northflank/js-client','Forwarding\x20service\x20','type','\x27:\x20\x22','next','Services:','bold','\x20in\x20project\x20','__setModuleDefault','data.id','writable','__importDefault','\x20is\x20exposed\x20on\x20','Forwarding\x20addon\x20','\x20is\x20running\x20and\x20reachable.','stop','flatMap'];a14Y=function(){return W;};return a14Y();}
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a15n=a15e;function a15F(){const O=['example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)','replace','then','option','105831xzNyXc','length','addHelpCommand','resolve','log','__awaiter','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','push','enablePositionalOptions','getCommand','setUTCSeconds','336zasgCS','checkUpdate','4hnYAVR','parseDateInput','contextProvider','81772jsJpyy','fetch','getDate','parse','assertContextExisting','Invalid\x20date\x20received:\x20','55vSvHIY','version','helpOption','2134970RffxVq','commander','Command','node-fetch','green','7GPJeLs','\x27\x20**','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','default','getCurrentBaseUrl','yellow','63009wXCVvE','modulePath','success','Display\x20help\x20for\x20command','2565300ymJDAx','next','split','getCurrentContext','getCurrentToken','allowUnknownOption','--skipValidation','176IYkCYL','\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20','chalk','throw','872345wZOUQC','getTime','timeout','json','getLastUpdateCheck','**\x20You\x27re\x20running\x20on\x20version\x20','reduce','Failed:\x20','No\x20console\x20output','../package.json','customUserAgent','isValidJSON','setLastUpdateCheck','allowExcessArguments',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','--quiet','retry','/latest','setDate','value','4893Bgixhp','Verbose\x20output','min','northflank-cli/','return\x20import(modulePath)','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','done','--verbose','error','warning','asyncSequential','Do\x20not\x20validate\x20input\x20fields\x20on\x20client\x20side'];a15F=function(){return O;};return a15F();}(function(F,e){const Z=a15e,G=F();while(!![]){try{const u=-parseInt(Z(0x152))/0x1*(-parseInt(Z(0x144))/0x2)+-parseInt(Z(0x158))/0x3*(parseInt(Z(0x141))/0x4)+-parseInt(Z(0x167))/0x5+-parseInt(Z(0x13f))/0x6*(-parseInt(Z(0x124))/0x7)+parseInt(Z(0x163))/0x8*(-parseInt(Z(0x134))/0x9)+-parseInt(Z(0x14d))/0xa*(-parseInt(Z(0x14a))/0xb)+-parseInt(Z(0x15c))/0xc;if(u===e)break;else G['push'](G['shift']());}catch(R){G['push'](G['shift']());}}}(a15F,0xb0f96));var __awaiter=this&&this[a15n(0x139)]||function(F,e,G,u){function R(b){return b instanceof G?b:new G(function(W){W(b);});}return new(G||(G=Promise))(function(b,W){function V(t){const v=a15e;try{m(u[v(0x15d)](t));}catch(T){W(T);}}function a(t){const A=a15e;try{m(u[A(0x166)](t));}catch(T){W(T);}}function m(t){const w=a15e;t[w(0x12a)]?b(t[w(0x123)]):R(t['value'])['then'](V,a);}m((u=u['apply'](F,e||[]))['next']());});},__importDefault=this&&this['__importDefault']||function(F){return F&&F['__esModule']?F:{'default':F};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['tsHint']=exports[a15n(0x142)]=exports[a15n(0x148)]=exports[a15n(0x172)]=exports[a15n(0x12e)]=exports[a15n(0x120)]=exports['getCommand']=exports[a15n(0x15a)]=exports['warning']=exports[a15n(0x12c)]=exports[a15n(0x140)]=exports[a15n(0x171)]=exports[a15n(0x145)]=void 0x0;const chalk_1=__importDefault(require(a15n(0x165))),commander_1=require(a15n(0x14e)),importDynamic=new Function(a15n(0x159),a15n(0x128)),fetch=(F,e)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const o=a15n,G=yield importDynamic(o(0x150));return G[o(0x155)](F,e);});exports['fetch']=fetch;const pgk=require(a15n(0x170));exports[a15n(0x171)]=a15n(0x127)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a15n(0x14b)]);function checkUpdate(F){return __awaiter(this,void 0x0,void 0x0,function*(){const c=a15e;function G(u,R){const i=a15e,b=new Date(Number(u));return b[i(0x122)](b[i(0x146)]()+R),b;}try{if(G(F[c(0x16b)](),0x1)>new Date())return;const u=pgk['version'],{name:R}=pgk;if(!u)return;const b='https://registry.npmjs.org/'+R+c(0x121),W=yield(0x0,exports[c(0x145)])(b,{'method':'GET','signal':AbortSignal[c(0x169)](0x1388)}),V=(yield W[c(0x16a)]())[c(0x14b)];needsUpdate(u,V)&&warning(c(0x16c)+u+c(0x11e)+V+'.'+('\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20'+R+c(0x164)+R+c(0x153))),yield F[c(0x173)](new Date());}catch(a){}});}exports[a15n(0x140)]=checkUpdate;function needsUpdate(F,e){const l=a15n,G=/(\.0+)+$/,u=F[l(0x131)](G,'')[l(0x15e)]('.'),R=e[l(0x131)](G,'')[l(0x15e)]('.');for(let b=0x0;b<Math[l(0x126)](u[l(0x135)],R[l(0x135)]);b+=0x1){const W=parseInt(R[b],0xa)-parseInt(u[b],0xa);if(W>0x0)return!![];if(W<0x0)return![];}return R[l(0x135)]>u[l(0x135)];}function error(F){const X=a15n;console['error'](chalk_1[X(0x155)]['redBright'](X(0x16e)+F));}exports['error']=error;function warning(F){const h=a15n;console[h(0x12c)](chalk_1['default'][h(0x157)](''+F));}exports[a15n(0x12d)]=warning;function success(F){const d=a15n;console[d(0x138)](chalk_1[d(0x155)][d(0x151)](''+F));}exports[a15n(0x15a)]=success;function getCommand(F=![]){const B=a15n,e=new commander_1[(B(0x14f))]();return e[B(0x14c)](undefined,B(0x15b)),e[B(0x136)](![]),e['storeOptionsAsProperties'](![]),e[B(0x161)](![]),e[B(0x11d)](![]),e[B(0x13c)](!![]),F&&(e[B(0x133)](B(0x12b),B(0x125),![]),e[B(0x133)](B(0x11f),B(0x16f),![]),e[B(0x133)](B(0x162),B(0x12f),![])),e;}exports[a15n(0x13d)]=getCommand;const retry=(F,e=0x32)=>G=>{let u=F;const R=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield G();}catch(b){if(u<=0x0)throw b;return u-=0x1,yield new Promise(W=>setTimeout(()=>W(),e)),R();}});return R();};exports[a15n(0x120)]=retry;const asyncSequential=(F,e)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const x=a15n,G=Promise[x(0x137)]([]);return F[x(0x16d)]((u,R)=>u[x(0x132)](b=>e(R)[x(0x132)](W=>{const r=x;return b[r(0x13b)](W),b;})),G);});exports['asyncSequential']=asyncSequential;function isValidJSON(F){const k=a15n;try{return JSON[k(0x147)](F);}catch(G){return![];}}function a15e(F,e){const G=a15F();return a15e=function(u,R){u=u-0x11d;let b=G[u];return b;},a15e(F,e);}exports[a15n(0x172)]=isValidJSON;function assertContextExisting(F){const K=a15n;if(F[K(0x143)][K(0x15f)]()===undefined)throw new Error(K(0x129));if(F[K(0x143)][K(0x156)]()===undefined)throw new Error(K(0x13a));if(F['contextProvider'][K(0x160)]()===undefined)throw new Error(K(0x154));}exports[a15n(0x148)]=assertContextExisting;const parseDateInput=F=>{const p=a15n;try{let G=new Date(F);if(isNaN(G[p(0x168)]())){const u=F['length']===0xd?F/0x3e8:F,R=new Date(0x0);R[p(0x13e)](u);if(isNaN(R[p(0x168)]()))throw new Error();return R;}return G;}catch(b){throw new Error(p(0x149)+F+',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)');}};exports[a15n(0x142)]=parseDateInput,exports['tsHint']=a15n(0x130);
1
+ 'use strict';const a15F=a15k;(function(Y,k){const v=a15k,X=Y();while(!![]){try{const B=parseInt(v(0x12a))/0x1*(-parseInt(v(0x12b))/0x2)+-parseInt(v(0x121))/0x3+-parseInt(v(0x13b))/0x4*(parseInt(v(0x12d))/0x5)+parseInt(v(0x111))/0x6*(-parseInt(v(0x122))/0x7)+parseInt(v(0x11e))/0x8*(-parseInt(v(0x100))/0x9)+-parseInt(v(0xff))/0xa+parseInt(v(0x119))/0xb*(parseInt(v(0x126))/0xc);if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a15Y,0xec88d));var __awaiter=this&&this[a15F(0x114)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const n=a15k;function j(O){const x=a15k;try{e(B[x(0x109)](O));}catch(T){C(T);}}function o(O){const t=a15k;try{e(B[t(0x131)](O));}catch(T){C(T);}}function e(O){const Q=a15k;O[Q(0x147)]?S(O['value']):l(O[Q(0x10c)])[Q(0x10a)](j,o);}e((B=B['apply'](Y,k||[]))[n(0x109)]());});},__importDefault=this&&this['__importDefault']||function(Y){const M=a15F;return Y&&Y[M(0x149)]?Y:{'default':Y};};Object[a15F(0x11f)](exports,'__esModule',{'value':!![]}),exports[a15F(0x133)]=exports[a15F(0x11c)]=exports[a15F(0x12c)]=exports['isValidJSON']=exports[a15F(0x132)]=exports[a15F(0x112)]=exports['getCommand']=exports['success']=exports[a15F(0x140)]=exports['error']=exports['checkUpdate']=exports['customUserAgent']=exports[a15F(0x120)]=exports[a15F(0x103)]=void 0x0;const chalk_1=__importDefault(require(a15F(0x128))),commander_1=require(a15F(0x134)),proxy_agent_1=require(a15F(0x130)),importDynamic=new Function(a15F(0x13a),a15F(0x10b)),fetch=(Y,k)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const p=a15F,X=yield importDynamic('node-fetch');return X[p(0xfe)](Y,k);});exports[a15F(0x103)]=fetch,exports['agent']=new proxy_agent_1[(a15F(0x12f))]();const pgk=require('../package.json');exports[a15F(0x11b)]=a15F(0x127)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a15F(0x10e)]);function checkUpdate(Y){return __awaiter(this,void 0x0,void 0x0,function*(){const P=a15k;function k(X,B){const d=a15k,l=new Date(Number(X));return l[d(0x11a)](l[d(0x13e)]()+B),l;}try{if(k(Y[P(0x10d)](),0x1)>new Date())return;const X=pgk[P(0x10e)],{name:B}=pgk;if(!X)return;const l=P(0x101)+B+P(0x14a),S=yield(0x0,exports['fetch'])(l,{'agent':exports[P(0x120)],'method':P(0x143),'signal':AbortSignal[P(0x145)](0x1388)}),C=(yield S[P(0x13d)]())[P(0x10e)];needsUpdate(X,C)&&warning('**\x20You\x27re\x20running\x20on\x20version\x20'+X+P(0x118)+C+'.'+(P(0x142)+B+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+B+P(0x129))),yield Y['setLastUpdateCheck'](new Date());}catch(j){}});}function a15Y(){const U=['--verbose','timeout','Verbose\x20output','done','--quiet','__esModule','/latest','default','18749180oqgats','603UJOZvP','https://registry.npmjs.org/','setUTCSeconds','fetch',',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)','Command','option','allowUnknownOption','getCurrentContext','next','then','return\x20import(modulePath)','value','getLastUpdateCheck','version','success','example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)','43032ZqKjUN','retry','parse','__awaiter','error','length','log',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','1153229gFTBJu','setDate','customUserAgent','parseDateInput','redBright','57336InZuRP','defineProperty','agent','5783283FFMyXT','259cPBQVC','contextProvider','split','yellow','756gIHTWf','northflank-cli/','chalk','\x27\x20**','163suAdkn','314PjOOkL','assertContextExisting','590105oxPGqD','getCurrentBaseUrl','ProxyAgent','proxy-agent','throw','asyncSequential','tsHint','commander','enablePositionalOptions','push','replace','--skipValidation','resolve','modulePath','36ROgiLK','reduce','json','getDate','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','warning','min','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','GET'];a15Y=function(){return U;};return a15Y();}exports['checkUpdate']=checkUpdate;function needsUpdate(Y,k){const f=a15F,X=/(\.0+)+$/,B=Y[f(0x137)](X,'')[f(0x124)]('.'),l=k[f(0x137)](X,'')[f(0x124)]('.');for(let S=0x0;S<Math[f(0x141)](B['length'],l['length']);S+=0x1){const C=parseInt(l[S],0xa)-parseInt(B[S],0xa);if(C>0x0)return!![];if(C<0x0)return![];}return l[f(0x116)]>B['length'];}function error(Y){const N=a15F;console['error'](chalk_1['default'][N(0x11d)]('Failed:\x20'+Y));}exports[a15F(0x115)]=error;function a15k(Y,k){const X=a15Y();return a15k=function(B,l){B=B-0xfe;let S=X[B];return S;},a15k(Y,k);}function warning(Y){const K=a15F;console['error'](chalk_1['default'][K(0x125)](''+Y));}exports[a15F(0x140)]=warning;function success(Y){const r=a15F;console[r(0x117)](chalk_1[r(0xfe)]['green'](''+Y));}exports[a15F(0x10f)]=success;function getCommand(Y=![]){const w=a15F,k=new commander_1[(w(0x105))]();return k['helpOption'](undefined,'Display\x20help\x20for\x20command'),k['addHelpCommand'](![]),k['storeOptionsAsProperties'](![]),k[w(0x107)](![]),k['allowExcessArguments'](![]),k[w(0x135)](!![]),Y&&(k[w(0x106)](w(0x144),w(0x146),![]),k[w(0x106)](w(0x148),'No\x20console\x20output',![]),k[w(0x106)](w(0x138),'Do\x20not\x20validate\x20input\x20fields\x20on\x20client\x20side',![])),k;}exports['getCommand']=getCommand;const retry=(Y,k=0x32)=>X=>{let B=Y;const l=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield X();}catch(S){if(B<=0x0)throw S;return B-=0x1,yield new Promise(C=>setTimeout(()=>C(),k)),l();}});return l();};exports['retry']=retry;const asyncSequential=(Y,k)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const h=a15F,X=Promise[h(0x139)]([]);return Y[h(0x13c)]((B,l)=>B[h(0x10a)](S=>k(l)[h(0x10a)](C=>{const g=h;return S[g(0x136)](C),S;})),X);});exports['asyncSequential']=asyncSequential;function isValidJSON(Y){const y=a15F;try{return JSON[y(0x113)](Y);}catch(k){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(Y){const R=a15F;if(Y['contextProvider'][R(0x108)]()===undefined)throw new Error('No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27');if(Y['contextProvider'][R(0x12e)]()===undefined)throw new Error('No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27');if(Y[R(0x123)]['getCurrentToken']()===undefined)throw new Error(R(0x13f));}exports[a15F(0x12c)]=assertContextExisting;const parseDateInput=Y=>{const q=a15F;try{let k=new Date(Y);if(isNaN(k['getTime']())){const X=Y[q(0x116)]===0xd?Y/0x3e8:Y,B=new Date(0x0);B[q(0x102)](X);if(isNaN(B['getTime']()))throw new Error();return B;}return k;}catch(l){throw new Error('Invalid\x20date\x20received:\x20'+Y+q(0x104));}};exports[a15F(0x11c)]=parseDateInput,exports[a15F(0x133)]=a15F(0x110);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northflank/cli",
3
- "version": "0.9.25",
3
+ "version": "0.9.27",
4
4
  "author": "Marco Suter",
5
5
  "description": "Provides a command-line interface to the Northflank platform.",
6
6
  "homepage": "https://www.northflank.com",
@@ -26,7 +26,7 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "dependencies": {
29
- "@northflank/js-client": "0.7.25",
29
+ "@northflank/js-client": "0.7.27",
30
30
  "bufferutil": "^4.0.7",
31
31
  "chalk": "~4.1.0",
32
32
  "columnify": "^1.5.4",
@@ -37,14 +37,13 @@
37
37
  "lodash": "^4.17.15",
38
38
  "node-fetch": "^3.3.2",
39
39
  "open": "^8.4.0",
40
+ "proxy-agent": "^6.5.0",
40
41
  "utf-8-validate": "^5.0.10",
41
- "ws": "^8.2.1",
42
- "global-agent": "^3.0.0"
42
+ "ws": "^8.2.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@fig/complete-commander": "^2.0.0",
46
45
  "ts-node": "^8.10.2",
47
- "typescript": "^4.0.3"
46
+ "typescript": "^4.9.5"
48
47
  },
49
48
  "keywords": [
50
49
  "northflank",