@northflank/cli 0.9.20 → 0.9.21

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 a12b=a12J;(function(Z,J){const O=a12J,z=Z();while(!![]){try{const P=-parseInt(O(0x212))/0x1*(parseInt(O(0x1dc))/0x2)+parseInt(O(0x1ad))/0x3+parseInt(O(0x1ae))/0x4+-parseInt(O(0x1e1))/0x5+-parseInt(O(0x1b6))/0x6+parseInt(O(0x1ea))/0x7*(-parseInt(O(0x1ec))/0x8)+parseInt(O(0x1ac))/0x9;if(P===J)break;else z['push'](z['shift']());}catch(B){z['push'](z['shift']());}}}(a12Z,0x6e203));function a12Z(){const ZZ=['Metrics\x20for\x20','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','askForService','3456270EInUHl','askForProject','warning','clear','__importDefault','flat','\x20to\x20get\x20logs\x20from','Option','No\x20metrics\x20found\x20for\x20this\x20query','printInitInfo','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','getTime','__esModule','getPaddingDataEnd','metrics','getPaddingDataStart','jobId','choices','format','forEach','metricsApiClient','askForContainer','addon','printMetricsTable','askForJob','--noDefaults','bold','--endTime\x20<timestamp>','\x20in\x20project\x20','Fetching\x20data..','assertContextExisting','Build\x20to\x20get\x20logs\x20from','-t,\x20--metricTypes\x20<metricTypes...>','deploymentId','../formatting/terminal-chart','min','action',',\x20volume:\x20','111014SRWcwV','split','valueOf','time','message','861945yMgrZq','printMetricsSingle','job','ApiClient',',\x20duration:\x20','conflicts','values','default','flatMap','1108849fnAGVX','map','8zutPeT','metricsRange','argParser',',\x20metric\x20types:\x20','json','getStandardMetricsCommand','Deployment\x20id,\x20example:\x20my-service-54785f4','log','rows','error','--build\x20--buildId\x20[buildId]','noDefaults','metricsSingle','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','getCurrentServiceName','CliMetrics','N/A','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','refreshInterval','container\x20','keys','defineProperty','askForBuild','charAt','then','pct','\x20--','tsHint','details','Error\x20while\x20fetching\x20metrics\x20entries:\x20','stdout','serviceId','Get\x20metrics\x20before\x20this\x20timestamp,\x20','Get\x20metrics\x20for\x20the\x20specified\x20','../utils','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','apiClient','value','4wpOMpk','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','--deployment\x20--deploymentId\x20[deploymentId]','alias','parseDateInput','yaml','max','../formatting/console-format-helpers','next','commander','metric','Metrics\x20overview','build-','@northflank/js-client',',\x20from:\x20',',\x20to:\x20','all\x20containers','length','metadata','assign','service','../inquirer-helper','toISOString','push','--startTime\x20<timestamp>','askForAddon','option','columns','handleError','--duration\x20[duration]','--run\x20--runId\x20[runId]','buildId','data','runId','containerId','printMetricsGraph','--timestamp\x20[timestamp]','addOption','inquirerHelper','toFixed','join','exit','metricUnit','MetricType','stringify','customUserAgent','startTime','getMetricsCommand','askForJobRun','-o,\x20--output\x20[output]','metricId','toUpperCase','done','9268146uXhmWI','1281336nxleCN','492152BBWOuH','\x20of\x20','description','isNaN','toTimeString'];a12Z=function(){return ZZ;};return a12Z();}var __awaiter=this&&this['__awaiter']||function(Z,J,z,B){function U(s){return s instanceof z?s:new z(function(A){A(s);});}return new(z||(z=Promise))(function(s,A){const l=a12J;function n(v){const G=a12J;try{C(B[G(0x21a)](v));}catch(o){A(o);}}function F(v){try{C(B['throw'](v));}catch(o){A(o);}}function C(v){const K=a12J;v[K(0x1ab)]?s(v[K(0x211)]):U(v[K(0x211)])[K(0x204)](n,F);}C((B=B['apply'](Z,J||[]))[l(0x21a)]());});},__importDefault=this&&this[a12b(0x1ba)]||function(Z){const f=a12b;return Z&&Z[f(0x1c2)]?Z:{'default':Z};};Object[a12b(0x201)](exports,'__esModule',{'value':!![]}),exports[a12b(0x1fb)]=void 0x0;function a12J(Z,J){const z=a12Z();return a12J=function(P,B){P=P-0x18b;let U=z[P];return U;},a12J(Z,J);}const js_client_1=require(a12b(0x21f)),utils_1=require(a12b(0x20e)),inquirer_helper_1=require(a12b(0x18c)),commander_1=require(a12b(0x21b)),terminal_chart_1=require(a12b(0x1d8)),console_format_helpers_1=require(a12b(0x219)),chalk_1=__importDefault(require('chalk'));class CliMetrics{constructor(Z){const r=a12b;this['apiContext']=Z,this['refreshInterval']=0x2710,this[r(0x1f1)]=(J,z)=>{const w=r,P=(0x0,utils_1['getCommand'])(!![])['name']((z?w(0x21e):'')+w(0x1c4))[w(0x215)]((z?w(0x21e):'')+w(0x21c))[w(0x1b0)](w(0x20d)+J)[w(0x191)]('--project\x20--projectId\x20[NAME]','Project\x20for\x20logs')[w(0x191)]('--'+J+w(0x206)+J+'Id\x20[NAME]',J[w(0x203)](0x0)[w(0x1aa)]()+J['slice'](0x1)+w(0x1bc))[w(0x191)]('--container\x20--containerId\x20[NAME]',w(0x1fd))[w(0x191)](w(0x18f),'Get\x20metrics\x20after\x20this\x20timestamp,\x20'+utils_1[w(0x207)],utils_1[w(0x216)])[w(0x191)](w(0x1d1),w(0x20c)+utils_1['tsHint'],utils_1[w(0x216)])[w(0x191)](w(0x194),w(0x20f))[w(0x19c)](new commander_1[(w(0x1bd))]('-o,\x20--output\x20[output]','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[w(0x1c7)](Object[w(0x1e7)]([w(0x1c8),'json',w(0x217)])))[w(0x19c)](new commander_1[(w(0x1bd))](w(0x1d6),'Which\x20metric\x20type\x20to\x20fetch')[w(0x1c7)](Object[w(0x1e7)](js_client_1[w(0x1a2)])))[w(0x19c)](new commander_1[(w(0x1bd))](w(0x19b),'Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20'+utils_1[w(0x207)])[w(0x1ee)](utils_1[w(0x216)])[w(0x1e6)]([w(0x1a5),'endTime']))[w(0x191)](w(0x1cf),w(0x213),![])[w(0x19c)](new commander_1[(w(0x1bd))](w(0x1a8),w(0x1f9))['choices'](Object[w(0x1e7)]([w(0x1c8),w(0x1f0),w(0x217)])));if(z)P[w(0x191)](w(0x1f6),w(0x1d5));if(J===w(0x1e3))P[w(0x191)](w(0x195),w(0x1b4));if(J===w(0x18b))P[w(0x191)](w(0x214),w(0x1f2));return P;},this[r(0x19a)]=(J,z)=>{return P=>{const Q=a12J,B=Object[Q(0x200)](P)[Q(0x1e9)](U=>{const T=Q,{values:s,metricInfo:A}=P[U],{metricUnit:n,metricResolution:F}=A;return s[T(0x1eb)](C=>{const c=T;var v,o;const {metadata:j,data:V}=C,i=z?(z===null||z===void 0x0?void 0x0:z[c(0x1c1)]())>new Date()[c(0x1c1)]()?new Date():z:undefined,p=new Date((v=V===null||V===void 0x0?void 0x0:V[0x0])===null||v===void 0x0?void 0x0:v['ts']),S=new Date((o=V===null||V===void 0x0?void 0x0:V[V[c(0x223)]-0x1])===null||o===void 0x0?void 0x0:o['ts']),e=this[c(0x1c5)](J,p,F),g=this[c(0x1c3)](i,S,F),I=[...e,...V,...g],m=I[c(0x1eb)](X=>[new Date(X['ts'])[c(0x1de)](),Number(X[c(0x211)])])['filter'](X=>!Number[c(0x1b1)](X[0x0])),L=Math[c(0x1d9)](Math['max'](process[c(0x20a)][c(0x192)]-0xa,0xa),0x64),M=Math[c(0x1d9)](Math[c(0x218)](process[c(0x20a)][c(0x1f4)]-0x9,0xa),0xf),x=n===c(0x205)?0x64:undefined,d=n===c(0x205)?'%':n,k=(0x0,terminal_chart_1['downSampleData'])(m,L),N=k['map'](X=>X[0x1]),W={'min':0x0,'height':M,'max':x,'unit':d,'startTs':J!==null&&J!==void 0x0?J:p,'endTs':i!==null&&i!==void 0x0?i:S};return{'dataSeries':N,'metadata':j,'chartOpts':W,'metricInfo':A};});})[Q(0x1bb)]();if(B[Q(0x223)]===0x0)(0x0,utils_1[Q(0x1b8)])(Q(0x1be));else B[Q(0x1c9)](U=>{const t=Q,{dataSeries:s,metadata:A,chartOpts:n,metricInfo:F}=U,{containerId:C,volumeId:v}=A,o=v?t(0x1db)+v:'';console[t(0x1f3)](F[t(0x1a9)]+'\x20for\x20container:\x20'+chalk_1['default'][t(0x1d0)](C)+o),console[t(0x1f3)]((0x0,terminal_chart_1['getAsciiChart'])(s,n));});};},this[r(0x1cd)]=(J,z,P)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const R=r;try{const B=yield this[R(0x1ca)][R(0x1c4)][R(0x1f8)](J,z,P);console[R(0x1b9)]();if(B[R(0x1f5)])(0x0,utils_1[R(0x1f5)])(R(0x209)+B[R(0x1f5)]['message']);else this[R(0x1e2)](B[R(0x197)]);}catch(U){console[R(0x1b9)](),(0x0,utils_1[R(0x1f5)])('Error\x20while\x20fetching\x20metrics\x20entries:\x20'+U[R(0x1e0)]);}}),this[r(0x193)]=J=>{const h=r;if(J['error']){const z=JSON[h(0x1a3)](J[h(0x1f5)][h(0x208)]);throw new Error(h(0x209)+J['error'][h(0x1e0)]+'\x20'+z);}},this['printInitInfo']=(J,z,P,B,U)=>{const a=r;if(U===!![])return;const {metricTypes:s,endTime:A,startTime:n,duration:F,containerId:C}=B,v=n?a(0x220)+n[a(0x18d)]():'',o=A?a(0x221)+A[a(0x18d)]():'',j=F?a(0x1e5)+F+'\x20seconds':'',V=C?a(0x1ff)+chalk_1[a(0x1e8)][a(0x1d0)](C):a(0x222),i=J+'\x20'+chalk_1[a(0x1e8)]['bold'](z)+a(0x1d2)+chalk_1['default'][a(0x1d0)](P),p=''+v+o+j,S=s?a(0x1ef)+(s===null||s===void 0x0?void 0x0:s[a(0x19f)](',')):'';console[a(0x1f3)](a(0x1b3)+V+a(0x1af)+i+S+p);},this['apiClient']=new js_client_1[(r(0x1e4))](Z,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[r(0x1a4)]}),this[r(0x1ca)]=this[r(0x210)],this[r(0x19d)]=new inquirer_helper_1['InquirerHelper'](this[r(0x210)]);}[a12b(0x1a6)](Z,J=![]){const Z1=a12b,z=(A,n)=>__awaiter(this,void 0x0,void 0x0,function*(){const u=a12J,F=n[u(0x1f7)],{apiContext:C,inquirerHelper:v}=this;switch(Z){case u(0x18b):{const o=F?undefined:C[u(0x1fa)]();return n[u(0x20b)]||o||(yield v[u(0x1b5)](A)());}case u(0x1e3):{const j=F?undefined:C[u(0x1fa)]();return n[u(0x1c6)]||j||(yield v[u(0x1ce)](A)());}case u(0x1cc):{const V=F?undefined:C[u(0x1fa)]();return n['addonId']||V||(yield v[u(0x190)](A)());}}}),P=(A,n,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const H=a12J;if(J)return F[H(0x196)]||(yield this[H(0x19d)][H(0x202)](A,Z==='service'?n:undefined,Z==='job'?n:undefined,!![])());return undefined;}),B=(A,n,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a12J;if(!J&&F[Y(0x199)]!==undefined){if(F[Y(0x199)]!==!![])return F['containerId'];return yield this[Y(0x19d)][Y(0x1cb)](A,Z===Y(0x18b)?n:undefined,Z===Y(0x1e3)?n:undefined,!![])();}return undefined;}),U=(A,n,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const E=a12J;if(Z==='job')return F[E(0x198)]||(yield this[E(0x19d)][E(0x1a7)](n,A,!![])());return undefined;}),s=(A,n,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z0=a12J;if(Z===Z0(0x18b)){if(F[Z0(0x1d7)]!==!![])return F[Z0(0x1d7)];return F['deploymentId'];}return undefined;});return this['getStandardMetricsCommand'](Z,J)[Z1(0x1da)](A=>__awaiter(this,void 0x0,void 0x0,function*(){const Z2=Z1,{noDefaults:n,projectId:F,duration:C,timestamp:v,output:o,startTime:j,endTime:V,metricTypes:i,quiet:p}=A;(0x0,utils_1[Z2(0x1d4)])(this['apiClient']);if(j&&V&&C)throw new Error(Z2(0x1c0));const {apiContext:S,inquirerHelper:e,metricsApiClient:g}=this,I=n?undefined:S['getCurrentProjectName'](),m=F||I||(yield e[Z2(0x1b7)]()),L=yield z(m,A),M=yield P(m,L,A),x=yield U(m,L,A),d=yield s(m,L,A),k=yield B(m,L,A),N={'projectId':m,'entityId':L},W={'containerName':k,'startTime':j,'endTime':V,'duration':C,'timestamp':v,'metricTypes':i,'runId':x,'buildId':M,'deploymentId':d,'isBuild':J!==null&&J!==void 0x0?J:![]},X=!(j||V||C);if(!p&&o!==Z2(0x217)&&o!=='yml'&&o!=='json')this[Z2(0x1bf)](Z,L,m,W,p);if(X){if(o!==undefined){const D=yield g['metrics'][Z2(0x1f8)](N,W,Z);this[Z2(0x193)](D),(0x0,console_format_helpers_1['printResponse'])(o,D[Z2(0x197)]);}else[...Array(process[Z2(0x20a)][Z2(0x1f4)]-0x1)]['forEach']((q,y)=>y===0x0?console[Z2(0x1f3)](Z2(0x1d3)):console['log']()),yield this[Z2(0x1cd)](N,W,Z)(),setInterval(this[Z2(0x1cd)](N,W,Z),this[Z2(0x1fe)]),yield new Promise(q=>setTimeout(q,this[Z2(0x1fe)]*0x64));}else{const q=yield g['metrics'][Z2(0x1ed)](N,W,Z);this['handleError'](q),o!==undefined?(0x0,console_format_helpers_1['printResponse'])(o,q[Z2(0x197)]):this[Z2(0x19a)](j,V!==null&&V!==void 0x0?V:new Date())(q[Z2(0x197)]);}process[Z2(0x1a0)]();}));}[a12b(0x1e2)](Z){const Z5=a12b,J=(B,U)=>{const Z3=a12J;if(!(U===null||U===void 0x0?void 0x0:U[Z3(0x211)]))Z3(0x1fc);const s=B[Z3(0x1a1)]===Z3(0x205)?'%':B[Z3(0x1a1)];return''+Number(U===null||U===void 0x0?void 0x0:U[Z3(0x211)])[Z3(0x19e)](0x3)+s;},z=B=>{const Z4=a12J;if(!(B===null||B===void 0x0?void 0x0:B['ts']))'N/A';return B['ts'][Z4(0x1b2)]()[Z4(0x1dd)]('\x20')[0x0];},P={};Object[Z5(0x200)](Z)[Z5(0x1c9)](B=>{const Z6=Z5,{values:U,metricInfo:s}=Z[B];return U[Z6(0x1c9)](A=>{const Z7=Z6;var n,F;const C=A[Z7(0x224)][Z7(0x199)];Object[Z7(0x225)](P,{[C]:Object['assign'](Object[Z7(0x225)]({},P===null||P===void 0x0?void 0x0:P[C]),{[Z7(0x1df)]:z((n=A[Z7(0x197)])===null||n===void 0x0?void 0x0:n[0x0]),'containerId':C,[s[Z7(0x1a9)]]:J(s,(F=A['data'])===null||F===void 0x0?void 0x0:F[0x0])})});});}),(0x0,console_format_helpers_1['printAsTable'])(Object['values'](P),Z5(0x21d));}[a12b(0x1c5)](Z,J,z){const Z8=a12b,P=s=>new Date(s[Z8(0x1c1)]()-B),B=z*0x3e8;if(!Z)return[];if(!J)return[];if(P(J)['getTime']()<Z[Z8(0x1c1)]())return[];const U=[{'ts':P(J),'value':0x0}];while(P(U[U[Z8(0x223)]-0x1]['ts'])[Z8(0x1c1)]()<=Z[Z8(0x1c1)]()){U['unshift']({'ts':P(U[U[Z8(0x223)]-0x1]['ts']),'value':0x0});}return U;}['getPaddingDataEnd'](Z,J,z){const Z9=a12b,P=s=>new Date(s['getTime']()+B),B=z*0x3e8;if(!Z)return[];if(!J)return[];if(P(J)[Z9(0x1c1)]()>Z[Z9(0x1c1)]())return[];const U=[{'ts':P(J),'value':0x0}];while(P(U[U[Z9(0x223)]-0x1]['ts'])['getTime']()<=Z[Z9(0x1c1)]()){U[Z9(0x18e)]({'ts':P(U[U[Z9(0x223)]-0x1]['ts']),'value':0x0});}return U;}}exports['CliMetrics']=CliMetrics;
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 +1 @@
1
- 'use strict';function a13Z(){const d=['onDownKey','301632EnzNzP','map','choices','loading','__awaiter','default','loop','3182552VrpKmb','inquirer/lib/prompts/list','then','chalk','3mUxxHo','done','catch','throw','apply','5597240rpElLx','selected','length','italic','pagOpt','6872ZuUZgf','469IGthxM','render','4938276HctKxB','loadMore','opt','name','push','DynamicReloadPaginationPrompt','__importDefault','value','reloadText','handleDynamicPageLoad','defineProperty','21818196qntwFZ','realLength','dir\x20must\x20be\x20up\x20or\x20down','next','\x20Loading\x20more\x20options','down','690280tOeVyu','nextPageCursor'];a13Z=function(){return d;};return a13Z();}const a13V=a13J;function a13J(Z,J){const z=a13Z();return a13J=function(P,B){P=P-0xb5;let U=z[P];return U;},a13J(Z,J);}(function(Z,J){const j=a13J,z=Z();while(!![]){try{const P=-parseInt(j(0xb8))/0x1+parseInt(j(0xb5))/0x2*(-parseInt(j(0xc3))/0x3)+parseInt(j(0xbf))/0x4+-parseInt(j(0xc8))/0x5+-parseInt(j(0xd0))/0x6+parseInt(j(0xce))/0x7*(-parseInt(j(0xcd))/0x8)+parseInt(j(0xdb))/0x9;if(P===J)break;else z['push'](z['shift']());}catch(B){z['push'](z['shift']());}}}(a13Z,0x8be87));var __awaiter=this&&this[a13V(0xbc)]||function(Z,J,z,B){function U(s){return s instanceof z?s:new z(function(A){A(s);});}return new(z||(z=Promise))(function(s,A){const e=a13J;function n(v){const i=a13J;try{C(B[i(0xde)](v));}catch(o){A(o);}}function F(v){const p=a13J;try{C(B[p(0xc6)](v));}catch(o){A(o);}}function C(v){const S=a13J;v[S(0xc4)]?s(v[S(0xd7)]):U(v['value'])[S(0xc1)](n,F);}C((B=B[e(0xc7)](Z,J||[]))['next']());});},__importDefault=this&&this[a13V(0xd6)]||function(Z){return Z&&Z['__esModule']?Z:{'default':Z};};Object[a13V(0xda)](exports,'__esModule',{'value':!![]}),exports[a13V(0xd5)]=void 0x0;const list_1=__importDefault(require(a13V(0xc0))),choice_1=__importDefault(require('inquirer/lib/objects/choice')),chalk_1=__importDefault(require(a13V(0xc2)));function incrementListIndex(Z,J,z){const g=a13V,P=z['choices'][g(0xdc)],B=g(0xbe)in z?Boolean(z[g(0xbe)]):!![];if(J==='up'){if(Z>0x0)return Z-0x1;return B?P-0x1:Z;}if(J===g(0xe0)){if(Z<P-0x1)return Z+0x1;return B?0x0:Z;}throw new Error(g(0xdd));}class DynamicReloadPaginationPrompt extends list_1[a13V(0xbd)]{constructor(Z,J,z){const I=a13V;super(Z,J,z),this[I(0xd8)]=chalk_1[I(0xbd)][I(0xcb)]('..\x20Load\x20more\x20options\x20..'),this[I(0xbb)]=![],this[I(0xcc)]=this[I(0xd2)],this[I(0xb6)]=this[I(0xcc)]['nextPageCursor'],this[I(0xb6)]!==undefined&&this[I(0xd2)][I(0xba)][I(0xd4)](new choice_1[(I(0xbd))](this[I(0xd8)],this['reloadText']));}['onUpKey'](){const m=a13V;if(this[m(0xbb)])return;this[m(0xc9)]=incrementListIndex(this[m(0xc9)],'up',this[m(0xd2)]),this[m(0xcf)]();}[a13V(0xb7)](){return __awaiter(this,void 0x0,void 0x0,function*(){const L=a13J;if(this[L(0xbb)])return;this[L(0xc9)]=incrementListIndex(this[L(0xc9)],L(0xe0),this[L(0xd2)]),yield this[L(0xd9)](),this[L(0xcf)]();});}['handleDynamicPageLoad'](){return __awaiter(this,void 0x0,void 0x0,function*(){const M=a13J;if(this[M(0xc9)]>=this[M(0xd2)][M(0xba)][M(0xca)]-0x1){if(this[M(0xb6)]===undefined)return;this[M(0xbb)]=!![];let Z=0x0;const J=setInterval(()=>{const x=M,U=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],s=chalk_1['default'][x(0xcb)](U[Z%U[x(0xca)]]+x(0xdf));this[x(0xd2)][x(0xba)]['choices'][this[x(0xc9)]][x(0xd3)]=''+s,Z+=0x1,this['render']();},0x50),{elements:z,nextPageCursor:P}=yield this[M(0xcc)][M(0xd1)]({'nextPageCursor':this[M(0xb6)]})[M(0xc5)](()=>({'elements':[],'nextPageCursor':undefined}));this[M(0xb6)]=P;const B=z[M(0xb9)](U=>new choice_1[(M(0xbd))](U,U));this['opt'][M(0xba)][M(0xba)]['splice'](this[M(0xc9)],0x1),this[M(0xd2)]['choices'][M(0xd4)](...B),P!==undefined&&this[M(0xd2)][M(0xba)][M(0xd4)](new choice_1[(M(0xbd))](this[M(0xd8)],this[M(0xd8)])),clearInterval(J),this[M(0xbb)]=![];}});}}exports[a13V(0xd5)]=DynamicReloadPaginationPrompt;
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 +1 @@
1
- 'use strict';function a14Z(){const M=['getAll','714447usjyfb','request','cursor','next','getNext','150gYQhng','apply','map','assign','value','push','2035400aouIMB','keys','_currentOffset','count','call','flat','8489010mMYzMh','hasNext','88FCyTsM','__awaiter','error','6029PwdZkF','then','payload','PaginationHelper','42GULGNO','159279cRWOnI','rawResponse','parameters','currentOffset','756315XoKHuY','endpoint','throw','33649ZjLMzB','__esModule'];a14Z=function(){return M;};return a14Z();}const a14V=a14J;(function(Z,J){const j=a14J,z=Z();while(!![]){try{const P=-parseInt(j(0xd4))/0x1*(-parseInt(j(0xe8))/0x2)+-parseInt(j(0xd9))/0x3*(parseInt(j(0xd1))/0x4)+parseInt(j(0xdd))/0x5+parseInt(j(0xd8))/0x6*(-parseInt(j(0xe0))/0x7)+parseInt(j(0xc9))/0x8+parseInt(j(0xe3))/0x9+parseInt(j(0xcf))/0xa;if(P===J)break;else z['push'](z['shift']());}catch(B){z['push'](z['shift']());}}}(a14Z,0x8eb04));var __awaiter=this&&this[a14V(0xd2)]||function(Z,J,z,B){function U(s){return s instanceof z?s:new z(function(A){A(s);});}return new(z||(z=Promise))(function(s,A){const S=a14J;function n(v){try{C(B['next'](v));}catch(o){A(o);}}function F(v){const i=a14J;try{C(B[i(0xdf)](v));}catch(o){A(o);}}function C(v){const p=a14J;v['done']?s(v[p(0xec)]):U(v[p(0xec)])[p(0xd5)](n,F);}C((B=B[S(0xe9)](Z,J||[]))[S(0xe6)]());});};Object['defineProperty'](exports,a14V(0xe1),{'value':!![]}),exports[a14V(0xd7)]=void 0x0;function a14J(Z,J){const z=a14Z();return a14J=function(P,B){P=P-0xc9;let U=z[P];return U;},a14J(Z,J);}class PaginationHelper{constructor(Z,J,z,P){const e=a14V;this[e(0xde)]=Z,this[e(0xdb)]=J,this['options']=z,this[e(0xd6)]=P,this[e(0xe5)]=null,this['_currentOffset']=0x0,this[e(0xd0)]=()=>this['cursor']!==undefined;}get[a14V(0xdc)](){const g=a14V;return this[g(0xcb)];}[a14V(0xe7)](){var Z,J;return __awaiter(this,void 0x0,void 0x0,function*(){const I=a14J,{data:z,request:P,error:B,pagination:U,rawResponse:s}=yield this[I(0xde)][I(0xcd)]({'parameters':this['parameters'],'options':Object[I(0xeb)](Object[I(0xeb)]({},this['options']),{'cursor':(Z=this[I(0xe5)])!==null&&Z!==void 0x0?Z:undefined}),'data':this['payload']});return this['cursor']=U===null||U===void 0x0?void 0x0:U[I(0xe5)],this['_currentOffset']+=(J=U===null||U===void 0x0?void 0x0:U[I(0xcc)])!==null&&J!==void 0x0?J:0x0,{'data':z,'request':P,'error':B,'pagination':U,'rawResponse':s};});}[a14V(0xe2)](){var Z,J;return __awaiter(this,void 0x0,void 0x0,function*(){const m=a14J,z=[];while(this[m(0xd0)]()){const P=yield this[m(0xe7)]();if(P[m(0xd3)])return P;z[m(0xed)](P);}return{'data':z[m(0xea)](B=>{const L=m,U=Object[L(0xca)](B['data']);if(U['length']===0x1)return B['data'][U[0x0]];return B['data'];})[m(0xce)](),'request':(Z=z[0x0])===null||Z===void 0x0?void 0x0:Z[m(0xe4)],'rawResponse':(J=z[0x0])===null||J===void 0x0?void 0x0:J[m(0xda)]};});}}exports[a14V(0xd7)]=PaginationHelper;
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;
@@ -1 +1 @@
1
- 'use strict';const a15d=a15J;(function(Z,J){const x=a15J,z=Z();while(!![]){try{const P=parseInt(x(0x20d))/0x1+parseInt(x(0x235))/0x2+-parseInt(x(0x279))/0x3*(parseInt(x(0x205))/0x4)+parseInt(x(0x263))/0x5*(-parseInt(x(0x25f))/0x6)+-parseInt(x(0x22a))/0x7+parseInt(x(0x21a))/0x8*(parseInt(x(0x1ed))/0x9)+-parseInt(x(0x254))/0xa*(-parseInt(x(0x200))/0xb);if(P===J)break;else z['push'](z['shift']());}catch(B){z['push'](z['shift']());}}}(a15Z,0x7a1fb));var __createBinding=this&&this[a15d(0x26d)]||(Object[a15d(0x21e)]?function(Z,J,z,P){const k=a15d;if(P===undefined)P=z;var B=Object['getOwnPropertyDescriptor'](J,z);(!B||('get'in B?!J[k(0x21d)]:B[k(0x249)]||B[k(0x240)]))&&(B={'enumerable':!![],'get':function(){return J[z];}}),Object['defineProperty'](Z,P,B);}:function(Z,J,z,P){if(P===undefined)P=z;Z[P]=J[z];}),__setModuleDefault=this&&this[a15d(0x241)]||(Object[a15d(0x21e)]?function(Z,J){const N=a15d;Object[N(0x204)](Z,N(0x265),{'enumerable':!![],'value':J});}:function(Z,J){Z['default']=J;}),__importStar=this&&this[a15d(0x248)]||function(Z){const W=a15d;if(Z&&Z[W(0x21d)])return Z;var J={};if(Z!=null){for(var z in Z)if(z!==W(0x265)&&Object[W(0x24f)][W(0x246)][W(0x24a)](Z,z))__createBinding(J,Z,z);}return __setModuleDefault(J,Z),J;},__awaiter=this&&this[a15d(0x276)]||function(Z,J,z,B){function U(s){return s instanceof z?s:new z(function(A){A(s);});}return new(z||(z=Promise))(function(s,A){const q=a15J;function n(v){const X=a15J;try{C(B[X(0x252)](v));}catch(o){A(o);}}function F(v){try{C(B['throw'](v));}catch(o){A(o);}}function C(v){const D=a15J;v[D(0x264)]?s(v[D(0x259)]):U(v[D(0x259)])['then'](n,F);}C((B=B[q(0x221)](Z,J||[]))[q(0x252)]());});},__importDefault=this&&this[a15d(0x23d)]||function(Z){const y=a15d;return Z&&Z[y(0x21d)]?Z:{'default':Z};};Object['defineProperty'](exports,a15d(0x21d),{'value':!![]}),exports[a15d(0x25c)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a15d(0x1f3))),utils_1=require('../utils'),inquirer_helper_1=require(a15d(0x25b)),os=__importStar(require('os')),lodash_1=require(a15d(0x1f6)),{EOL}=require('os');class CliPortForward{constructor(Z){const O=a15d;this[O(0x24e)]=O(0x27c),this['skipHostnamesText']=O(0x250),this[O(0x262)]=new js_client_1[(O(0x260))](Z,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[O(0x23f)]});const J=new inquirer_helper_1['InquirerHelper'](this[O(0x262)]);this[O(0x230)]=(0x0,utils_1[O(0x242)])()['name'](O(0x1f1))[O(0x223)](O(0x274))['description'](O(0x202));const z=(0x0,utils_1[O(0x242)])(!![])[O(0x253)](O(0x210))[O(0x23c)](O(0x27a))[O(0x261)](O(0x1fa),O(0x27d))[O(0x261)](O(0x227),this[O(0x24e)],![])[O(0x261)]('--skipHostnames',this['skipHostnamesText'],![])[O(0x278)](({noDefaults:U,projectId:s,skipHostnames:A})=>__awaiter(this,void 0x0,void 0x0,function*(){const G=O;(0x0,utils_1[G(0x20f)])(this['apiClient']);const n=this[G(0x1f0)](A),F=U?undefined:Z[G(0x207)](),C=s||F||(yield J[G(0x269)]());try{const {services:v,addons:o}=yield n[G(0x268)]({'projectId':C},A);if(v[G(0x1f8)]+o['length']<=0x0)(0x0,utils_1['warning'])(G(0x23b)+chalk_1[G(0x265)]['bold'](C));else{const j=v[G(0x272)](p=>p['length']>0x0)[G(0x1f8)],V=o[G(0x272)](p=>p['length']>0x0)[G(0x1f8)],i=G(0x1fe)+chalk_1[G(0x265)][G(0x243)](C);console[G(0x20c)](G(0x217)+chalk_1[G(0x265)][G(0x233)][G(0x243)](j+G(0x23e))+G(0x26c)+chalk_1[G(0x265)][G(0x233)][G(0x243)](V+G(0x208))+i),console[G(0x20c)](),console['log'](chalk_1['default'][G(0x243)](G(0x206))),v[G(0x24d)](S=>{const K=G;if(S[K(0x1f8)]>=0x1&&!S[0x0][K(0x1f2)])this[K(0x258)](S,{'type':K(0x20a),'name':S[0x0][K(0x247)]['id']},A);}),console[G(0x20c)](chalk_1[G(0x265)][G(0x243)](G(0x275))),o[G(0x24d)](S=>{const l=G;if(S[l(0x1f8)]>=0x1&&!S[0x0][l(0x1f2)])this['printForwardingInfo'](S,{'type':l(0x21f),'name':S[0x0]['data']['id']},A);}),this[G(0x27e)]([...v['flat'](),...o[G(0x234)]()],A);}}catch(p){(0x0,utils_1['error'])(G(0x222)+p['message']);}})),P=(0x0,utils_1[O(0x242)])(!![])['name'](O(0x20a))[O(0x23c)](O(0x25a))['option'](O(0x1fa),O(0x218))[O(0x261)](O(0x22e),'Service\x20to\x20forward')[O(0x261)](O(0x227),this[O(0x24e)],![])[O(0x261)]('--skipHostnames',this['skipHostnamesText'],![])[O(0x278)](({noDefaults:U,projectId:s,serviceId:A,skipHostnames:n})=>__awaiter(this,void 0x0,void 0x0,function*(){const b=O;(0x0,utils_1[b(0x20f)])(this[b(0x262)]);const F=this['getProxyForwarder'](n),C=U?undefined:Z[b(0x207)](),v=s||C||(yield J[b(0x269)]()),o=U?undefined:Z[b(0x239)](),j=A||o||(yield J[b(0x251)](v)());console['log'](b(0x1fc)+chalk_1[b(0x265)][b(0x243)](j)+'\x20in\x20project\x20'+chalk_1[b(0x265)][b(0x243)](v));try{const V=yield F[b(0x1ec)]({'projectId':v,'serviceId':j},n);this[b(0x258)](V,{'name':j,'type':b(0x20a)},n),this['printHostsFileHint'](V,n);}catch(i){(0x0,utils_1[b(0x1f2)])(b(0x222)+i[b(0x201)]);}})),B=(0x0,utils_1[O(0x242)])(!![])[O(0x253)](O(0x21f))[O(0x23c)](O(0x256))[O(0x261)](O(0x1fa),O(0x218))[O(0x261)](O(0x214),'Addon\x20to\x20forward')['option'](O(0x277),this[O(0x1f4)],![])[O(0x278)](({noDefaults:U,projectId:s,addonId:A,skipHostnames:n})=>__awaiter(this,void 0x0,void 0x0,function*(){const f=O;(0x0,utils_1['assertContextExisting'])(this['apiClient']);const F=this[f(0x1f0)](n),C=U?undefined:Z[f(0x207)](),v=s||C||(yield J['askForProject']()),o=A||(yield J[f(0x1fb)](v)());console['log'](f(0x25e)+chalk_1['default']['bold'](o)+'\x20in\x20project\x20'+chalk_1[f(0x265)][f(0x243)](v));try{const j={'projectId':v,'addonId':o},V=yield F[f(0x24b)](j,n);this['printForwardingInfo'](V,{'name':o,'type':'addon'},n),this[f(0x27e)](V,n);}catch(i){(0x0,utils_1['error'])(f(0x222)+i[f(0x201)]);}}));this[O(0x230)][O(0x255)](z),this[O(0x230)][O(0x255)](P),this[O(0x230)][O(0x255)](B);}[a15d(0x1f0)](Z=![]){const r=a15d,J=this[r(0x262)][r(0x21b)];if(!Z){const z=J['canExecuteWithHostnames']();if(z['error'])throw new Error(z[r(0x201)]);}return J['on'](r(0x228),(P,B)=>{const w=r,U=chalk_1['default']['bold'](B[w(0x216)]+'\x20\x27'+B['id']+'\x27'),s=B[w(0x26f)]['length']>0x0;(0x0,utils_1['warning'])(w(0x26b)+B[w(0x238)]+':'+B['port']+'\x20to\x20'+U),Z&&s&&(0x0,utils_1['warning'])(w(0x1f7));}),J['on'](r(0x21c),(P,B,U)=>{const Q=r;(0x0,utils_1['warning'])(Q(0x22d)+B[Q(0x238)]+':'+B[Q(0x266)]+Q(0x26e)+(U===null||U===void 0x0?void 0x0:U[Q(0x201)])+'\x22');}),process['on'](r(0x27b),()=>__awaiter(this,void 0x0,void 0x0,function*(){const T=r;try{yield J[T(0x271)]();}catch(P){(0x0,utils_1['error'])(T(0x20b)+P[T(0x201)]);}finally{process['exit']();}})),J;}[a15d(0x258)](Z,J,z=![]){const c=a15d,{type:P,name:B}=J;if(Z['length']<=0x0){const n='Please\x20ensure\x20the\x20'+J['type']+'\x20is\x20running\x20and\x20reachable.';(0x0,utils_1[c(0x1fd)])('\x20\x20\x20No\x20running\x20container\x20found\x20for\x20'+P+'\x20'+chalk_1[c(0x265)][c(0x243)](B)+'.\x20'+n);return;}const U=(0x0,lodash_1[c(0x224)])(Z,c(0x225)),s=F=>'\x20('+(F['portName']?F[c(0x226)]+c(0x22b):'')+F[c(0x245)]+')';function A(F,C=0x2){const t=c;if(!z){const v=F[t(0x245)]===t(0x209)?t(0x1f5):'';F['hostnames']['forEach'](o=>{const R=t;console['log']((0x0,lodash_1[R(0x231)])('\x20',C)+'-\x20'+v+o+':'+F[R(0x266)]);});}}Object[c(0x229)](U)[c(0x24d)](([F,C])=>{const h=c;var v,o;const j='>\x20'+(0x0,lodash_1[h(0x1ee)])(P)+'\x20\x27'+chalk_1[h(0x265)][h(0x211)][h(0x243)](F)+'\x27';if(P==='addon'){if(C[h(0x1f8)]===0x1){const V=C[0x0];if(V[h(0x1f2)]){(0x0,utils_1[h(0x1f2)])(h(0x220)+F+':\x20'+V['error'][h(0x201)]);return;}const i=V[h(0x247)],p=!z?'\x20'+chalk_1['default'][h(0x215)](h(0x244)+i[h(0x26f)]['join'](',')):'';(0x0,utils_1[h(0x203)])(j+h(0x257)+i[h(0x238)]+':'+i['port']+s(i)+p);}else{const S=(0x0,lodash_1[h(0x1ff)])(C,e=>{const a=h;var g,I;return(I=(g=e===null||e===void 0x0?void 0x0:e[a(0x247)])===null||g===void 0x0?void 0x0:g[a(0x26f)])===null||I===void 0x0?void 0x0:I[a(0x270)](',');})[h(0x1f8)]>0x1;(0x0,utils_1[h(0x203)])(j+h(0x267)+(S?h(0x25d):h(0x237))+':'),C[h(0x24d)](e=>{const u=h;if(e[u(0x1f2)]){(0x0,utils_1[u(0x1f2)])(u(0x220)+F+':\x20'+e['error'][u(0x201)]);return;}const g=e[u(0x247)],I=!z?',\x20hostname:\x20'+g[u(0x26f)][u(0x270)](','):'';console['log']('\x20\x20-\x20Address:\x20'+g['address']+':'+g['port']+s(g)+I);});}}if(P===h(0x20a)){if(C[h(0x1f8)]===0x1){const e=C[0x0];if(e[h(0x1f2)]){(0x0,utils_1[h(0x1f2)])(h(0x220)+F+':\x20'+e['error'][h(0x201)]);return;}const g=e[h(0x247)],I=!z?h(0x213):':',m=g[h(0x238)]+':'+g['port']+s(g);(0x0,utils_1[h(0x203)])(j+h(0x257)+m+I),A(g);}else(0x0,utils_1['success'])(j+h(0x257)+((o=(v=C[0x0])===null||v===void 0x0?void 0x0:v['data'])===null||o===void 0x0?void 0x0:o[h(0x238)])+h(0x26a)),C['forEach'](L=>{const H=h;if(L[H(0x1f2)]){(0x0,utils_1[H(0x1f2)])(H(0x220)+F+':\x20'+L['error'][H(0x201)]);return;}const M=L[H(0x247)];(0x0,utils_1[H(0x203)])(H(0x232)+M[H(0x266)]+s(M)),A(M,0x4);});}});}['printHostsFileHint'](Z,J=![]){const Y=a15d;if(J){const z=Z['flatMap'](C=>C[Y(0x247)])[Y(0x272)](C=>C!==undefined),P=(process===null||process===void 0x0?void 0x0:process['platform'])===Y(0x23a),B=os[Y(0x1eb)]()===Y(0x22c),U=P?Y(0x22f):Y(0x236),s=chalk_1[Y(0x265)][Y(0x243)](Y(0x273)),A=B?EOL+Y(0x1f9)+s+Y(0x212):undefined;let n=Y(0x24c)+s+Y(0x20e)+Y(0x277)+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+U+'):';A!==undefined&&(0x0,utils_1['warning'])(A!==null&&A!==void 0x0?A:'');(0x0,utils_1[Y(0x1fd)])(n);const F=z['map'](C=>C[Y(0x238)]+Y(0x219)+C[Y(0x26f)][Y(0x270)]('\x20'));console[Y(0x20c)]((0x0,lodash_1[Y(0x1ef)])(F)[Y(0x270)](EOL)),console[Y(0x20c)]();}}}exports[a15d(0x25c)]=CliPortForward;function a15J(Z,J){const z=a15Z();return a15J=function(P,B){P=P-0x1eb;let U=z[P];return U;},a15J(Z,J);}function a15Z(){const E=['description','__importDefault','\x20service\x20ports','customUserAgent','configurable','__setModuleDefault','getCommand','bold','with\x20hostname:\x20','protocol','hasOwnProperty','data','__importStar','writable','call','forwardAddon','Running\x20in\x20','forEach','noDefaultsText','prototype','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','askForService','next','name','10bMniSG','addCommand','Port-forwarding\x20for\x20the\x20specified\x20addon','\x20is\x20exposed\x20on\x20','printForwardingInfo','value','Port-forwarding\x20for\x20the\x20specified\x20service','../inquirer-helper','CliPortForward','hosts','Forwarding\x20addon\x20','72qxhGYK','ApiClient','option','apiClient','357165WRPpxA','done','default','port','\x20is\x20exposed\x20with\x20multiple\x20','forwardProject','askForProject','\x20with\x20multiple\x20ports:','Stop\x20forwarding\x20traffic\x20from\x20','\x20and\x20','__createBinding','\x27:\x20\x22','hostnames','join','stop','filter','skipHostnames','fwd','Addons:','__awaiter','--skipHostnames','action','319359NwJYwT','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','SIGINT','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','project\x20for\x20forwarding','printHostsFileHint','platform','forwardService','63KDMKpn','capitalize','uniq','getProxyForwarder','forward','error','chalk','skipHostnamesText','http://','lodash','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','length','Running\x20on\x20macOS\x20in\x20','--project\x20--projectId\x20[NAME]','askForAddon','Forwarding\x20service\x20','warning','\x20in\x20project\x20','uniqBy','6374533hxRmjP','message','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','success','defineProperty','4QOoUaq','Services:','getCurrentProjectName','\x20addon\x20ports','HTTP','service','Cleaning\x20up\x20open\x20connections\x20failed:\x20','log','182425mPLcmT','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','assertContextExisting','all','greenBright','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','\x20with\x20these\x20hostnames:','--addon\x20--addonId\x20[NAME]','reset','type','Forwarding\x20','Project\x20for\x20forwarding','\x20\x20\x20\x20\x20\x20\x20\x20\x20','616328qLUznu','forwarding','connection-error','__esModule','create','addon','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','apply','Failed:\x20','alias','groupBy','data.id','portName','--noDefaults','tunnel-close','entries','4806886onbRgc','\x20-\x20','darwin','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','--service\x20--serviceId\x20[NAME]','C:/Windows/System32/drivers/etc/hosts','portFwdCmd','repeat','\x20\x20-\x20port\x20','green','flat','1698702gKoIPa','/etc/hosts','ports','address','getCurrentServiceName','win32','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20'];a15Z=function(){return E;};return a15Z();}
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;
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a16V=a16J;(function(Z,J){const j=a16J,z=Z();while(!![]){try{const P=-parseInt(j(0x1e6))/0x1*(parseInt(j(0x1ea))/0x2)+-parseInt(j(0x1f6))/0x3*(parseInt(j(0x215))/0x4)+parseInt(j(0x21b))/0x5+parseInt(j(0x214))/0x6+parseInt(j(0x205))/0x7*(parseInt(j(0x21a))/0x8)+-parseInt(j(0x1f0))/0x9+parseInt(j(0x208))/0xa*(parseInt(j(0x213))/0xb);if(P===J)break;else z['push'](z['shift']());}catch(B){z['push'](z['shift']());}}}(a16Z,0x830a5));var __awaiter=this&&this[a16V(0x218)]||function(Z,J,z,B){function U(s){return s instanceof z?s:new z(function(A){A(s);});}return new(z||(z=Promise))(function(s,A){const S=a16J;function n(v){try{C(B['next'](v));}catch(o){A(o);}}function F(v){const i=a16J;try{C(B[i(0x207)](v));}catch(o){A(o);}}function C(v){const p=a16J;v[p(0x1e3)]?s(v[p(0x209)]):U(v[p(0x209)])[p(0x21d)](n,F);}C((B=B[S(0x1dd)](Z,J||[]))[S(0x220)]());});},__importDefault=this&&this[a16V(0x20a)]||function(Z){const e=a16V;return Z&&Z[e(0x210)]?Z:{'default':Z};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a16V(0x21f)]=exports['parseDateInput']=exports['assertContextExisting']=exports[a16V(0x1fd)]=exports[a16V(0x1f3)]=exports['retry']=exports[a16V(0x219)]=exports[a16V(0x20b)]=exports['warning']=exports[a16V(0x20e)]=exports[a16V(0x221)]=exports['customUserAgent']=void 0x0;function a16J(Z,J){const z=a16Z();return a16J=function(P,B){P=P-0x1d7;let U=z[P];return U;},a16J(Z,J);}const node_fetch_1=__importDefault(require('node-fetch')),chalk_1=__importDefault(require(a16V(0x222))),commander_1=require(a16V(0x1ed)),pgk=require(a16V(0x1e0));exports[a16V(0x1e9)]='northflank-cli/'+(pgk===null||pgk===void 0x0?void 0x0:pgk[a16V(0x20f)]);function checkUpdate(Z){return __awaiter(this,void 0x0,void 0x0,function*(){const I=a16J;function J(z,P){const g=a16J,B=new Date(Number(z));return B['setDate'](B[g(0x1f1)]()+P),B;}try{if(J(Z[I(0x1f9)](),0x1)>new Date())return;const z=pgk[I(0x20f)],{name:P}=pgk;if(!z)return;const B=I(0x212)+P+I(0x211),U=yield(0x0,node_fetch_1['default'])(B,{'method':I(0x1d8),'timeout':0x1388}),s=(yield U['json']())['version'];needsUpdate(z,s)&&warning(I(0x217)+z+I(0x1d7)+s+'.'+(I(0x1e8)+P+I(0x1e5)+P+I(0x1f7))),yield Z['setLastUpdateCheck'](new Date());}catch(A){}});}exports[a16V(0x221)]=checkUpdate;function needsUpdate(Z,J){const m=a16V,z=/(\.0+)+$/,P=Z[m(0x1f8)](z,'')[m(0x216)]('.'),B=J[m(0x1f8)](z,'')[m(0x216)]('.');for(let U=0x0;U<Math[m(0x1ef)](P[m(0x1e1)],B[m(0x1e1)]);U+=0x1){const s=parseInt(B[U],0xa)-parseInt(P[U],0xa);if(s>0x0)return!![];if(s<0x0)return![];}return B['length']>P['length'];}function error(Z){const L=a16V;console[L(0x20e)](chalk_1[L(0x1fa)]['redBright'](L(0x1df)+Z));}exports[a16V(0x20e)]=error;function warning(Z){const M=a16V;console[M(0x20e)](chalk_1[M(0x1fa)][M(0x1d9)](''+Z));}exports[a16V(0x1e2)]=warning;function success(Z){const x=a16V;console[x(0x1fc)](chalk_1[x(0x1fa)]['green'](''+Z));}exports[a16V(0x20b)]=success;function getCommand(Z=![]){const d=a16V,J=new commander_1[(d(0x1ec))]();return J[d(0x1ee)](undefined,'Display\x20help\x20for\x20command'),J[d(0x20c)](![]),J[d(0x21e)](![]),J['allowUnknownOption'](![]),J[d(0x204)](![]),J[d(0x1e7)](!![]),Z&&(J[d(0x1fe)](d(0x1f5),'Verbose\x20output',![]),J[d(0x1fe)]('--quiet','No\x20console\x20output',![]),J['option'](d(0x201),d(0x21c),![])),J;}exports['getCommand']=getCommand;const retry=(Z,J=0x32)=>z=>{let P=Z;const B=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield z();}catch(U){if(P<=0x0)throw U;return P-=0x1,yield new Promise(s=>setTimeout(()=>s(),J)),B();}});return B();};exports[a16V(0x1e4)]=retry;const asyncSequential=(Z,J)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const k=a16V,z=Promise['resolve']([]);return Z[k(0x203)]((P,B)=>P[k(0x21d)](U=>J(B)[k(0x21d)](s=>{const N=k;return U[N(0x1fb)](s),U;})),z);});exports[a16V(0x1f3)]=asyncSequential;function isValidJSON(Z){const W=a16V;try{return JSON[W(0x206)](Z);}catch(J){return![];}}exports[a16V(0x1fd)]=isValidJSON;function a16Z(){const q=['split','**\x20You\x27re\x20running\x20on\x20version\x20','__awaiter','getCommand','7064thcApI','2335910XVyjii','Do\x20not\x20validate\x20input\x20fields\x20on\x20client\x20side','then','storeOptionsAsProperties','tsHint','next','checkUpdate','chalk',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','GET','yellow','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','getCurrentToken','contextProvider','apply','getTime','Failed:\x20','../package.json','length','warning','done','retry','\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20','13WElmSe','enablePositionalOptions','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','customUserAgent','54298ShwqzK','setUTCSeconds','Command','commander','helpOption','min','187290DDZTvi','getDate','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','asyncSequential','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','--verbose','105ERsTfE','\x27\x20**','replace','getLastUpdateCheck','default','push','log','isValidJSON','option','example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)','Invalid\x20date\x20received:\x20','--skipValidation','getCurrentBaseUrl','reduce','allowExcessArguments','1652QINUUj','parse','throw','40uKJIzg','value','__importDefault','success','addHelpCommand','assertContextExisting','error','version','__esModule','/latest','https://registry.npmjs.org/','280885dSoWix','1631208HtDZxv','15896iVsDAH'];a16Z=function(){return q;};return a16Z();}function assertContextExisting(Z){const X=a16V;if(Z[X(0x1dc)]['getCurrentContext']()===undefined)throw new Error(X(0x1da));if(Z[X(0x1dc)][X(0x202)]()===undefined)throw new Error(X(0x1f2));if(Z[X(0x1dc)][X(0x1db)]()===undefined)throw new Error(X(0x1f4));}exports[a16V(0x20d)]=assertContextExisting;const parseDateInput=Z=>{const D=a16V;try{let J=new Date(Z);if(isNaN(J[D(0x1de)]())){const z=Z[D(0x1e1)]===0xd?Z/0x3e8:Z,P=new Date(0x0);P[D(0x1eb)](z);if(isNaN(P[D(0x1de)]()))throw new Error();return P;}return J;}catch(B){throw new Error(D(0x200)+Z+',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)');}};exports['parseDateInput']=parseDateInput,exports[a16V(0x21f)]=a16V(0x1ff);
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)';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northflank/cli",
3
- "version": "0.9.20",
3
+ "version": "0.9.21",
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.19",
29
+ "@northflank/js-client": "0.7.21",
30
30
  "bufferutil": "^4.0.7",
31
31
  "chalk": "~4.1.0",
32
32
  "columnify": "^1.5.4",