@northflank/cli 0.9.21 → 0.9.22

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 a12G=a12o;(function(e,o){const D=a12o,h=e();while(!![]){try{const p=parseInt(D(0x1b3))/0x1*(-parseInt(D(0x188))/0x2)+-parseInt(D(0x174))/0x3*(-parseInt(D(0x171))/0x4)+parseInt(D(0x142))/0x5*(-parseInt(D(0x1b6))/0x6)+-parseInt(D(0x158))/0x7+parseInt(D(0x1bf))/0x8*(parseInt(D(0x182))/0x9)+parseInt(D(0x189))/0xa*(-parseInt(D(0x197))/0xb)+parseInt(D(0x1af))/0xc*(parseInt(D(0x154))/0xd);if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a12e,0x7c57e));function a12o(e,o){const h=a12e();return a12o=function(p,Y){p=p-0x136;let q=h[p];return q;},a12o(e,o);}var __awaiter=this&&this['__awaiter']||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){function v(Z){const f=a12o;try{I(p[f(0x162)](Z));}catch(k){J(k);}}function s(Z){const i=a12o;try{I(p[i(0x180)](Z));}catch(k){J(k);}}function I(Z){const R=a12o;Z['done']?q(Z[R(0x18d)]):Y(Z['value'])['then'](v,s);}I((p=p['apply'](e,o||[]))['next']());});},__importDefault=this&&this['__importDefault']||function(e){const t=a12o;return e&&e[t(0x153)]?e:{'default':e};};function a12e(){const ee=['columns','\x20seconds','values','join','json','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','length','22XTOfCI','customUserAgent','log','\x20--','\x20for\x20container:\x20','askForJobRun','charAt','noDefaults','--noDefaults','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','toTimeString','--build\x20--buildId\x20[buildId]','-t,\x20--metricTypes\x20<metricTypes...>','apiClient','metricsSingle','printMetricsTable','printInitInfo','service','assign','--container\x20--containerId\x20[NAME]','deploymentId','printMetricsGraph','flatMap','printResponse','1116FcngWb','N/A','No\x20metrics\x20found\x20for\x20this\x20query','Build\x20to\x20get\x20logs\x20from','1OCiWXh','min','../utils','12SCLBlS','commander','\x20to\x20get\x20logs\x20from','build-','--project\x20--projectId\x20[NAME]','runId','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','metricUnit','time','8FWrnqR','metricsApiClient',',\x20metric\x20types:\x20','option','--startTime\x20<timestamp>','Which\x20metric\x20type\x20to\x20fetch','keys','inquirerHelper','name','pct','yml','CliMetrics','action','serviceId','Project\x20for\x20logs','details','jobId','argParser','forEach',',\x20to:\x20','choices','printMetricsSingle','InquirerHelper','Fetching\x20data..','1311590xtXJUq','refreshInterval','message',',\x20volume:\x20','--deployment\x20--deploymentId\x20[deploymentId]','Error\x20while\x20fetching\x20metrics\x20entries:\x20','description','stringify','printAsTable','clear','metricsRange','handleError','Option','askForContainer','--run\x20--runId\x20[runId]','\x20in\x20project\x20','-o,\x20--output\x20[output]','__esModule','309725AwiOej','filter','alias','askForProject','3651326JYMFXd','map','split','startTime','conflicts','data','metrics','getStandardMetricsCommand','../inquirer-helper','default','next','chalk','getCurrentServiceName','getTime','Metrics\x20overview','rows',',\x20duration:\x20','error','--timestamp\x20[timestamp]','job','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','Id\x20[NAME]','max','askForJob','getCurrentProjectName','52SaWdSv','@northflank/js-client','stdout','140625DVuJib','warning','containerId','slice','buildId','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','getPaddingDataEnd','downSampleData','getAsciiChart','metricId','askForService','isNaN','throw','MetricType','1436850lqcjPK','bold','getPaddingDataStart','endTime','Get\x20metrics\x20for\x20the\x20specified\x20','tsHint','1043124dTogWJ','4538120jaItYm','apiContext','yaml','parseDateInput','value','toISOString','addOption'];a12e=function(){return ee;};return a12e();}Object['defineProperty'](exports,a12G(0x153),{'value':!![]}),exports[a12G(0x1ca)]=void 0x0;const js_client_1=require(a12G(0x172)),utils_1=require(a12G(0x1b5)),inquirer_helper_1=require(a12G(0x160)),commander_1=require(a12G(0x1b7)),terminal_chart_1=require('../formatting/terminal-chart'),console_format_helpers_1=require('../formatting/console-format-helpers'),chalk_1=__importDefault(require(a12G(0x163)));class CliMetrics{constructor(e){const y=a12G;this[y(0x18a)]=e,this['refreshInterval']=0x2710,this[y(0x15f)]=(o,h)=>{const S=y,p=(0x0,utils_1['getCommand'])(!![])[S(0x1c7)]((h?'build-':'')+'metrics')[S(0x156)]((h?S(0x1b9):'')+'metric')[S(0x148)](S(0x186)+o)['option'](S(0x1ba),S(0x138))[S(0x1c2)]('--'+o+S(0x19a)+o+S(0x16d),o[S(0x19d)](0x0)['toUpperCase']()+o[S(0x177)](0x1)+S(0x1b8))['option'](S(0x1aa),S(0x1a0))[S(0x1c2)](S(0x1c3),'Get\x20metrics\x20after\x20this\x20timestamp,\x20'+utils_1['tsHint'],utils_1[S(0x18c)])[S(0x1c2)]('--endTime\x20<timestamp>','Get\x20metrics\x20before\x20this\x20timestamp,\x20'+utils_1[S(0x187)],utils_1[S(0x18c)])[S(0x1c2)]('--duration\x20[duration]',S(0x16c))['addOption'](new commander_1['Option'](S(0x152),'Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[S(0x13e)](Object[S(0x192)](['format',S(0x194),'yaml'])))[S(0x18f)](new commander_1[(S(0x14e))](S(0x1a3),S(0x1c4))[S(0x13e)](Object[S(0x192)](js_client_1[S(0x181)])))[S(0x18f)](new commander_1['Option'](S(0x16a),S(0x1bc)+utils_1[S(0x187)])[S(0x13b)](utils_1[S(0x18c)])[S(0x15c)]([S(0x15b),S(0x185)]))[S(0x1c2)](S(0x19f),S(0x179),![])[S(0x18f)](new commander_1[(S(0x14e))]('-o,\x20--output\x20[output]','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[S(0x13e)](Object[S(0x192)](['format',S(0x194),S(0x18b)])));if(h)p[S(0x1c2)](S(0x1a2),S(0x1b2));if(o===S(0x16b))p[S(0x1c2)](S(0x150),S(0x195));if(o===S(0x1a8))p['option'](S(0x146),'Deployment\x20id,\x20example:\x20my-service-54785f4');return p;},this[y(0x1ac)]=(o,h)=>{return p=>{const X=a12o,Y=Object['keys'](p)[X(0x1ad)](q=>{const m=X,{values:J,metricInfo:v}=p[q],{metricUnit:s,metricResolution:I}=v;return J[m(0x159)](Z=>{const U=m;var k,L;const {metadata:F,data:W}=Z,N=h?(h===null||h===void 0x0?void 0x0:h[U(0x165)]())>new Date()['getTime']()?new Date():h:undefined,g=new Date((k=W===null||W===void 0x0?void 0x0:W[0x0])===null||k===void 0x0?void 0x0:k['ts']),w=new Date((L=W===null||W===void 0x0?void 0x0:W[W[U(0x196)]-0x1])===null||L===void 0x0?void 0x0:L['ts']),C=this[U(0x184)](o,g,I),x=this[U(0x17a)](N,w,I),l=[...C,...W,...x],b=l[U(0x159)](n=>[new Date(n['ts'])['valueOf'](),Number(n['value'])])[U(0x155)](n=>!Number[U(0x17f)](n[0x0])),a=Math[U(0x1b4)](Math[U(0x16e)](process[U(0x173)][U(0x190)]-0xa,0xa),0x64),z=Math[U(0x1b4)](Math['max'](process[U(0x173)][U(0x167)]-0x9,0xa),0xf),H=s===U(0x1c8)?0x64:undefined,P=s===U(0x1c8)?'%':s,V=(0x0,terminal_chart_1[U(0x17b)])(b,a),u=V[U(0x159)](n=>n[0x1]),c={'min':0x0,'height':z,'max':H,'unit':P,'startTs':o!==null&&o!==void 0x0?o:g,'endTs':N!==null&&N!==void 0x0?N:w};return{'dataSeries':u,'metadata':F,'chartOpts':c,'metricInfo':v};});})['flat']();if(Y[X(0x196)]===0x0)(0x0,utils_1[X(0x175)])(X(0x1b1));else Y['forEach'](q=>{const T=X,{dataSeries:J,metadata:v,chartOpts:s,metricInfo:I}=q,{containerId:Z,volumeId:k}=v,L=k?T(0x145)+k:'';console[T(0x199)](I[T(0x17d)]+T(0x19b)+chalk_1[T(0x161)]['bold'](Z)+L),console[T(0x199)]((0x0,terminal_chart_1[T(0x17c)])(J,s));});};},this['printMetricsTable']=(o,h,p)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const O=y;try{const Y=yield this[O(0x1c0)][O(0x15e)][O(0x1a5)](o,h,p);console[O(0x14b)]();if(Y[O(0x169)])(0x0,utils_1[O(0x169)])('Error\x20while\x20fetching\x20metrics\x20entries:\x20'+Y['error'][O(0x144)]);else this[O(0x13f)](Y[O(0x15d)]);}catch(q){console[O(0x14b)](),(0x0,utils_1[O(0x169)])(O(0x147)+q[O(0x144)]);}}),this[y(0x14d)]=o=>{const E=y;if(o[E(0x169)]){const h=JSON[E(0x149)](o[E(0x169)][E(0x139)]);throw new Error(E(0x147)+o[E(0x169)]['message']+'\x20'+h);}},this[y(0x1a7)]=(o,h,p,Y,q)=>{const A=y;if(q===!![])return;const {metricTypes:J,endTime:v,startTime:s,duration:I,containerId:Z}=Y,k=s?',\x20from:\x20'+s[A(0x18e)]():'',L=v?A(0x13d)+v['toISOString']():'',F=I?A(0x168)+I+A(0x191):'',W=Z?'container\x20'+chalk_1[A(0x161)]['bold'](Z):'all\x20containers',N=o+'\x20'+chalk_1[A(0x161)][A(0x183)](h)+A(0x151)+chalk_1[A(0x161)]['bold'](p),g=''+k+L+F,w=J?A(0x1c1)+(J===null||J===void 0x0?void 0x0:J[A(0x193)](',')):'';console[A(0x199)]('Metrics\x20for\x20'+W+'\x20of\x20'+N+w+g);},this['apiClient']=new js_client_1['ApiClient'](e,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[y(0x198)]}),this['metricsApiClient']=this[y(0x1a4)],this[y(0x1c6)]=new inquirer_helper_1[(y(0x140))](this[y(0x1a4)]);}['getMetricsCommand'](e,o=![]){const e1=a12G,h=(v,s)=>__awaiter(this,void 0x0,void 0x0,function*(){const M=a12o,I=s[M(0x19e)],{apiContext:Z,inquirerHelper:k}=this;switch(e){case M(0x1a8):{const L=I?undefined:Z[M(0x164)]();return s[M(0x137)]||L||(yield k[M(0x17e)](v)());}case M(0x16b):{const F=I?undefined:Z[M(0x164)]();return s[M(0x13a)]||F||(yield k[M(0x16f)](v)());}case'addon':{const W=I?undefined:Z[M(0x164)]();return s['addonId']||W||(yield k['askForAddon'](v)());}}}),p=(v,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const K=a12o;if(o)return I[K(0x178)]||(yield this['inquirerHelper']['askForBuild'](v,e===K(0x1a8)?s:undefined,e==='job'?s:undefined,!![])());return undefined;}),Y=(v,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const r=a12o;if(!o&&I[r(0x176)]!==undefined){if(I[r(0x176)]!==!![])return I[r(0x176)];return yield this['inquirerHelper'][r(0x14f)](v,e===r(0x1a8)?s:undefined,e===r(0x16b)?s:undefined,!![])();}return undefined;}),q=(v,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const B=a12o;if(e===B(0x16b))return I[B(0x1bb)]||(yield this[B(0x1c6)][B(0x19c)](s,v,!![])());return undefined;}),J=(v,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const e0=a12o;if(e===e0(0x1a8)){if(I[e0(0x1ab)]!==!![])return I[e0(0x1ab)];return I[e0(0x1ab)];}return undefined;});return this[e1(0x15f)](e,o)[e1(0x136)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const e2=e1,{noDefaults:s,projectId:I,duration:Z,timestamp:k,output:L,startTime:F,endTime:W,metricTypes:N,quiet:g}=v;(0x0,utils_1['assertContextExisting'])(this[e2(0x1a4)]);if(F&&W&&Z)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const {apiContext:w,inquirerHelper:C,metricsApiClient:x}=this,l=s?undefined:w[e2(0x170)](),b=I||l||(yield C[e2(0x157)]()),a=yield h(b,v),z=yield p(b,a,v),H=yield q(b,a,v),P=yield J(b,a,v),V=yield Y(b,a,v),u={'projectId':b,'entityId':a},c={'containerName':V,'startTime':F,'endTime':W,'duration':Z,'timestamp':k,'metricTypes':N,'runId':H,'buildId':z,'deploymentId':P,'isBuild':o!==null&&o!==void 0x0?o:![]},n=!(F||W||Z);if(!g&&L!==e2(0x18b)&&L!==e2(0x1c9)&&L!==e2(0x194))this[e2(0x1a7)](e,a,b,c,g);if(n){if(L!==undefined){const d=yield x[e2(0x15e)][e2(0x1a5)](u,c,e);this['handleError'](d),(0x0,console_format_helpers_1[e2(0x1ae)])(L,d[e2(0x15d)]);}else[...Array(process[e2(0x173)][e2(0x167)]-0x1)][e2(0x13c)]((j,Q)=>Q===0x0?console[e2(0x199)](e2(0x141)):console[e2(0x199)]()),yield this['printMetricsTable'](u,c,e)(),setInterval(this[e2(0x1a6)](u,c,e),this['refreshInterval']),yield new Promise(j=>setTimeout(j,this[e2(0x143)]*0x64));}else{const j=yield x[e2(0x15e)][e2(0x14c)](u,c,e);this[e2(0x14d)](j),L!==undefined?(0x0,console_format_helpers_1[e2(0x1ae)])(L,j[e2(0x15d)]):this[e2(0x1ac)](F,W!==null&&W!==void 0x0?W:new Date())(j[e2(0x15d)]);}process['exit']();}));}[a12G(0x13f)](e){const e5=a12G,o=(Y,q)=>{const e3=a12o;if(!(q===null||q===void 0x0?void 0x0:q[e3(0x18d)]))e3(0x1b0);const J=Y['metricUnit']===e3(0x1c8)?'%':Y[e3(0x1bd)];return''+Number(q===null||q===void 0x0?void 0x0:q[e3(0x18d)])['toFixed'](0x3)+J;},h=Y=>{const e4=a12o;if(!(Y===null||Y===void 0x0?void 0x0:Y['ts']))e4(0x1b0);return Y['ts'][e4(0x1a1)]()[e4(0x15a)]('\x20')[0x0];},p={};Object[e5(0x1c5)](e)[e5(0x13c)](Y=>{const e6=e5,{values:q,metricInfo:J}=e[Y];return q[e6(0x13c)](v=>{const e7=e6;var s,I;const Z=v['metadata']['containerId'];Object[e7(0x1a9)](p,{[Z]:Object['assign'](Object[e7(0x1a9)]({},p===null||p===void 0x0?void 0x0:p[Z]),{[e7(0x1be)]:h((s=v[e7(0x15d)])===null||s===void 0x0?void 0x0:s[0x0]),'containerId':Z,[J[e7(0x17d)]]:o(J,(I=v['data'])===null||I===void 0x0?void 0x0:I[0x0])})});});}),(0x0,console_format_helpers_1[e5(0x14a)])(Object[e5(0x192)](p),e5(0x166));}[a12G(0x184)](e,o,h){const e8=a12G,p=J=>new Date(J['getTime']()-Y),Y=h*0x3e8;if(!e)return[];if(!o)return[];if(p(o)[e8(0x165)]()<e['getTime']())return[];const q=[{'ts':p(o),'value':0x0}];while(p(q[q[e8(0x196)]-0x1]['ts'])[e8(0x165)]()<=e[e8(0x165)]()){q['unshift']({'ts':p(q[q[e8(0x196)]-0x1]['ts']),'value':0x0});}return q;}[a12G(0x17a)](e,o,h){const e9=a12G,p=J=>new Date(J[e9(0x165)]()+Y),Y=h*0x3e8;if(!e)return[];if(!o)return[];if(p(o)[e9(0x165)]()>e['getTime']())return[];const q=[{'ts':p(o),'value':0x0}];while(p(q[q[e9(0x196)]-0x1]['ts'])[e9(0x165)]()<=e[e9(0x165)]()){q['push']({'ts':p(q[q[e9(0x196)]-0x1]['ts']),'value':0x0});}return q;}}exports[a12G(0x1ca)]=CliMetrics;
1
+ 'use strict';function a12N(x,N){const c=a12x();return a12N=function(a,J){a=a-0x105;let p=c[a];return p;},a12N(x,N);}const a12o=a12N;function a12x(){const xx=['tsHint','pct',',\x20from:\x20','--deployment\x20--deploymentId\x20[deploymentId]','1094844XdAUXA','default','--container\x20--containerId\x20[NAME]','getPaddingDataEnd','MetricType','bold','customUserAgent','getCurrentProjectName','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','endTime','641463WxrKyK','../utils','printMetricsGraph','exit','deploymentId','length','Which\x20metric\x20type\x20to\x20fetch','name','choices','../formatting/terminal-chart','Project\x20for\x20logs','stringify','metricsSingle','clear','value','columns','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','-o,\x20--output\x20[output]','unshift','../inquirer-helper','564494JZJyjE','askForBuild','printMetricsTable','job','askForAddon','warning','Id\x20[NAME]','container\x20','Get\x20metrics\x20for\x20the\x20specified\x20','\x20seconds','Metrics\x20overview','keys','getPaddingDataStart','Get\x20metrics\x20before\x20this\x20timestamp,\x20','refreshInterval','N/A','\x20to\x20get\x20logs\x20from','addonId','278490ybmQXt',',\x20duration:\x20','noDefaults','runId','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)',',\x20volume:\x20','all\x20containers','Build\x20to\x20get\x20logs\x20from','apiContext','split','downSampleData','json','push','format','Deployment\x20id,\x20example:\x20my-service-54785f4','service','@northflank/js-client','option','74944tQfypW','toTimeString','filter','toUpperCase','startTime','CliMetrics','defineProperty','commander','serviceId','stdout','No\x20metrics\x20found\x20for\x20this\x20query','metricsApiClient','Error\x20while\x20fetching\x20metrics\x20entries:\x20','\x20of\x20','--noDefaults','askForJobRun','containerId','parseDateInput','charAt','log','askForService','assertContextExisting','178021cXgpNI','next','\x20--','145060wtpdMC','getTime','printMetricsSingle','metrics','map','Option','flat','54HXSIPK','metricId','build-','Fetching\x20data..','chalk','join','flatMap','done','InquirerHelper','getCurrentServiceName','printInitInfo','error','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','__importDefault','min','throw','inquirerHelper','metadata','112sNQhxF','description','getMetricsCommand','-t,\x20--metricTypes\x20<metricTypes...>','rows','apiClient','ApiClient','alias','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','--startTime\x20<timestamp>','max','toISOString','values','__esModule','time','handleError','addOption','details','metricUnit','assign','\x20for\x20container:\x20','--endTime\x20<timestamp>','yaml','\x20in\x20project\x20','getStandardMetricsCommand','askForJob','5kTYYBr','forEach','__awaiter','isNaN','printAsTable','message','data'];a12x=function(){return xx;};return a12x();}(function(x,N){const B=a12N,c=x();while(!![]){try{const a=-parseInt(B(0x13d))/0x1+-parseInt(B(0x19c))/0x2+parseInt(B(0x188))/0x3+parseInt(B(0x140))/0x4+parseInt(B(0x173))/0x5*(parseInt(B(0x17e))/0x6)+parseInt(B(0x159))/0x7*(parseInt(B(0x127))/0x8)+parseInt(B(0x147))/0x9*(parseInt(B(0x115))/0xa);if(a===N)break;else c['push'](c['shift']());}catch(J){c['push'](c['shift']());}}}(a12x,0x469fa));var __awaiter=this&&this[a12o(0x175)]||function(x,N,c,a){function J(p){return p instanceof c?p:new c(function(e){e(p);});}return new(c||(c=Promise))(function(p,e){const X=a12N;function s(M){const G=a12N;try{d(a[G(0x13e)](M));}catch(A){e(A);}}function q(M){const E=a12N;try{d(a[E(0x156)](M));}catch(A){e(A);}}function d(M){const u=a12N;M[u(0x14e)]?p(M[u(0x196)]):J(M[u(0x196)])['then'](s,q);}d((a=a['apply'](x,N||[]))[X(0x13e)]());});},__importDefault=this&&this[a12o(0x154)]||function(x){return x&&x['__esModule']?x:{'default':x};};Object[a12o(0x12d)](exports,a12o(0x166),{'value':!![]}),exports[a12o(0x12c)]=void 0x0;const js_client_1=require(a12o(0x125)),utils_1=require(a12o(0x189)),inquirer_helper_1=require(a12o(0x19b)),commander_1=require(a12o(0x12e)),terminal_chart_1=require(a12o(0x191)),console_format_helpers_1=require('../formatting/console-format-helpers'),chalk_1=__importDefault(require(a12o(0x14b)));class CliMetrics{constructor(x){const R=a12o;this[R(0x11d)]=x,this[R(0x111)]=0x2710,this[R(0x171)]=(N,c)=>{const t=R,a=(0x0,utils_1['getCommand'])(!![])[t(0x18f)]((c?t(0x149):'')+t(0x143))[t(0x160)]((c?t(0x149):'')+'metric')[t(0x15a)](t(0x10b)+N)[t(0x126)]('--project\x20--projectId\x20[NAME]',t(0x192))[t(0x126)]('--'+N+t(0x13f)+N+t(0x109),N[t(0x139)](0x0)[t(0x12a)]()+N['slice'](0x1)+t(0x113))[t(0x126)](t(0x180),t(0x119))[t(0x126)](t(0x162),'Get\x20metrics\x20after\x20this\x20timestamp,\x20'+utils_1[t(0x17a)],utils_1[t(0x138)])[t(0x126)](t(0x16e),t(0x110)+utils_1['tsHint'],utils_1[t(0x138)])['option']('--duration\x20[duration]',t(0x186))['addOption'](new commander_1[(t(0x145))]('-o,\x20--output\x20[output]',t(0x153))[t(0x190)](Object['values']([t(0x122),t(0x120),t(0x16f)])))[t(0x169)](new commander_1[(t(0x145))](t(0x15c),t(0x18e))[t(0x190)](Object['values'](js_client_1[t(0x182)])))[t(0x169)](new commander_1['Option']('--timestamp\x20[timestamp]',t(0x161)+utils_1[t(0x17a)])['argParser'](utils_1[t(0x138)])['conflicts']([t(0x12b),t(0x187)]))['option'](t(0x135),'Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])[t(0x169)](new commander_1['Option'](t(0x199),t(0x153))['choices'](Object['values'](['format',t(0x120),t(0x16f)])));if(c)a[t(0x126)]('--build\x20--buildId\x20[buildId]',t(0x11c));if(N===t(0x106))a[t(0x126)]('--run\x20--runId\x20[runId]','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0');if(N===t(0x124))a[t(0x126)](t(0x17d),t(0x123));return a;},this['printMetricsGraph']=(N,c)=>{return a=>{const f=a12N,J=Object['keys'](a)[f(0x14d)](p=>{const Y=f,{values:e,metricInfo:s}=a[p],{metricUnit:q,metricResolution:d}=s;return e[Y(0x144)](M=>{const H=Y;var A,l;const {metadata:Z,data:V}=M,g=c?(c===null||c===void 0x0?void 0x0:c['getTime']())>new Date()['getTime']()?new Date():c:undefined,P=new Date((A=V===null||V===void 0x0?void 0x0:V[0x0])===null||A===void 0x0?void 0x0:A['ts']),n=new Date((l=V===null||V===void 0x0?void 0x0:V[V[H(0x18d)]-0x1])===null||l===void 0x0?void 0x0:l['ts']),Q=this['getPaddingDataStart'](N,P,d),k=this[H(0x181)](g,n,d),b=[...Q,...V,...k],F=b[H(0x144)](W=>[new Date(W['ts'])['valueOf'](),Number(W[H(0x196)])])[H(0x129)](W=>!Number[H(0x176)](W[0x0])),I=Math[H(0x155)](Math[H(0x163)](process[H(0x130)][H(0x197)]-0xa,0xa),0x64),z=Math[H(0x155)](Math[H(0x163)](process[H(0x130)][H(0x15d)]-0x9,0xa),0xf),w=q==='pct'?0x64:undefined,j=q===H(0x17b)?'%':q,K=(0x0,terminal_chart_1[H(0x11f)])(F,I),m=K[H(0x144)](W=>W[0x1]),S={'min':0x0,'height':z,'max':w,'unit':j,'startTs':N!==null&&N!==void 0x0?N:P,'endTs':g!==null&&g!==void 0x0?g:n};return{'dataSeries':m,'metadata':Z,'chartOpts':S,'metricInfo':s};});})[f(0x146)]();if(J[f(0x18d)]===0x0)(0x0,utils_1[f(0x108)])(f(0x131));else J[f(0x174)](p=>{const D=f,{dataSeries:e,metadata:s,chartOpts:q,metricInfo:d}=p,{containerId:M,volumeId:A}=s,l=A?D(0x11a)+A:'';console[D(0x13a)](d[D(0x148)]+D(0x16d)+chalk_1[D(0x17f)][D(0x183)](M)+l),console['log']((0x0,terminal_chart_1['getAsciiChart'])(e,q));});};},this[R(0x105)]=(N,c,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const r=R;try{const J=yield this['metricsApiClient'][r(0x143)][r(0x194)](N,c,a);console[r(0x195)]();if(J['error'])(0x0,utils_1[r(0x152)])(r(0x133)+J[r(0x152)]['message']);else this[r(0x142)](J[r(0x179)]);}catch(p){console[r(0x195)](),(0x0,utils_1[r(0x152)])(r(0x133)+p[r(0x178)]);}}),this[R(0x168)]=N=>{const i=R;if(N['error']){const c=JSON[i(0x193)](N[i(0x152)][i(0x16a)]);throw new Error(i(0x133)+N[i(0x152)]['message']+'\x20'+c);}},this[R(0x151)]=(N,c,a,J,p)=>{const U=R;if(p===!![])return;const {metricTypes:e,endTime:s,startTime:q,duration:d,containerId:M}=J,A=q?U(0x17c)+q['toISOString']():'',l=s?',\x20to:\x20'+s[U(0x164)]():'',Z=d?U(0x116)+d+U(0x10c):'',V=M?U(0x10a)+chalk_1['default'][U(0x183)](M):U(0x11b),g=N+'\x20'+chalk_1[U(0x17f)][U(0x183)](c)+U(0x170)+chalk_1[U(0x17f)][U(0x183)](a),P=''+A+l+Z,n=e?',\x20metric\x20types:\x20'+(e===null||e===void 0x0?void 0x0:e[U(0x14c)](',')):'';console['log']('Metrics\x20for\x20'+V+U(0x134)+g+n+P);},this['apiClient']=new js_client_1[(R(0x15f))](x,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[R(0x184)]}),this[R(0x132)]=this[R(0x15e)],this[R(0x157)]=new inquirer_helper_1[(R(0x14f))](this[R(0x15e)]);}[a12o(0x15b)](x,N=![]){const x1=a12o,c=(s,q)=>__awaiter(this,void 0x0,void 0x0,function*(){const y=a12N,d=q[y(0x117)],{apiContext:M,inquirerHelper:A}=this;switch(x){case'service':{const l=d?undefined:M[y(0x150)]();return q[y(0x12f)]||l||(yield A[y(0x13b)](s)());}case y(0x106):{const Z=d?undefined:M[y(0x150)]();return q['jobId']||Z||(yield A[y(0x172)](s)());}case'addon':{const V=d?undefined:M[y(0x150)]();return q[y(0x114)]||V||(yield A[y(0x107)](s)());}}}),a=(s,q,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const C=a12N;if(N)return d['buildId']||(yield this[C(0x157)][C(0x19d)](s,x===C(0x124)?q:undefined,x===C(0x106)?q:undefined,!![])());return undefined;}),J=(s,q,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const T=a12N;if(!N&&d[T(0x137)]!==undefined){if(d[T(0x137)]!==!![])return d[T(0x137)];return yield this[T(0x157)]['askForContainer'](s,x===T(0x124)?q:undefined,x==='job'?q:undefined,!![])();}return undefined;}),p=(s,q,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const O=a12N;if(x==='job')return d[O(0x118)]||(yield this[O(0x157)][O(0x136)](q,s,!![])());return undefined;}),e=(s,q,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const x0=a12N;if(x===x0(0x124)){if(d[x0(0x18c)]!==!![])return d[x0(0x18c)];return d[x0(0x18c)];}return undefined;});return this[x1(0x171)](x,N)['action'](s=>__awaiter(this,void 0x0,void 0x0,function*(){const x2=x1,{noDefaults:q,projectId:d,duration:M,timestamp:A,output:l,startTime:Z,endTime:V,metricTypes:g,quiet:P}=s;(0x0,utils_1[x2(0x13c)])(this['apiClient']);if(Z&&V&&M)throw new Error(x2(0x198));const {apiContext:n,inquirerHelper:Q,metricsApiClient:k}=this,b=q?undefined:n[x2(0x185)](),F=d||b||(yield Q['askForProject']()),I=yield c(F,s),z=yield a(F,I,s),w=yield p(F,I,s),j=yield e(F,I,s),K=yield J(F,I,s),m={'projectId':F,'entityId':I},S={'containerName':K,'startTime':Z,'endTime':V,'duration':M,'timestamp':A,'metricTypes':g,'runId':w,'buildId':z,'deploymentId':j,'isBuild':N!==null&&N!==void 0x0?N:![]},W=!(Z||V||M);if(!P&&l!=='yaml'&&l!=='yml'&&l!==x2(0x120))this[x2(0x151)](x,I,F,S,P);if(W){if(l!==undefined){const L=yield k['metrics'][x2(0x194)](m,S,x);this[x2(0x168)](L),(0x0,console_format_helpers_1['printResponse'])(l,L[x2(0x179)]);}else[...Array(process['stdout']['rows']-0x1)]['forEach']((v,h)=>h===0x0?console[x2(0x13a)](x2(0x14a)):console[x2(0x13a)]()),yield this[x2(0x105)](m,S,x)(),setInterval(this[x2(0x105)](m,S,x),this[x2(0x111)]),yield new Promise(v=>setTimeout(v,this[x2(0x111)]*0x64));}else{const v=yield k[x2(0x143)]['metricsRange'](m,S,x);this['handleError'](v),l!==undefined?(0x0,console_format_helpers_1['printResponse'])(l,v[x2(0x179)]):this[x2(0x18a)](Z,V!==null&&V!==void 0x0?V:new Date())(v['data']);}process[x2(0x18b)]();}));}[a12o(0x142)](x){const x5=a12o,N=(J,p)=>{const x3=a12N;if(!(p===null||p===void 0x0?void 0x0:p['value']))x3(0x112);const e=J[x3(0x16b)]==='pct'?'%':J[x3(0x16b)];return''+Number(p===null||p===void 0x0?void 0x0:p[x3(0x196)])['toFixed'](0x3)+e;},c=J=>{const x4=a12N;if(!(J===null||J===void 0x0?void 0x0:J['ts']))x4(0x112);return J['ts'][x4(0x128)]()[x4(0x11e)]('\x20')[0x0];},a={};Object[x5(0x10e)](x)[x5(0x174)](J=>{const x6=x5,{values:p,metricInfo:e}=x[J];return p[x6(0x174)](s=>{const x7=x6;var q,d;const M=s[x7(0x158)][x7(0x137)];Object[x7(0x16c)](a,{[M]:Object[x7(0x16c)](Object[x7(0x16c)]({},a===null||a===void 0x0?void 0x0:a[M]),{[x7(0x167)]:c((q=s[x7(0x179)])===null||q===void 0x0?void 0x0:q[0x0]),'containerId':M,[e[x7(0x148)]]:N(e,(d=s[x7(0x179)])===null||d===void 0x0?void 0x0:d[0x0])})});});}),(0x0,console_format_helpers_1[x5(0x177)])(Object[x5(0x165)](a),x5(0x10d));}[a12o(0x10f)](x,N,c){const x8=a12o,a=e=>new Date(e[x8(0x141)]()-J),J=c*0x3e8;if(!x)return[];if(!N)return[];if(a(N)['getTime']()<x['getTime']())return[];const p=[{'ts':a(N),'value':0x0}];while(a(p[p['length']-0x1]['ts'])[x8(0x141)]()<=x[x8(0x141)]()){p[x8(0x19a)]({'ts':a(p[p['length']-0x1]['ts']),'value':0x0});}return p;}[a12o(0x181)](x,N,c){const x9=a12o,a=e=>new Date(e[x9(0x141)]()+J),J=c*0x3e8;if(!x)return[];if(!N)return[];if(a(N)[x9(0x141)]()>x[x9(0x141)]())return[];const p=[{'ts':a(N),'value':0x0}];while(a(p[p[x9(0x18d)]-0x1]['ts'])[x9(0x141)]()<=x[x9(0x141)]()){p[x9(0x121)]({'ts':a(p[p[x9(0x18d)]-0x1]['ts']),'value':0x0});}return p;}}exports['CliMetrics']=CliMetrics;
@@ -1 +1 @@
1
- 'use strict';const a13C=a13o;function a13o(e,o){const h=a13e();return a13o=function(p,Y){p=p-0x141;let q=h[p];return q;},a13o(e,o);}(function(e,o){const L=a13o,h=e();while(!![]){try{const p=parseInt(L(0x141))/0x1*(parseInt(L(0x152))/0x2)+-parseInt(L(0x161))/0x3*(parseInt(L(0x142))/0x4)+-parseInt(L(0x154))/0x5+-parseInt(L(0x14f))/0x6+-parseInt(L(0x15d))/0x7*(parseInt(L(0x146))/0x8)+-parseInt(L(0x159))/0x9+parseInt(L(0x15b))/0xa*(parseInt(L(0x164))/0xb);if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a13e,0x7d909));var __awaiter=this&&this['__awaiter']||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const g=a13o;function v(Z){const F=a13o;try{I(p[F(0x167)](Z));}catch(k){J(k);}}function s(Z){const W=a13o;try{I(p[W(0x148)](Z));}catch(k){J(k);}}function I(Z){const N=a13o;Z['done']?q(Z[N(0x168)]):Y(Z[N(0x168)])[N(0x15f)](v,s);}I((p=p[g(0x14e)](e,o||[]))['next']());});},__importDefault=this&&this['__importDefault']||function(e){const w=a13o;return e&&e[w(0x14b)]?e:{'default':e};};Object[a13C(0x15e)](exports,a13C(0x14b),{'value':!![]}),exports[a13C(0x162)]=void 0x0;const list_1=__importDefault(require('inquirer/lib/prompts/list')),choice_1=__importDefault(require('inquirer/lib/objects/choice')),chalk_1=__importDefault(require('chalk'));function incrementListIndex(e,o,h){const x=a13C,p=h['choices'][x(0x158)],Y=x(0x153)in h?Boolean(h['loop']):!![];if(o==='up'){if(e>0x0)return e-0x1;return Y?p-0x1:e;}if(o===x(0x143)){if(e<p-0x1)return e+0x1;return Y?0x0:e;}throw new Error(x(0x144));}class DynamicReloadPaginationPrompt extends list_1[a13C(0x147)]{constructor(e,o,h){const l=a13C;super(e,o,h),this[l(0x157)]=chalk_1[l(0x147)][l(0x160)](l(0x15c)),this[l(0x145)]=![],this[l(0x166)]=this[l(0x156)],this['nextPageCursor']=this[l(0x166)][l(0x151)],this['nextPageCursor']!==undefined&&this[l(0x156)][l(0x14d)][l(0x163)](new choice_1['default'](this[l(0x157)],this[l(0x157)]));}['onUpKey'](){const b=a13C;if(this['loading'])return;this[b(0x15a)]=incrementListIndex(this[b(0x15a)],'up',this[b(0x156)]),this['render']();}['onDownKey'](){return __awaiter(this,void 0x0,void 0x0,function*(){const a=a13o;if(this[a(0x145)])return;this['selected']=incrementListIndex(this[a(0x15a)],a(0x143),this[a(0x156)]),yield this[a(0x14a)](),this[a(0x155)]();});}[a13C(0x14a)](){return __awaiter(this,void 0x0,void 0x0,function*(){const z=a13o;if(this[z(0x15a)]>=this['opt']['choices'][z(0x14c)]-0x1){if(this[z(0x151)]===undefined)return;this[z(0x145)]=!![];let e=0x0;const o=setInterval(()=>{const H=z,q=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],J=chalk_1[H(0x147)][H(0x160)](q[e%q[H(0x14c)]]+H(0x150));this[H(0x156)]['choices'][H(0x14d)][this['selected']][H(0x149)]=''+J,e+=0x1,this[H(0x155)]();},0x50),{elements:h,nextPageCursor:p}=yield this[z(0x166)]['loadMore']({'nextPageCursor':this[z(0x151)]})['catch'](()=>({'elements':[],'nextPageCursor':undefined}));this[z(0x151)]=p;const Y=h[z(0x169)](q=>new choice_1[(z(0x147))](q,q));this[z(0x156)]['choices'][z(0x14d)][z(0x165)](this['selected'],0x1),this[z(0x156)]['choices'][z(0x163)](...Y),p!==undefined&&this[z(0x156)][z(0x14d)][z(0x163)](new choice_1[(z(0x147))](this[z(0x157)],this[z(0x157)])),clearInterval(o),this[z(0x145)]=![];}});}}function a13e(){const P=['throw','name','handleDynamicPageLoad','__esModule','length','choices','apply','4252140shEGxm','\x20Loading\x20more\x20options','nextPageCursor','250QsNZHv','loop','1864020FmoeRF','render','opt','reloadText','realLength','3601125cFPNpr','selected','158190sCYiLE','..\x20Load\x20more\x20options\x20..','14zuyltE','defineProperty','then','italic','3cEJqSr','DynamicReloadPaginationPrompt','push','1595PNzCsh','splice','pagOpt','next','value','map','3557IVlZbJ','639544OgKAFS','down','dir\x20must\x20be\x20up\x20or\x20down','loading','2330248VoxBTt','default'];a13e=function(){return P;};return a13e();}exports[a13C(0x162)]=DynamicReloadPaginationPrompt;
1
+ 'use strict';const a13P=a13N;(function(x,N){const l=a13N,c=x();while(!![]){try{const a=-parseInt(l(0x84))/0x1*(parseInt(l(0xa7))/0x2)+-parseInt(l(0xa0))/0x3*(-parseInt(l(0xac))/0x4)+parseInt(l(0x9e))/0x5+-parseInt(l(0xa4))/0x6*(parseInt(l(0xad))/0x7)+-parseInt(l(0x87))/0x8*(parseInt(l(0x88))/0x9)+parseInt(l(0x96))/0xa+parseInt(l(0x85))/0xb*(parseInt(l(0xa1))/0xc);if(a===N)break;else c['push'](c['shift']());}catch(J){c['push'](c['shift']());}}}(a13x,0xaaea6));function a13x(){const z=['onUpKey','3562625oeSgkk','value','3DUdnaH','4812QhzQZv','loading','pagOpt','48930EcrbmD','then','catch','4632EKQmFy','italic','reloadText','inquirer/lib/objects/choice','choices','3960284RYBCgf','763uaQPfX','next','nextPageCursor','423ZrjVpF','40370mXHIOt','loadMore','24mtEzDS','3211011taGJBu','__importDefault','name','handleDynamicPageLoad','default','onDownKey','dir\x20must\x20be\x20up\x20or\x20down','opt','length','splice','push','inquirer/lib/prompts/list','selected','loop','4647040OsRBhY','\x20Loading\x20more\x20options','defineProperty','render','DynamicReloadPaginationPrompt','..\x20Load\x20more\x20options\x20..','throw'];a13x=function(){return z;};return a13x();}var __awaiter=this&&this['__awaiter']||function(x,N,c,a){function J(p){return p instanceof c?p:new c(function(e){e(p);});}return new(c||(c=Promise))(function(p,e){const g=a13N;function s(M){try{d(a['next'](M));}catch(A){e(A);}}function q(M){const Z=a13N;try{d(a[Z(0x9c)](M));}catch(A){e(A);}}function d(M){const V=a13N;M['done']?p(M[V(0x9f)]):J(M[V(0x9f)])[V(0xa5)](s,q);}d((a=a['apply'](x,N||[]))[g(0x82)]());});},__importDefault=this&&this[a13P(0x89)]||function(x){return x&&x['__esModule']?x:{'default':x};};Object[a13P(0x98)](exports,'__esModule',{'value':!![]}),exports[a13P(0x9a)]=void 0x0;const list_1=__importDefault(require(a13P(0x93))),choice_1=__importDefault(require(a13P(0xaa))),chalk_1=__importDefault(require('chalk'));function incrementListIndex(x,N,c){const n=a13P,a=c[n(0xab)]['realLength'],J=n(0x95)in c?Boolean(c[n(0x95)]):!![];if(N==='up'){if(x>0x0)return x-0x1;return J?a-0x1:x;}if(N==='down'){if(x<a-0x1)return x+0x1;return J?0x0:x;}throw new Error(n(0x8e));}function a13N(x,N){const c=a13x();return a13N=function(a,J){a=a-0x82;let p=c[a];return p;},a13N(x,N);}class DynamicReloadPaginationPrompt extends list_1['default']{constructor(x,N,c){const Q=a13P;super(x,N,c),this[Q(0xa9)]=chalk_1[Q(0x8c)]['italic'](Q(0x9b)),this[Q(0xa2)]=![],this[Q(0xa3)]=this[Q(0x8f)],this[Q(0x83)]=this[Q(0xa3)]['nextPageCursor'],this['nextPageCursor']!==undefined&&this[Q(0x8f)]['choices'][Q(0x92)](new choice_1[(Q(0x8c))](this[Q(0xa9)],this['reloadText']));}[a13P(0x9d)](){const k=a13P;if(this['loading'])return;this[k(0x94)]=incrementListIndex(this[k(0x94)],'up',this[k(0x8f)]),this[k(0x99)]();}[a13P(0x8d)](){return __awaiter(this,void 0x0,void 0x0,function*(){const b=a13N;if(this[b(0xa2)])return;this['selected']=incrementListIndex(this[b(0x94)],'down',this['opt']),yield this[b(0x8b)](),this['render']();});}[a13P(0x8b)](){return __awaiter(this,void 0x0,void 0x0,function*(){const F=a13N;if(this[F(0x94)]>=this[F(0x8f)]['choices']['length']-0x1){if(this[F(0x83)]===undefined)return;this['loading']=!![];let x=0x0;const N=setInterval(()=>{const I=F,p=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],e=chalk_1[I(0x8c)][I(0xa8)](p[x%p[I(0x90)]]+I(0x97));this['opt']['choices'][I(0xab)][this[I(0x94)]][I(0x8a)]=''+e,x+=0x1,this[I(0x99)]();},0x50),{elements:c,nextPageCursor:a}=yield this[F(0xa3)][F(0x86)]({'nextPageCursor':this['nextPageCursor']})[F(0xa6)](()=>({'elements':[],'nextPageCursor':undefined}));this[F(0x83)]=a;const J=c['map'](p=>new choice_1[(F(0x8c))](p,p));this[F(0x8f)][F(0xab)][F(0xab)][F(0x91)](this[F(0x94)],0x1),this['opt']['choices'][F(0x92)](...J),a!==undefined&&this[F(0x8f)]['choices']['push'](new choice_1[(F(0x8c))](this['reloadText'],this[F(0xa9)])),clearInterval(N),this[F(0xa2)]=![];}});}}exports[a13P(0x9a)]=DynamicReloadPaginationPrompt;
@@ -1 +1 @@
1
- 'use strict';const a15P=a15o;function a15e(){const e0=['skipHostnames','default','addon','HTTP','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','Project\x20for\x20forwarding','forwardProject','\x20\x20-\x20port\x20',',\x20hostname:\x20','bold','call','/etc/hosts','\x20with\x20these\x20hostnames:','capitalize','\x27:\x20\x22','action','option','ApiClient','Forwarding\x20service\x20','greenBright','308iWZFiZ','assertContextExisting','value','\x20-\x20','--service\x20--serviceId\x20[NAME]','create','92890BhaKht','win32','filter','forwarding','Port-forwarding\x20for\x20the\x20specified\x20addon','noDefaultsText','getCommand','539672VQAnzm','9SgCHHc','prototype','then','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','getProxyForwarder','Addon\x20to\x20forward','length','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','type','Running\x20on\x20macOS\x20in\x20','entries','637792mlGDAE','addCommand','success','protocol','--addon\x20--addonId\x20[NAME]','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','lodash','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','\x20is\x20running\x20and\x20reachable.','__setModuleDefault','\x20is\x20exposed\x20with\x20multiple\x20','5WVrARN','hosts','__importDefault','__createBinding','data','apply','Forwarding\x20addon\x20','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','1140678TXpgfL','84255ZqnSxq','flatMap','__esModule','Services:','join','Cleaning\x20up\x20open\x20connections\x20failed:\x20','project\x20for\x20forwarding','\x20in\x20project\x20','\x20to\x20','getCurrentServiceName','Addons:','Port-forwarding\x20for\x20the\x20specified\x20service','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','printForwardingInfo','ports','14eJIOSf','forwardService','getCurrentProjectName','message','writable','tunnel-close','askForAddon','next','description','\x20is\x20exposed\x20on\x20','port','repeat','getOwnPropertyDescriptor','flat','connection-error','customUserAgent','askForProject','error','portFwdCmd','Running\x20in\x20','canExecuteWithHostnames','warning','address','fwd','with\x20hostname:\x20','defineProperty','portName','../inquirer-helper','@northflank/js-client','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','all','log','forwardAddon','name','exit','Failed:\x20','apiClient','258954MjgKpj','skipHostnamesText','forEach','\x20and\x20','map','--skipHostnames','darwin','../utils','\x20addon\x20ports','hostnames','__importStar','9819sTUwdB','uniqBy','--project\x20--projectId\x20[NAME]','InquirerHelper','printHostsFileHint','--noDefaults','reset','service'];a15e=function(){return e0;};return a15e();}(function(e,o){const H=a15o,h=e();while(!![]){try{const p=-parseInt(H(0xe1))/0x1+parseInt(H(0x13a))/0x2*(parseInt(H(0x12b))/0x3)+-parseInt(H(0x116))/0x4+parseInt(H(0x122))/0x5*(parseInt(H(0xd6))/0x6)+-parseInt(H(0x12a))/0x7+-parseInt(H(0x10a))/0x8*(parseInt(H(0x10b))/0x9)+parseInt(H(0x103))/0xa*(parseInt(H(0xfd))/0xb);if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a15e,0x18746));var __createBinding=this&&this[a15P(0x125)]||(Object[a15P(0x102)]?function(e,h,p,Y){const V=a15P;if(Y===undefined)Y=p;var q=Object[V(0x146)](h,p);(!q||('get'in q?!h[V(0x12d)]:q[V(0x13e)]||q['configurable']))&&(q={'enumerable':!![],'get':function(){return h[p];}}),Object[V(0x153)](e,Y,q);}:function(e,h,p,Y){if(Y===undefined)Y=p;e[Y]=h[p];}),__setModuleDefault=this&&this[a15P(0x120)]||(Object['create']?function(e,h){const u=a15P;Object[u(0x153)](e,'default',{'enumerable':!![],'value':h});}:function(e,h){const c=a15P;e[c(0xea)]=h;}),__importStar=this&&this[a15P(0xe0)]||function(e){const n=a15P;if(e&&e['__esModule'])return e;var o={};if(e!=null){for(var h in e)if(h!==n(0xea)&&Object[n(0x10c)]['hasOwnProperty'][n(0xf3)](e,h))__createBinding(o,e,h);}return __setModuleDefault(o,e),o;},__awaiter=this&&this['__awaiter']||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const Q=a15o;function v(Z){const d=a15o;try{I(p[d(0x141)](Z));}catch(k){J(k);}}function s(Z){try{I(p['throw'](Z));}catch(k){J(k);}}function I(Z){const j=a15o;Z['done']?q(Z['value']):Y(Z[j(0xff)])[j(0x10d)](v,s);}I((p=p[Q(0x127)](e,o||[]))[Q(0x141)]());});},__importDefault=this&&this[a15P(0x124)]||function(e){const D=a15P;return e&&e[D(0x12d)]?e:{'default':e};};Object[a15P(0x153)](exports,a15P(0x12d),{'value':!![]}),exports['CliPortForward']=void 0x0;function a15o(e,o){const h=a15e();return a15o=function(p,Y){p=p-0xd5;let q=h[p];return q;},a15o(e,o);}const js_client_1=require(a15P(0x156)),chalk_1=__importDefault(require('chalk')),utils_1=require(a15P(0xdd)),inquirer_helper_1=require(a15P(0x155)),os=__importStar(require('os')),lodash_1=require(a15P(0x11d)),{EOL}=require('os');class CliPortForward{constructor(e){const f=a15P;this[f(0x108)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this['skipHostnamesText']=f(0x11e),this[f(0xd5)]=new js_client_1[(f(0xfa))](e,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[f(0x149)]});const o=new inquirer_helper_1[(f(0xe4))](this[f(0xd5)]);this['portFwdCmd']=(0x0,utils_1[f(0x109)])()[f(0x15b)]('forward')['alias'](f(0x151))['description'](f(0x11b));const h=(0x0,utils_1[f(0x109)])(!![])['name'](f(0x158))[f(0x142)](f(0x112))[f(0xf9)](f(0xe3),f(0x131))[f(0xf9)]('--noDefaults',this['noDefaultsText'],![])['option'](f(0xdb),this[f(0xd7)],![])[f(0xf8)](({noDefaults:q,projectId:J,skipHostnames:v})=>__awaiter(this,void 0x0,void 0x0,function*(){const i=f;(0x0,utils_1[i(0xfe)])(this[i(0xd5)]);const s=this[i(0x10f)](v),I=q?undefined:e[i(0x13c)](),Z=J||I||(yield o[i(0x14a)]());try{const {services:k,addons:L}=yield s[i(0xef)]({'projectId':Z},v);if(k[i(0x111)]+L['length']<=0x0)(0x0,utils_1[i(0x14f)])(i(0x10e)+chalk_1['default']['bold'](Z));else{const F=k['filter'](g=>g[i(0x111)]>0x0)['length'],W=L[i(0x105)](g=>g[i(0x111)]>0x0)[i(0x111)],N=i(0x132)+chalk_1[i(0xea)][i(0xf2)](Z);console[i(0x159)]('Forwarding\x20'+chalk_1[i(0xea)]['green']['bold'](F+'\x20service\x20ports')+i(0xd9)+chalk_1[i(0xea)]['green'][i(0xf2)](W+i(0xde))+N),console[i(0x159)](),console[i(0x159)](chalk_1['default'][i(0xf2)](i(0x12e))),k[i(0xd8)](g=>{const R=i;if(g[R(0x111)]>=0x1&&!g[0x0][R(0x14b)])this['printForwardingInfo'](g,{'type':R(0xe8),'name':g[0x0]['data']['id']},v);}),console[i(0x159)](chalk_1[i(0xea)][i(0xf2)](i(0x135))),L[i(0xd8)](g=>{const t=i;if(g[t(0x111)]>=0x1&&!g[0x0][t(0x14b)])this['printForwardingInfo'](g,{'type':t(0xeb),'name':g[0x0][t(0x126)]['id']},v);}),this[i(0xe5)]([...k['flat'](),...L[i(0x147)]()],v);}}catch(g){(0x0,utils_1['error'])(i(0x15d)+g[i(0x13d)]);}})),p=(0x0,utils_1[f(0x109)])(!![])[f(0x15b)](f(0xe8))[f(0x142)](f(0x136))[f(0xf9)](f(0xe3),f(0xee))[f(0xf9)](f(0x101),'Service\x20to\x20forward')[f(0xf9)](f(0xe6),this[f(0x108)],![])['option'](f(0xdb),this[f(0xd7)],![])[f(0xf8)](({noDefaults:q,projectId:J,serviceId:v,skipHostnames:s})=>__awaiter(this,void 0x0,void 0x0,function*(){const G=f;(0x0,utils_1[G(0xfe)])(this[G(0xd5)]);const I=this[G(0x10f)](s),Z=q?undefined:e['getCurrentProjectName'](),k=J||Z||(yield o[G(0x14a)]()),L=q?undefined:e[G(0x134)](),F=v||L||(yield o['askForService'](k)());console[G(0x159)](G(0xfb)+chalk_1[G(0xea)]['bold'](F)+G(0x132)+chalk_1['default'][G(0xf2)](k));try{const W=yield I[G(0x13b)]({'projectId':k,'serviceId':F},s);this[G(0x138)](W,{'name':F,'type':G(0xe8)},s),this['printHostsFileHint'](W,s);}catch(N){(0x0,utils_1[G(0x14b)])(G(0x15d)+N['message']);}})),Y=(0x0,utils_1['getCommand'])(!![])[f(0x15b)]('addon')[f(0x142)](f(0x107))[f(0xf9)](f(0xe3),f(0xee))[f(0xf9)](f(0x11a),f(0x110))[f(0xf9)](f(0xdb),this[f(0xd7)],![])[f(0xf8)](({noDefaults:q,projectId:J,addonId:v,skipHostnames:s})=>__awaiter(this,void 0x0,void 0x0,function*(){const y=f;(0x0,utils_1[y(0xfe)])(this[y(0xd5)]);const I=this[y(0x10f)](s),Z=q?undefined:e[y(0x13c)](),k=J||Z||(yield o[y(0x14a)]()),L=v||(yield o[y(0x140)](k)());console['log'](y(0x128)+chalk_1[y(0xea)][y(0xf2)](L)+y(0x132)+chalk_1[y(0xea)][y(0xf2)](k));try{const F={'projectId':k,'addonId':L},W=yield I[y(0x15a)](F,s);this['printForwardingInfo'](W,{'name':L,'type':y(0xeb)},s),this[y(0xe5)](W,s);}catch(N){(0x0,utils_1[y(0x14b)])(y(0x15d)+N[y(0x13d)]);}}));this['portFwdCmd'][f(0x117)](h),this[f(0x14c)][f(0x117)](p),this[f(0x14c)]['addCommand'](Y);}[a15P(0x10f)](e=![]){const S=a15P,o=this['apiClient'][S(0x106)];if(!e){const h=o[S(0x14e)]();if(h[S(0x14b)])throw new Error(h[S(0x13d)]);}return o['on'](S(0x13f),(p,Y)=>{const X=S,q=chalk_1[X(0xea)][X(0xf2)](Y[X(0x113)]+'\x20\x27'+Y['id']+'\x27'),J=Y[X(0xdf)][X(0x111)]>0x0;(0x0,utils_1[X(0x14f)])('Stop\x20forwarding\x20traffic\x20from\x20'+Y[X(0x150)]+':'+Y[X(0x144)]+X(0x133)+q),e&&J&&(0x0,utils_1['warning'])('\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.');}),o['on'](S(0x148),(p,Y,q)=>{const m=S;(0x0,utils_1['warning'])(m(0x157)+Y[m(0x150)]+':'+Y[m(0x144)]+m(0xf7)+(q===null||q===void 0x0?void 0x0:q['message'])+'\x22');}),process['on']('SIGINT',()=>__awaiter(this,void 0x0,void 0x0,function*(){const U=S;try{yield o['stop']();}catch(p){(0x0,utils_1[U(0x14b)])(U(0x130)+p[U(0x13d)]);}finally{process[U(0x15c)]();}})),o;}['printForwardingInfo'](e,o,h=![]){const T=a15P,{type:p,name:Y}=o;if(e['length']<=0x0){const s='Please\x20ensure\x20the\x20'+o[T(0x113)]+T(0x11f);(0x0,utils_1[T(0x14f)])(T(0x129)+p+'\x20'+chalk_1[T(0xea)][T(0xf2)](Y)+'.\x20'+s);return;}const q=(0x0,lodash_1['groupBy'])(e,'data.id'),J=I=>'\x20('+(I[T(0x154)]?I[T(0x154)]+T(0x100):'')+I['protocol']+')';function v(I,Z=0x2){const O=T;if(!h){const k=I[O(0x119)]===O(0xec)?'http://':'';I[O(0xdf)][O(0xd8)](L=>{const E=O;console[E(0x159)]((0x0,lodash_1[E(0x145)])('\x20',Z)+'-\x20'+k+L+':'+I[E(0x144)]);});}}Object[T(0x115)](q)['forEach'](([I,Z])=>{const A=T;var k,L;const F='>\x20'+(0x0,lodash_1[A(0xf6)])(p)+'\x20\x27'+chalk_1['default'][A(0xfc)][A(0xf2)](I)+'\x27';if(p==='addon'){if(Z[A(0x111)]===0x1){const W=Z[0x0];if(W[A(0x14b)]){(0x0,utils_1[A(0x14b)])(A(0x11c)+I+':\x20'+W['error'][A(0x13d)]);return;}const N=W[A(0x126)],g=!h?'\x20'+chalk_1[A(0xea)][A(0xe7)](A(0x152)+N[A(0xdf)][A(0x12f)](',')):'';(0x0,utils_1[A(0x118)])(F+'\x20is\x20exposed\x20on\x20'+N[A(0x150)]+':'+N[A(0x144)]+J(N)+g);}else{const w=(0x0,lodash_1[A(0xe2)])(Z,C=>{const M=A;var x,l;return(l=(x=C===null||C===void 0x0?void 0x0:C[M(0x126)])===null||x===void 0x0?void 0x0:x[M(0xdf)])===null||l===void 0x0?void 0x0:l[M(0x12f)](',');})[A(0x111)]>0x1;(0x0,utils_1[A(0x118)])(F+A(0x121)+(w?A(0x123):A(0x139))+':'),Z['forEach'](C=>{const K=A;if(C[K(0x14b)]){(0x0,utils_1[K(0x14b)])(K(0x11c)+I+':\x20'+C[K(0x14b)][K(0x13d)]);return;}const x=C[K(0x126)],l=!h?K(0xf1)+x[K(0xdf)][K(0x12f)](','):'';console[K(0x159)]('\x20\x20-\x20Address:\x20'+x[K(0x150)]+':'+x['port']+J(x)+l);});}}if(p===A(0xe8)){if(Z['length']===0x1){const C=Z[0x0];if(C['error']){(0x0,utils_1[A(0x14b)])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+I+':\x20'+C[A(0x14b)][A(0x13d)]);return;}const x=C[A(0x126)],l=!h?A(0xf5):':',b=x[A(0x150)]+':'+x[A(0x144)]+J(x);(0x0,utils_1[A(0x118)])(F+A(0x143)+b+l),v(x);}else(0x0,utils_1[A(0x118)])(F+'\x20is\x20exposed\x20on\x20'+((L=(k=Z[0x0])===null||k===void 0x0?void 0x0:k['data'])===null||L===void 0x0?void 0x0:L[A(0x150)])+'\x20with\x20multiple\x20ports:'),Z[A(0xd8)](a=>{const r=A;if(a[r(0x14b)]){(0x0,utils_1[r(0x14b)])(r(0x11c)+I+':\x20'+a['error'][r(0x13d)]);return;}const z=a[r(0x126)];(0x0,utils_1['success'])(r(0xf0)+z[r(0x144)]+J(z)),v(z,0x4);});}});}['printHostsFileHint'](e,o=![]){const B=a15P;if(o){const h=e[B(0x12c)](Z=>Z['data'])[B(0x105)](Z=>Z!==undefined),p=(process===null||process===void 0x0?void 0x0:process['platform'])===B(0x104),Y=os['platform']()===B(0xdc),q=p?'C:/Windows/System32/drivers/etc/hosts':B(0xf4),J=chalk_1['default'][B(0xf2)](B(0xe9)),v=Y?EOL+B(0x114)+J+B(0x137):undefined;let s=B(0x14d)+J+B(0xed)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+q+'):';v!==undefined&&(0x0,utils_1['warning'])(v!==null&&v!==void 0x0?v:'');(0x0,utils_1[B(0x14f)])(s);const I=h[B(0xda)](Z=>Z[B(0x150)]+'\x20\x20\x20\x20\x20\x20\x20\x20\x20'+Z[B(0xdf)][B(0x12f)]('\x20'));console[B(0x159)]((0x0,lodash_1['uniq'])(I)[B(0x12f)](EOL)),console[B(0x159)]();}}}exports['CliPortForward']=CliPortForward;
1
+ 'use strict';function a14x(){const O=['--skipHostnames','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','askForService','37tiLbYS','create','fwd','Forwarding\x20service\x20','name','protocol','ApiClient','getCommand','\x20\x20\x20\x20\x20\x20\x20\x20\x20','tunnel-close','__createBinding','askForProject','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','success','hosts','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','\x20and\x20','SIGINT','noDefaultsText','Stop\x20forwarding\x20traffic\x20from\x20','\x20with\x20these\x20hostnames:','askForAddon','customUserAgent','apply','map','12014tebHmV','Cleaning\x20up\x20open\x20connections\x20failed:\x20','uniq','writable','action','__setModuleDefault','addon','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','option','3564695KzbRKi','\x27:\x20\x22','\x20with\x20multiple\x20ports:','next','HTTP','Please\x20ensure\x20the\x20','capitalize','skipHostnamesText','\x20service\x20ports','__awaiter','message','call','flat','darwin','lodash','entries','type','address','29420pWUVGu','value','__importDefault','\x20\x20-\x20Address:\x20','addCommand','__esModule','hostnames','getOwnPropertyDescriptor','--noDefaults','6RwWxOW','assertContextExisting','Forwarding\x20addon\x20','printForwardingInfo','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','greenBright','forEach','--service\x20--serviceId\x20[NAME]','log','groupBy','uniqBy','with\x20hostname:\x20','\x20in\x20project\x20','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','join','http://','forward','bold','filter','--project\x20--projectId\x20[NAME]','warning','../utils','\x20to\x20','printHostsFileHint','get','Project\x20for\x20forwarding','forwarding','service','26BdBwFP','CliPortForward','112MJTZjY','error','getCurrentServiceName','apiClient','length','Running\x20in\x20','4297308jciQvc','defineProperty','Running\x20on\x20macOS\x20in\x20','port','Forwarding\x20','105CxDfDb','Port-forwarding\x20for\x20the\x20specified\x20addon','3057615ErAELB','hasOwnProperty','InquirerHelper','\x20addon\x20ports','data','forwardProject','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','description','--addon\x20--addonId\x20[NAME]','portName','../inquirer-helper','/etc/hosts','6801003BMJGnu','getProxyForwarder','data.id','189368zmsqGY','chalk','\x20is\x20running\x20and\x20reachable.','Failed:\x20','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','\x20is\x20exposed\x20on\x20','default','platform','reset','green','portFwdCmd','__importStar','\x20is\x20exposed\x20with\x20multiple\x20','alias','10SjhwFT','Addons:'];a14x=function(){return O;};return a14x();}const a14j=a14N;(function(x,N){const w=a14N,c=x();while(!![]){try{const a=-parseInt(w(0x205))/0x1*(parseInt(w(0x194))/0x2)+-parseInt(w(0x1e1))/0x3*(parseInt(w(0x1af))/0x4)+parseInt(w(0x19d))/0x5*(parseInt(w(0x1b8))/0x6)+-parseInt(w(0x1d6))/0x7*(-parseInt(w(0x1f2))/0x8)+-parseInt(w(0x1e3))/0x9*(parseInt(w(0x200))/0xa)+-parseInt(w(0x1ef))/0xb+parseInt(w(0x1dc))/0xc*(parseInt(w(0x1d4))/0xd);if(a===N)break;else c['push'](c['shift']());}catch(J){c['push'](c['shift']());}}}(a14x,0x5a619));var __createBinding=this&&this[a14j(0x185)]||(Object[a14j(0x206)]?function(x,N,c,a){const K=a14j;if(a===undefined)a=c;var J=Object[K(0x1b6)](N,c);(!J||(K(0x1d0)in J?!N[K(0x1b4)]:J[K(0x197)]||J['configurable']))&&(J={'enumerable':!![],'get':function(){return N[c];}}),Object[K(0x1dd)](x,a,J);}:function(x,N,c,a){if(a===undefined)a=c;x[a]=N[c];}),__setModuleDefault=this&&this[a14j(0x199)]||(Object[a14j(0x206)]?function(x,N){const m=a14j;Object['defineProperty'](x,m(0x1f8),{'enumerable':!![],'value':N});}:function(x,N){const S=a14j;x[S(0x1f8)]=N;}),__importStar=this&&this[a14j(0x1fd)]||function(x){const W=a14j;if(x&&x[W(0x1b4)])return x;var N={};if(x!=null){for(var c in x)if(c!==W(0x1f8)&&Object['prototype'][W(0x1e4)][W(0x1a8)](x,c))__createBinding(N,x,c);}return __setModuleDefault(N,x),N;},__awaiter=this&&this[a14j(0x1a6)]||function(x,N,c,a){function J(p){return p instanceof c?p:new c(function(e){e(p);});}return new(c||(c=Promise))(function(p,e){const h=a14N;function s(M){const L=a14N;try{d(a[L(0x1a0)](M));}catch(A){e(A);}}function q(M){try{d(a['throw'](M));}catch(A){e(A);}}function d(M){const v=a14N;M['done']?p(M[v(0x1b0)]):J(M[v(0x1b0)])['then'](s,q);}d((a=a[h(0x192)](x,N||[]))[h(0x1a0)]());});},__importDefault=this&&this[a14j(0x1b1)]||function(x){return x&&x['__esModule']?x:{'default':x};};Object[a14j(0x1dd)](exports,'__esModule',{'value':!![]}),exports[a14j(0x1d5)]=void 0x0;function a14N(x,N){const c=a14x();return a14N=function(a,J){a=a-0x17d;let p=c[a];return p;},a14N(x,N);}const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a14j(0x1f3))),utils_1=require(a14j(0x1cd)),inquirer_helper_1=require(a14j(0x1ed)),os=__importStar(require('os')),lodash_1=require(a14j(0x1ab)),{EOL}=require('os');class CliPortForward{constructor(x){const B=a14j;this[B(0x18d)]=B(0x203),this['skipHostnamesText']=B(0x1c5),this[B(0x1d9)]=new js_client_1[(B(0x181))](x,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[B(0x191)]});const N=new inquirer_helper_1[(B(0x1e5))](this[B(0x1d9)]);this[B(0x1fc)]=(0x0,utils_1['getCommand'])()['name'](B(0x1c8))[B(0x1ff)](B(0x17d))[B(0x1ea)](B(0x1e9));const c=(0x0,utils_1[B(0x182)])(!![])[B(0x17f)]('all')['description']('Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project')['option'](B(0x1cb),'project\x20for\x20forwarding')['option'](B(0x1b7),this[B(0x18d)],![])[B(0x19c)](B(0x202),this[B(0x1a4)],![])[B(0x198)](({noDefaults:p,projectId:e,skipHostnames:s})=>__awaiter(this,void 0x0,void 0x0,function*(){const o=B;(0x0,utils_1['assertContextExisting'])(this[o(0x1d9)]);const q=this[o(0x1f0)](s),d=p?undefined:x['getCurrentProjectName'](),M=e||d||(yield N[o(0x186)]());try{const {services:A,addons:l}=yield q[o(0x1e8)]({'projectId':M},s);if(A[o(0x1da)]+l['length']<=0x0)(0x0,utils_1[o(0x1cc)])(o(0x19b)+chalk_1[o(0x1f8)]['bold'](M));else{const Z=A['filter'](P=>P[o(0x1da)]>0x0)[o(0x1da)],V=l['filter'](P=>P[o(0x1da)]>0x0)[o(0x1da)],g=o(0x1c4)+chalk_1['default']['bold'](M);console[o(0x1c0)](o(0x1e0)+chalk_1[o(0x1f8)]['green'][o(0x1c9)](Z+o(0x1a5))+o(0x18b)+chalk_1[o(0x1f8)][o(0x1fb)][o(0x1c9)](V+o(0x1e6))+g),console[o(0x1c0)](),console[o(0x1c0)](chalk_1['default']['bold']('Services:')),A['forEach'](P=>{const G=o;if(P[G(0x1da)]>=0x1&&!P[0x0][G(0x1d7)])this[G(0x1bb)](P,{'type':G(0x1d3),'name':P[0x0]['data']['id']},s);}),console[o(0x1c0)](chalk_1[o(0x1f8)][o(0x1c9)](o(0x201))),l[o(0x1be)](P=>{const E=o;if(P[E(0x1da)]>=0x1&&!P[0x0][E(0x1d7)])this[E(0x1bb)](P,{'type':E(0x19a),'name':P[0x0][E(0x1e7)]['id']},s);}),this['printHostsFileHint']([...A[o(0x1a9)](),...l[o(0x1a9)]()],s);}}catch(P){(0x0,utils_1[o(0x1d7)])('Failed:\x20'+P[o(0x1a7)]);}})),a=(0x0,utils_1[B(0x182)])(!![])[B(0x17f)]('service')[B(0x1ea)]('Port-forwarding\x20for\x20the\x20specified\x20service')[B(0x19c)](B(0x1cb),B(0x1d1))[B(0x19c)](B(0x1bf),'Service\x20to\x20forward')[B(0x19c)](B(0x1b7),this['noDefaultsText'],![])[B(0x19c)](B(0x202),this[B(0x1a4)],![])[B(0x198)](({noDefaults:p,projectId:e,serviceId:s,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const u=B;(0x0,utils_1[u(0x1b9)])(this[u(0x1d9)]);const d=this[u(0x1f0)](q),M=p?undefined:x['getCurrentProjectName'](),A=e||M||(yield N['askForProject']()),l=p?undefined:x[u(0x1d8)](),Z=s||l||(yield N[u(0x204)](A)());console[u(0x1c0)](u(0x17e)+chalk_1[u(0x1f8)][u(0x1c9)](Z)+u(0x1c4)+chalk_1[u(0x1f8)][u(0x1c9)](A));try{const V=yield d['forwardService']({'projectId':A,'serviceId':Z},q);this[u(0x1bb)](V,{'name':Z,'type':u(0x1d3)},q),this[u(0x1cf)](V,q);}catch(g){(0x0,utils_1[u(0x1d7)])(u(0x1f5)+g[u(0x1a7)]);}})),J=(0x0,utils_1[B(0x182)])(!![])[B(0x17f)](B(0x19a))[B(0x1ea)](B(0x1e2))[B(0x19c)](B(0x1cb),B(0x1d1))[B(0x19c)](B(0x1eb),'Addon\x20to\x20forward')[B(0x19c)](B(0x202),this['skipHostnamesText'],![])[B(0x198)](({noDefaults:p,projectId:e,addonId:s,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const X=B;(0x0,utils_1[X(0x1b9)])(this[X(0x1d9)]);const d=this[X(0x1f0)](q),M=p?undefined:x['getCurrentProjectName'](),A=e||M||(yield N[X(0x186)]()),l=s||(yield N[X(0x190)](A)());console[X(0x1c0)](X(0x1ba)+chalk_1['default'][X(0x1c9)](l)+'\x20in\x20project\x20'+chalk_1[X(0x1f8)][X(0x1c9)](A));try{const Z={'projectId':A,'addonId':l},V=yield d['forwardAddon'](Z,q);this[X(0x1bb)](V,{'name':l,'type':X(0x19a)},q),this[X(0x1cf)](V,q);}catch(g){(0x0,utils_1[X(0x1d7)])(X(0x1f5)+g[X(0x1a7)]);}}));this[B(0x1fc)]['addCommand'](c),this[B(0x1fc)][B(0x1b3)](a),this[B(0x1fc)][B(0x1b3)](J);}[a14j(0x1f0)](x=![]){const R=a14j,N=this[R(0x1d9)][R(0x1d2)];if(!x){const c=N['canExecuteWithHostnames']();if(c[R(0x1d7)])throw new Error(c['message']);}return N['on'](R(0x184),(a,J)=>{const t=R,p=chalk_1[t(0x1f8)][t(0x1c9)](J[t(0x1ad)]+'\x20\x27'+J['id']+'\x27'),e=J['hostnames']['length']>0x0;(0x0,utils_1[t(0x1cc)])(t(0x18e)+J['address']+':'+J[t(0x1df)]+t(0x1ce)+p),x&&e&&(0x0,utils_1[t(0x1cc)])(t(0x187));}),N['on']('connection-error',(a,J,p)=>{const f=R;(0x0,utils_1['warning'])(f(0x1f6)+J[f(0x1ae)]+':'+J[f(0x1df)]+f(0x19e)+(p===null||p===void 0x0?void 0x0:p['message'])+'\x22');}),process['on'](R(0x18c),()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=R;try{yield N['stop']();}catch(a){(0x0,utils_1[Y(0x1d7)])(Y(0x195)+a[Y(0x1a7)]);}finally{process['exit']();}})),N;}[a14j(0x1bb)](x,N,c=![]){const H=a14j,{type:a,name:J}=N;if(x[H(0x1da)]<=0x0){const q=H(0x1a2)+N['type']+H(0x1f4);(0x0,utils_1[H(0x1cc)])('\x20\x20\x20No\x20running\x20container\x20found\x20for\x20'+a+'\x20'+chalk_1[H(0x1f8)][H(0x1c9)](J)+'.\x20'+q);return;}const p=(0x0,lodash_1[H(0x1c1)])(x,H(0x1f1)),e=d=>'\x20('+(d[H(0x1ec)]?d[H(0x1ec)]+'\x20-\x20':'')+d['protocol']+')';function s(d,M=0x2){const D=H;if(!c){const A=d[D(0x180)]===D(0x1a1)?D(0x1c7):'';d[D(0x1b5)][D(0x1be)](l=>{const r=D;console[r(0x1c0)]((0x0,lodash_1['repeat'])('\x20',M)+'-\x20'+A+l+':'+d[r(0x1df)]);});}}Object[H(0x1ac)](p)[H(0x1be)](([d,M])=>{const i=H;var A,l;const Z='>\x20'+(0x0,lodash_1[i(0x1a3)])(a)+'\x20\x27'+chalk_1[i(0x1f8)][i(0x1bd)][i(0x1c9)](d)+'\x27';if(a===i(0x19a)){if(M[i(0x1da)]===0x1){const V=M[0x0];if(V[i(0x1d7)]){(0x0,utils_1['error'])(i(0x18a)+d+':\x20'+V[i(0x1d7)]['message']);return;}const g=V[i(0x1e7)],P=!c?'\x20'+chalk_1[i(0x1f8)][i(0x1fa)](i(0x1c3)+g[i(0x1b5)][i(0x1c6)](',')):'';(0x0,utils_1[i(0x188)])(Z+'\x20is\x20exposed\x20on\x20'+g[i(0x1ae)]+':'+g['port']+e(g)+P);}else{const n=(0x0,lodash_1[i(0x1c2)])(M,Q=>{const U=i;var k,b;return(b=(k=Q===null||Q===void 0x0?void 0x0:Q['data'])===null||k===void 0x0?void 0x0:k['hostnames'])===null||b===void 0x0?void 0x0:b[U(0x1c6)](',');})[i(0x1da)]>0x1;(0x0,utils_1['success'])(Z+i(0x1fe)+(n?i(0x189):'ports')+':'),M[i(0x1be)](Q=>{const y=i;if(Q['error']){(0x0,utils_1[y(0x1d7)])(y(0x18a)+d+':\x20'+Q['error']['message']);return;}const k=Q['data'],b=!c?',\x20hostname:\x20'+k[y(0x1b5)][y(0x1c6)](','):'';console[y(0x1c0)](y(0x1b2)+k[y(0x1ae)]+':'+k[y(0x1df)]+e(k)+b);});}}if(a===i(0x1d3)){if(M[i(0x1da)]===0x1){const Q=M[0x0];if(Q['error']){(0x0,utils_1['error'])(i(0x18a)+d+':\x20'+Q[i(0x1d7)][i(0x1a7)]);return;}const k=Q[i(0x1e7)],b=!c?i(0x18f):':',F=k[i(0x1ae)]+':'+k[i(0x1df)]+e(k);(0x0,utils_1[i(0x188)])(Z+'\x20is\x20exposed\x20on\x20'+F+b),s(k);}else(0x0,utils_1[i(0x188)])(Z+i(0x1f7)+((l=(A=M[0x0])===null||A===void 0x0?void 0x0:A['data'])===null||l===void 0x0?void 0x0:l[i(0x1ae)])+i(0x19f)),M[i(0x1be)](I=>{const C=i;if(I[C(0x1d7)]){(0x0,utils_1['error'])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+d+':\x20'+I[C(0x1d7)][C(0x1a7)]);return;}const z=I[C(0x1e7)];(0x0,utils_1[C(0x188)])('\x20\x20-\x20port\x20'+z['port']+e(z)),s(z,0x4);});}});}[a14j(0x1cf)](x,N=![]){const T=a14j;if(N){const c=x['flatMap'](M=>M[T(0x1e7)])[T(0x1ca)](M=>M!==undefined),a=(process===null||process===void 0x0?void 0x0:process[T(0x1f9)])==='win32',J=os[T(0x1f9)]()===T(0x1aa),p=a?'C:/Windows/System32/drivers/etc/hosts':T(0x1ee),e=chalk_1[T(0x1f8)][T(0x1c9)]('skipHostnames'),s=J?EOL+T(0x1de)+e+T(0x1bc):undefined;let q=T(0x1db)+e+'\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20'+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+p+'):';s!==undefined&&(0x0,utils_1[T(0x1cc)])(s!==null&&s!==void 0x0?s:'');(0x0,utils_1['warning'])(q);const d=c[T(0x193)](M=>M[T(0x1ae)]+T(0x183)+M[T(0x1b5)][T(0x1c6)]('\x20'));console[T(0x1c0)]((0x0,lodash_1[T(0x196)])(d)['join'](EOL)),console[T(0x1c0)]();}}}exports[a14j(0x1d5)]=CliPortForward;
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a16F=a16o;(function(e,o){const L=a16o,h=e();while(!![]){try{const p=-parseInt(L(0x15c))/0x1*(parseInt(L(0x15b))/0x2)+-parseInt(L(0x130))/0x3*(-parseInt(L(0x154))/0x4)+parseInt(L(0x165))/0x5+parseInt(L(0x131))/0x6*(parseInt(L(0x141))/0x7)+parseInt(L(0x166))/0x8*(parseInt(L(0x167))/0x9)+parseInt(L(0x13d))/0xa+-parseInt(L(0x128))/0xb;if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a16e,0x6c724));var __awaiter=this&&this[a16F(0x144)]||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const w=a16o;function v(Z){const W=a16o;try{I(p[W(0x15a)](Z));}catch(k){J(k);}}function s(Z){const N=a16o;try{I(p[N(0x14e)](Z));}catch(k){J(k);}}function I(Z){const g=a16o;Z[g(0x129)]?q(Z['value']):Y(Z[g(0x12c)])[g(0x152)](v,s);}I((p=p[w(0x160)](e,o||[]))[w(0x15a)]());});},__importDefault=this&&this['__importDefault']||function(e){const C=a16F;return e&&e[C(0x12a)]?e:{'default':e};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a16F(0x125)]=exports[a16F(0x13a)]=exports['assertContextExisting']=exports['isValidJSON']=exports[a16F(0x127)]=exports[a16F(0x169)]=exports[a16F(0x142)]=exports[a16F(0x12b)]=exports[a16F(0x157)]=exports[a16F(0x149)]=exports[a16F(0x145)]=exports[a16F(0x153)]=void 0x0;const node_fetch_1=__importDefault(require(a16F(0x132))),chalk_1=__importDefault(require(a16F(0x14c))),commander_1=require(a16F(0x135)),pgk=require(a16F(0x12f));exports[a16F(0x153)]=a16F(0x11f)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a16F(0x126)]);function checkUpdate(e){return __awaiter(this,void 0x0,void 0x0,function*(){const l=a16o;function o(h,p){const x=a16o,Y=new Date(Number(h));return Y[x(0x124)](Y['getDate']()+p),Y;}try{if(o(e[l(0x123)](),0x1)>new Date())return;const h=pgk['version'],{name:p}=pgk;if(!h)return;const Y=l(0x156)+p+l(0x14d),q=yield(0x0,node_fetch_1[l(0x13e)])(Y,{'method':l(0x133),'timeout':0x1388}),J=(yield q['json']())['version'];needsUpdate(h,J)&&warning(l(0x168)+h+',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20'+J+'.'+(l(0x14a)+p+l(0x146)+p+'\x27\x20**')),yield e[l(0x151)](new Date());}catch(v){}});}exports[a16F(0x145)]=checkUpdate;function needsUpdate(e,o){const b=a16F,h=/(\.0+)+$/,p=e[b(0x14b)](h,'')[b(0x12d)]('.'),Y=o['replace'](h,'')['split']('.');for(let q=0x0;q<Math['min'](p[b(0x143)],Y[b(0x143)]);q+=0x1){const J=parseInt(Y[q],0xa)-parseInt(p[q],0xa);if(J>0x0)return!![];if(J<0x0)return![];}return Y[b(0x143)]>p['length'];}function error(e){const a=a16F;console[a(0x149)](chalk_1[a(0x13e)]['redBright'](a(0x11e)+e));}exports[a16F(0x149)]=error;function warning(e){const z=a16F;console[z(0x149)](chalk_1[z(0x13e)][z(0x15f)](''+e));}exports[a16F(0x157)]=warning;function success(e){const H=a16F;console[H(0x13c)](chalk_1[H(0x13e)]['green'](''+e));}exports[a16F(0x12b)]=success;function getCommand(e=![]){const P=a16F,o=new commander_1[(P(0x163))]();return o[P(0x15d)](undefined,'Display\x20help\x20for\x20command'),o[P(0x139)](![]),o[P(0x150)](![]),o[P(0x15e)](![]),o[P(0x148)](![]),o[P(0x134)](!![]),e&&(o[P(0x136)](P(0x121),P(0x159),![]),o[P(0x136)](P(0x12e),'No\x20console\x20output',![]),o[P(0x136)]('--skipValidation',P(0x137),![])),o;}exports[a16F(0x142)]=getCommand;const retry=(e,o=0x32)=>h=>{let p=e;const Y=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield h();}catch(q){if(p<=0x0)throw q;return p-=0x1,yield new Promise(J=>setTimeout(()=>J(),o)),Y();}});return Y();};function a16o(e,o){const h=a16e();return a16o=function(p,Y){p=p-0x11e;let q=h[p];return q;},a16o(e,o);}exports[a16F(0x169)]=retry;const asyncSequential=(e,o)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const V=a16F,h=Promise[V(0x164)]([]);return e[V(0x14f)]((p,Y)=>p[V(0x152)](q=>o(Y)[V(0x152)](J=>{const u=V;return q[u(0x155)](J),q;})),h);});exports[a16F(0x127)]=asyncSequential;function a16e(){const d=['24iJVqRC','2258118DyvfeR','**\x20You\x27re\x20running\x20on\x20version\x20','retry','Failed:\x20','northflank-cli/','getCurrentToken','--verbose','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','getLastUpdateCheck','setDate','tsHint','version','asyncSequential','14850517nREaon','done','__esModule','success','value','split','--quiet','../package.json','48DeVGxj','66kMzafk','node-fetch','GET','enablePositionalOptions','commander','option','Do\x20not\x20validate\x20input\x20fields\x20on\x20client\x20side','isValidJSON','addHelpCommand','parseDateInput','assertContextExisting','log','4697560dhyzNr','default','setUTCSeconds','getCurrentBaseUrl','412447XoyIdq','getCommand','length','__awaiter','checkUpdate','\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20','Invalid\x20date\x20received:\x20','allowExcessArguments','error','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','replace','chalk','/latest','throw','reduce','storeOptionsAsProperties','setLastUpdateCheck','then','customUserAgent','138052mHogKE','push','https://registry.npmjs.org/','warning',',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)','Verbose\x20output','next','76puZJyl','20323iQEJGH','helpOption','allowUnknownOption','yellow','apply','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','getTime','Command','resolve','718580QOsHcH'];a16e=function(){return d;};return a16e();}function isValidJSON(o){try{return JSON['parse'](o);}catch(h){return![];}}exports[a16F(0x138)]=isValidJSON;function assertContextExisting(e){const c=a16F;if(e['contextProvider']['getCurrentContext']()===undefined)throw new Error('No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27');if(e['contextProvider'][c(0x140)]()===undefined)throw new Error(c(0x122));if(e['contextProvider'][c(0x120)]()===undefined)throw new Error(c(0x161));}exports[a16F(0x13b)]=assertContextExisting;const parseDateInput=o=>{const n=a16F;try{let h=new Date(o);if(isNaN(h['getTime']())){const p=o[n(0x143)]===0xd?o/0x3e8:o,Y=new Date(0x0);Y[n(0x13f)](p);if(isNaN(Y[n(0x162)]()))throw new Error();return Y;}return h;}catch(q){throw new Error(n(0x147)+o+n(0x158));}};exports['parseDateInput']=parseDateInput,exports['tsHint']='example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)';
1
+ 'use strict';const a15Z=a15N;(function(x,N){const l=a15N,c=x();while(!![]){try{const a=-parseInt(l(0xab))/0x1+-parseInt(l(0xce))/0x2+-parseInt(l(0xd8))/0x3+-parseInt(l(0xaf))/0x4+parseInt(l(0xef))/0x5*(-parseInt(l(0xd9))/0x6)+-parseInt(l(0xe1))/0x7+-parseInt(l(0xda))/0x8*(-parseInt(l(0xf2))/0x9);if(a===N)break;else c['push'](c['shift']());}catch(J){c['push'](c['shift']());}}}(a15x,0xf3b04));var __awaiter=this&&this[a15Z(0xb0)]||function(x,N,c,a){function J(p){return p instanceof c?p:new c(function(e){e(p);});}return new(c||(c=Promise))(function(p,e){const P=a15N;function s(M){const V=a15N;try{d(a[V(0xe9)](M));}catch(A){e(A);}}function q(M){try{d(a['throw'](M));}catch(A){e(A);}}function d(M){const g=a15N;M[g(0xc0)]?p(M[g(0xb1)]):J(M[g(0xb1)])['then'](s,q);}d((a=a[P(0xdf)](x,N||[]))['next']());});},__importDefault=this&&this['__importDefault']||function(x){const n=a15Z;return x&&x[n(0xd6)]?x:{'default':x};};Object[a15Z(0xb3)](exports,'__esModule',{'value':!![]}),exports[a15Z(0xbe)]=exports[a15Z(0xc3)]=exports[a15Z(0xdc)]=exports[a15Z(0xb2)]=exports['asyncSequential']=exports['retry']=exports[a15Z(0xe0)]=exports[a15Z(0xc9)]=exports['warning']=exports[a15Z(0xe7)]=exports[a15Z(0xad)]=exports['customUserAgent']=void 0x0;const node_fetch_1=__importDefault(require(a15Z(0xb6))),chalk_1=__importDefault(require(a15Z(0xc1))),commander_1=require(a15Z(0xdd)),pgk=require(a15Z(0xe5));exports[a15Z(0xcc)]=a15Z(0xbc)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a15Z(0xaa)]);function checkUpdate(x){return __awaiter(this,void 0x0,void 0x0,function*(){const k=a15N;function N(c,a){const Q=a15N,J=new Date(Number(c));return J['setDate'](J[Q(0xdb)]()+a),J;}try{if(N(x[k(0xbb)](),0x1)>new Date())return;const c=pgk[k(0xaa)],{name:a}=pgk;if(!c)return;const J=k(0xc2)+a+k(0xc5),p=yield(0x0,node_fetch_1['default'])(J,{'method':'GET','timeout':0x1388}),s=(yield p[k(0xd4)]())['version'];needsUpdate(c,s)&&warning(k(0xba)+c+k(0xcd)+s+'.'+('\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20'+a+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+a+'\x27\x20**')),yield x[k(0xb7)](new Date());}catch(q){}});}exports['checkUpdate']=checkUpdate;function needsUpdate(x,N){const b=a15Z,c=/(\.0+)+$/,a=x[b(0xe2)](c,'')[b(0xf1)]('.'),J=N[b(0xe2)](c,'')[b(0xf1)]('.');for(let p=0x0;p<Math[b(0xee)](a[b(0xd5)],J[b(0xd5)]);p+=0x1){const e=parseInt(J[p],0xa)-parseInt(a[p],0xa);if(e>0x0)return!![];if(e<0x0)return![];}return J[b(0xd5)]>a[b(0xd5)];}function error(x){const F=a15Z;console[F(0xe7)](chalk_1[F(0xf3)]['redBright']('Failed:\x20'+x));}exports['error']=error;function warning(x){const I=a15Z;console[I(0xe7)](chalk_1['default'][I(0xd7)](''+x));}function a15N(x,N){const c=a15x();return a15N=function(a,J){a=a-0xa7;let p=c[a];return p;},a15N(x,N);}exports[a15Z(0xa9)]=warning;function success(x){const z=a15Z;console[z(0xd1)](chalk_1[z(0xf3)][z(0xcb)](''+x));}exports['success']=success;function getCommand(x=![]){const w=a15Z,N=new commander_1[(w(0xb9))]();return N[w(0xa7)](undefined,w(0xb8)),N[w(0xeb)](![]),N[w(0xc6)](![]),N[w(0xa8)](![]),N['allowExcessArguments'](![]),N[w(0xd3)](!![]),x&&(N[w(0xc8)](w(0xca),w(0xf0),![]),N[w(0xc8)](w(0xec),w(0xac),![]),N[w(0xc8)](w(0xea),w(0xe6),![])),N;}exports[a15Z(0xe0)]=getCommand;const retry=(x,N=0x32)=>c=>{let a=x;const J=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield c();}catch(p){if(a<=0x0)throw p;return a-=0x1,yield new Promise(s=>setTimeout(()=>s(),N)),J();}});return J();};function a15x(){const L=['__awaiter','value','isValidJSON','defineProperty','getCurrentToken','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','node-fetch','setLastUpdateCheck','Display\x20help\x20for\x20command','Command','**\x20You\x27re\x20running\x20on\x20version\x20','getLastUpdateCheck','northflank-cli/','then','tsHint','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','done','chalk','https://registry.npmjs.org/','parseDateInput','Invalid\x20date\x20received:\x20','/latest','storeOptionsAsProperties','resolve','option','success','--verbose','green','customUserAgent',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','3882740SxKOTp','push','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','log','contextProvider','enablePositionalOptions','json','length','__esModule','yellow','4287540SQaYtI','6097272DBYSMj','43280RzHdAq','getDate','assertContextExisting','commander',',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)','apply','getCommand','9182040bnhxxY','replace','setUTCSeconds','parse','../package.json','Do\x20not\x20validate\x20input\x20fields\x20on\x20client\x20side','error','retry','next','--skipValidation','addHelpCommand','--quiet','asyncSequential','min','5kNSEwD','Verbose\x20output','split','14463wkLPQj','default','helpOption','allowUnknownOption','warning','version','1187515bEIFEx','No\x20console\x20output','checkUpdate','getTime','3238900ljTGDN'];a15x=function(){return L;};return a15x();}exports[a15Z(0xe8)]=retry;const asyncSequential=(x,N)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const j=a15Z,c=Promise[j(0xc7)]([]);return x['reduce']((a,J)=>a[j(0xbd)](p=>N(J)['then'](e=>{const K=j;return p[K(0xcf)](e),p;})),c);});exports[a15Z(0xed)]=asyncSequential;function isValidJSON(x){const m=a15Z;try{return JSON[m(0xe4)](x);}catch(N){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(x){const S=a15Z;if(x[S(0xd2)]['getCurrentContext']()===undefined)throw new Error(S(0xb5));if(x[S(0xd2)]['getCurrentBaseUrl']()===undefined)throw new Error(S(0xbf));if(x[S(0xd2)][S(0xb4)]()===undefined)throw new Error(S(0xd0));}exports[a15Z(0xdc)]=assertContextExisting;const parseDateInput=x=>{const W=a15Z;try{let N=new Date(x);if(isNaN(N[W(0xae)]())){const c=x[W(0xd5)]===0xd?x/0x3e8:x,a=new Date(0x0);a[W(0xe3)](c);if(isNaN(a['getTime']()))throw new Error();return a;}return N;}catch(J){throw new Error(W(0xc4)+x+W(0xde));}};exports[a15Z(0xc3)]=parseDateInput,exports[a15Z(0xbe)]='example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northflank/cli",
3
- "version": "0.9.21",
3
+ "version": "0.9.22",
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.21",
29
+ "@northflank/js-client": "0.7.22",
30
30
  "bufferutil": "^4.0.7",
31
31
  "chalk": "~4.1.0",
32
32
  "columnify": "^1.5.4",
@@ -1 +0,0 @@
1
- 'use strict';const a14F=a14o;(function(e,o){const L=a14o,h=e();while(!![]){try{const p=parseInt(L(0xf8))/0x1*(-parseInt(L(0x113))/0x2)+parseInt(L(0x110))/0x3+-parseInt(L(0xf1))/0x4+-parseInt(L(0xfb))/0x5*(-parseInt(L(0xef))/0x6)+parseInt(L(0x114))/0x7*(-parseInt(L(0xf0))/0x8)+-parseInt(L(0x10e))/0x9*(parseInt(L(0x10f))/0xa)+parseInt(L(0x10c))/0xb;if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a14e,0xa3e93));var __awaiter=this&&this[a14F(0xf7)]||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const g=a14o;function v(Z){const W=a14o;try{I(p[W(0x111)](Z));}catch(k){J(k);}}function s(Z){try{I(p['throw'](Z));}catch(k){J(k);}}function I(Z){const N=a14o;Z[N(0xfd)]?q(Z[N(0x10a)]):Y(Z[N(0x10a)])['then'](v,s);}I((p=p[g(0xff)](e,o||[]))['next']());});};function a14o(e,o){const h=a14e();return a14o=function(p,Y){p=p-0xef;let q=h[p];return q;},a14o(e,o);}Object[a14F(0xf3)](exports,a14F(0x105),{'value':!![]}),exports[a14F(0x100)]=void 0x0;function a14e(){const a=['__esModule','cursor','length','getNext','flat','value','keys','1540836HIfqIj','options','55953BZThMH','470rzYJmj','3933264HohTez','next','assign','10070sqBgtk','120302iPssjD','6xnByYr','8RzZDkM','1812004vKQzbP','call','defineProperty','payload','_currentOffset','parameters','__awaiter','181YvRoPY','push','map','4469680mLAmnW','count','done','endpoint','apply','PaginationHelper','data','hasNext','getAll','error'];a14e=function(){return a;};return a14e();}class PaginationHelper{constructor(e,o,h,p){const w=a14F;this['endpoint']=e,this[w(0xf6)]=o,this[w(0x10d)]=h,this[w(0xf4)]=p,this['cursor']=null,this[w(0xf5)]=0x0,this[w(0x102)]=()=>this[w(0x106)]!==undefined;}get['currentOffset'](){const C=a14F;return this[C(0xf5)];}[a14F(0x108)](){var e,o;return __awaiter(this,void 0x0,void 0x0,function*(){const x=a14o,{data:h,request:p,error:Y,pagination:q,rawResponse:J}=yield this[x(0xfe)][x(0xf2)]({'parameters':this['parameters'],'options':Object['assign'](Object[x(0x112)]({},this[x(0x10d)]),{'cursor':(e=this[x(0x106)])!==null&&e!==void 0x0?e:undefined}),'data':this[x(0xf4)]});return this[x(0x106)]=q===null||q===void 0x0?void 0x0:q['cursor'],this[x(0xf5)]+=(o=q===null||q===void 0x0?void 0x0:q[x(0xfc)])!==null&&o!==void 0x0?o:0x0,{'data':h,'request':p,'error':Y,'pagination':q,'rawResponse':J};});}[a14F(0x103)](){var e,o;return __awaiter(this,void 0x0,void 0x0,function*(){const l=a14o,h=[];while(this[l(0x102)]()){const p=yield this[l(0x108)]();if(p[l(0x104)])return p;h[l(0xf9)](p);}return{'data':h[l(0xfa)](Y=>{const b=l,q=Object[b(0x10b)](Y[b(0x101)]);if(q[b(0x107)]===0x1)return Y[b(0x101)][q[0x0]];return Y[b(0x101)];})[l(0x109)](),'request':(e=h[0x0])===null||e===void 0x0?void 0x0:e['request'],'rawResponse':(o=h[0x0])===null||o===void 0x0?void 0x0:o['rawResponse']};});}}exports[a14F(0x100)]=PaginationHelper;