@northflank/cli 0.9.9 → 0.9.11

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 a12x=a12V;(function(X,V){const i=a12V,h=X();while(!![]){try{const Q=-parseInt(i(0x1ab))/0x1+-parseInt(i(0x1b3))/0x2+-parseInt(i(0x1b4))/0x3*(parseInt(i(0x21a))/0x4)+-parseInt(i(0x227))/0x5*(parseInt(i(0x19c))/0x6)+parseInt(i(0x1e4))/0x7+parseInt(i(0x1ee))/0x8+-parseInt(i(0x1fe))/0x9*(-parseInt(i(0x1fb))/0xa);if(Q===V)break;else h['push'](h['shift']());}catch(J){h['push'](h['shift']());}}}(a12X,0x2f382));function a12X(){const X7=['Get\x20metrics\x20after\x20this\x20timestamp,\x20','length','../inquirer-helper','364840KvLWDu','183QuwdnS','runId','serviceId','N/A','metrics','argParser','endTime','Metrics\x20overview','Metrics\x20for\x20',',\x20to:\x20','Fetching\x20data..','printMetricsTable','service','job','askForBuild','build-','-o,\x20--output\x20[output]','printAsTable','askForContainer','\x20for\x20container:\x20','done','--duration\x20[duration]','\x20in\x20project\x20','map','join','apiContext','-t,\x20--metricTypes\x20<metricTypes...>',',\x20from:\x20','log','flatMap',',\x20metric\x20types:\x20','addon','getStandardMetricsCommand','keys','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','Get\x20metrics\x20before\x20this\x20timestamp,\x20','tsHint','values','bold','assign','apply','printMetricsGraph','conflicts','details','stringify','customUserAgent','action','metricUnit','970753ikGVww','container\x20','--run\x20--runId\x20[runId]','yml','forEach','format','\x20of\x20','flat','throw','value','2413400DmJiiH','max','noDefaults','--timestamp\x20[timestamp]','CliMetrics','yaml','printInitInfo','InquirerHelper','askForJobRun','printResponse','--container\x20--containerId\x20[NAME]','metric','getTime','5990700gVtTxc','assertContextExisting','../formatting/terminal-chart','9USAZVT','next','../utils','alias','default','Id\x20[NAME]','--startTime\x20<timestamp>','toUpperCase','Option','json','jobId','getCurrentProjectName','askForJob','columns','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','getAsciiChart','data','metricsApiClient','MetricType','pct','all\x20containers','inquirerHelper','metricId','error','metricsSingle','addonId','description','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','172Ammvcr','valueOf','warning','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','metricsRange','name','getCommand','Error\x20while\x20fetching\x20metrics\x20entries:\x20','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','askForService','Get\x20metrics\x20for\x20the\x20specified\x20','getPaddingDataEnd','charAt','5jpTKpZ','handleError','printMetricsSingle','split','__awaiter','option','containerId','apiClient','choices','\x20seconds','rows','addOption','2240754IiIzvu','parseDateInput','refreshInterval','chalk','getPaddingDataStart','startTime','downSampleData','slice','askForAddon','min','toTimeString','unshift','--project\x20--projectId\x20[NAME]','stdout','clear','287512HHPMfB','getCurrentServiceName',',\x20volume:\x20','Project\x20for\x20logs','message'];a12X=function(){return X7;};return a12X();}var __awaiter=this&&this[a12x(0x22b)]||function(X,V,h,Q){function J(G){return G instanceof h?G:new h(function(I){I(G);});}return new(h||(h=Promise))(function(G,I){const e=a12V;function T(A){const L=a12V;try{E(Q[L(0x1ff)](A));}catch(D){I(D);}}function W(A){const y=a12V;try{E(Q[y(0x1ec)](A));}catch(D){I(D);}}function E(A){const M=a12V;A[M(0x1c8)]?G(A[M(0x1ed)]):J(A[M(0x1ed)])['then'](T,W);}E((Q=Q[e(0x1dc)](X,V||[]))['next']());});},__importDefault=this&&this['__importDefault']||function(X){return X&&X['__esModule']?X:{'default':X};};function a12V(X,V){const h=a12X();return a12V=function(Q,J){Q=Q-0x199;let G=h[Q];return G;},a12V(X,V);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CliMetrics']=void 0x0;const js_client_1=require('@northflank/js-client'),utils_1=require(a12x(0x200)),inquirer_helper_1=require(a12x(0x1b2)),commander_1=require('commander'),terminal_chart_1=require(a12x(0x1fd)),console_format_helpers_1=require('../formatting/console-format-helpers'),chalk_1=__importDefault(require(a12x(0x19f)));class CliMetrics{constructor(X){const Z=a12x;this[Z(0x1cd)]=X,this['refreshInterval']=0x2710,this[Z(0x1d4)]=(V,h)=>{const C=Z,Q=(0x0,utils_1[C(0x220)])(!![])[C(0x21f)]((h?C(0x1c3):'')+C(0x1b8))[C(0x201)]((h?C(0x1c3):'')+C(0x1f9))[C(0x218)](C(0x224)+V)['option'](C(0x1a8),C(0x1ae))['option']('--'+V+'\x20--'+V+C(0x203),V[C(0x226)](0x0)[C(0x205)]()+V[C(0x1a3)](0x1)+'\x20to\x20get\x20logs\x20from')[C(0x22c)](C(0x1f8),C(0x21d))[C(0x22c)](C(0x204),C(0x1b0)+utils_1[C(0x1d8)],utils_1[C(0x19d)])[C(0x22c)]('--endTime\x20<timestamp>',C(0x1d7)+utils_1[C(0x1d8)],utils_1[C(0x19d)])[C(0x22c)](C(0x1c9),C(0x20c))['addOption'](new commander_1['Option'](C(0x1c4),C(0x222))[C(0x22f)](Object[C(0x1d9)]([C(0x1e9),C(0x207),C(0x1f3)])))[C(0x19b)](new commander_1[(C(0x206))](C(0x1ce),'Which\x20metric\x20type\x20to\x20fetch')['choices'](Object[C(0x1d9)](js_client_1[C(0x210)])))[C(0x19b)](new commander_1[(C(0x206))](C(0x1f1),C(0x1d6)+utils_1[C(0x1d8)])[C(0x1b9)](utils_1['parseDateInput'])[C(0x1de)]([C(0x1a1),C(0x1ba)]))[C(0x22c)]('--noDefaults',C(0x219),![])['addOption'](new commander_1[(C(0x206))](C(0x1c4),C(0x222))[C(0x22f)](Object['values']([C(0x1e9),C(0x207),C(0x1f3)])));if(h)Q[C(0x22c)]('--build\x20--buildId\x20[buildId]','Build\x20to\x20get\x20logs\x20from');if(V===C(0x1c1))Q[C(0x22c)](C(0x1e6),'Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0');return Q;},this[Z(0x1dd)]=(V,h)=>{return Q=>{const u=a12V,J=Object[u(0x1d5)](Q)[u(0x1d1)](G=>{const c=u,{values:I,metricInfo:T}=Q[G],{metricUnit:W,metricResolution:E}=T;return I[c(0x1cb)](A=>{const Y=c;var P,D;const {metadata:K,data:d}=A,f=h?(h===null||h===void 0x0?void 0x0:h['getTime']())>new Date()[Y(0x1fa)]()?new Date():h:undefined,z=new Date((P=d===null||d===void 0x0?void 0x0:d[0x0])===null||P===void 0x0?void 0x0:P['ts']),F=new Date((D=d===null||d===void 0x0?void 0x0:d[d[Y(0x1b1)]-0x1])===null||D===void 0x0?void 0x0:D['ts']),n=this[Y(0x1a0)](V,z,E),q=this[Y(0x225)](f,F,E),a=[...n,...d,...q],R=a[Y(0x1cb)](N=>[new Date(N['ts'])[Y(0x21b)](),Number(N['value'])])['filter'](N=>!Number['isNaN'](N[0x0])),v=Math['min'](Math[Y(0x1ef)](process[Y(0x1a9)][Y(0x20b)]-0xa,0xa),0x64),g=Math[Y(0x1a5)](Math[Y(0x1ef)](process['stdout']['rows']-0x9,0xa),0xf),B=W===Y(0x211)?0x64:undefined,O=W===Y(0x211)?'%':W,H=(0x0,terminal_chart_1[Y(0x1a2)])(R,v),k=H['map'](N=>N[0x1]),o={'min':0x0,'height':g,'max':B,'unit':O,'startTs':V!==null&&V!==void 0x0?V:z,'endTs':f!==null&&f!==void 0x0?f:F};return{'dataSeries':k,'metadata':K,'chartOpts':o,'metricInfo':T};});})[u(0x1eb)]();if(J[u(0x1b1)]===0x0)(0x0,utils_1[u(0x21c)])('No\x20metrics\x20found\x20for\x20this\x20query');else J[u(0x1e8)](G=>{const j=u,{dataSeries:I,metadata:T,chartOpts:W,metricInfo:E}=G,{containerId:A,volumeId:P}=T,D=P?j(0x1ad)+P:'';console[j(0x1d0)](E['metricId']+j(0x1c7)+chalk_1['default'][j(0x1da)](A)+D),console[j(0x1d0)]((0x0,terminal_chart_1[j(0x20d)])(I,W));});};},this[Z(0x1bf)]=(V,h,Q)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const b=Z;try{const J=yield this['metricsApiClient']['metrics'][b(0x216)](V,h,Q);console[b(0x1aa)]();if(J['error'])(0x0,utils_1[b(0x215)])(b(0x221)+J[b(0x215)]['message']);else this[b(0x229)](J[b(0x20e)]);}catch(G){console[b(0x1aa)](),(0x0,utils_1['error'])(b(0x221)+G[b(0x1af)]);}}),this[Z(0x228)]=V=>{const s=Z;if(V[s(0x215)])throw new Error('Error\x20while\x20fetching\x20metrics\x20entries:\x20'+V[s(0x215)]['message']+'\x20'+JSON[s(0x1e0)](V[s(0x215)][s(0x1df)]));},this[Z(0x1f4)]=(V,h,Q,J,G)=>{const w=Z;if(G===!![])return;const {metricTypes:I,endTime:T,startTime:W,duration:E,containerId:A}=J,P=W?w(0x1cf)+W['toISOString']():'',D=T?w(0x1bd)+T['toISOString']():'',K=E?',\x20duration:\x20'+E+w(0x199):'',d=A?w(0x1e5)+chalk_1[w(0x202)][w(0x1da)](A):w(0x212),f=V+'\x20'+chalk_1['default'][w(0x1da)](h)+w(0x1ca)+chalk_1[w(0x202)][w(0x1da)](Q),z=''+P+D+K,F=I?w(0x1d2)+(I===null||I===void 0x0?void 0x0:I[w(0x1cc)](',')):'';console['log'](w(0x1bc)+d+w(0x1ea)+f+F+z);},this[Z(0x22e)]=new js_client_1['ApiClient'](X,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Z(0x1e1)]}),this[Z(0x20f)]=this[Z(0x22e)],this['inquirerHelper']=new inquirer_helper_1[(Z(0x1f5))](this[Z(0x22e)]);}['getMetricsCommand'](X,V=![]){const t=a12x,h=(I,T)=>__awaiter(this,void 0x0,void 0x0,function*(){const m=a12V,W=T[m(0x1f0)],{apiContext:E,inquirerHelper:A}=this;switch(X){case m(0x1c0):{const P=W?undefined:E['getCurrentServiceName']();return T[m(0x1b6)]||P||(yield A[m(0x223)](I)());}case m(0x1c1):{const D=W?undefined:E[m(0x1ac)]();return T[m(0x208)]||D||(yield A[m(0x20a)](I)());}case m(0x1d3):{const K=W?undefined:E[m(0x1ac)]();return T[m(0x217)]||K||(yield A[m(0x1a4)](I)());}}}),Q=(I,T,W)=>__awaiter(this,void 0x0,void 0x0,function*(){const r=a12V;if(V)return W['buildId']||(yield this[r(0x213)][r(0x1c2)](I,X===r(0x1c0)?T:undefined,X==='job'?T:undefined,!![])());return undefined;}),J=(I,T,W)=>__awaiter(this,void 0x0,void 0x0,function*(){const l=a12V;if(!V&&W[l(0x22d)]!==undefined){if(W[l(0x22d)]!==!![])return W[l(0x22d)];return yield this[l(0x213)][l(0x1c6)](I,X===l(0x1c0)?T:undefined,X==='job'?T:undefined,!![])();}return undefined;}),G=(I,T,W)=>__awaiter(this,void 0x0,void 0x0,function*(){const S=a12V;if(X===S(0x1c1))return W[S(0x1b5)]||(yield this['inquirerHelper'][S(0x1f6)](T,I,!![])());return undefined;});return this['getStandardMetricsCommand'](X,V)[t(0x1e2)](I=>__awaiter(this,void 0x0,void 0x0,function*(){const U=t,{noDefaults:T,projectId:W,duration:E,timestamp:A,output:P,startTime:D,endTime:K,metricTypes:d,quiet:f}=I;(0x0,utils_1[U(0x1fc)])(this[U(0x22e)]);if(D&&K&&E)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const {apiContext:z,inquirerHelper:F,metricsApiClient:n}=this,q=T?undefined:z[U(0x209)](),a=W||q||(yield F['askForProject']()),R=yield h(a,I),v=yield Q(a,R,I),g=yield G(a,R,I),B=yield J(a,R,I),O={'projectId':a,'entityId':R},H={'containerName':B,'startTime':D,'endTime':K,'duration':E,'timestamp':A,'metricTypes':d,'runId':g,'buildId':v,'isBuild':V!==null&&V!==void 0x0?V:![]},k=!(D||K||E);if(!f&&P!==U(0x1f3)&&P!==U(0x1e7)&&P!==U(0x207))this['printInitInfo'](X,R,a,H,f);if(k){if(P!==undefined){const o=yield n['metrics'][U(0x216)](O,H,X);this[U(0x228)](o),(0x0,console_format_helpers_1[U(0x1f7)])(P,o[U(0x20e)]);}else[...Array(process[U(0x1a9)][U(0x19a)]-0x1)]['forEach']((N,p)=>p===0x0?console[U(0x1d0)](U(0x1be)):console[U(0x1d0)]()),yield this[U(0x1bf)](O,H,X)(),setInterval(this[U(0x1bf)](O,H,X),this[U(0x19e)]),yield new Promise(N=>setTimeout(N,this['refreshInterval']*0x64));}else{const N=yield n[U(0x1b8)][U(0x21e)](O,H,X);this[U(0x228)](N),P!==undefined?(0x0,console_format_helpers_1[U(0x1f7)])(P,N[U(0x20e)]):this[U(0x1dd)](D,K!==null&&K!==void 0x0?K:new Date())(N[U(0x20e)]);}process['exit']();}));}[a12x(0x229)](X){const X2=a12x,V=(J,G)=>{const X0=a12V;if(!(G===null||G===void 0x0?void 0x0:G[X0(0x1ed)]))'N/A';const I=J['metricUnit']==='pct'?'%':J[X0(0x1e3)];return''+Number(G===null||G===void 0x0?void 0x0:G['value'])['toFixed'](0x3)+I;},h=J=>{const X1=a12V;if(!(J===null||J===void 0x0?void 0x0:J['ts']))X1(0x1b7);return J['ts'][X1(0x1a6)]()[X1(0x22a)]('\x20')[0x0];},Q={};Object[X2(0x1d5)](X)['forEach'](J=>{const X3=X2,{values:G,metricInfo:I}=X[J];return G[X3(0x1e8)](T=>{const X4=X3;var W,E;const A=T['metadata']['containerId'];Object[X4(0x1db)](Q,{[A]:Object[X4(0x1db)](Object[X4(0x1db)]({},Q===null||Q===void 0x0?void 0x0:Q[A]),{['time']:h((W=T[X4(0x20e)])===null||W===void 0x0?void 0x0:W[0x0]),'containerId':A,[I[X4(0x214)]]:V(I,(E=T[X4(0x20e)])===null||E===void 0x0?void 0x0:E[0x0])})});});}),(0x0,console_format_helpers_1[X2(0x1c5)])(Object[X2(0x1d9)](Q),X2(0x1bb));}[a12x(0x1a0)](X,V,h){const X5=a12x,Q=I=>new Date(I[X5(0x1fa)]()-J),J=h*0x3e8;if(!X)return[];if(!V)return[];if(Q(V)[X5(0x1fa)]()<X[X5(0x1fa)]())return[];const G=[{'ts':Q(V),'value':0x0}];while(Q(G[G[X5(0x1b1)]-0x1]['ts'])[X5(0x1fa)]()<=X[X5(0x1fa)]()){G[X5(0x1a7)]({'ts':Q(G[G[X5(0x1b1)]-0x1]['ts']),'value':0x0});}return G;}[a12x(0x225)](X,V,h){const X6=a12x,Q=I=>new Date(I[X6(0x1fa)]()+J),J=h*0x3e8;if(!X)return[];if(!V)return[];if(Q(V)['getTime']()>X[X6(0x1fa)]())return[];const G=[{'ts':Q(V),'value':0x0}];while(Q(G[G[X6(0x1b1)]-0x1]['ts'])[X6(0x1fa)]()<=X['getTime']()){G['push']({'ts':Q(G[G[X6(0x1b1)]-0x1]['ts']),'value':0x0});}return G;}}exports[a12x(0x1f2)]=CliMetrics;
1
+ 'use strict';const a12M=a12h;function a12h(w,h){const G=a12w();return a12h=function(P,v){P=P-0x14c;let O=G[P];return O;},a12h(w,h);}(function(w,h){const C=a12h,G=w();while(!![]){try{const P=-parseInt(C(0x151))/0x1*(-parseInt(C(0x17f))/0x2)+-parseInt(C(0x14c))/0x3*(-parseInt(C(0x155))/0x4)+parseInt(C(0x1a9))/0x5*(-parseInt(C(0x1cf))/0x6)+parseInt(C(0x164))/0x7*(-parseInt(C(0x190))/0x8)+parseInt(C(0x1a5))/0x9*(parseInt(C(0x15a))/0xa)+-parseInt(C(0x170))/0xb+parseInt(C(0x177))/0xc*(parseInt(C(0x1d8))/0xd);if(P===h)break;else G['push'](G['shift']());}catch(v){G['push'](G['shift']());}}}(a12w,0x77b49));var __awaiter=this&&this[a12M(0x1db)]||function(w,h,G,v){function O(Z){return Z instanceof G?Z:new G(function(a){a(Z);});}return new(G||(G=Promise))(function(Z,a){const c=a12h;function l(A){const Q=a12h;try{U(v[Q(0x192)](A));}catch(D){a(D);}}function B(A){const H=a12h;try{U(v[H(0x1ca)](A));}catch(D){a(D);}}function U(A){const n=a12h;A[n(0x1c8)]?Z(A[n(0x1c5)]):O(A[n(0x1c5)])[n(0x1a2)](l,B);}U((v=v[c(0x19c)](w,h||[]))['next']());});},__importDefault=this&&this[a12M(0x1a1)]||function(w){const r=a12M;return w&&w[r(0x1ad)]?w:{'default':w};};function a12w(){const w8=['default','length','CliMetrics','getCurrentServiceName','yml','470634OhGdRM','Which\x20metric\x20type\x20to\x20fetch','forEach','values','--run\x20--runId\x20[runId]','metricUnit','toTimeString','askForBuild','name','--timestamp\x20[timestamp]','InquirerHelper','metricsApiClient','pct','downSampleData','Id\x20[NAME]','message','split','19232XNjLAe','Project\x20for\x20logs','next','containerId','N/A','valueOf','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','getPaddingDataStart','-o,\x20--output\x20[output]','keys','Fetching\x20data..','addon','apply','rows','assign','--endTime\x20<timestamp>','defineProperty','__importDefault','then','printResponse','commander','1089bPSIqM','bold','job','warning','65qEPJOP','--build\x20--buildId\x20[buildId]','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','time','__esModule',',\x20duration:\x20','yaml','service','format','getStandardMetricsCommand','map','MetricType','askForContainer','startTime','choices','toISOString','getCommand','stringify','json','getPaddingDataEnd','option','slice','charAt',',\x20from:\x20','min','filter','action','customUserAgent','value','../formatting/console-format-helpers','-t,\x20--metricTypes\x20<metricTypes...>','done','--noDefaults','throw','askForAddon','join','jobId','\x20of\x20','261810XMgWbA','build-','push','metricsSingle','endTime','addOption','\x20seconds','Error\x20while\x20fetching\x20metrics\x20entries:\x20','Metrics\x20for\x20','689qXRERq','unshift','printAsTable','__awaiter','max','askForService','apiContext','getTime','flatMap','Get\x20metrics\x20after\x20this\x20timestamp,\x20','513096NcOtWA','serviceId','exit','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','apiClient','1GgQXba','printMetricsSingle','data','alias','4dnxCPp','toUpperCase','metrics','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','noDefaults','24740wTHiZb','addonId','\x20--','stdout','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','metricsRange','log','container\x20','tsHint','all\x20containers','497LtBkhL','Get\x20metrics\x20before\x20this\x20timestamp,\x20',',\x20metric\x20types:\x20','parseDateInput','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','metricId','--container\x20--containerId\x20[NAME]','error','details','\x20for\x20container:\x20','No\x20metrics\x20found\x20for\x20this\x20query','inquirerHelper','5416994mRdEat','description','flat','\x20in\x20project\x20','handleError','Build\x20to\x20get\x20logs\x20from','getMetricsCommand','229812wUTAuj','refreshInterval','Option'];a12w=function(){return w8;};return a12w();}Object[a12M(0x1a0)](exports,a12M(0x1ad),{'value':!![]}),exports[a12M(0x17c)]=void 0x0;const js_client_1=require('@northflank/js-client'),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),commander_1=require(a12M(0x1a4)),terminal_chart_1=require('../formatting/terminal-chart'),console_format_helpers_1=require(a12M(0x1c6)),chalk_1=__importDefault(require('chalk'));class CliMetrics{constructor(w){const j=a12M;this[j(0x1de)]=w,this[j(0x178)]=0x2710,this['getStandardMetricsCommand']=(h,G)=>{const m=j,P=(0x0,utils_1[m(0x1b9)])(!![])[m(0x187)]((G?m(0x1d0):'')+m(0x157))[m(0x154)]((G?m(0x1d0):'')+'metric')[m(0x171)]('Get\x20metrics\x20for\x20the\x20specified\x20'+h)['option']('--project\x20--projectId\x20[NAME]',m(0x191))[m(0x1bd)]('--'+h+m(0x15c)+h+m(0x18d),h[m(0x1bf)](0x0)[m(0x156)]()+h[m(0x1be)](0x1)+'\x20to\x20get\x20logs\x20from')[m(0x1bd)](m(0x16a),m(0x158))[m(0x1bd)]('--startTime\x20<timestamp>',m(0x1e1)+utils_1[m(0x162)],utils_1['parseDateInput'])[m(0x1bd)](m(0x19f),m(0x165)+utils_1['tsHint'],utils_1[m(0x167)])[m(0x1bd)]('--duration\x20[duration]',m(0x15e))[m(0x1d4)](new commander_1['Option'](m(0x198),m(0x14f))[m(0x1b7)](Object[m(0x182)]([m(0x1b1),m(0x1bb),m(0x1af)])))[m(0x1d4)](new commander_1['Option'](m(0x1c7),m(0x180))[m(0x1b7)](Object[m(0x182)](js_client_1[m(0x1b4)])))[m(0x1d4)](new commander_1[(m(0x179))](m(0x188),m(0x168)+utils_1['tsHint'])['argParser'](utils_1[m(0x167)])['conflicts']([m(0x1b6),m(0x1d3)]))[m(0x1bd)](m(0x1c9),m(0x196),![])[m(0x1d4)](new commander_1['Option']('-o,\x20--output\x20[output]',m(0x14f))['choices'](Object[m(0x182)]([m(0x1b1),m(0x1bb),m(0x1af)])));if(G)P['option'](m(0x1aa),m(0x175));if(h===m(0x1a7))P[m(0x1bd)](m(0x183),m(0x1ab));return P;},this['printMetricsGraph']=(h,G)=>{return P=>{const y=a12h,v=Object[y(0x199)](P)[y(0x1e0)](O=>{const E=y,{values:Z,metricInfo:a}=P[O],{metricUnit:l,metricResolution:B}=a;return Z[E(0x1b3)](U=>{const K=E;var A,D;const {metadata:p,data:s}=U,W=G?(G===null||G===void 0x0?void 0x0:G['getTime']())>new Date()[K(0x1df)]()?new Date():G:undefined,X=new Date((A=s===null||s===void 0x0?void 0x0:s[0x0])===null||A===void 0x0?void 0x0:A['ts']),T=new Date((D=s===null||s===void 0x0?void 0x0:s[s[K(0x17b)]-0x1])===null||D===void 0x0?void 0x0:D['ts']),I=this[K(0x197)](h,X,B),k=this[K(0x1bc)](W,T,B),Y=[...I,...s,...k],x=Y[K(0x1b3)](S=>[new Date(S['ts'])[K(0x195)](),Number(S[K(0x1c5)])])[K(0x1c2)](S=>!Number['isNaN'](S[0x0])),b=Math[K(0x1c1)](Math[K(0x1dc)](process[K(0x15d)]['columns']-0xa,0xa),0x64),q=Math[K(0x1c1)](Math['max'](process['stdout'][K(0x19d)]-0x9,0xa),0xf),f=l===K(0x18b)?0x64:undefined,e=l==='pct'?'%':l,i=(0x0,terminal_chart_1[K(0x18c)])(x,b),u=i['map'](S=>S[0x1]),t={'min':0x0,'height':q,'max':f,'unit':e,'startTs':h!==null&&h!==void 0x0?h:X,'endTs':W!==null&&W!==void 0x0?W:T};return{'dataSeries':u,'metadata':p,'chartOpts':t,'metricInfo':a};});})[y(0x172)]();if(v[y(0x17b)]===0x0)(0x0,utils_1[y(0x1a8)])(y(0x16e));else v[y(0x181)](O=>{const g=y,{dataSeries:Z,metadata:a,chartOpts:l,metricInfo:B}=O,{containerId:U,volumeId:A}=a,D=A?',\x20volume:\x20'+A:'';console[g(0x160)](B['metricId']+g(0x16d)+chalk_1[g(0x17a)][g(0x1a6)](U)+D),console[g(0x160)]((0x0,terminal_chart_1['getAsciiChart'])(Z,l));});};},this['printMetricsTable']=(h,G,P)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=j;try{const v=yield this[J(0x18a)][J(0x157)][J(0x1d2)](h,G,P);console['clear']();if(v[J(0x16b)])(0x0,utils_1[J(0x16b)])(J(0x1d6)+v['error'][J(0x18e)]);else this[J(0x152)](v[J(0x153)]);}catch(O){console['clear'](),(0x0,utils_1[J(0x16b)])(J(0x1d6)+O[J(0x18e)]);}}),this[j(0x174)]=h=>{const R=j;if(h[R(0x16b)]){const G=JSON[R(0x1ba)](h[R(0x16b)][R(0x16c)]);throw new Error(R(0x1d6)+h['error'][R(0x18e)]+'\x20'+G);}},this['printInitInfo']=(h,G,P,v,O)=>{const N=j;if(O===!![])return;const {metricTypes:Z,endTime:a,startTime:l,duration:B,containerId:U}=v,A=l?N(0x1c0)+l[N(0x1b8)]():'',D=a?',\x20to:\x20'+a[N(0x1b8)]():'',p=B?N(0x1ae)+B+N(0x1d5):'',s=U?N(0x161)+chalk_1[N(0x17a)]['bold'](U):N(0x163),W=h+'\x20'+chalk_1[N(0x17a)][N(0x1a6)](G)+N(0x173)+chalk_1['default'][N(0x1a6)](P),X=''+A+D+p,T=Z?N(0x166)+(Z===null||Z===void 0x0?void 0x0:Z[N(0x1cc)](',')):'';console[N(0x160)](N(0x1d7)+s+N(0x1ce)+W+T+X);},this['apiClient']=new js_client_1['ApiClient'](w,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[j(0x1c4)]}),this[j(0x18a)]=this['apiClient'],this[j(0x16f)]=new inquirer_helper_1[(j(0x189))](this[j(0x150)]);}[a12M(0x176)](w,h=![]){const d=a12M,G=(Z,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const z=a12h,l=a[z(0x159)],{apiContext:B,inquirerHelper:U}=this;switch(w){case z(0x1b0):{const A=l?undefined:B[z(0x17d)]();return a[z(0x14d)]||A||(yield U[z(0x1dd)](Z)());}case'job':{const D=l?undefined:B[z(0x17d)]();return a[z(0x1cd)]||D||(yield U['askForJob'](Z)());}case z(0x19b):{const p=l?undefined:B[z(0x17d)]();return a[z(0x15b)]||p||(yield U[z(0x1cb)](Z)());}}}),P=(Z,a,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const F=a12h;if(h)return l['buildId']||(yield this[F(0x16f)][F(0x186)](Z,w===F(0x1b0)?a:undefined,w===F(0x1a7)?a:undefined,!![])());return undefined;}),v=(Z,a,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const o=a12h;if(!h&&l[o(0x193)]!==undefined){if(l[o(0x193)]!==!![])return l[o(0x193)];return yield this['inquirerHelper'][o(0x1b5)](Z,w==='service'?a:undefined,w===o(0x1a7)?a:undefined,!![])();}return undefined;}),O=(Z,a,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const L=a12h;if(w===L(0x1a7))return l['runId']||(yield this[L(0x16f)]['askForJobRun'](a,Z,!![])());return undefined;});return this[d(0x1b2)](w,h)[d(0x1c3)](Z=>__awaiter(this,void 0x0,void 0x0,function*(){const w0=d,{noDefaults:a,projectId:l,duration:B,timestamp:U,output:A,startTime:D,endTime:p,metricTypes:s,quiet:W}=Z;(0x0,utils_1['assertContextExisting'])(this['apiClient']);if(D&&p&&B)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const {apiContext:X,inquirerHelper:T,metricsApiClient:I}=this,k=a?undefined:X['getCurrentProjectName'](),Y=l||k||(yield T['askForProject']()),x=yield G(Y,Z),b=yield P(Y,x,Z),q=yield O(Y,x,Z),f=yield v(Y,x,Z),e={'projectId':Y,'entityId':x},i={'containerName':f,'startTime':D,'endTime':p,'duration':B,'timestamp':U,'metricTypes':s,'runId':q,'buildId':b,'isBuild':h!==null&&h!==void 0x0?h:![]},u=!(D||p||B);if(!W&&A!==w0(0x1af)&&A!==w0(0x17e)&&A!==w0(0x1bb))this['printInitInfo'](w,x,Y,i,W);if(u){if(A!==undefined){const t=yield I[w0(0x157)][w0(0x1d2)](e,i,w);this[w0(0x174)](t),(0x0,console_format_helpers_1[w0(0x1a3)])(A,t[w0(0x153)]);}else[...Array(process[w0(0x15d)]['rows']-0x1)][w0(0x181)]((S,V)=>V===0x0?console[w0(0x160)](w0(0x19a)):console['log']()),yield this['printMetricsTable'](e,i,w)(),setInterval(this['printMetricsTable'](e,i,w),this[w0(0x178)]),yield new Promise(S=>setTimeout(S,this[w0(0x178)]*0x64));}else{const S=yield I['metrics'][w0(0x15f)](e,i,w);this[w0(0x174)](S),A!==undefined?(0x0,console_format_helpers_1[w0(0x1a3)])(A,S['data']):this['printMetricsGraph'](D,p!==null&&p!==void 0x0?p:new Date())(S[w0(0x153)]);}process[w0(0x14e)]();}));}['printMetricsSingle'](w){const w3=a12M,h=(O,Z)=>{const w1=a12h;if(!(Z===null||Z===void 0x0?void 0x0:Z[w1(0x1c5)]))w1(0x194);const a=O['metricUnit']===w1(0x18b)?'%':O[w1(0x184)];return''+Number(Z===null||Z===void 0x0?void 0x0:Z['value'])['toFixed'](0x3)+a;},G=O=>{const w2=a12h;if(!(O===null||O===void 0x0?void 0x0:O['ts']))w2(0x194);return O['ts'][w2(0x185)]()[w2(0x18f)]('\x20')[0x0];},P={};Object['keys'](w)[w3(0x181)](v=>{const w4=w3,{values:O,metricInfo:Z}=w[v];return O[w4(0x181)](a=>{const w5=w4;var l,B;const U=a['metadata'][w5(0x193)];Object['assign'](P,{[U]:Object[w5(0x19e)](Object[w5(0x19e)]({},P===null||P===void 0x0?void 0x0:P[U]),{[w5(0x1ac)]:G((l=a[w5(0x153)])===null||l===void 0x0?void 0x0:l[0x0]),'containerId':U,[Z[w5(0x169)]]:h(Z,(B=a['data'])===null||B===void 0x0?void 0x0:B[0x0])})});});}),(0x0,console_format_helpers_1[w3(0x1da)])(Object[w3(0x182)](P),'Metrics\x20overview');}[a12M(0x197)](w,h,G){const w6=a12M,P=Z=>new Date(Z[w6(0x1df)]()-v),v=G*0x3e8;if(!w)return[];if(!h)return[];if(P(h)[w6(0x1df)]()<w[w6(0x1df)]())return[];const O=[{'ts':P(h),'value':0x0}];while(P(O[O[w6(0x17b)]-0x1]['ts'])[w6(0x1df)]()<=w['getTime']()){O[w6(0x1d9)]({'ts':P(O[O['length']-0x1]['ts']),'value':0x0});}return O;}['getPaddingDataEnd'](w,h,G){const w7=a12M,P=Z=>new Date(Z[w7(0x1df)]()+v),v=G*0x3e8;if(!w)return[];if(!h)return[];if(P(h)[w7(0x1df)]()>w['getTime']())return[];const O=[{'ts':P(h),'value':0x0}];while(P(O[O[w7(0x17b)]-0x1]['ts'])[w7(0x1df)]()<=w[w7(0x1df)]()){O[w7(0x1d1)]({'ts':P(O[O[w7(0x17b)]-0x1]['ts']),'value':0x0});}return O;}}exports['CliMetrics']=CliMetrics;
@@ -1 +1 @@
1
- 'use strict';const a13d=a13V;function a13V(X,V){const h=a13X();return a13V=function(Q,J){Q=Q-0xea;let G=h[Q];return G;},a13V(X,V);}(function(X,V){const K=a13V,h=X();while(!![]){try{const Q=-parseInt(K(0x101))/0x1*(-parseInt(K(0x104))/0x2)+-parseInt(K(0xfc))/0x3+parseInt(K(0x113))/0x4+parseInt(K(0x100))/0x5+parseInt(K(0x10a))/0x6*(-parseInt(K(0xf1))/0x7)+-parseInt(K(0xf8))/0x8+parseInt(K(0xf0))/0x9;if(Q===V)break;else h['push'](h['shift']());}catch(J){h['push'](h['shift']());}}}(a13X,0xe3e6f));var __awaiter=this&&this[a13d(0x116)]||function(X,V,h,Q){function J(G){return G instanceof h?G:new h(function(I){I(G);});}return new(h||(h=Promise))(function(G,I){const F=a13V;function T(A){try{E(Q['next'](A));}catch(D){I(D);}}function W(A){const f=a13V;try{E(Q[f(0x111)](A));}catch(D){I(D);}}function E(A){const z=a13V;A[z(0xfe)]?G(A[z(0x105)]):J(A['value'])[z(0x103)](T,W);}E((Q=Q[F(0x110)](X,V||[]))[F(0xed)]());});},__importDefault=this&&this[a13d(0xf7)]||function(X){const n=a13d;return X&&X[n(0x102)]?X:{'default':X};};Object['defineProperty'](exports,a13d(0x102),{'value':!![]}),exports[a13d(0xfa)]=void 0x0;const list_1=__importDefault(require(a13d(0x10f))),choice_1=__importDefault(require(a13d(0xee))),chalk_1=__importDefault(require(a13d(0x10e)));function incrementListIndex(X,V,h){const q=a13d,Q=h['choices'][q(0x109)],J=q(0x108)in h?Boolean(h[q(0x108)]):!![];if(V==='up'){if(X>0x0)return X-0x1;return J?Q-0x1:X;}if(V===q(0xf4)){if(X<Q-0x1)return X+0x1;return J?0x0:X;}throw new Error(q(0xf6));}class DynamicReloadPaginationPrompt extends list_1['default']{constructor(X,V,h){const a=a13d;super(X,V,h),this['reloadText']=chalk_1[a(0xf2)][a(0xf9)](a(0xec)),this[a(0x10c)]=![],this[a(0xf3)]=this[a(0xfd)],this[a(0xeb)]=this[a(0xf3)][a(0xeb)],this['nextPageCursor']!==undefined&&this['opt'][a(0x10d)]['push'](new choice_1[(a(0xf2))](this[a(0xf5)],this[a(0xf5)]));}[a13d(0x107)](){const R=a13d;if(this[R(0x10c)])return;this[R(0xea)]=incrementListIndex(this[R(0xea)],'up',this[R(0xfd)]),this[R(0x114)]();}['onDownKey'](){return __awaiter(this,void 0x0,void 0x0,function*(){const v=a13V;if(this['loading'])return;this['selected']=incrementListIndex(this['selected'],v(0xf4),this['opt']),yield this[v(0xff)](),this[v(0x114)]();});}[a13d(0xff)](){return __awaiter(this,void 0x0,void 0x0,function*(){const g=a13V;if(this['selected']>=this[g(0xfd)][g(0x10d)]['length']-0x1){if(this[g(0xeb)]===undefined)return;this[g(0x10c)]=!![];let X=0x0;const V=setInterval(()=>{const B=g,G=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],I=chalk_1['default'][B(0xf9)](G[X%G[B(0x115)]]+B(0x10b));this[B(0xfd)]['choices'][B(0x10d)][this[B(0xea)]][B(0xfb)]=''+I,X+=0x1,this['render']();},0x50),{elements:h,nextPageCursor:Q}=yield this['pagOpt']['loadMore']({'nextPageCursor':this[g(0xeb)]})['catch'](()=>({'elements':[],'nextPageCursor':undefined}));this[g(0xeb)]=Q;const J=h[g(0xef)](G=>new choice_1[(g(0xf2))](G,G));this['opt'][g(0x10d)][g(0x10d)][g(0x112)](this['selected'],0x1),this[g(0xfd)][g(0x10d)][g(0x106)](...J),Q!==undefined&&this[g(0xfd)][g(0x10d)][g(0x106)](new choice_1[(g(0xf2))](this[g(0xf5)],this[g(0xf5)])),clearInterval(V),this['loading']=![];}});}}exports[a13d(0xfa)]=DynamicReloadPaginationPrompt;function a13X(){const O=['then','44tyLFan','value','push','onUpKey','loop','realLength','6jHfiXn','\x20Loading\x20more\x20options','loading','choices','chalk','inquirer/lib/prompts/list','apply','throw','splice','1826320qsMMjx','render','length','__awaiter','selected','nextPageCursor','..\x20Load\x20more\x20options\x20..','next','inquirer/lib/objects/choice','map','12042900BlWtRt','8098195LGcWsx','default','pagOpt','down','reloadText','dir\x20must\x20be\x20up\x20or\x20down','__importDefault','11205048CAcfen','italic','DynamicReloadPaginationPrompt','name','1029615wqzAUk','opt','done','handleDynamicPageLoad','950050BRAvuR','84069QIRogS','__esModule'];a13X=function(){return O;};return a13X();}
1
+ 'use strict';const a13s=a13h;(function(w,h){const p=a13h,G=w();while(!![]){try{const P=parseInt(p(0x10c))/0x1*(-parseInt(p(0x108))/0x2)+parseInt(p(0x12d))/0x3*(-parseInt(p(0x124))/0x4)+-parseInt(p(0x102))/0x5+-parseInt(p(0x126))/0x6+-parseInt(p(0x121))/0x7+-parseInt(p(0x11a))/0x8+parseInt(p(0x12b))/0x9;if(P===h)break;else G['push'](G['shift']());}catch(v){G['push'](G['shift']());}}}(a13w,0x7402c));var __awaiter=this&&this[a13s(0x123)]||function(w,h,G,v){function O(Z){return Z instanceof G?Z:new G(function(a){a(Z);});}return new(G||(G=Promise))(function(Z,a){const T=a13h;function l(A){try{U(v['next'](A));}catch(D){a(D);}}function B(A){const W=a13h;try{U(v[W(0x109)](A));}catch(D){a(D);}}function U(A){const X=a13h;A[X(0x11c)]?Z(A['value']):O(A[X(0x128)])[X(0x11e)](l,B);}U((v=v[T(0x118)](w,h||[]))[T(0x10b)]());});},__importDefault=this&&this[a13s(0x103)]||function(w){return w&&w['__esModule']?w:{'default':w};};Object[a13s(0x11d)](exports,a13s(0x125),{'value':!![]}),exports[a13s(0x110)]=void 0x0;const list_1=__importDefault(require(a13s(0x114))),choice_1=__importDefault(require('inquirer/lib/objects/choice')),chalk_1=__importDefault(require(a13s(0x119)));function incrementListIndex(w,h,G){const I=a13s,P=G[I(0x11b)][I(0x101)],v=I(0x115)in G?Boolean(G[I(0x115)]):!![];if(h==='up'){if(w>0x0)return w-0x1;return v?P-0x1:w;}if(h===I(0x111)){if(w<P-0x1)return w+0x1;return v?0x0:w;}throw new Error(I(0x10e));}class DynamicReloadPaginationPrompt extends list_1['default']{constructor(w,h,G){const k=a13s;super(w,h,G),this[k(0x12a)]=chalk_1[k(0x127)]['italic'](k(0x12c)),this['loading']=![],this[k(0x120)]=this['opt'],this['nextPageCursor']=this['pagOpt'][k(0x106)],this[k(0x106)]!==undefined&&this[k(0x113)][k(0x11b)][k(0x117)](new choice_1[(k(0x127))](this[k(0x12a)],this['reloadText']));}[a13s(0x129)](){const Y=a13s;if(this[Y(0x11f)])return;this[Y(0x104)]=incrementListIndex(this[Y(0x104)],'up',this[Y(0x113)]),this['render']();}['onDownKey'](){return __awaiter(this,void 0x0,void 0x0,function*(){const x=a13h;if(this[x(0x11f)])return;this[x(0x104)]=incrementListIndex(this[x(0x104)],x(0x111),this[x(0x113)]),yield this['handleDynamicPageLoad'](),this[x(0x107)]();});}[a13s(0x116)](){return __awaiter(this,void 0x0,void 0x0,function*(){const b=a13h;if(this['selected']>=this[b(0x113)]['choices'][b(0x112)]-0x1){if(this[b(0x106)]===undefined)return;this['loading']=!![];let w=0x0;const h=setInterval(()=>{const q=b,O=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],Z=chalk_1[q(0x127)][q(0x10d)](O[w%O[q(0x112)]]+q(0x12e));this['opt'][q(0x11b)][q(0x11b)][this[q(0x104)]][q(0x10a)]=''+Z,w+=0x1,this[q(0x107)]();},0x50),{elements:G,nextPageCursor:P}=yield this[b(0x120)][b(0x105)]({'nextPageCursor':this['nextPageCursor']})[b(0x122)](()=>({'elements':[],'nextPageCursor':undefined}));this[b(0x106)]=P;const v=G['map'](O=>new choice_1['default'](O,O));this[b(0x113)][b(0x11b)][b(0x11b)][b(0x10f)](this['selected'],0x1),this[b(0x113)][b(0x11b)]['push'](...v),P!==undefined&&this['opt'][b(0x11b)][b(0x117)](new choice_1[(b(0x127))](this[b(0x12a)],this[b(0x12a)])),clearInterval(h),this[b(0x11f)]=![];}});}}function a13h(w,h){const G=a13w();return a13h=function(P,v){P=P-0x101;let O=G[P];return O;},a13h(w,h);}function a13w(){const f=['2677272ltpRBE','default','value','onUpKey','reloadText','24740487WEoVUE','..\x20Load\x20more\x20options\x20..','6BKBbUA','\x20Loading\x20more\x20options','realLength','529605DpLgME','__importDefault','selected','loadMore','nextPageCursor','render','846RxjnQz','throw','name','next','1318OSlRzJ','italic','dir\x20must\x20be\x20up\x20or\x20down','splice','DynamicReloadPaginationPrompt','down','length','opt','inquirer/lib/prompts/list','loop','handleDynamicPageLoad','push','apply','chalk','4641264BrknHU','choices','done','defineProperty','then','loading','pagOpt','299180UuUnAl','catch','__awaiter','1082436ScEUcd','__esModule'];a13w=function(){return f;};return a13w();}exports[a13s(0x110)]=DynamicReloadPaginationPrompt;
@@ -1 +1 @@
1
- 'use strict';const a14O=a14V;function a14V(X,V){const h=a14X();return a14V=function(Q,J){Q=Q-0x1d4;let G=h[Q];return G;},a14V(X,V);}(function(X,V){const B=a14V,h=X();while(!![]){try{const Q=-parseInt(B(0x240))/0x1+-parseInt(B(0x24f))/0x2+parseInt(B(0x1ea))/0x3+parseInt(B(0x23a))/0x4+parseInt(B(0x214))/0x5+parseInt(B(0x1e0))/0x6+-parseInt(B(0x21b))/0x7;if(Q===V)break;else h['push'](h['shift']());}catch(J){h['push'](h['shift']());}}}(a14X,0x249b1));var __createBinding=this&&this[a14O(0x1da)]||(Object[a14O(0x1fb)]?function(X,V,h,Q){const H=a14O;if(Q===undefined)Q=h;var J=Object[H(0x1df)](V,h);(!J||('get'in J?!V[H(0x227)]:J[H(0x1e1)]||J[H(0x235)]))&&(J={'enumerable':!![],'get':function(){return V[h];}}),Object[H(0x24e)](X,Q,J);}:function(X,V,h,Q){if(Q===undefined)Q=h;X[Q]=V[h];}),__setModuleDefault=this&&this[a14O(0x222)]||(Object[a14O(0x1fb)]?function(X,V){const k=a14O;Object['defineProperty'](X,k(0x233),{'enumerable':!![],'value':V});}:function(X,V){const o=a14O;X[o(0x233)]=V;}),__importStar=this&&this['__importStar']||function(X){const N=a14O;if(X&&X[N(0x227)])return X;var V={};if(X!=null){for(var h in X)if(h!==N(0x233)&&Object[N(0x220)][N(0x1e4)][N(0x22b)](X,h))__createBinding(V,X,h);}return __setModuleDefault(V,X),V;},__awaiter=this&&this['__awaiter']||function(X,V,h,Q){function J(G){return G instanceof h?G:new h(function(I){I(G);});}return new(h||(h=Promise))(function(G,I){const L=a14V;function T(A){const p=a14V;try{E(Q[p(0x23e)](A));}catch(D){I(D);}}function W(A){const i=a14V;try{E(Q[i(0x230)](A));}catch(D){I(D);}}function E(A){const x=a14V;A[x(0x257)]?G(A[x(0x246)]):J(A[x(0x246)])['then'](T,W);}E((Q=Q[L(0x1ed)](X,V||[]))['next']());});},__importDefault=this&&this[a14O(0x243)]||function(X){return X&&X['__esModule']?X:{'default':X};};Object[a14O(0x24e)](exports,a14O(0x227),{'value':!![]}),exports['CliPortForward']=void 0x0;const js_client_1=require(a14O(0x1f6)),chalk_1=__importDefault(require(a14O(0x218))),utils_1=require(a14O(0x231)),inquirer_helper_1=require(a14O(0x201)),os=__importStar(require('os')),lodash_1=require('lodash'),{EOL}=require('os');class CliPortForward{constructor(X){const y=a14O;this[y(0x1d7)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this[y(0x22f)]=y(0x1e6),this[y(0x21c)]=new js_client_1[(y(0x1f0))](X,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[y(0x21f)]});const V=new inquirer_helper_1[(y(0x1e5))](this[y(0x21c)]);this[y(0x1d9)]=(0x0,utils_1[y(0x24a)])()[y(0x258)](y(0x253))[y(0x210)](y(0x226))['description'](y(0x252));const h=(0x0,utils_1[y(0x24a)])(!![])[y(0x258)]('all')['description'](y(0x1fa))['option']('--project\x20--projectId\x20[NAME]','project\x20for\x20forwarding')[y(0x1fe)](y(0x1f2),this[y(0x1d7)],![])[y(0x1fe)]('--skipHostnames',this[y(0x22f)],![])[y(0x21e)](({noDefaults:G,projectId:I,skipHostnames:T})=>__awaiter(this,void 0x0,void 0x0,function*(){const M=y;(0x0,utils_1[M(0x244)])(this[M(0x21c)]);const W=this[M(0x25a)](T),E=G?undefined:X[M(0x1fc)](),A=I||E||(yield V[M(0x225)]());try{const {services:P,addons:D}=yield W['forwardProject']({'projectId':A},T);if(P['length']+D[M(0x221)]<=0x0)(0x0,utils_1[M(0x22a)])('No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20'+chalk_1[M(0x233)]['bold'](A));else{const K=P[M(0x20a)](z=>z[M(0x221)]>0x0)[M(0x221)],d=D[M(0x20a)](z=>z[M(0x221)]>0x0)[M(0x221)],f=M(0x20e)+chalk_1['default'][M(0x24c)](A);console[M(0x202)](M(0x224)+chalk_1['default'][M(0x213)][M(0x24c)](K+M(0x22c))+M(0x255)+chalk_1[M(0x233)][M(0x213)][M(0x24c)](d+M(0x25b))+f),console[M(0x202)](),console['log'](chalk_1[M(0x233)][M(0x24c)](M(0x241))),P['forEach'](z=>{const e=M;if(z[e(0x221)]>=0x1&&!z[0x0][e(0x1f3)])this[e(0x20c)](z,{'type':e(0x1eb),'name':z[0x0][e(0x1f5)]['id']},T);}),console[M(0x202)](chalk_1[M(0x233)][M(0x24c)](M(0x1e2))),D[M(0x1db)](z=>{const Z=M;if(z[Z(0x221)]>=0x1&&!z[0x0][Z(0x1f3)])this[Z(0x20c)](z,{'type':Z(0x1e7),'name':z[0x0][Z(0x1f5)]['id']},T);}),this['printHostsFileHint']([...P['flat'](),...D[M(0x1ec)]()],T);}}catch(z){(0x0,utils_1['error'])(M(0x1f1)+z['message']);}})),Q=(0x0,utils_1[y(0x24a)])(!![])['name'](y(0x1eb))[y(0x24b)](y(0x1d5))['option'](y(0x216),y(0x215))[y(0x1fe)]('--service\x20--serviceId\x20[NAME]',y(0x248))[y(0x1fe)]('--noDefaults',this[y(0x1d7)],![])[y(0x1fe)](y(0x20d),this[y(0x22f)],![])[y(0x21e)](({noDefaults:G,projectId:I,serviceId:T,skipHostnames:W})=>__awaiter(this,void 0x0,void 0x0,function*(){const C=y;(0x0,utils_1[C(0x244)])(this['apiClient']);const E=this[C(0x25a)](W),A=G?undefined:X['getCurrentProjectName'](),P=I||A||(yield V[C(0x225)]()),D=G?undefined:X[C(0x1ff)](),K=T||D||(yield V[C(0x232)](P)());console['log'](C(0x21a)+chalk_1[C(0x233)][C(0x24c)](K)+C(0x20e)+chalk_1[C(0x233)][C(0x24c)](P));try{const d=yield E[C(0x21d)]({'projectId':P,'serviceId':K},W);this[C(0x20c)](d,{'name':K,'type':C(0x1eb)},W),this['printHostsFileHint'](d,W);}catch(f){(0x0,utils_1[C(0x1f3)])('Failed:\x20'+f[C(0x259)]);}})),J=(0x0,utils_1[y(0x24a)])(!![])[y(0x258)](y(0x1e7))[y(0x24b)](y(0x1dc))[y(0x1fe)](y(0x216),y(0x215))[y(0x1fe)](y(0x242),y(0x219))['option'](y(0x20d),this['skipHostnamesText'],![])['action'](({noDefaults:G,projectId:I,addonId:T,skipHostnames:W})=>__awaiter(this,void 0x0,void 0x0,function*(){const u=y;(0x0,utils_1['assertContextExisting'])(this['apiClient']);const E=this[u(0x25a)](W),A=G?undefined:X[u(0x1fc)](),P=I||A||(yield V[u(0x225)]()),D=T||(yield V['askForAddon'](P)());console['log']('Forwarding\x20addon\x20'+chalk_1[u(0x233)][u(0x24c)](D)+u(0x20e)+chalk_1[u(0x233)][u(0x24c)](P));try{const K={'projectId':P,'addonId':D},d=yield E['forwardAddon'](K,W);this[u(0x20c)](d,{'name':D,'type':'addon'},W),this[u(0x20f)](d,W);}catch(f){(0x0,utils_1[u(0x1f3)])(u(0x1f1)+f[u(0x259)]);}}));this[y(0x1d9)][y(0x23b)](h),this[y(0x1d9)][y(0x23b)](Q),this['portFwdCmd'][y(0x23b)](J);}[a14O(0x25a)](X=![]){const c=a14O,V=this[c(0x21c)][c(0x249)];if(!X){const h=V[c(0x228)]();if(h[c(0x1f3)])throw new Error(h[c(0x259)]);}return V['on']('tunnel-close',(Q,J)=>{const Y=c,G=chalk_1[Y(0x233)][Y(0x24c)](J['type']+'\x20\x27'+J['id']+'\x27'),I=J[Y(0x239)]['length']>0x0;(0x0,utils_1[Y(0x22a)])('Stop\x20forwarding\x20traffic\x20from\x20'+J['address']+':'+J[Y(0x208)]+Y(0x207)+G),X&&I&&(0x0,utils_1[Y(0x22a)])('\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.');}),V['on'](c(0x254),(Q,J,G)=>{const j=c;(0x0,utils_1[j(0x22a)])('Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27'+J[j(0x256)]+':'+J[j(0x208)]+j(0x1f7)+(G===null||G===void 0x0?void 0x0:G['message'])+'\x22');}),process['on']('SIGINT',()=>__awaiter(this,void 0x0,void 0x0,function*(){const b=c;try{yield V[b(0x1dd)]();}catch(Q){(0x0,utils_1[b(0x1f3)])(b(0x245)+Q[b(0x259)]);}finally{process[b(0x1f9)]();}})),V;}[a14O(0x20c)](X,V,h=![]){const s=a14O,{type:Q,name:J}=V;if(X[s(0x221)]<=0x0){const W=s(0x23d)+V[s(0x250)]+s(0x237);(0x0,utils_1[s(0x22a)])('\x20\x20\x20No\x20running\x20container\x20found\x20for\x20'+Q+'\x20'+chalk_1[s(0x233)][s(0x24c)](J)+'.\x20'+W);return;}const G=(0x0,lodash_1[s(0x217)])(X,s(0x1d4)),I=E=>'\x20('+(E[s(0x1e3)]?E[s(0x1e3)]+s(0x1f4):'')+E[s(0x209)]+')';function T(E,A=0x2){const w=s;if(!h){const P=E[w(0x209)]===w(0x211)?w(0x22e):'';E[w(0x239)]['forEach'](D=>{const m=w;console[m(0x202)]((0x0,lodash_1[m(0x1ef)])('\x20',A)+'-\x20'+P+D+':'+E[m(0x208)]);});}}Object[s(0x1e9)](G)[s(0x1db)](([E,A])=>{const r=s;var P,D;const K='>\x20'+(0x0,lodash_1[r(0x1d8)])(Q)+'\x20\x27'+chalk_1[r(0x233)][r(0x22d)][r(0x24c)](E)+'\x27';if(Q===r(0x1e7)){if(A[r(0x221)]===0x1){const d=A[0x0];if(d['error']){(0x0,utils_1[r(0x1f3)])(r(0x20b)+E+':\x20'+d[r(0x1f3)]['message']);return;}const f=d[r(0x1f5)],z=!h?'\x20'+chalk_1[r(0x233)]['reset'](r(0x24d)+f[r(0x239)]['join'](',')):'';(0x0,utils_1[r(0x1fd)])(K+'\x20is\x20exposed\x20on\x20'+f[r(0x256)]+':'+f[r(0x208)]+I(f)+z);}else{const F=(0x0,lodash_1[r(0x229)])(A,n=>{const l=r;var q,a;return(a=(q=n===null||n===void 0x0?void 0x0:n['data'])===null||q===void 0x0?void 0x0:q[l(0x239)])===null||a===void 0x0?void 0x0:a[l(0x1ee)](',');})[r(0x221)]>0x1;(0x0,utils_1['success'])(K+r(0x1d6)+(F?r(0x251):r(0x1e8))+':'),A[r(0x1db)](n=>{const S=r;if(n['error']){(0x0,utils_1[S(0x1f3)])(S(0x20b)+E+':\x20'+n[S(0x1f3)]['message']);return;}const q=n['data'],a=!h?S(0x1de)+q[S(0x239)][S(0x1ee)](','):'';console[S(0x202)]('\x20\x20-\x20Address:\x20'+q[S(0x256)]+':'+q[S(0x208)]+I(q)+a);});}}if(Q===r(0x1eb)){if(A[r(0x221)]===0x1){const n=A[0x0];if(n[r(0x1f3)]){(0x0,utils_1[r(0x1f3)])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+E+':\x20'+n[r(0x1f3)][r(0x259)]);return;}const q=n['data'],a=!h?'\x20with\x20these\x20hostnames:':':',R=q[r(0x256)]+':'+q[r(0x208)]+I(q);(0x0,utils_1[r(0x1fd)])(K+r(0x205)+R+a),T(q);}else(0x0,utils_1['success'])(K+r(0x205)+((D=(P=A[0x0])===null||P===void 0x0?void 0x0:P[r(0x1f5)])===null||D===void 0x0?void 0x0:D['address'])+r(0x234)),A[r(0x1db)](v=>{const t=r;if(v['error']){(0x0,utils_1['error'])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+E+':\x20'+v[t(0x1f3)][t(0x259)]);return;}const g=v['data'];(0x0,utils_1['success'])('\x20\x20-\x20port\x20'+g[t(0x208)]+I(g)),T(g,0x4);});}});}['printHostsFileHint'](X,V=![]){const U=a14O;if(V){const h=X[U(0x200)](A=>A[U(0x1f5)])['filter'](A=>A!==undefined),Q=(process===null||process===void 0x0?void 0x0:process['platform'])===U(0x247),J=os['platform']()===U(0x23c),G=Q?U(0x23f):U(0x206),I=chalk_1[U(0x233)][U(0x24c)](U(0x238)),T=J?EOL+U(0x203)+I+'\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.':undefined;let W=U(0x223)+I+U(0x236)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+G+'):';T!==undefined&&(0x0,utils_1[U(0x22a)])(T!==null&&T!==void 0x0?T:'');(0x0,utils_1[U(0x22a)])(W);const E=h[U(0x204)](A=>A['address']+U(0x212)+A['hostnames']['join']('\x20'));console[U(0x202)]((0x0,lodash_1['uniq'])(E)[U(0x1ee)](EOL)),console[U(0x202)]();}}}exports[a14O(0x1f8)]=CliPortForward;function a14X(){const X0=['greenBright','http://','skipHostnamesText','throw','../utils','askForService','default','\x20with\x20multiple\x20ports:','configurable','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','\x20is\x20running\x20and\x20reachable.','skipHostnames','hostnames','334624hACesO','addCommand','darwin','Please\x20ensure\x20the\x20','next','C:/Windows/System32/drivers/etc/hosts','89144Uwjnjj','Services:','--addon\x20--addonId\x20[NAME]','__importDefault','assertContextExisting','Cleaning\x20up\x20open\x20connections\x20failed:\x20','value','win32','Service\x20to\x20forward','forwarding','getCommand','description','bold','with\x20hostname:\x20','defineProperty','432aHMMBQ','type','hosts','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','forward','connection-error','\x20and\x20','address','done','name','message','getProxyForwarder','\x20addon\x20ports','data.id','Port-forwarding\x20for\x20the\x20specified\x20service','\x20is\x20exposed\x20with\x20multiple\x20','noDefaultsText','capitalize','portFwdCmd','__createBinding','forEach','Port-forwarding\x20for\x20the\x20specified\x20addon','stop',',\x20hostname:\x20','getOwnPropertyDescriptor','1107600FsNEeX','writable','Addons:','portName','hasOwnProperty','InquirerHelper','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','addon','ports','entries','29115zKoFdD','service','flat','apply','join','repeat','ApiClient','Failed:\x20','--noDefaults','error','\x20-\x20','data','@northflank/js-client','\x27:\x20\x22','CliPortForward','exit','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','create','getCurrentProjectName','success','option','getCurrentServiceName','flatMap','../inquirer-helper','log','Running\x20on\x20macOS\x20in\x20','map','\x20is\x20exposed\x20on\x20','/etc/hosts','\x20to\x20','port','protocol','filter','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','printForwardingInfo','--skipHostnames','\x20in\x20project\x20','printHostsFileHint','alias','HTTP','\x20\x20\x20\x20\x20\x20\x20\x20\x20','green','894760pKRAas','Project\x20for\x20forwarding','--project\x20--projectId\x20[NAME]','groupBy','chalk','Addon\x20to\x20forward','Forwarding\x20service\x20','1523312SLINby','apiClient','forwardService','action','customUserAgent','prototype','length','__setModuleDefault','Running\x20in\x20','Forwarding\x20','askForProject','fwd','__esModule','canExecuteWithHostnames','uniqBy','warning','call','\x20service\x20ports'];a14X=function(){return X0;};return a14X();}
1
+ 'use strict';const a14e=a14h;(function(w,h){const f=a14h,G=w();while(!![]){try{const P=parseInt(f(0x1f3))/0x1+-parseInt(f(0x239))/0x2+-parseInt(f(0x1fe))/0x3+parseInt(f(0x235))/0x4+parseInt(f(0x22f))/0x5*(parseInt(f(0x208))/0x6)+parseInt(f(0x22d))/0x7+-parseInt(f(0x1d9))/0x8*(parseInt(f(0x22a))/0x9);if(P===h)break;else G['push'](G['shift']());}catch(v){G['push'](G['shift']());}}}(a14w,0x95db8));function a14w(){const d=['address','darwin','__esModule','next','action','\x20addon\x20ports','project\x20for\x20forwarding','port','skipHostnamesText','warning','create','printHostsFileHint','call','done','getProxyForwarder','protocol','apiClient','forwarding','1013944ibJQcm','bold','defineProperty','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20(','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','__importStar','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','assertContextExisting','forEach','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','get','hostnames','description','type','getCurrentServiceName','greenBright','forward','Forwarding\x20addon\x20','alias','\x20is\x20exposed\x20with\x20multiple\x20','Port-forwarding\x20for\x20the\x20specified\x20addon','uniqBy','flat','Service\x20to\x20forward','repeat','670369uRdCkQ','\x20in\x20project\x20','addCommand','__importDefault','--addon\x20--addonId\x20[NAME]','hasOwnProperty','http://','value','green','Forwarding\x20','filter','2425899Ziuxbw','reset','prototype','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','groupBy','Services:','name','/etc/hosts','portFwdCmd','\x20\x20-\x20port\x20','342PABNrG','entries','Running\x20on\x20macOS\x20in\x20','Project\x20for\x20forwarding','getCommand','option','askForAddon','hosts','--noDefaults','fwd','\x20\x20-\x20Address:\x20','getCurrentProjectName','message','service','printForwardingInfo','stop','ApiClient','\x20and\x20','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','--skipHostnames','log','success','C:/Windows/System32/drivers/etc/hosts','Running\x20in\x20','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','chalk','Failed:\x20','join','data','configurable','data.id','Port-forwarding\x20for\x20the\x20specified\x20service','--project\x20--projectId\x20[NAME]','@northflank/js-client','36kWySIy','lodash','error','4314751MfHkFB','exit','89920BAnKDb','tunnel-close','\x20with\x20multiple\x20ports:','uniq','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','CliPortForward','1052072pNUxuI','default','apply','\x20is\x20running\x20and\x20reachable.','1290894eicaTq','skipHostnames','--service\x20--serviceId\x20[NAME]','Addon\x20to\x20forward','noDefaultsText','ports','addon','then','flatMap','win32','forwardService','Cleaning\x20up\x20open\x20connections\x20failed:\x20','canExecuteWithHostnames','length','portName','askForProject','customUserAgent','\x20is\x20exposed\x20on\x20','HTTP','Forwarding\x20service\x20','\x20service\x20ports','\x20-\x20','\x27:\x20\x22','writable'];a14w=function(){return d;};return a14w();}var __createBinding=this&&this['__createBinding']||(Object[a14e(0x1d1)]?function(w,h,G,P){const i=a14e;if(P===undefined)P=G;var v=Object['getOwnPropertyDescriptor'](h,G);(!v||(i(0x1e4)in v?!h[i(0x1c9)]:v[i(0x1c6)]||v[i(0x225)]))&&(v={'enumerable':!![],'get':function(){return h[G];}}),Object[i(0x1db)](w,P,v);}:function(w,h,G,P){if(P===undefined)P=G;w[P]=h[G];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a14e(0x1d1)]?function(w,h){const u=a14e;Object['defineProperty'](w,u(0x236),{'enumerable':!![],'value':h});}:function(w,h){w['default']=h;}),__importStar=this&&this[a14e(0x1df)]||function(w){const t=a14e;if(w&&w[t(0x1c9)])return w;var h={};if(w!=null){for(var G in w)if(G!==t(0x236)&&Object[t(0x200)][t(0x1f8)][t(0x1d3)](w,G))__createBinding(h,w,G);}return __setModuleDefault(h,w),h;},__awaiter=this&&this['__awaiter']||function(w,h,G,v){function O(Z){return Z instanceof G?Z:new G(function(a){a(Z);});}return new(G||(G=Promise))(function(Z,a){const C=a14h;function l(A){const S=a14h;try{U(v[S(0x1ca)](A));}catch(D){a(D);}}function B(A){try{U(v['throw'](A));}catch(D){a(D);}}function U(A){const V=a14h;A[V(0x1d4)]?Z(A[V(0x1fa)]):O(A[V(0x1fa)])[V(0x1b6)](l,B);}U((v=v[C(0x237)](w,h||[]))['next']());});},__importDefault=this&&this[a14e(0x1f6)]||function(w){const M=a14e;return w&&w[M(0x1c9)]?w:{'default':w};};Object[a14e(0x1db)](exports,a14e(0x1c9),{'value':!![]}),exports['CliPortForward']=void 0x0;const js_client_1=require(a14e(0x229)),chalk_1=__importDefault(require(a14e(0x221))),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),os=__importStar(require('os')),lodash_1=require(a14e(0x22b)),{EOL}=require('os');class CliPortForward{constructor(w){const Q=a14e;this[Q(0x1b3)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this['skipHostnamesText']=Q(0x1e0),this[Q(0x1d7)]=new js_client_1[(Q(0x218))](w,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Q(0x1bf)]});const h=new inquirer_helper_1['InquirerHelper'](this[Q(0x1d7)]);this['portFwdCmd']=(0x0,utils_1[Q(0x20c)])()[Q(0x204)](Q(0x1ea))[Q(0x1ec)](Q(0x211))['description'](Q(0x201));const G=(0x0,utils_1[Q(0x20c)])(!![])[Q(0x204)]('all')[Q(0x1e6)](Q(0x1de))['option'](Q(0x228),Q(0x1cd))[Q(0x20d)]('--noDefaults',this['noDefaultsText'],![])[Q(0x20d)](Q(0x21b),this[Q(0x1cf)],![])['action'](({noDefaults:O,projectId:Z,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const H=Q;(0x0,utils_1[H(0x1e1)])(this[H(0x1d7)]);const l=this['getProxyForwarder'](a),B=O?undefined:w[H(0x213)](),U=Z||B||(yield h[H(0x1be)]());try{const {services:A,addons:D}=yield l['forwardProject']({'projectId':U},a);if(A['length']+D['length']<=0x0)(0x0,utils_1[H(0x1d0)])(H(0x233)+chalk_1['default'][H(0x1da)](U));else{const p=A[H(0x1fd)](X=>X['length']>0x0)[H(0x1bc)],s=D[H(0x1fd)](X=>X[H(0x1bc)]>0x0)[H(0x1bc)],W=H(0x1f4)+chalk_1[H(0x236)][H(0x1da)](U);console[H(0x21c)](H(0x1fc)+chalk_1[H(0x236)][H(0x1fb)][H(0x1da)](p+H(0x1c3))+H(0x219)+chalk_1[H(0x236)]['green'][H(0x1da)](s+H(0x1cc))+W),console['log'](),console['log'](chalk_1[H(0x236)][H(0x1da)](H(0x203))),A['forEach'](X=>{const n=H;if(X['length']>=0x1&&!X[0x0][n(0x22c)])this[n(0x216)](X,{'type':n(0x215),'name':X[0x0][n(0x224)]['id']},a);}),console['log'](chalk_1[H(0x236)][H(0x1da)]('Addons:')),D[H(0x1e2)](X=>{const c=H;if(X[c(0x1bc)]>=0x1&&!X[0x0][c(0x22c)])this[c(0x216)](X,{'type':c(0x1b5),'name':X[0x0]['data']['id']},a);}),this[H(0x1d2)]([...A[H(0x1f0)](),...D['flat']()],a);}}catch(X){(0x0,utils_1[H(0x22c)])(H(0x222)+X[H(0x214)]);}})),P=(0x0,utils_1[Q(0x20c)])(!![])[Q(0x204)](Q(0x215))[Q(0x1e6)](Q(0x227))[Q(0x20d)](Q(0x228),Q(0x20b))[Q(0x20d)](Q(0x1b1),Q(0x1f1))[Q(0x20d)](Q(0x210),this[Q(0x1b3)],![])['option'](Q(0x21b),this['skipHostnamesText'],![])['action'](({noDefaults:O,projectId:Z,serviceId:a,skipHostnames:l})=>__awaiter(this,void 0x0,void 0x0,function*(){const r=Q;(0x0,utils_1[r(0x1e1)])(this[r(0x1d7)]);const B=this[r(0x1d5)](l),U=O?undefined:w[r(0x213)](),A=Z||U||(yield h[r(0x1be)]()),D=O?undefined:w[r(0x1e8)](),p=a||D||(yield h['askForService'](A)());console[r(0x21c)](r(0x1c2)+chalk_1['default'][r(0x1da)](p)+r(0x1f4)+chalk_1[r(0x236)]['bold'](A));try{const s=yield B[r(0x1b9)]({'projectId':A,'serviceId':p},l);this[r(0x216)](s,{'name':p,'type':'service'},l),this[r(0x1d2)](s,l);}catch(W){(0x0,utils_1[r(0x22c)])(r(0x222)+W[r(0x214)]);}})),v=(0x0,utils_1[Q(0x20c)])(!![])[Q(0x204)]('addon')[Q(0x1e6)](Q(0x1ee))[Q(0x20d)](Q(0x228),Q(0x20b))[Q(0x20d)](Q(0x1f7),Q(0x1b2))[Q(0x20d)](Q(0x21b),this[Q(0x1cf)],![])[Q(0x1cb)](({noDefaults:O,projectId:Z,addonId:a,skipHostnames:l})=>__awaiter(this,void 0x0,void 0x0,function*(){const j=Q;(0x0,utils_1['assertContextExisting'])(this['apiClient']);const B=this[j(0x1d5)](l),U=O?undefined:w['getCurrentProjectName'](),A=Z||U||(yield h['askForProject']()),D=a||(yield h[j(0x20e)](A)());console[j(0x21c)](j(0x1eb)+chalk_1['default']['bold'](D)+j(0x1f4)+chalk_1[j(0x236)][j(0x1da)](A));try{const p={'projectId':A,'addonId':D},s=yield B['forwardAddon'](p,l);this['printForwardingInfo'](s,{'name':D,'type':j(0x1b5)},l),this[j(0x1d2)](s,l);}catch(W){(0x0,utils_1[j(0x22c)])(j(0x222)+W[j(0x214)]);}}));this[Q(0x206)]['addCommand'](G),this[Q(0x206)][Q(0x1f5)](P),this[Q(0x206)][Q(0x1f5)](v);}[a14e(0x1d5)](w=![]){const m=a14e,h=this['apiClient'][m(0x1d8)];if(!w){const G=h[m(0x1bb)]();if(G[m(0x22c)])throw new Error(G['message']);}return h['on'](m(0x230),(P,v)=>{const y=m,O=chalk_1[y(0x236)][y(0x1da)](v[y(0x1e7)]+'\x20\x27'+v['id']+'\x27'),Z=v[y(0x1e5)][y(0x1bc)]>0x0;(0x0,utils_1[y(0x1d0)])('Stop\x20forwarding\x20traffic\x20from\x20'+v['address']+':'+v[y(0x1ce)]+'\x20to\x20'+O),w&&Z&&(0x0,utils_1[y(0x1d0)])(y(0x1e3));}),h['on']('connection-error',(P,v,O)=>{const E=m;(0x0,utils_1[E(0x1d0)])(E(0x1dc)+v[E(0x1c7)]+':'+v[E(0x1ce)]+E(0x1c5)+(O===null||O===void 0x0?void 0x0:O['message'])+'\x22');}),process['on']('SIGINT',()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=m;try{yield h[K(0x217)]();}catch(P){(0x0,utils_1[K(0x22c)])(K(0x1ba)+P[K(0x214)]);}finally{process[K(0x22e)]();}})),h;}[a14e(0x216)](w,h,G=![]){const g=a14e,{type:P,name:v}=h;if(w[g(0x1bc)]<=0x0){const l='Please\x20ensure\x20the\x20'+h[g(0x1e7)]+g(0x238);(0x0,utils_1[g(0x1d0)])('\x20\x20\x20No\x20running\x20container\x20found\x20for\x20'+P+'\x20'+chalk_1[g(0x236)]['bold'](v)+'.\x20'+l);return;}const O=(0x0,lodash_1[g(0x202)])(w,g(0x226)),Z=B=>'\x20('+(B[g(0x1bd)]?B[g(0x1bd)]+g(0x1c4):'')+B['protocol']+')';function a(B,U=0x2){const J=g;if(!G){const A=B[J(0x1d6)]===J(0x1c1)?J(0x1f9):'';B[J(0x1e5)][J(0x1e2)](D=>{const R=J;console['log']((0x0,lodash_1[R(0x1f2)])('\x20',U)+'-\x20'+A+D+':'+B[R(0x1ce)]);});}}Object[g(0x209)](O)[g(0x1e2)](([B,U])=>{const N=g;var A,D;const p='>\x20'+(0x0,lodash_1['capitalize'])(P)+'\x20\x27'+chalk_1['default'][N(0x1e9)][N(0x1da)](B)+'\x27';if(P==='addon'){if(U[N(0x1bc)]===0x1){const s=U[0x0];if(s[N(0x22c)]){(0x0,utils_1[N(0x22c)])(N(0x21a)+B+':\x20'+s[N(0x22c)]['message']);return;}const W=s[N(0x224)],X=!G?'\x20'+chalk_1[N(0x236)][N(0x1ff)]('with\x20hostname:\x20'+W[N(0x1e5)][N(0x223)](',')):'';(0x0,utils_1[N(0x21d)])(p+N(0x1c0)+W[N(0x1c7)]+':'+W[N(0x1ce)]+Z(W)+X);}else{const T=(0x0,lodash_1[N(0x1ef)])(U,I=>{const z=N;var k,Y;return(Y=(k=I===null||I===void 0x0?void 0x0:I[z(0x224)])===null||k===void 0x0?void 0x0:k[z(0x1e5)])===null||Y===void 0x0?void 0x0:Y[z(0x223)](',');})[N(0x1bc)]>0x1;(0x0,utils_1[N(0x21d)])(p+N(0x1ed)+(T?N(0x20f):N(0x1b4))+':'),U['forEach'](I=>{const F=N;if(I[F(0x22c)]){(0x0,utils_1[F(0x22c)])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+B+':\x20'+I[F(0x22c)][F(0x214)]);return;}const k=I[F(0x224)],Y=!G?',\x20hostname:\x20'+k['hostnames'][F(0x223)](','):'';console[F(0x21c)](F(0x212)+k['address']+':'+k['port']+Z(k)+Y);});}}if(P==='service'){if(U['length']===0x1){const I=U[0x0];if(I['error']){(0x0,utils_1[N(0x22c)])(N(0x21a)+B+':\x20'+I[N(0x22c)][N(0x214)]);return;}const k=I[N(0x224)],Y=!G?'\x20with\x20these\x20hostnames:':':',x=k['address']+':'+k[N(0x1ce)]+Z(k);(0x0,utils_1['success'])(p+N(0x1c0)+x+Y),a(k);}else(0x0,utils_1[N(0x21d)])(p+N(0x1c0)+((D=(A=U[0x0])===null||A===void 0x0?void 0x0:A[N(0x224)])===null||D===void 0x0?void 0x0:D[N(0x1c7)])+N(0x231)),U['forEach'](b=>{const o=N;if(b[o(0x22c)]){(0x0,utils_1[o(0x22c)])(o(0x21a)+B+':\x20'+b['error'][o(0x214)]);return;}const q=b[o(0x224)];(0x0,utils_1['success'])(o(0x207)+q[o(0x1ce)]+Z(q)),a(q,0x4);});}});}[a14e(0x1d2)](w,h=![]){const L=a14e;if(h){const G=w[L(0x1b7)](U=>U['data'])['filter'](U=>U!==undefined),P=(process===null||process===void 0x0?void 0x0:process['platform'])===L(0x1b8),v=os['platform']()===L(0x1c8),O=P?L(0x21e):L(0x205),Z=chalk_1[L(0x236)]['bold'](L(0x23a)),a=v?EOL+L(0x20a)+Z+'\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.':undefined;let l=L(0x21f)+Z+L(0x220)+L(0x21b)+L(0x1dd)+O+'):';a!==undefined&&(0x0,utils_1[L(0x1d0)])(a!==null&&a!==void 0x0?a:'');(0x0,utils_1[L(0x1d0)])(l);const B=G['map'](U=>U[L(0x1c7)]+'\x20\x20\x20\x20\x20\x20\x20\x20\x20'+U[L(0x1e5)][L(0x223)]('\x20'));console['log']((0x0,lodash_1[L(0x232)])(B)[L(0x223)](EOL)),console[L(0x21c)]();}}}function a14h(w,h){const G=a14w();return a14h=function(P,v){P=P-0x1b1;let O=G[P];return O;},a14h(w,h);}exports[a14e(0x234)]=CliPortForward;
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a15n=a15V;function a15V(X,V){const h=a15X();return a15V=function(Q,J){Q=Q-0x1ca;let G=h[Q];return G;},a15V(X,V);}(function(X,V){const K=a15V,h=X();while(!![]){try{const Q=-parseInt(K(0x20b))/0x1*(parseInt(K(0x1ca))/0x2)+-parseInt(K(0x1cf))/0x3+parseInt(K(0x1dd))/0x4+-parseInt(K(0x1fd))/0x5+-parseInt(K(0x20f))/0x6+-parseInt(K(0x1e7))/0x7*(parseInt(K(0x1fa))/0x8)+parseInt(K(0x206))/0x9*(parseInt(K(0x1da))/0xa);if(Q===V)break;else h['push'](h['shift']());}catch(J){h['push'](h['shift']());}}}(a15X,0xb0d8e));var __awaiter=this&&this['__awaiter']||function(X,V,h,Q){function J(G){return G instanceof h?G:new h(function(I){I(G);});}return new(h||(h=Promise))(function(G,I){const F=a15V;function T(A){const d=a15V;try{E(Q[d(0x1e0)](A));}catch(D){I(D);}}function W(A){const f=a15V;try{E(Q[f(0x1d2)](A));}catch(D){I(D);}}function E(A){const z=a15V;A[z(0x1d6)]?G(A['value']):J(A[z(0x1e4)])[z(0x1ef)](T,W);}E((Q=Q[F(0x1f4)](X,V||[]))[F(0x1e0)]());});},__importDefault=this&&this[a15n(0x1ec)]||function(X){return X&&X['__esModule']?X:{'default':X};};Object[a15n(0x20c)](exports,a15n(0x1e2),{'value':!![]}),exports[a15n(0x1ff)]=exports['parseDateInput']=exports[a15n(0x1f7)]=exports[a15n(0x200)]=exports['asyncSequential']=exports['retry']=exports[a15n(0x208)]=exports[a15n(0x1cc)]=exports[a15n(0x1de)]=exports[a15n(0x1df)]=exports[a15n(0x211)]=exports[a15n(0x1dc)]=void 0x0;const node_fetch_1=__importDefault(require(a15n(0x1fc))),chalk_1=__importDefault(require(a15n(0x1d3))),commander_1=require(a15n(0x1f1)),pgk=require(a15n(0x1d5));exports[a15n(0x1dc)]=a15n(0x210)+(pgk===null||pgk===void 0x0?void 0x0:pgk['version']);function checkUpdate(X){return __awaiter(this,void 0x0,void 0x0,function*(){const a=a15V;function V(h,Q){const q=a15V,J=new Date(Number(h));return J[q(0x203)](J['getDate']()+Q),J;}try{if(V(X[a(0x1d8)](),0x1)>new Date())return;const h=pgk[a(0x1f9)],{name:Q}=pgk;if(!h)return;const J='https://registry.npmjs.org/'+Q+'/latest',G=yield(0x0,node_fetch_1[a(0x1d9)])(J,{'method':'GET','timeout':0x1388}),I=(yield G[a(0x201)]())[a(0x1f9)];needsUpdate(h,I)&&warning(a(0x1d4)+h+',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20'+I+'.'+(a(0x205)+Q+a(0x204)+Q+a(0x1eb))),yield X['setLastUpdateCheck'](new Date());}catch(T){}});}exports[a15n(0x211)]=checkUpdate;function a15X(){const i=['getCommand','Failed:\x20','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','226627HOcrpL','defineProperty','getCurrentContext','Verbose\x20output','3958764SuZfvk','northflank-cli/','checkUpdate','green','retry','allowUnknownOption','8QsYAgu','resolve','success','Display\x20help\x20for\x20command','getCurrentBaseUrl','311745zvJHVq','log','redBright','throw','chalk','**\x20You\x27re\x20running\x20on\x20version\x20','../package.json','done','yellow','getLastUpdateCheck','default','34141790ARXbyM','min','customUserAgent','3236732fseqED','warning','error','next','contextProvider','__esModule','--verbose','value','Command','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','1505UHWOmQ','getTime','asyncSequential','example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)','\x27\x20**','__importDefault','split','storeOptionsAsProperties','then','parseDateInput','commander','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','--quiet','apply','setUTCSeconds','push','assertContextExisting','option','version','33368XPIvSm','addHelpCommand','node-fetch','4660070ASjUbP','length','tsHint','isValidJSON','json','parse','setDate','\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','9hPOkSo','replace'];a15X=function(){return i;};return a15X();}function needsUpdate(X,V){const R=a15n,h=/(\.0+)+$/,Q=X[R(0x207)](h,'')[R(0x1ed)]('.'),J=V[R(0x207)](h,'')[R(0x1ed)]('.');for(let G=0x0;G<Math[R(0x1db)](Q[R(0x1fe)],J[R(0x1fe)]);G+=0x1){const I=parseInt(J[G],0xa)-parseInt(Q[G],0xa);if(I>0x0)return!![];if(I<0x0)return![];}return J['length']>Q[R(0x1fe)];}function error(X){const v=a15n;console['error'](chalk_1[v(0x1d9)][v(0x1d1)](v(0x209)+X));}exports[a15n(0x1df)]=error;function warning(X){const g=a15n;console['error'](chalk_1[g(0x1d9)][g(0x1d7)](''+X));}exports[a15n(0x1de)]=warning;function success(X){const B=a15n;console[B(0x1d0)](chalk_1[B(0x1d9)][B(0x212)](''+X));}exports['success']=success;function getCommand(X=![]){const O=a15n,V=new commander_1[(O(0x1e5))]();return V['helpOption'](undefined,O(0x1cd)),V[O(0x1fb)](![]),V[O(0x1ee)](![]),V[O(0x214)](![]),V['allowExcessArguments'](![]),V['enablePositionalOptions'](!![]),X&&(V[O(0x1f8)](O(0x1e3),O(0x20e),![]),V[O(0x1f8)](O(0x1f3),'No\x20console\x20output',![])),V;}exports[a15n(0x208)]=getCommand;const retry=(X,V=0x32)=>h=>{let Q=X;const J=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield h();}catch(G){if(Q<=0x0)throw G;return Q-=0x1,yield new Promise(I=>setTimeout(()=>I(),V)),J();}});return J();};exports[a15n(0x213)]=retry;const asyncSequential=(X,V)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const H=a15n,h=Promise[H(0x1cb)]([]);return X['reduce']((Q,J)=>Q['then'](G=>V(J)[H(0x1ef)](I=>{const k=H;return G[k(0x1f6)](I),G;})),h);});exports[a15n(0x1e9)]=asyncSequential;function isValidJSON(X){const o=a15n;try{return JSON[o(0x202)](X);}catch(V){return![];}}exports[a15n(0x200)]=isValidJSON;function assertContextExisting(X){const N=a15n;if(X[N(0x1e1)][N(0x20d)]()===undefined)throw new Error(N(0x1e6));if(X['contextProvider'][N(0x1ce)]()===undefined)throw new Error(N(0x20a));if(X[N(0x1e1)]['getCurrentToken']()===undefined)throw new Error(N(0x1f2));}exports[a15n(0x1f7)]=assertContextExisting;const parseDateInput=X=>{const p=a15n;try{let V=new Date(X);if(isNaN(V[p(0x1e8)]())){const h=X['length']===0xd?X/0x3e8:X,Q=new Date(0x0);Q[p(0x1f5)](h);if(isNaN(Q[p(0x1e8)]()))throw new Error();return Q;}return V;}catch(J){throw new Error('Invalid\x20date\x20received:\x20'+X+',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)');}};exports[a15n(0x1f0)]=parseDateInput,exports[a15n(0x1ff)]=a15n(0x1ea);
1
+ 'use strict';const a15s=a15h;function a15w(){const S=['getTime','__awaiter','Display\x20help\x20for\x20command','example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','version','warning','retry','success','split','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','getDate','done','tsHint','storeOptionsAsProperties','65JDyheZ','isValidJSON','2504079UXUoXz','Command','default','121836wuzjoF','Failed:\x20','2805465BzXBDf','getCurrentToken','node-fetch','replace','7cfZsQL','Invalid\x20date\x20received:\x20','212udpzjn','push','then','json','getLastUpdateCheck','helpOption','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','175461PhNcgC','56UctXme','--quiet','getCommand','assertContextExisting','checkUpdate','chalk','parseDateInput','length','reduce','yellow','/latest','__importDefault','__esModule','--verbose','Verbose\x20output','\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20','allowExcessArguments','23529eQJplU','562122kHzdXv','3284KhUKGi','enablePositionalOptions','error','apply','value','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','next','setLastUpdateCheck','8SMrMgy','northflank-cli/',',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)','customUserAgent','https://registry.npmjs.org/','GET','option','allowUnknownOption','contextProvider','green','270TIDeCZ','**\x20You\x27re\x20running\x20on\x20version\x20','min'];a15w=function(){return S;};return a15w();}(function(w,h){const p=a15h,G=w();while(!![]){try{const P=-parseInt(p(0xbf))/0x1*(parseInt(p(0xd2))/0x2)+-parseInt(p(0xd0))/0x3*(-parseInt(p(0xb7))/0x4)+-parseInt(p(0xb1))/0x5+parseInt(p(0xd1))/0x6*(-parseInt(p(0xb5))/0x7)+parseInt(p(0xda))/0x8*(parseInt(p(0xac))/0x9)+-parseInt(p(0xe4))/0xa*(-parseInt(p(0xbe))/0xb)+-parseInt(p(0xaf))/0xc*(-parseInt(p(0xaa))/0xd);if(P===h)break;else G['push'](G['shift']());}catch(v){G['push'](G['shift']());}}}(a15w,0x68a4c));var __awaiter=this&&this[a15s(0xe8)]||function(w,h,G,v){function O(Z){return Z instanceof G?Z:new G(function(a){a(Z);});}return new(G||(G=Promise))(function(Z,a){const X=a15h;function l(A){try{U(v['next'](A));}catch(D){a(D);}}function B(A){try{U(v['throw'](A));}catch(D){a(D);}}function U(A){const W=a15h;A[W(0xa7)]?Z(A[W(0xd6)]):O(A['value'])['then'](l,B);}U((v=v[X(0xd5)](w,h||[]))[X(0xd8)]());});},__importDefault=this&&this[a15s(0xca)]||function(w){const T=a15s;return w&&w[T(0xcb)]?w:{'default':w};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['tsHint']=exports[a15s(0xc5)]=exports[a15s(0xc2)]=exports[a15s(0xab)]=exports['asyncSequential']=exports['retry']=exports['getCommand']=exports['success']=exports[a15s(0xed)]=exports[a15s(0xd4)]=exports[a15s(0xc3)]=exports[a15s(0xdd)]=void 0x0;const node_fetch_1=__importDefault(require(a15s(0xb3))),chalk_1=__importDefault(require(a15s(0xc4))),commander_1=require('commander'),pgk=require('../package.json');exports[a15s(0xdd)]=a15s(0xdb)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a15s(0xec)]);function checkUpdate(w){return __awaiter(this,void 0x0,void 0x0,function*(){const k=a15h;function h(G,P){const I=a15h,v=new Date(Number(G));return v['setDate'](v[I(0xa6)]()+P),v;}try{if(h(w[k(0xbb)](),0x1)>new Date())return;const G=pgk[k(0xec)],{name:P}=pgk;if(!G)return;const v=k(0xde)+P+k(0xc9),O=yield(0x0,node_fetch_1['default'])(v,{'method':k(0xdf),'timeout':0x1388}),Z=(yield O[k(0xba)]())['version'];needsUpdate(G,Z)&&warning(k(0xe5)+G+k(0xeb)+Z+'.'+(k(0xbd)+P+k(0xce)+P+'\x27\x20**')),yield w[k(0xd9)](new Date());}catch(a){}});}exports[a15s(0xc3)]=checkUpdate;function needsUpdate(w,h){const Y=a15s,G=/(\.0+)+$/,P=w[Y(0xb4)](G,'')[Y(0xf0)]('.'),v=h['replace'](G,'')['split']('.');for(let O=0x0;O<Math[Y(0xe6)](P[Y(0xc6)],v['length']);O+=0x1){const Z=parseInt(v[O],0xa)-parseInt(P[O],0xa);if(Z>0x0)return!![];if(Z<0x0)return![];}return v[Y(0xc6)]>P[Y(0xc6)];}function error(w){const x=a15s;console['error'](chalk_1[x(0xae)]['redBright'](x(0xb0)+w));}exports[a15s(0xd4)]=error;function warning(w){const b=a15s;console['error'](chalk_1[b(0xae)][b(0xc8)](''+w));}exports[a15s(0xed)]=warning;function success(w){const q=a15s;console['log'](chalk_1[q(0xae)][q(0xe3)](''+w));}exports[a15s(0xef)]=success;function getCommand(w=![]){const f=a15s,h=new commander_1[(f(0xad))]();return h[f(0xbc)](undefined,f(0xe9)),h['addHelpCommand'](![]),h[f(0xa9)](![]),h[f(0xe1)](![]),h[f(0xcf)](![]),h[f(0xd3)](!![]),w&&(h['option'](f(0xcc),f(0xcd),![]),h[f(0xe0)](f(0xc0),'No\x20console\x20output',![])),h;}exports[a15s(0xc1)]=getCommand;const retry=(w,h=0x32)=>G=>{let P=w;const v=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield G();}catch(O){if(P<=0x0)throw O;return P-=0x1,yield new Promise(Z=>setTimeout(()=>Z(),h)),v();}});return v();};exports[a15s(0xee)]=retry;const asyncSequential=(w,h)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const e=a15s,G=Promise['resolve']([]);return w[e(0xc7)]((P,v)=>P['then'](O=>h(v)[e(0xb9)](Z=>{const i=e;return O[i(0xb8)](Z),O;})),G);});exports['asyncSequential']=asyncSequential;function isValidJSON(w){try{return JSON['parse'](w);}catch(h){return![];}}exports[a15s(0xab)]=isValidJSON;function assertContextExisting(w){const u=a15s;if(w[u(0xe2)]['getCurrentContext']()===undefined)throw new Error('No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27');if(w[u(0xe2)]['getCurrentBaseUrl']()===undefined)throw new Error(u(0xd7));if(w[u(0xe2)][u(0xb2)]()===undefined)throw new Error(u(0xf1));}function a15h(w,h){const G=a15w();return a15h=function(P,v){P=P-0xa6;let O=G[P];return O;},a15h(w,h);}exports[a15s(0xc2)]=assertContextExisting;const parseDateInput=w=>{const t=a15s;try{let h=new Date(w);if(isNaN(h[t(0xe7)]())){const G=w['length']===0xd?w/0x3e8:w,P=new Date(0x0);P['setUTCSeconds'](G);if(isNaN(P[t(0xe7)]()))throw new Error();return P;}return h;}catch(O){throw new Error(t(0xb6)+w+t(0xdc));}};exports['parseDateInput']=parseDateInput,exports[a15s(0xa8)]=a15s(0xea);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northflank/cli",
3
- "version": "0.9.9",
3
+ "version": "0.9.11",
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.9",
29
+ "@northflank/js-client": "0.7.12",
30
30
  "ajv": "8.6.3",
31
31
  "bufferutil": "^4.0.7",
32
32
  "chalk": "~4.1.0",