@northflank/cli 0.9.11 → 0.9.13
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.
- package/dist/api-helpers.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/contextCommands.js +1 -1
- package/dist/defaults.js +1 -1
- package/dist/exec/index.js +1 -1
- package/dist/formatting/command-overview.js +1 -1
- package/dist/formatting/console-format-helpers.js +1 -1
- package/dist/formatting/terminal-chart.js +1 -1
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/logs/index.js +1 -1
- package/dist/logs/log-formatter.js +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/pagination/inquirer-pagination-prompt.js +1 -1
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
package/dist/metrics/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a12M=a12h;function a12h(w,h){const G=a12w();return a12h=function(P,v){P=P-0x14c;let O=G[P];return O;},a12h(w,h);}(function(w,h){const C=a12h,G=w();while(!![]){try{const P=-parseInt(C(0x151))/0x1*(-parseInt(C(0x17f))/0x2)+-parseInt(C(0x14c))/0x3*(-parseInt(C(0x155))/0x4)+parseInt(C(0x1a9))/0x5*(-parseInt(C(0x1cf))/0x6)+parseInt(C(0x164))/0x7*(-parseInt(C(0x190))/0x8)+parseInt(C(0x1a5))/0x9*(parseInt(C(0x15a))/0xa)+-parseInt(C(0x170))/0xb+parseInt(C(0x177))/0xc*(parseInt(C(0x1d8))/0xd);if(P===h)break;else G['push'](G['shift']());}catch(v){G['push'](G['shift']());}}}(a12w,0x77b49));var __awaiter=this&&this[a12M(0x1db)]||function(w,h,G,v){function O(Z){return Z instanceof G?Z:new G(function(a){a(Z);});}return new(G||(G=Promise))(function(Z,a){const c=a12h;function l(A){const Q=a12h;try{U(v[Q(0x192)](A));}catch(D){a(D);}}function B(A){const H=a12h;try{U(v[H(0x1ca)](A));}catch(D){a(D);}}function U(A){const n=a12h;A[n(0x1c8)]?Z(A[n(0x1c5)]):O(A[n(0x1c5)])[n(0x1a2)](l,B);}U((v=v[c(0x19c)](w,h||[]))['next']());});},__importDefault=this&&this[a12M(0x1a1)]||function(w){const r=a12M;return w&&w[r(0x1ad)]?w:{'default':w};};function a12w(){const w8=['default','length','CliMetrics','getCurrentServiceName','yml','470634OhGdRM','Which\x20metric\x20type\x20to\x20fetch','forEach','values','--run\x20--runId\x20[runId]','metricUnit','toTimeString','askForBuild','name','--timestamp\x20[timestamp]','InquirerHelper','metricsApiClient','pct','downSampleData','Id\x20[NAME]','message','split','19232XNjLAe','Project\x20for\x20logs','next','containerId','N/A','valueOf','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','getPaddingDataStart','-o,\x20--output\x20[output]','keys','Fetching\x20data..','addon','apply','rows','assign','--endTime\x20<timestamp>','defineProperty','__importDefault','then','printResponse','commander','1089bPSIqM','bold','job','warning','65qEPJOP','--build\x20--buildId\x20[buildId]','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','time','__esModule',',\x20duration:\x20','yaml','service','format','getStandardMetricsCommand','map','MetricType','askForContainer','startTime','choices','toISOString','getCommand','stringify','json','getPaddingDataEnd','option','slice','charAt',',\x20from:\x20','min','filter','action','customUserAgent','value','../formatting/console-format-helpers','-t,\x20--metricTypes\x20<metricTypes...>','done','--noDefaults','throw','askForAddon','join','jobId','\x20of\x20','261810XMgWbA','build-','push','metricsSingle','endTime','addOption','\x20seconds','Error\x20while\x20fetching\x20metrics\x20entries:\x20','Metrics\x20for\x20','689qXRERq','unshift','printAsTable','__awaiter','max','askForService','apiContext','getTime','flatMap','Get\x20metrics\x20after\x20this\x20timestamp,\x20','513096NcOtWA','serviceId','exit','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','apiClient','1GgQXba','printMetricsSingle','data','alias','4dnxCPp','toUpperCase','metrics','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','noDefaults','24740wTHiZb','addonId','\x20--','stdout','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','metricsRange','log','container\x20','tsHint','all\x20containers','497LtBkhL','Get\x20metrics\x20before\x20this\x20timestamp,\x20',',\x20metric\x20types:\x20','parseDateInput','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','metricId','--container\x20--containerId\x20[NAME]','error','details','\x20for\x20container:\x20','No\x20metrics\x20found\x20for\x20this\x20query','inquirerHelper','5416994mRdEat','description','flat','\x20in\x20project\x20','handleError','Build\x20to\x20get\x20logs\x20from','getMetricsCommand','229812wUTAuj','refreshInterval','Option'];a12w=function(){return w8;};return a12w();}Object[a12M(0x1a0)](exports,a12M(0x1ad),{'value':!![]}),exports[a12M(0x17c)]=void 0x0;const js_client_1=require('@northflank/js-client'),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),commander_1=require(a12M(0x1a4)),terminal_chart_1=require('../formatting/terminal-chart'),console_format_helpers_1=require(a12M(0x1c6)),chalk_1=__importDefault(require('chalk'));class CliMetrics{constructor(w){const j=a12M;this[j(0x1de)]=w,this[j(0x178)]=0x2710,this['getStandardMetricsCommand']=(h,G)=>{const m=j,P=(0x0,utils_1[m(0x1b9)])(!![])[m(0x187)]((G?m(0x1d0):'')+m(0x157))[m(0x154)]((G?m(0x1d0):'')+'metric')[m(0x171)]('Get\x20metrics\x20for\x20the\x20specified\x20'+h)['option']('--project\x20--projectId\x20[NAME]',m(0x191))[m(0x1bd)]('--'+h+m(0x15c)+h+m(0x18d),h[m(0x1bf)](0x0)[m(0x156)]()+h[m(0x1be)](0x1)+'\x20to\x20get\x20logs\x20from')[m(0x1bd)](m(0x16a),m(0x158))[m(0x1bd)]('--startTime\x20<timestamp>',m(0x1e1)+utils_1[m(0x162)],utils_1['parseDateInput'])[m(0x1bd)](m(0x19f),m(0x165)+utils_1['tsHint'],utils_1[m(0x167)])[m(0x1bd)]('--duration\x20[duration]',m(0x15e))[m(0x1d4)](new commander_1['Option'](m(0x198),m(0x14f))[m(0x1b7)](Object[m(0x182)]([m(0x1b1),m(0x1bb),m(0x1af)])))[m(0x1d4)](new commander_1['Option'](m(0x1c7),m(0x180))[m(0x1b7)](Object[m(0x182)](js_client_1[m(0x1b4)])))[m(0x1d4)](new commander_1[(m(0x179))](m(0x188),m(0x168)+utils_1['tsHint'])['argParser'](utils_1[m(0x167)])['conflicts']([m(0x1b6),m(0x1d3)]))[m(0x1bd)](m(0x1c9),m(0x196),![])[m(0x1d4)](new commander_1['Option']('-o,\x20--output\x20[output]',m(0x14f))['choices'](Object[m(0x182)]([m(0x1b1),m(0x1bb),m(0x1af)])));if(G)P['option'](m(0x1aa),m(0x175));if(h===m(0x1a7))P[m(0x1bd)](m(0x183),m(0x1ab));return P;},this['printMetricsGraph']=(h,G)=>{return P=>{const y=a12h,v=Object[y(0x199)](P)[y(0x1e0)](O=>{const E=y,{values:Z,metricInfo:a}=P[O],{metricUnit:l,metricResolution:B}=a;return Z[E(0x1b3)](U=>{const K=E;var A,D;const {metadata:p,data:s}=U,W=G?(G===null||G===void 0x0?void 0x0:G['getTime']())>new Date()[K(0x1df)]()?new Date():G:undefined,X=new Date((A=s===null||s===void 0x0?void 0x0:s[0x0])===null||A===void 0x0?void 0x0:A['ts']),T=new Date((D=s===null||s===void 0x0?void 0x0:s[s[K(0x17b)]-0x1])===null||D===void 0x0?void 0x0:D['ts']),I=this[K(0x197)](h,X,B),k=this[K(0x1bc)](W,T,B),Y=[...I,...s,...k],x=Y[K(0x1b3)](S=>[new Date(S['ts'])[K(0x195)](),Number(S[K(0x1c5)])])[K(0x1c2)](S=>!Number['isNaN'](S[0x0])),b=Math[K(0x1c1)](Math[K(0x1dc)](process[K(0x15d)]['columns']-0xa,0xa),0x64),q=Math[K(0x1c1)](Math['max'](process['stdout'][K(0x19d)]-0x9,0xa),0xf),f=l===K(0x18b)?0x64:undefined,e=l==='pct'?'%':l,i=(0x0,terminal_chart_1[K(0x18c)])(x,b),u=i['map'](S=>S[0x1]),t={'min':0x0,'height':q,'max':f,'unit':e,'startTs':h!==null&&h!==void 0x0?h:X,'endTs':W!==null&&W!==void 0x0?W:T};return{'dataSeries':u,'metadata':p,'chartOpts':t,'metricInfo':a};});})[y(0x172)]();if(v[y(0x17b)]===0x0)(0x0,utils_1[y(0x1a8)])(y(0x16e));else v[y(0x181)](O=>{const g=y,{dataSeries:Z,metadata:a,chartOpts:l,metricInfo:B}=O,{containerId:U,volumeId:A}=a,D=A?',\x20volume:\x20'+A:'';console[g(0x160)](B['metricId']+g(0x16d)+chalk_1[g(0x17a)][g(0x1a6)](U)+D),console[g(0x160)]((0x0,terminal_chart_1['getAsciiChart'])(Z,l));});};},this['printMetricsTable']=(h,G,P)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=j;try{const v=yield this[J(0x18a)][J(0x157)][J(0x1d2)](h,G,P);console['clear']();if(v[J(0x16b)])(0x0,utils_1[J(0x16b)])(J(0x1d6)+v['error'][J(0x18e)]);else this[J(0x152)](v[J(0x153)]);}catch(O){console['clear'](),(0x0,utils_1[J(0x16b)])(J(0x1d6)+O[J(0x18e)]);}}),this[j(0x174)]=h=>{const R=j;if(h[R(0x16b)]){const G=JSON[R(0x1ba)](h[R(0x16b)][R(0x16c)]);throw new Error(R(0x1d6)+h['error'][R(0x18e)]+'\x20'+G);}},this['printInitInfo']=(h,G,P,v,O)=>{const N=j;if(O===!![])return;const {metricTypes:Z,endTime:a,startTime:l,duration:B,containerId:U}=v,A=l?N(0x1c0)+l[N(0x1b8)]():'',D=a?',\x20to:\x20'+a[N(0x1b8)]():'',p=B?N(0x1ae)+B+N(0x1d5):'',s=U?N(0x161)+chalk_1[N(0x17a)]['bold'](U):N(0x163),W=h+'\x20'+chalk_1[N(0x17a)][N(0x1a6)](G)+N(0x173)+chalk_1['default'][N(0x1a6)](P),X=''+A+D+p,T=Z?N(0x166)+(Z===null||Z===void 0x0?void 0x0:Z[N(0x1cc)](',')):'';console[N(0x160)](N(0x1d7)+s+N(0x1ce)+W+T+X);},this['apiClient']=new js_client_1['ApiClient'](w,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[j(0x1c4)]}),this[j(0x18a)]=this['apiClient'],this[j(0x16f)]=new inquirer_helper_1[(j(0x189))](this[j(0x150)]);}[a12M(0x176)](w,h=![]){const d=a12M,G=(Z,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const z=a12h,l=a[z(0x159)],{apiContext:B,inquirerHelper:U}=this;switch(w){case z(0x1b0):{const A=l?undefined:B[z(0x17d)]();return a[z(0x14d)]||A||(yield U[z(0x1dd)](Z)());}case'job':{const D=l?undefined:B[z(0x17d)]();return a[z(0x1cd)]||D||(yield U['askForJob'](Z)());}case z(0x19b):{const p=l?undefined:B[z(0x17d)]();return a[z(0x15b)]||p||(yield U[z(0x1cb)](Z)());}}}),P=(Z,a,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const F=a12h;if(h)return l['buildId']||(yield this[F(0x16f)][F(0x186)](Z,w===F(0x1b0)?a:undefined,w===F(0x1a7)?a:undefined,!![])());return undefined;}),v=(Z,a,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const o=a12h;if(!h&&l[o(0x193)]!==undefined){if(l[o(0x193)]!==!![])return l[o(0x193)];return yield this['inquirerHelper'][o(0x1b5)](Z,w==='service'?a:undefined,w===o(0x1a7)?a:undefined,!![])();}return undefined;}),O=(Z,a,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const L=a12h;if(w===L(0x1a7))return l['runId']||(yield this[L(0x16f)]['askForJobRun'](a,Z,!![])());return undefined;});return this[d(0x1b2)](w,h)[d(0x1c3)](Z=>__awaiter(this,void 0x0,void 0x0,function*(){const w0=d,{noDefaults:a,projectId:l,duration:B,timestamp:U,output:A,startTime:D,endTime:p,metricTypes:s,quiet:W}=Z;(0x0,utils_1['assertContextExisting'])(this['apiClient']);if(D&&p&&B)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const {apiContext:X,inquirerHelper:T,metricsApiClient:I}=this,k=a?undefined:X['getCurrentProjectName'](),Y=l||k||(yield T['askForProject']()),x=yield G(Y,Z),b=yield P(Y,x,Z),q=yield O(Y,x,Z),f=yield v(Y,x,Z),e={'projectId':Y,'entityId':x},i={'containerName':f,'startTime':D,'endTime':p,'duration':B,'timestamp':U,'metricTypes':s,'runId':q,'buildId':b,'isBuild':h!==null&&h!==void 0x0?h:![]},u=!(D||p||B);if(!W&&A!==w0(0x1af)&&A!==w0(0x17e)&&A!==w0(0x1bb))this['printInitInfo'](w,x,Y,i,W);if(u){if(A!==undefined){const t=yield I[w0(0x157)][w0(0x1d2)](e,i,w);this[w0(0x174)](t),(0x0,console_format_helpers_1[w0(0x1a3)])(A,t[w0(0x153)]);}else[...Array(process[w0(0x15d)]['rows']-0x1)][w0(0x181)]((S,V)=>V===0x0?console[w0(0x160)](w0(0x19a)):console['log']()),yield this['printMetricsTable'](e,i,w)(),setInterval(this['printMetricsTable'](e,i,w),this[w0(0x178)]),yield new Promise(S=>setTimeout(S,this[w0(0x178)]*0x64));}else{const S=yield I['metrics'][w0(0x15f)](e,i,w);this[w0(0x174)](S),A!==undefined?(0x0,console_format_helpers_1[w0(0x1a3)])(A,S['data']):this['printMetricsGraph'](D,p!==null&&p!==void 0x0?p:new Date())(S[w0(0x153)]);}process[w0(0x14e)]();}));}['printMetricsSingle'](w){const w3=a12M,h=(O,Z)=>{const w1=a12h;if(!(Z===null||Z===void 0x0?void 0x0:Z[w1(0x1c5)]))w1(0x194);const a=O['metricUnit']===w1(0x18b)?'%':O[w1(0x184)];return''+Number(Z===null||Z===void 0x0?void 0x0:Z['value'])['toFixed'](0x3)+a;},G=O=>{const w2=a12h;if(!(O===null||O===void 0x0?void 0x0:O['ts']))w2(0x194);return O['ts'][w2(0x185)]()[w2(0x18f)]('\x20')[0x0];},P={};Object['keys'](w)[w3(0x181)](v=>{const w4=w3,{values:O,metricInfo:Z}=w[v];return O[w4(0x181)](a=>{const w5=w4;var l,B;const U=a['metadata'][w5(0x193)];Object['assign'](P,{[U]:Object[w5(0x19e)](Object[w5(0x19e)]({},P===null||P===void 0x0?void 0x0:P[U]),{[w5(0x1ac)]:G((l=a[w5(0x153)])===null||l===void 0x0?void 0x0:l[0x0]),'containerId':U,[Z[w5(0x169)]]:h(Z,(B=a['data'])===null||B===void 0x0?void 0x0:B[0x0])})});});}),(0x0,console_format_helpers_1[w3(0x1da)])(Object[w3(0x182)](P),'Metrics\x20overview');}[a12M(0x197)](w,h,G){const w6=a12M,P=Z=>new Date(Z[w6(0x1df)]()-v),v=G*0x3e8;if(!w)return[];if(!h)return[];if(P(h)[w6(0x1df)]()<w[w6(0x1df)]())return[];const O=[{'ts':P(h),'value':0x0}];while(P(O[O[w6(0x17b)]-0x1]['ts'])[w6(0x1df)]()<=w['getTime']()){O[w6(0x1d9)]({'ts':P(O[O['length']-0x1]['ts']),'value':0x0});}return O;}['getPaddingDataEnd'](w,h,G){const w7=a12M,P=Z=>new Date(Z[w7(0x1df)]()+v),v=G*0x3e8;if(!w)return[];if(!h)return[];if(P(h)[w7(0x1df)]()>w['getTime']())return[];const O=[{'ts':P(h),'value':0x0}];while(P(O[O[w7(0x17b)]-0x1]['ts'])[w7(0x1df)]()<=w[w7(0x1df)]()){O[w7(0x1d1)]({'ts':P(O[O[w7(0x17b)]-0x1]['ts']),'value':0x0});}return O;}}exports['CliMetrics']=CliMetrics;
|
|
1
|
+
'use strict';const a12r=a12I;(function(A,I){const p=a12I,a=A();while(!![]){try{const d=-parseInt(p(0x119))/0x1+parseInt(p(0xc4))/0x2*(-parseInt(p(0xc3))/0x3)+-parseInt(p(0x13c))/0x4+parseInt(p(0x13a))/0x5+parseInt(p(0x10f))/0x6+parseInt(p(0xc8))/0x7+parseInt(p(0xdb))/0x8;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a12A,0x55499));function a12I(A,I){const a=a12A();return a12I=function(d,s){d=d-0xb8;let T=a[d];return T;},a12I(A,I);}var __awaiter=this&&this[a12r(0x132)]||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const Z=a12I;function g(f){const H=a12I;try{L(d[H(0xfb)](f));}catch(t){V(t);}}function u(f){const P=a12I;try{L(d[P(0xf7)](f));}catch(t){V(t);}}function L(f){const R=a12I;f[R(0xde)]?T(f[R(0xd2)]):s(f[R(0xd2)])[R(0x128)](g,u);}L((d=d['apply'](A,I||[]))[Z(0xfb)]());});},__importDefault=this&&this['__importDefault']||function(A){return A&&A['__esModule']?A:{'default':A};};Object[a12r(0x137)](exports,a12r(0x11c),{'value':!![]}),exports[a12r(0xe7)]=void 0x0;function a12A(){const A6=['../formatting/console-format-helpers','metricsApiClient','getAsciiChart','@northflank/js-client','--container\x20--containerId\x20[NAME]','-o,\x20--output\x20[output]','commander','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','-t,\x20--metricTypes\x20<metricTypes...>','bold','printResponse','format','ApiClient',',\x20to:\x20','3iKwASI','1278518xTjRgV','message','option','error','4613497LXsXdm','parseDateInput',',\x20volume:\x20','min','getCommand','metricsSingle','askForContainer','yml','serviceId','toUpperCase','value','\x20in\x20project\x20','printInitInfo','json','No\x20metrics\x20found\x20for\x20this\x20query','columns','pct','Which\x20metric\x20type\x20to\x20fetch','inquirerHelper','6274384mxVfca','metrics','getStandardMetricsCommand','done','../inquirer-helper','--build\x20--buildId\x20[buildId]','Option','name','printAsTable','split','assign','Get\x20metrics\x20for\x20the\x20specified\x20','CliMetrics','data','job','metricUnit','N/A','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','\x20of\x20','valueOf','askForAddon','apiContext','\x20--','forEach','description','refreshInterval','keys','metricId','throw','slice','map','printMetricsSingle','next','addOption','yaml','getPaddingDataStart','join','Build\x20to\x20get\x20logs\x20from','Error\x20while\x20fetching\x20metrics\x20entries:\x20','toTimeString','Get\x20metrics\x20before\x20this\x20timestamp,\x20','MetricType','stdout','action','metadata','tsHint','max',',\x20duration:\x20','buildId','getCurrentServiceName','alias','\x20seconds','3253296xdwyZR','InquirerHelper','all\x20containers','getPaddingDataEnd','flat','--endTime\x20<timestamp>','charAt','warning','--timestamp\x20[timestamp]','--project\x20--projectId\x20[NAME]','502389qpYcqW','values','stringify','__esModule','--startTime\x20<timestamp>','printMetricsTable','getCurrentProjectName','containerId','noDefaults','askForJobRun','printMetricsGraph','askForJob','handleError','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','askForProject','then','rows','log','addonId','build-','askForBuild','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','default','Metrics\x20overview','toISOString','__awaiter',',\x20metric\x20types:\x20','\x20for\x20container:\x20',',\x20from:\x20','getTime','defineProperty','flatMap','apiClient','940560oDNGbk','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','2730848pEeaEZ','length','service','choices','clear','\x20to\x20get\x20logs\x20from'];a12A=function(){return A6;};return a12A();}const js_client_1=require(a12r(0xb8)),utils_1=require('../utils'),inquirer_helper_1=require(a12r(0xdf)),commander_1=require(a12r(0xbb)),terminal_chart_1=require('../formatting/terminal-chart'),console_format_helpers_1=require(a12r(0x142)),chalk_1=__importDefault(require('chalk'));class CliMetrics{constructor(A){const B=a12r;this[B(0xf0)]=A,this[B(0xf4)]=0x2710,this[B(0xdd)]=(I,a)=>{const E=B,d=(0x0,utils_1[E(0xcc)])(!![])[E(0xe2)]((a?E(0x12c):'')+E(0xdc))[E(0x10d)]((a?E(0x12c):'')+'metric')[E(0xf3)](E(0xe6)+I)[E(0xc6)](E(0x118),'Project\x20for\x20logs')[E(0xc6)]('--'+I+E(0xf1)+I+'Id\x20[NAME]',I[E(0x115)](0x0)[E(0xd1)]()+I[E(0xf8)](0x1)+E(0x141))[E(0xc6)](E(0xb9),E(0x12e))[E(0xc6)](E(0x11d),'Get\x20metrics\x20after\x20this\x20timestamp,\x20'+utils_1[E(0x108)],utils_1[E(0xc9)])['option'](E(0x114),E(0x103)+utils_1[E(0x108)],utils_1['parseDateInput'])[E(0xc6)]('--duration\x20[duration]','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set')[E(0xfc)](new commander_1[(E(0xe1))]('-o,\x20--output\x20[output]','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')['choices'](Object['values']([E(0xc0),'json',E(0xfd)])))['addOption'](new commander_1[(E(0xe1))](E(0xbd),E(0xd9))[E(0x13f)](Object['values'](js_client_1[E(0x104)])))[E(0xfc)](new commander_1['Option'](E(0x117),E(0xec)+utils_1[E(0x108)])['argParser'](utils_1['parseDateInput'])['conflicts'](['startTime','endTime']))[E(0xc6)]('--noDefaults',E(0x13b),![])[E(0xfc)](new commander_1[(E(0xe1))](E(0xba),'Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[E(0x13f)](Object[E(0x11a)]([E(0xc0),E(0xd5),E(0xfd)])));if(a)d['option'](E(0xe0),E(0x100));if(I===E(0xe9))d[E(0xc6)]('--run\x20--runId\x20[runId]',E(0xbc));return d;},this[B(0x123)]=(I,a)=>{return d=>{const J=a12I,s=Object[J(0xf5)](d)[J(0x138)](T=>{const {values:V,metricInfo:g}=d[T],{metricUnit:u,metricResolution:L}=g;return V['map'](f=>{const b=a12I;var t,m;const {metadata:U,data:S}=f,k=a?(a===null||a===void 0x0?void 0x0:a['getTime']())>new Date()[b(0x136)]()?new Date():a:undefined,e=new Date((t=S===null||S===void 0x0?void 0x0:S[0x0])===null||t===void 0x0?void 0x0:t['ts']),x=new Date((m=S===null||S===void 0x0?void 0x0:S[S['length']-0x1])===null||m===void 0x0?void 0x0:m['ts']),o=this['getPaddingDataStart'](I,e,L),M=this[b(0x112)](k,x,L),N=[...o,...S,...M],q=N[b(0xf9)](Q=>[new Date(Q['ts'])[b(0xee)](),Number(Q['value'])])['filter'](Q=>!Number['isNaN'](Q[0x0])),K=Math[b(0xcb)](Math['max'](process[b(0x105)][b(0xd7)]-0xa,0xa),0x64),y=Math[b(0xcb)](Math[b(0x109)](process[b(0x105)]['rows']-0x9,0xa),0xf),D=u==='pct'?0x64:undefined,l=u===b(0xd8)?'%':u,n=(0x0,terminal_chart_1['downSampleData'])(q,K),v=n[b(0xf9)](Q=>Q[0x1]),X={'min':0x0,'height':y,'max':D,'unit':l,'startTs':I!==null&&I!==void 0x0?I:e,'endTs':k!==null&&k!==void 0x0?k:x};return{'dataSeries':v,'metadata':U,'chartOpts':X,'metricInfo':g};});})[J(0x113)]();if(s[J(0x13d)]===0x0)(0x0,utils_1[J(0x116)])(J(0xd6));else s['forEach'](T=>{const Y=J,{dataSeries:V,metadata:g,chartOpts:u,metricInfo:L}=T,{containerId:f,volumeId:t}=g,m=t?Y(0xca)+t:'';console[Y(0x12a)](L[Y(0xf6)]+Y(0x134)+chalk_1[Y(0x12f)][Y(0xbe)](f)+m),console['log']((0x0,terminal_chart_1[Y(0x144)])(V,u));});};},this['printMetricsTable']=(I,a,d)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=B;try{const s=yield this[F(0x143)][F(0xdc)][F(0xcd)](I,a,d);console[F(0x140)]();if(s[F(0xc7)])(0x0,utils_1[F(0xc7)])(F(0x101)+s[F(0xc7)]['message']);else this[F(0xfa)](s[F(0xe8)]);}catch(T){console[F(0x140)](),(0x0,utils_1[F(0xc7)])(F(0x101)+T[F(0xc5)]);}}),this[B(0x125)]=I=>{const c=B;if(I[c(0xc7)]){const a=JSON[c(0x11b)](I['error']['details']);throw new Error(c(0x101)+I['error'][c(0xc5)]+'\x20'+a);}},this[B(0xd4)]=(I,a,d,s,T)=>{const W=B;if(T===!![])return;const {metricTypes:V,endTime:g,startTime:u,duration:L,containerId:f}=s,t=u?W(0x135)+u[W(0x131)]():'',m=g?W(0xc2)+g[W(0x131)]():'',U=L?W(0x10a)+L+W(0x10e):'',S=f?'container\x20'+chalk_1[W(0x12f)]['bold'](f):W(0x111),k=I+'\x20'+chalk_1[W(0x12f)][W(0xbe)](a)+W(0xd3)+chalk_1['default'][W(0xbe)](d),e=''+t+m+U,x=V?W(0x133)+(V===null||V===void 0x0?void 0x0:V[W(0xff)](',')):'';console[W(0x12a)]('Metrics\x20for\x20'+S+W(0xed)+k+x+e);},this[B(0x139)]=new js_client_1[(B(0xc1))](A,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']}),this[B(0x143)]=this['apiClient'],this[B(0xda)]=new inquirer_helper_1[(B(0x110))](this['apiClient']);}['getMetricsCommand'](A,I=![]){const h=a12r,a=(V,g)=>__awaiter(this,void 0x0,void 0x0,function*(){const C=a12I,u=g[C(0x121)],{apiContext:L,inquirerHelper:f}=this;switch(A){case C(0x13e):{const t=u?undefined:L[C(0x10c)]();return g[C(0xd0)]||t||(yield f['askForService'](V)());}case C(0xe9):{const m=u?undefined:L[C(0x10c)]();return g['jobId']||m||(yield f[C(0x124)](V)());}case'addon':{const U=u?undefined:L[C(0x10c)]();return g[C(0x12b)]||U||(yield f[C(0xef)](V)());}}}),d=(V,g,u)=>__awaiter(this,void 0x0,void 0x0,function*(){const G=a12I;if(I)return u[G(0x10b)]||(yield this['inquirerHelper'][G(0x12d)](V,A===G(0x13e)?g:undefined,A===G(0xe9)?g:undefined,!![])());return undefined;}),s=(V,g,u)=>__awaiter(this,void 0x0,void 0x0,function*(){const j=a12I;if(!I&&u[j(0x120)]!==undefined){if(u[j(0x120)]!==!![])return u[j(0x120)];return yield this['inquirerHelper'][j(0xce)](V,A===j(0x13e)?g:undefined,A==='job'?g:undefined,!![])();}return undefined;}),T=(V,g,u)=>__awaiter(this,void 0x0,void 0x0,function*(){const z=a12I;if(A===z(0xe9))return u['runId']||(yield this['inquirerHelper'][z(0x122)](g,V,!![])());return undefined;});return this['getStandardMetricsCommand'](A,I)[h(0x106)](V=>__awaiter(this,void 0x0,void 0x0,function*(){const w=h,{noDefaults:g,projectId:u,duration:L,timestamp:f,output:t,startTime:m,endTime:U,metricTypes:S,quiet:k}=V;(0x0,utils_1['assertContextExisting'])(this[w(0x139)]);if(m&&U&&L)throw new Error(w(0x126));const {apiContext:e,inquirerHelper:x,metricsApiClient:o}=this,M=g?undefined:e[w(0x11f)](),N=u||M||(yield x[w(0x127)]()),q=yield a(N,V),K=yield d(N,q,V),y=yield T(N,q,V),D=yield s(N,q,V),l={'projectId':N,'entityId':q},n={'containerName':D,'startTime':m,'endTime':U,'duration':L,'timestamp':f,'metricTypes':S,'runId':y,'buildId':K,'isBuild':I!==null&&I!==void 0x0?I:![]},v=!(m||U||L);if(!k&&t!==w(0xfd)&&t!==w(0xcf)&&t!==w(0xd5))this[w(0xd4)](A,q,N,n,k);if(v){if(t!==undefined){const X=yield o[w(0xdc)][w(0xcd)](l,n,A);this[w(0x125)](X),(0x0,console_format_helpers_1[w(0xbf)])(t,X['data']);}else[...Array(process['stdout'][w(0x129)]-0x1)]['forEach']((Q,O)=>O===0x0?console[w(0x12a)]('Fetching\x20data..'):console[w(0x12a)]()),yield this[w(0x11e)](l,n,A)(),setInterval(this[w(0x11e)](l,n,A),this[w(0xf4)]),yield new Promise(Q=>setTimeout(Q,this[w(0xf4)]*0x64));}else{const Q=yield o[w(0xdc)]['metricsRange'](l,n,A);this[w(0x125)](Q),t!==undefined?(0x0,console_format_helpers_1[w(0xbf)])(t,Q[w(0xe8)]):this['printMetricsGraph'](m,U!==null&&U!==void 0x0?U:new Date())(Q[w(0xe8)]);}process['exit']();}));}['printMetricsSingle'](A){const A3=a12r,I=(s,T)=>{const i=a12I;if(!(T===null||T===void 0x0?void 0x0:T[i(0xd2)]))i(0xeb);const V=s[i(0xea)]==='pct'?'%':s[i(0xea)];return''+Number(T===null||T===void 0x0?void 0x0:T[i(0xd2)])['toFixed'](0x3)+V;},a=s=>{const A0=a12I;if(!(s===null||s===void 0x0?void 0x0:s['ts']))'N/A';return s['ts'][A0(0x102)]()[A0(0xe4)]('\x20')[0x0];},d={};Object['keys'](A)['forEach'](s=>{const A1=a12I,{values:T,metricInfo:V}=A[s];return T[A1(0xf2)](g=>{const A2=A1;var u,L;const f=g[A2(0x107)][A2(0x120)];Object[A2(0xe5)](d,{[f]:Object[A2(0xe5)](Object[A2(0xe5)]({},d===null||d===void 0x0?void 0x0:d[f]),{['time']:a((u=g[A2(0xe8)])===null||u===void 0x0?void 0x0:u[0x0]),'containerId':f,[V[A2(0xf6)]]:I(V,(L=g[A2(0xe8)])===null||L===void 0x0?void 0x0:L[0x0])})});});}),(0x0,console_format_helpers_1[A3(0xe3)])(Object[A3(0x11a)](d),A3(0x130));}[a12r(0xfe)](A,I,a){const A4=a12r,d=V=>new Date(V[A4(0x136)]()-s),s=a*0x3e8;if(!A)return[];if(!I)return[];if(d(I)[A4(0x136)]()<A[A4(0x136)]())return[];const T=[{'ts':d(I),'value':0x0}];while(d(T[T[A4(0x13d)]-0x1]['ts'])['getTime']()<=A[A4(0x136)]()){T['unshift']({'ts':d(T[T[A4(0x13d)]-0x1]['ts']),'value':0x0});}return T;}[a12r(0x112)](A,I,a){const A5=a12r,d=V=>new Date(V[A5(0x136)]()+s),s=a*0x3e8;if(!A)return[];if(!I)return[];if(d(I)[A5(0x136)]()>A[A5(0x136)]())return[];const T=[{'ts':d(I),'value':0x0}];while(d(T[T[A5(0x13d)]-0x1]['ts'])[A5(0x136)]()<=A['getTime']()){T['push']({'ts':d(T[T[A5(0x13d)]-0x1]['ts']),'value':0x0});}return T;}}exports['CliMetrics']=CliMetrics;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a13U=a13I;(function(A,I){const m=a13I,a=A();while(!![]){try{const d=parseInt(m(0x1f9))/0x1+parseInt(m(0x1e6))/0x2*(-parseInt(m(0x1eb))/0x3)+parseInt(m(0x1ff))/0x4*(parseInt(m(0x1f3))/0x5)+-parseInt(m(0x1d5))/0x6*(-parseInt(m(0x1e7))/0x7)+parseInt(m(0x1db))/0x8*(parseInt(m(0x1d8))/0x9)+-parseInt(m(0x1fe))/0xa*(parseInt(m(0x1ec))/0xb)+-parseInt(m(0x1de))/0xc;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a13A,0x7567b));function a13I(A,I){const a=a13A();return a13I=function(d,s){d=d-0x1d1;let T=a[d];return T;},a13I(A,I);}var __awaiter=this&&this[a13U(0x1dc)]||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const x=a13I;function g(f){const S=a13I;try{L(d[S(0x1fb)](f));}catch(t){V(t);}}function u(f){const k=a13I;try{L(d[k(0x1e4)](f));}catch(t){V(t);}}function L(f){const e=a13I;f['done']?T(f[e(0x1fd)]):s(f[e(0x1fd)])[e(0x1d4)](g,u);}L((d=d[x(0x1da)](A,I||[]))[x(0x1fb)]());});},__importDefault=this&&this[a13U(0x1f0)]||function(A){return A&&A['__esModule']?A:{'default':A};};Object[a13U(0x1d9)](exports,a13U(0x1f5),{'value':!![]}),exports[a13U(0x1ee)]=void 0x0;const list_1=__importDefault(require('inquirer/lib/prompts/list')),choice_1=__importDefault(require(a13U(0x1f1))),chalk_1=__importDefault(require(a13U(0x1dd)));function incrementListIndex(A,I,a){const o=a13U,d=a[o(0x1e0)][o(0x1e3)],s=o(0x1d1)in a?Boolean(a['loop']):!![];if(I==='up'){if(A>0x0)return A-0x1;return s?d-0x1:A;}if(I===o(0x1d3)){if(A<d-0x1)return A+0x1;return s?0x0:A;}throw new Error(o(0x1fa));}function a13A(){const D=['6296Fcdppu','loop','nextPageCursor','down','then','108NAGdll','handleDynamicPageLoad','onDownKey','9pBiKXP','defineProperty','apply','3425224eZuyaJ','__awaiter','chalk','4838916QIFzCZ','push','choices','pagOpt','loadMore','realLength','throw','map','2OGwaXp','91196qsjcgV','italic','default','..\x20Load\x20more\x20options\x20..','1405245YcnaHQ','319649egtYdO','opt','DynamicReloadPaginationPrompt','loading','__importDefault','inquirer/lib/objects/choice','render','1835LqlaRI','selected','__esModule','name','reloadText','catch','402824ffMPnh','dir\x20must\x20be\x20up\x20or\x20down','next','length','value','100PoigXQ'];a13A=function(){return D;};return a13A();}class DynamicReloadPaginationPrompt extends list_1[a13U(0x1e9)]{constructor(A,I,d){const M=a13U;super(A,I,d),this[M(0x1f7)]=chalk_1[M(0x1e9)][M(0x1e8)](M(0x1ea)),this['loading']=![],this[M(0x1e1)]=this['opt'],this['nextPageCursor']=this['pagOpt']['nextPageCursor'],this[M(0x1d2)]!==undefined&&this[M(0x1ed)]['choices'][M(0x1df)](new choice_1['default'](this[M(0x1f7)],this['reloadText']));}['onUpKey'](){const N=a13U;if(this[N(0x1ef)])return;this[N(0x1f4)]=incrementListIndex(this['selected'],'up',this[N(0x1ed)]),this[N(0x1f2)]();}[a13U(0x1d7)](){return __awaiter(this,void 0x0,void 0x0,function*(){const q=a13I;if(this[q(0x1ef)])return;this[q(0x1f4)]=incrementListIndex(this[q(0x1f4)],'down',this['opt']),yield this[q(0x1d6)](),this[q(0x1f2)]();});}[a13U(0x1d6)](){return __awaiter(this,void 0x0,void 0x0,function*(){const K=a13I;if(this['selected']>=this[K(0x1ed)][K(0x1e0)][K(0x1fc)]-0x1){if(this[K(0x1d2)]===undefined)return;this[K(0x1ef)]=!![];let A=0x0;const I=setInterval(()=>{const y=K,T=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],V=chalk_1[y(0x1e9)][y(0x1e8)](T[A%T[y(0x1fc)]]+'\x20Loading\x20more\x20options');this[y(0x1ed)][y(0x1e0)][y(0x1e0)][this['selected']][y(0x1f6)]=''+V,A+=0x1,this[y(0x1f2)]();},0x50),{elements:a,nextPageCursor:d}=yield this[K(0x1e1)][K(0x1e2)]({'nextPageCursor':this[K(0x1d2)]})[K(0x1f8)](()=>({'elements':[],'nextPageCursor':undefined}));this[K(0x1d2)]=d;const s=a[K(0x1e5)](T=>new choice_1['default'](T,T));this['opt']['choices'][K(0x1e0)]['splice'](this[K(0x1f4)],0x1),this[K(0x1ed)]['choices'][K(0x1df)](...s),d!==undefined&&this[K(0x1ed)][K(0x1e0)][K(0x1df)](new choice_1[(K(0x1e9))](this[K(0x1f7)],this[K(0x1f7)])),clearInterval(I),this['loading']=![];}});}}exports[a13U(0x1ee)]=DynamicReloadPaginationPrompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a14e=a14h;(function(w,h){const f=a14h,G=w();while(!![]){try{const P=parseInt(f(0x1f3))/0x1+-parseInt(f(0x239))/0x2+-parseInt(f(0x1fe))/0x3+parseInt(f(0x235))/0x4+parseInt(f(0x22f))/0x5*(parseInt(f(0x208))/0x6)+parseInt(f(0x22d))/0x7+-parseInt(f(0x1d9))/0x8*(parseInt(f(0x22a))/0x9);if(P===h)break;else G['push'](G['shift']());}catch(v){G['push'](G['shift']());}}}(a14w,0x95db8));function a14w(){const d=['address','darwin','__esModule','next','action','\x20addon\x20ports','project\x20for\x20forwarding','port','skipHostnamesText','warning','create','printHostsFileHint','call','done','getProxyForwarder','protocol','apiClient','forwarding','1013944ibJQcm','bold','defineProperty','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20(','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','__importStar','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','assertContextExisting','forEach','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','get','hostnames','description','type','getCurrentServiceName','greenBright','forward','Forwarding\x20addon\x20','alias','\x20is\x20exposed\x20with\x20multiple\x20','Port-forwarding\x20for\x20the\x20specified\x20addon','uniqBy','flat','Service\x20to\x20forward','repeat','670369uRdCkQ','\x20in\x20project\x20','addCommand','__importDefault','--addon\x20--addonId\x20[NAME]','hasOwnProperty','http://','value','green','Forwarding\x20','filter','2425899Ziuxbw','reset','prototype','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','groupBy','Services:','name','/etc/hosts','portFwdCmd','\x20\x20-\x20port\x20','342PABNrG','entries','Running\x20on\x20macOS\x20in\x20','Project\x20for\x20forwarding','getCommand','option','askForAddon','hosts','--noDefaults','fwd','\x20\x20-\x20Address:\x20','getCurrentProjectName','message','service','printForwardingInfo','stop','ApiClient','\x20and\x20','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','--skipHostnames','log','success','C:/Windows/System32/drivers/etc/hosts','Running\x20in\x20','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','chalk','Failed:\x20','join','data','configurable','data.id','Port-forwarding\x20for\x20the\x20specified\x20service','--project\x20--projectId\x20[NAME]','@northflank/js-client','36kWySIy','lodash','error','4314751MfHkFB','exit','89920BAnKDb','tunnel-close','\x20with\x20multiple\x20ports:','uniq','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','CliPortForward','1052072pNUxuI','default','apply','\x20is\x20running\x20and\x20reachable.','1290894eicaTq','skipHostnames','--service\x20--serviceId\x20[NAME]','Addon\x20to\x20forward','noDefaultsText','ports','addon','then','flatMap','win32','forwardService','Cleaning\x20up\x20open\x20connections\x20failed:\x20','canExecuteWithHostnames','length','portName','askForProject','customUserAgent','\x20is\x20exposed\x20on\x20','HTTP','Forwarding\x20service\x20','\x20service\x20ports','\x20-\x20','\x27:\x20\x22','writable'];a14w=function(){return d;};return a14w();}var __createBinding=this&&this['__createBinding']||(Object[a14e(0x1d1)]?function(w,h,G,P){const i=a14e;if(P===undefined)P=G;var v=Object['getOwnPropertyDescriptor'](h,G);(!v||(i(0x1e4)in v?!h[i(0x1c9)]:v[i(0x1c6)]||v[i(0x225)]))&&(v={'enumerable':!![],'get':function(){return h[G];}}),Object[i(0x1db)](w,P,v);}:function(w,h,G,P){if(P===undefined)P=G;w[P]=h[G];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a14e(0x1d1)]?function(w,h){const u=a14e;Object['defineProperty'](w,u(0x236),{'enumerable':!![],'value':h});}:function(w,h){w['default']=h;}),__importStar=this&&this[a14e(0x1df)]||function(w){const t=a14e;if(w&&w[t(0x1c9)])return w;var h={};if(w!=null){for(var G in w)if(G!==t(0x236)&&Object[t(0x200)][t(0x1f8)][t(0x1d3)](w,G))__createBinding(h,w,G);}return __setModuleDefault(h,w),h;},__awaiter=this&&this['__awaiter']||function(w,h,G,v){function O(Z){return Z instanceof G?Z:new G(function(a){a(Z);});}return new(G||(G=Promise))(function(Z,a){const C=a14h;function l(A){const S=a14h;try{U(v[S(0x1ca)](A));}catch(D){a(D);}}function B(A){try{U(v['throw'](A));}catch(D){a(D);}}function U(A){const V=a14h;A[V(0x1d4)]?Z(A[V(0x1fa)]):O(A[V(0x1fa)])[V(0x1b6)](l,B);}U((v=v[C(0x237)](w,h||[]))['next']());});},__importDefault=this&&this[a14e(0x1f6)]||function(w){const M=a14e;return w&&w[M(0x1c9)]?w:{'default':w};};Object[a14e(0x1db)](exports,a14e(0x1c9),{'value':!![]}),exports['CliPortForward']=void 0x0;const js_client_1=require(a14e(0x229)),chalk_1=__importDefault(require(a14e(0x221))),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),os=__importStar(require('os')),lodash_1=require(a14e(0x22b)),{EOL}=require('os');class CliPortForward{constructor(w){const Q=a14e;this[Q(0x1b3)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this['skipHostnamesText']=Q(0x1e0),this[Q(0x1d7)]=new js_client_1[(Q(0x218))](w,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Q(0x1bf)]});const h=new inquirer_helper_1['InquirerHelper'](this[Q(0x1d7)]);this['portFwdCmd']=(0x0,utils_1[Q(0x20c)])()[Q(0x204)](Q(0x1ea))[Q(0x1ec)](Q(0x211))['description'](Q(0x201));const G=(0x0,utils_1[Q(0x20c)])(!![])[Q(0x204)]('all')[Q(0x1e6)](Q(0x1de))['option'](Q(0x228),Q(0x1cd))[Q(0x20d)]('--noDefaults',this['noDefaultsText'],![])[Q(0x20d)](Q(0x21b),this[Q(0x1cf)],![])['action'](({noDefaults:O,projectId:Z,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const H=Q;(0x0,utils_1[H(0x1e1)])(this[H(0x1d7)]);const l=this['getProxyForwarder'](a),B=O?undefined:w[H(0x213)](),U=Z||B||(yield h[H(0x1be)]());try{const {services:A,addons:D}=yield l['forwardProject']({'projectId':U},a);if(A['length']+D['length']<=0x0)(0x0,utils_1[H(0x1d0)])(H(0x233)+chalk_1['default'][H(0x1da)](U));else{const p=A[H(0x1fd)](X=>X['length']>0x0)[H(0x1bc)],s=D[H(0x1fd)](X=>X[H(0x1bc)]>0x0)[H(0x1bc)],W=H(0x1f4)+chalk_1[H(0x236)][H(0x1da)](U);console[H(0x21c)](H(0x1fc)+chalk_1[H(0x236)][H(0x1fb)][H(0x1da)](p+H(0x1c3))+H(0x219)+chalk_1[H(0x236)]['green'][H(0x1da)](s+H(0x1cc))+W),console['log'](),console['log'](chalk_1[H(0x236)][H(0x1da)](H(0x203))),A['forEach'](X=>{const n=H;if(X['length']>=0x1&&!X[0x0][n(0x22c)])this[n(0x216)](X,{'type':n(0x215),'name':X[0x0][n(0x224)]['id']},a);}),console['log'](chalk_1[H(0x236)][H(0x1da)]('Addons:')),D[H(0x1e2)](X=>{const c=H;if(X[c(0x1bc)]>=0x1&&!X[0x0][c(0x22c)])this[c(0x216)](X,{'type':c(0x1b5),'name':X[0x0]['data']['id']},a);}),this[H(0x1d2)]([...A[H(0x1f0)](),...D['flat']()],a);}}catch(X){(0x0,utils_1[H(0x22c)])(H(0x222)+X[H(0x214)]);}})),P=(0x0,utils_1[Q(0x20c)])(!![])[Q(0x204)](Q(0x215))[Q(0x1e6)](Q(0x227))[Q(0x20d)](Q(0x228),Q(0x20b))[Q(0x20d)](Q(0x1b1),Q(0x1f1))[Q(0x20d)](Q(0x210),this[Q(0x1b3)],![])['option'](Q(0x21b),this['skipHostnamesText'],![])['action'](({noDefaults:O,projectId:Z,serviceId:a,skipHostnames:l})=>__awaiter(this,void 0x0,void 0x0,function*(){const r=Q;(0x0,utils_1[r(0x1e1)])(this[r(0x1d7)]);const B=this[r(0x1d5)](l),U=O?undefined:w[r(0x213)](),A=Z||U||(yield h[r(0x1be)]()),D=O?undefined:w[r(0x1e8)](),p=a||D||(yield h['askForService'](A)());console[r(0x21c)](r(0x1c2)+chalk_1['default'][r(0x1da)](p)+r(0x1f4)+chalk_1[r(0x236)]['bold'](A));try{const s=yield B[r(0x1b9)]({'projectId':A,'serviceId':p},l);this[r(0x216)](s,{'name':p,'type':'service'},l),this[r(0x1d2)](s,l);}catch(W){(0x0,utils_1[r(0x22c)])(r(0x222)+W[r(0x214)]);}})),v=(0x0,utils_1[Q(0x20c)])(!![])[Q(0x204)]('addon')[Q(0x1e6)](Q(0x1ee))[Q(0x20d)](Q(0x228),Q(0x20b))[Q(0x20d)](Q(0x1f7),Q(0x1b2))[Q(0x20d)](Q(0x21b),this[Q(0x1cf)],![])[Q(0x1cb)](({noDefaults:O,projectId:Z,addonId:a,skipHostnames:l})=>__awaiter(this,void 0x0,void 0x0,function*(){const j=Q;(0x0,utils_1['assertContextExisting'])(this['apiClient']);const B=this[j(0x1d5)](l),U=O?undefined:w['getCurrentProjectName'](),A=Z||U||(yield h['askForProject']()),D=a||(yield h[j(0x20e)](A)());console[j(0x21c)](j(0x1eb)+chalk_1['default']['bold'](D)+j(0x1f4)+chalk_1[j(0x236)][j(0x1da)](A));try{const p={'projectId':A,'addonId':D},s=yield B['forwardAddon'](p,l);this['printForwardingInfo'](s,{'name':D,'type':j(0x1b5)},l),this[j(0x1d2)](s,l);}catch(W){(0x0,utils_1[j(0x22c)])(j(0x222)+W[j(0x214)]);}}));this[Q(0x206)]['addCommand'](G),this[Q(0x206)][Q(0x1f5)](P),this[Q(0x206)][Q(0x1f5)](v);}[a14e(0x1d5)](w=![]){const m=a14e,h=this['apiClient'][m(0x1d8)];if(!w){const G=h[m(0x1bb)]();if(G[m(0x22c)])throw new Error(G['message']);}return h['on'](m(0x230),(P,v)=>{const y=m,O=chalk_1[y(0x236)][y(0x1da)](v[y(0x1e7)]+'\x20\x27'+v['id']+'\x27'),Z=v[y(0x1e5)][y(0x1bc)]>0x0;(0x0,utils_1[y(0x1d0)])('Stop\x20forwarding\x20traffic\x20from\x20'+v['address']+':'+v[y(0x1ce)]+'\x20to\x20'+O),w&&Z&&(0x0,utils_1[y(0x1d0)])(y(0x1e3));}),h['on']('connection-error',(P,v,O)=>{const E=m;(0x0,utils_1[E(0x1d0)])(E(0x1dc)+v[E(0x1c7)]+':'+v[E(0x1ce)]+E(0x1c5)+(O===null||O===void 0x0?void 0x0:O['message'])+'\x22');}),process['on']('SIGINT',()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=m;try{yield h[K(0x217)]();}catch(P){(0x0,utils_1[K(0x22c)])(K(0x1ba)+P[K(0x214)]);}finally{process[K(0x22e)]();}})),h;}[a14e(0x216)](w,h,G=![]){const g=a14e,{type:P,name:v}=h;if(w[g(0x1bc)]<=0x0){const l='Please\x20ensure\x20the\x20'+h[g(0x1e7)]+g(0x238);(0x0,utils_1[g(0x1d0)])('\x20\x20\x20No\x20running\x20container\x20found\x20for\x20'+P+'\x20'+chalk_1[g(0x236)]['bold'](v)+'.\x20'+l);return;}const O=(0x0,lodash_1[g(0x202)])(w,g(0x226)),Z=B=>'\x20('+(B[g(0x1bd)]?B[g(0x1bd)]+g(0x1c4):'')+B['protocol']+')';function a(B,U=0x2){const J=g;if(!G){const A=B[J(0x1d6)]===J(0x1c1)?J(0x1f9):'';B[J(0x1e5)][J(0x1e2)](D=>{const R=J;console['log']((0x0,lodash_1[R(0x1f2)])('\x20',U)+'-\x20'+A+D+':'+B[R(0x1ce)]);});}}Object[g(0x209)](O)[g(0x1e2)](([B,U])=>{const N=g;var A,D;const p='>\x20'+(0x0,lodash_1['capitalize'])(P)+'\x20\x27'+chalk_1['default'][N(0x1e9)][N(0x1da)](B)+'\x27';if(P==='addon'){if(U[N(0x1bc)]===0x1){const s=U[0x0];if(s[N(0x22c)]){(0x0,utils_1[N(0x22c)])(N(0x21a)+B+':\x20'+s[N(0x22c)]['message']);return;}const W=s[N(0x224)],X=!G?'\x20'+chalk_1[N(0x236)][N(0x1ff)]('with\x20hostname:\x20'+W[N(0x1e5)][N(0x223)](',')):'';(0x0,utils_1[N(0x21d)])(p+N(0x1c0)+W[N(0x1c7)]+':'+W[N(0x1ce)]+Z(W)+X);}else{const T=(0x0,lodash_1[N(0x1ef)])(U,I=>{const z=N;var k,Y;return(Y=(k=I===null||I===void 0x0?void 0x0:I[z(0x224)])===null||k===void 0x0?void 0x0:k[z(0x1e5)])===null||Y===void 0x0?void 0x0:Y[z(0x223)](',');})[N(0x1bc)]>0x1;(0x0,utils_1[N(0x21d)])(p+N(0x1ed)+(T?N(0x20f):N(0x1b4))+':'),U['forEach'](I=>{const F=N;if(I[F(0x22c)]){(0x0,utils_1[F(0x22c)])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+B+':\x20'+I[F(0x22c)][F(0x214)]);return;}const k=I[F(0x224)],Y=!G?',\x20hostname:\x20'+k['hostnames'][F(0x223)](','):'';console[F(0x21c)](F(0x212)+k['address']+':'+k['port']+Z(k)+Y);});}}if(P==='service'){if(U['length']===0x1){const I=U[0x0];if(I['error']){(0x0,utils_1[N(0x22c)])(N(0x21a)+B+':\x20'+I[N(0x22c)][N(0x214)]);return;}const k=I[N(0x224)],Y=!G?'\x20with\x20these\x20hostnames:':':',x=k['address']+':'+k[N(0x1ce)]+Z(k);(0x0,utils_1['success'])(p+N(0x1c0)+x+Y),a(k);}else(0x0,utils_1[N(0x21d)])(p+N(0x1c0)+((D=(A=U[0x0])===null||A===void 0x0?void 0x0:A[N(0x224)])===null||D===void 0x0?void 0x0:D[N(0x1c7)])+N(0x231)),U['forEach'](b=>{const o=N;if(b[o(0x22c)]){(0x0,utils_1[o(0x22c)])(o(0x21a)+B+':\x20'+b['error'][o(0x214)]);return;}const q=b[o(0x224)];(0x0,utils_1['success'])(o(0x207)+q[o(0x1ce)]+Z(q)),a(q,0x4);});}});}[a14e(0x1d2)](w,h=![]){const L=a14e;if(h){const G=w[L(0x1b7)](U=>U['data'])['filter'](U=>U!==undefined),P=(process===null||process===void 0x0?void 0x0:process['platform'])===L(0x1b8),v=os['platform']()===L(0x1c8),O=P?L(0x21e):L(0x205),Z=chalk_1[L(0x236)]['bold'](L(0x23a)),a=v?EOL+L(0x20a)+Z+'\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.':undefined;let l=L(0x21f)+Z+L(0x220)+L(0x21b)+L(0x1dd)+O+'):';a!==undefined&&(0x0,utils_1[L(0x1d0)])(a!==null&&a!==void 0x0?a:'');(0x0,utils_1[L(0x1d0)])(l);const B=G['map'](U=>U[L(0x1c7)]+'\x20\x20\x20\x20\x20\x20\x20\x20\x20'+U[L(0x1e5)][L(0x223)]('\x20'));console['log']((0x0,lodash_1[L(0x232)])(B)[L(0x223)](EOL)),console[L(0x21c)]();}}}function a14h(w,h){const G=a14w();return a14h=function(P,v){P=P-0x1b1;let O=G[P];return O;},a14h(w,h);}exports[a14e(0x234)]=CliPortForward;
|
|
1
|
+
'use strict';const a14l=a14I;(function(A,I){const D=a14I,a=A();while(!![]){try{const d=-parseInt(D(0x1f7))/0x1*(-parseInt(D(0x206))/0x2)+parseInt(D(0x254))/0x3*(parseInt(D(0x24a))/0x4)+-parseInt(D(0x1f6))/0x5*(parseInt(D(0x222))/0x6)+-parseInt(D(0x1fc))/0x7+parseInt(D(0x20e))/0x8*(parseInt(D(0x243))/0x9)+parseInt(D(0x259))/0xa+parseInt(D(0x1f0))/0xb;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a14A,0x5c1a1));var __createBinding=this&&this[a14l(0x240)]||(Object['create']?function(A,I,a,d){const n=a14l;if(d===undefined)d=a;var s=Object[n(0x23a)](I,a);(!s||(n(0x1eb)in s?!I[n(0x20d)]:s['writable']||s[n(0x1dc)]))&&(s={'enumerable':!![],'get':function(){return I[a];}}),Object['defineProperty'](A,d,s);}:function(A,I,a,d){if(d===undefined)d=a;A[d]=I[a];}),__setModuleDefault=this&&this[a14l(0x23e)]||(Object[a14l(0x203)]?function(A,I){const v=a14l;Object[v(0x1f2)](A,'default',{'enumerable':!![],'value':I});}:function(A,I){const X=a14l;A[X(0x1db)]=I;}),__importStar=this&&this[a14l(0x21b)]||function(A){const Q=a14l;if(A&&A[Q(0x20d)])return A;var I={};if(A!=null){for(var a in A)if(a!=='default'&&Object[Q(0x236)]['hasOwnProperty'][Q(0x219)](A,a))__createBinding(I,A,a);}return __setModuleDefault(I,A),I;},__awaiter=this&&this['__awaiter']||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const r=a14I;function g(f){try{L(d['next'](f));}catch(t){V(t);}}function u(f){const O=a14I;try{L(d[O(0x1f1)](f));}catch(t){V(t);}}function L(f){const p=a14I;f[p(0x1de)]?T(f['value']):s(f[p(0x227)])[p(0x1fb)](g,u);}L((d=d[r(0x20c)](A,I||[]))[r(0x1ed)]());});},__importDefault=this&&this[a14l(0x1fd)]||function(A){const H=a14l;return A&&A[H(0x20d)]?A:{'default':A};};Object[a14l(0x1f2)](exports,a14l(0x20d),{'value':!![]}),exports[a14l(0x23c)]=void 0x0;const js_client_1=require(a14l(0x21e)),chalk_1=__importDefault(require('chalk')),utils_1=require(a14l(0x256)),inquirer_helper_1=require(a14l(0x235)),os=__importStar(require('os')),lodash_1=require('lodash'),{EOL}=require('os');function a14I(A,I){const a=a14A();return a14I=function(d,s){d=d-0x1db;let T=a[d];return T;},a14I(A,I);}class CliPortForward{constructor(A){const P=a14l;this[P(0x216)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this[P(0x1e5)]=P(0x25c),this[P(0x24c)]=new js_client_1[(P(0x1dd))](A,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[P(0x250)]});const I=new inquirer_helper_1[(P(0x22f))](this[P(0x24c)]);this[P(0x230)]=(0x0,utils_1[P(0x22d)])()[P(0x217)](P(0x22b))[P(0x25d)](P(0x1f8))[P(0x247)](P(0x204));const a=(0x0,utils_1[P(0x22d)])(!![])[P(0x217)]('all')[P(0x247)](P(0x23b))[P(0x215)]('--project\x20--projectId\x20[NAME]',P(0x25a))['option'](P(0x248),this[P(0x216)],![])['option'](P(0x1f3),this[P(0x1e5)],![])[P(0x1ea)](({noDefaults:T,projectId:V,skipHostnames:g})=>__awaiter(this,void 0x0,void 0x0,function*(){const R=P;(0x0,utils_1[R(0x252)])(this[R(0x24c)]);const u=this[R(0x233)](g),L=T?undefined:A[R(0x1fa)](),f=V||L||(yield I['askForProject']());try{const {services:t,addons:m}=yield u['forwardProject']({'projectId':f},g);if(t[R(0x1ef)]+m[R(0x1ef)]<=0x0)(0x0,utils_1[R(0x200)])('No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20'+chalk_1['default'][R(0x229)](f));else{const U=t[R(0x1ec)](x=>x[R(0x1ef)]>0x0)['length'],S=m['filter'](x=>x[R(0x1ef)]>0x0)['length'],k='\x20in\x20project\x20'+chalk_1[R(0x1db)][R(0x229)](f);console[R(0x1fe)](R(0x1e4)+chalk_1['default'][R(0x1e8)][R(0x229)](U+'\x20service\x20ports')+R(0x1ff)+chalk_1[R(0x1db)][R(0x1e8)][R(0x229)](S+R(0x260))+k),console[R(0x1fe)](),console['log'](chalk_1['default'][R(0x229)](R(0x253))),t['forEach'](x=>{const Z=R;if(x[Z(0x1ef)]>=0x1&&!x[0x0]['error'])this['printForwardingInfo'](x,{'type':'service','name':x[0x0]['data']['id']},g);}),console[R(0x1fe)](chalk_1[R(0x1db)]['bold']('Addons:')),m[R(0x244)](x=>{const B=R;if(x[B(0x1ef)]>=0x1&&!x[0x0][B(0x239)])this[B(0x202)](x,{'type':B(0x24f),'name':x[0x0]['data']['id']},g);}),this[R(0x1e0)]([...t[R(0x228)](),...m['flat']()],g);}}catch(x){(0x0,utils_1[R(0x239)])('Failed:\x20'+x[R(0x237)]);}})),d=(0x0,utils_1[P(0x22d)])(!![])[P(0x217)](P(0x205))[P(0x247)](P(0x1e3))['option'](P(0x1e6),P(0x21c))[P(0x215)](P(0x20b),'Service\x20to\x20forward')[P(0x215)](P(0x248),this[P(0x216)],![])[P(0x215)](P(0x1f3),this[P(0x1e5)],![])[P(0x1ea)](({noDefaults:T,projectId:V,serviceId:g,skipHostnames:u})=>__awaiter(this,void 0x0,void 0x0,function*(){const E=P;(0x0,utils_1[E(0x252)])(this[E(0x24c)]);const L=this[E(0x233)](u),f=T?undefined:A[E(0x1fa)](),t=V||f||(yield I[E(0x1e1)]()),m=T?undefined:A[E(0x20f)](),U=g||m||(yield I['askForService'](t)());console[E(0x1fe)](E(0x210)+chalk_1[E(0x1db)][E(0x229)](U)+E(0x221)+chalk_1[E(0x1db)][E(0x229)](t));try{const S=yield L[E(0x1e9)]({'projectId':t,'serviceId':U},u);this['printForwardingInfo'](S,{'name':U,'type':E(0x205)},u),this[E(0x1e0)](S,u);}catch(k){(0x0,utils_1[E(0x239)])(E(0x207)+k[E(0x237)]);}})),s=(0x0,utils_1['getCommand'])(!![])[P(0x217)](P(0x24f))[P(0x247)](P(0x224))[P(0x215)]('--project\x20--projectId\x20[NAME]','Project\x20for\x20forwarding')['option'](P(0x22c),P(0x1e2))[P(0x215)]('--skipHostnames',this[P(0x1e5)],![])['action'](({noDefaults:T,projectId:V,addonId:g,skipHostnames:u})=>__awaiter(this,void 0x0,void 0x0,function*(){const J=P;(0x0,utils_1['assertContextExisting'])(this[J(0x24c)]);const L=this['getProxyForwarder'](u),f=T?undefined:A['getCurrentProjectName'](),t=V||f||(yield I[J(0x1e1)]()),m=g||(yield I['askForAddon'](t)());console[J(0x1fe)](J(0x234)+chalk_1['default']['bold'](m)+J(0x221)+chalk_1['default'][J(0x229)](t));try{const U={'projectId':t,'addonId':m},S=yield L[J(0x23f)](U,u);this['printForwardingInfo'](S,{'name':m,'type':J(0x24f)},u),this[J(0x1e0)](S,u);}catch(k){(0x0,utils_1[J(0x239)])(J(0x207)+k['message']);}}));this[P(0x230)][P(0x25e)](a),this[P(0x230)][P(0x25e)](d),this[P(0x230)][P(0x25e)](s);}[a14l(0x233)](A=![]){const b=a14l,I=this[b(0x24c)][b(0x1ee)];if(!A){const a=I[b(0x242)]();if(a[b(0x239)])throw new Error(a[b(0x237)]);}return I['on']('tunnel-close',(d,s)=>{const Y=b,T=chalk_1[Y(0x1db)][Y(0x229)](s[Y(0x1df)]+'\x20\x27'+s['id']+'\x27'),V=s[Y(0x20a)][Y(0x1ef)]>0x0;(0x0,utils_1[Y(0x200)])(Y(0x214)+s[Y(0x257)]+':'+s[Y(0x232)]+Y(0x220)+T),A&&V&&(0x0,utils_1[Y(0x200)])(Y(0x24b));}),I['on']('connection-error',(d,s,T)=>{const F=b;(0x0,utils_1['warning'])(F(0x258)+s[F(0x257)]+':'+s['port']+F(0x1f4)+(T===null||T===void 0x0?void 0x0:T['message'])+'\x22');}),process['on']('SIGINT',()=>__awaiter(this,void 0x0,void 0x0,function*(){const c=b;try{yield I['stop']();}catch(d){(0x0,utils_1[c(0x239)])(c(0x241)+d[c(0x237)]);}finally{process[c(0x21a)]();}})),I;}[a14l(0x202)](A,I,a=![]){const W=a14l,{type:d,name:s}=I;if(A[W(0x1ef)]<=0x0){const u=W(0x246)+I[W(0x1df)]+W(0x218);(0x0,utils_1[W(0x200)])(W(0x251)+d+'\x20'+chalk_1['default']['bold'](s)+'.\x20'+u);return;}const T=(0x0,lodash_1[W(0x226)])(A,'data.id'),V=L=>'\x20('+(L[W(0x22a)]?L['portName']+'\x20-\x20':'')+L[W(0x21d)]+')';function g(L,f=0x2){const C=W;if(!a){const t=L[C(0x21d)]===C(0x24d)?'http://':'';L[C(0x20a)][C(0x244)](m=>{const G=C;console[G(0x1fe)]((0x0,lodash_1[G(0x22e)])('\x20',f)+'-\x20'+t+m+':'+L[G(0x232)]);});}}Object['entries'](T)[W(0x244)](([L,f])=>{const j=W;var t,m;const U='>\x20'+(0x0,lodash_1[j(0x249)])(d)+'\x20\x27'+chalk_1[j(0x1db)]['greenBright'][j(0x229)](L)+'\x27';if(d==='addon'){if(f['length']===0x1){const S=f[0x0];if(S['error']){(0x0,utils_1['error'])(j(0x21f)+L+':\x20'+S['error'][j(0x237)]);return;}const k=S[j(0x238)],e=!a?'\x20'+chalk_1[j(0x1db)][j(0x1e7)](j(0x212)+k['hostnames'][j(0x23d)](',')):'';(0x0,utils_1[j(0x245)])(U+j(0x208)+k[j(0x257)]+':'+k[j(0x232)]+V(k)+e);}else{const x=(0x0,lodash_1[j(0x25b)])(f,o=>{const z=j;var M,N;return(N=(M=o===null||o===void 0x0?void 0x0:o[z(0x238)])===null||M===void 0x0?void 0x0:M[z(0x20a)])===null||N===void 0x0?void 0x0:N[z(0x23d)](',');})[j(0x1ef)]>0x1;(0x0,utils_1[j(0x245)])(U+j(0x1f9)+(x?j(0x231):'ports')+':'),f[j(0x244)](o=>{const h=j;if(o['error']){(0x0,utils_1[h(0x239)])(h(0x21f)+L+':\x20'+o[h(0x239)][h(0x237)]);return;}const M=o[h(0x238)],N=!a?',\x20hostname:\x20'+M[h(0x20a)][h(0x23d)](','):'';console[h(0x1fe)]('\x20\x20-\x20Address:\x20'+M[h(0x257)]+':'+M[h(0x232)]+V(M)+N);});}}if(d===j(0x205)){if(f[j(0x1ef)]===0x1){const o=f[0x0];if(o[j(0x239)]){(0x0,utils_1[j(0x239)])(j(0x21f)+L+':\x20'+o[j(0x239)][j(0x237)]);return;}const M=o[j(0x238)],N=!a?j(0x201):':',q=M[j(0x257)]+':'+M[j(0x232)]+V(M);(0x0,utils_1['success'])(U+j(0x208)+q+N),g(M);}else(0x0,utils_1['success'])(U+j(0x208)+((m=(t=f[0x0])===null||t===void 0x0?void 0x0:t['data'])===null||m===void 0x0?void 0x0:m[j(0x257)])+j(0x25f)),f[j(0x244)](K=>{const w=j;if(K[w(0x239)]){(0x0,utils_1[w(0x239)])(w(0x21f)+L+':\x20'+K[w(0x239)][w(0x237)]);return;}const y=K[w(0x238)];(0x0,utils_1['success'])(w(0x209)+y[w(0x232)]+V(y)),g(y,0x4);});}});}[a14l(0x1e0)](A,I=![]){const i=a14l;if(I){const a=A['flatMap'](t=>t[i(0x238)])[i(0x1ec)](f=>f!==undefined),d=(process===null||process===void 0x0?void 0x0:process[i(0x24e)])==='win32',s=os[i(0x24e)]()==='darwin',T=d?i(0x1f5):i(0x223),V=chalk_1[i(0x1db)][i(0x229)]('skipHostnames'),g=s?EOL+'Running\x20on\x20macOS\x20in\x20'+V+'\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.':undefined;let u=i(0x225)+V+i(0x213)+i(0x1f3)+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+T+'):';g!==undefined&&(0x0,utils_1[i(0x200)])(g!==null&&g!==void 0x0?g:'');(0x0,utils_1[i(0x200)])(u);const L=a['map'](f=>f['address']+i(0x255)+f[i(0x20a)]['join']('\x20'));console['log']((0x0,lodash_1[i(0x211)])(L)[i(0x23d)](EOL)),console['log']();}}}exports[a14l(0x23c)]=CliPortForward;function a14A(){const A0=['24ymWmpp','/etc/hosts','Port-forwarding\x20for\x20the\x20specified\x20addon','Running\x20in\x20','groupBy','value','flat','bold','portName','forward','--addon\x20--addonId\x20[NAME]','getCommand','repeat','InquirerHelper','portFwdCmd','hosts','port','getProxyForwarder','Forwarding\x20addon\x20','../inquirer-helper','prototype','message','data','error','getOwnPropertyDescriptor','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','CliPortForward','join','__setModuleDefault','forwardAddon','__createBinding','Cleaning\x20up\x20open\x20connections\x20failed:\x20','canExecuteWithHostnames','27KheGVv','forEach','success','Please\x20ensure\x20the\x20','description','--noDefaults','capitalize','456UQEyPL','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','apiClient','HTTP','platform','addon','customUserAgent','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','assertContextExisting','Services:','1755yKRSOX','\x20\x20\x20\x20\x20\x20\x20\x20\x20','../utils','address','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','287440Ffbmpu','project\x20for\x20forwarding','uniqBy','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','alias','addCommand','\x20with\x20multiple\x20ports:','\x20addon\x20ports','default','configurable','ApiClient','done','type','printHostsFileHint','askForProject','Addon\x20to\x20forward','Port-forwarding\x20for\x20the\x20specified\x20service','Forwarding\x20','skipHostnamesText','--project\x20--projectId\x20[NAME]','reset','green','forwardService','action','get','filter','next','forwarding','length','6760347OMFVef','throw','defineProperty','--skipHostnames','\x27:\x20\x22','C:/Windows/System32/drivers/etc/hosts','846085ETHUgH','81ScbmpW','fwd','\x20is\x20exposed\x20with\x20multiple\x20','getCurrentProjectName','then','2845983RoMypa','__importDefault','log','\x20and\x20','warning','\x20with\x20these\x20hostnames:','printForwardingInfo','create','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','service','1912yzehMM','Failed:\x20','\x20is\x20exposed\x20on\x20','\x20\x20-\x20port\x20','hostnames','--service\x20--serviceId\x20[NAME]','apply','__esModule','1795304AGtZaf','getCurrentServiceName','Forwarding\x20service\x20','uniq','with\x20hostname:\x20','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','Stop\x20forwarding\x20traffic\x20from\x20','option','noDefaultsText','name','\x20is\x20running\x20and\x20reachable.','call','exit','__importStar','Project\x20for\x20forwarding','protocol','@northflank/js-client','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','\x20to\x20','\x20in\x20project\x20'];a14A=function(){return A0;};return a14A();}
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a15U=a15I;(function(A,I){const m=a15I,a=A();while(!![]){try{const d=parseInt(m(0x14f))/0x1*(parseInt(m(0x13a))/0x2)+-parseInt(m(0x144))/0x3+parseInt(m(0x163))/0x4+-parseInt(m(0x148))/0x5*(-parseInt(m(0x162))/0x6)+-parseInt(m(0x143))/0x7+parseInt(m(0x147))/0x8+-parseInt(m(0x134))/0x9;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a15A,0x3cece));var __awaiter=this&&this[a15U(0x13e)]||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const e=a15I;function g(f){const S=a15I;try{L(d[S(0x16d)](f));}catch(t){V(t);}}function u(f){try{L(d['throw'](f));}catch(t){V(t);}}function L(f){const k=a15I;f[k(0x141)]?T(f['value']):s(f[k(0x130)])['then'](g,u);}L((d=d[e(0x146)](A,I||[]))[e(0x16d)]());});},__importDefault=this&&this[a15U(0x13f)]||function(A){const x=a15U;return A&&A[x(0x167)]?A:{'default':A};};Object[a15U(0x169)](exports,a15U(0x167),{'value':!![]}),exports[a15U(0x145)]=exports[a15U(0x13c)]=exports['assertContextExisting']=exports[a15U(0x150)]=exports[a15U(0x161)]=exports[a15U(0x140)]=exports[a15U(0x160)]=exports['success']=exports[a15U(0x137)]=exports[a15U(0x15f)]=exports[a15U(0x142)]=exports[a15U(0x16f)]=void 0x0;const node_fetch_1=__importDefault(require(a15U(0x12c))),chalk_1=__importDefault(require(a15U(0x15c))),commander_1=require(a15U(0x15e)),pgk=require('../package.json');exports[a15U(0x16f)]='northflank-cli/'+(pgk===null||pgk===void 0x0?void 0x0:pgk[a15U(0x14e)]);function a15I(A,I){const a=a15A();return a15I=function(d,s){d=d-0x12c;let T=a[d];return T;},a15I(A,I);}function checkUpdate(A){return __awaiter(this,void 0x0,void 0x0,function*(){const M=a15I;function I(a,d){const o=a15I,s=new Date(Number(a));return s['setDate'](s[o(0x171)]()+d),s;}try{if(I(A[M(0x131)](),0x1)>new Date())return;const a=pgk[M(0x14e)],{name:d}=pgk;if(!a)return;const s='https://registry.npmjs.org/'+d+M(0x132),T=yield(0x0,node_fetch_1[M(0x159)])(s,{'method':M(0x12f),'timeout':0x1388}),V=(yield T[M(0x14d)]())[M(0x14e)];needsUpdate(a,V)&&warning('**\x20You\x27re\x20running\x20on\x20version\x20'+a+M(0x164)+V+'.'+('\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20'+d+M(0x12d)+d+M(0x170))),yield A[M(0x168)](new Date());}catch(g){}});}function a15A(){const O=['json','version','7RhVYWj','isValidJSON','addHelpCommand','then','getCurrentBaseUrl','resolve','min','getCurrentContext','option','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','default','green','getTime','chalk','assertContextExisting','commander','error','getCommand','asyncSequential','191742oNOnZt','1938152pIvEdG',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','redBright','reduce','__esModule','setLastUpdateCheck','defineProperty','parse','getCurrentToken','push','next','replace','customUserAgent','\x27\x20**','getDate','Display\x20help\x20for\x20command','node-fetch','\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20','split','GET','value','getLastUpdateCheck','/latest','example:\x202020-02-02T02:02:02Z\x20(date\x20string)\x20or\x201580608922\x20(unix\x20ts)','4491648hZEnxG','No\x20console\x20output','Invalid\x20date\x20received:\x20','warning','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','contextProvider','44656RGXQKr','--verbose','parseDateInput','Verbose\x20output','__awaiter','__importDefault','retry','done','checkUpdate','2588054alXnzp','108759DRtSZY','tsHint','apply','3854448YiQzzx','5ySXGKK','length','yellow','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','storeOptionsAsProperties'];a15A=function(){return O;};return a15A();}exports[a15U(0x142)]=checkUpdate;function needsUpdate(A,I){const N=a15U,a=/(\.0+)+$/,d=A[N(0x16e)](a,'')[N(0x12e)]('.'),s=I[N(0x16e)](a,'')['split']('.');for(let T=0x0;T<Math[N(0x155)](d[N(0x149)],s[N(0x149)]);T+=0x1){const V=parseInt(s[T],0xa)-parseInt(d[T],0xa);if(V>0x0)return!![];if(V<0x0)return![];}return s[N(0x149)]>d[N(0x149)];}function error(A){const q=a15U;console[q(0x15f)](chalk_1['default'][q(0x165)]('Failed:\x20'+A));}exports[a15U(0x15f)]=error;function warning(A){const K=a15U;console[K(0x15f)](chalk_1[K(0x159)][K(0x14a)](''+A));}exports[a15U(0x137)]=warning;function success(A){const y=a15U;console['log'](chalk_1[y(0x159)][y(0x15a)](''+A));}exports['success']=success;function getCommand(A=![]){const D=a15U,I=new commander_1['Command']();return I['helpOption'](undefined,D(0x172)),I[D(0x151)](![]),I[D(0x14c)](![]),I['allowUnknownOption'](![]),I['allowExcessArguments'](![]),I['enablePositionalOptions'](!![]),A&&(I[D(0x157)](D(0x13b),D(0x13d),![]),I['option']('--quiet',D(0x135),![])),I;}exports['getCommand']=getCommand;const retry=(A,I=0x32)=>a=>{let d=A;const s=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield a();}catch(T){if(d<=0x0)throw T;return d-=0x1,yield new Promise(V=>setTimeout(()=>V(),I)),s();}});return s();};exports[a15U(0x140)]=retry;const asyncSequential=(A,I)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const l=a15U,a=Promise[l(0x154)]([]);return A[l(0x166)]((d,s)=>d[l(0x152)](T=>I(s)['then'](V=>{const n=l;return T[n(0x16c)](V),T;})),a);});exports[a15U(0x161)]=asyncSequential;function isValidJSON(A){const v=a15U;try{return JSON[v(0x16a)](A);}catch(I){return![];}}exports[a15U(0x150)]=isValidJSON;function assertContextExisting(A){const X=a15U;if(A[X(0x139)][X(0x156)]()===undefined)throw new Error(X(0x158));if(A[X(0x139)][X(0x153)]()===undefined)throw new Error(X(0x14b));if(A[X(0x139)][X(0x16b)]()===undefined)throw new Error(X(0x138));}exports[a15U(0x15d)]=assertContextExisting;const parseDateInput=A=>{const Q=a15U;try{let I=new Date(A);if(isNaN(I['getTime']())){const a=A['length']===0xd?A/0x3e8:A,d=new Date(0x0);d['setUTCSeconds'](a);if(isNaN(d[Q(0x15b)]()))throw new Error();return d;}return I;}catch(s){throw new Error(Q(0x136)+A+',\x20expected\x20valid\x20date\x20string\x20(example:\x202020-02-02T02:02:02Z)\x20or\x20unix\x20timestamp\x20(example\x201580608922)');}};exports[a15U(0x13c)]=parseDateInput,exports['tsHint']=a15U(0x133);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@northflank/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.13",
|
|
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.
|
|
29
|
+
"@northflank/js-client": "0.7.14",
|
|
30
30
|
"ajv": "8.6.3",
|
|
31
31
|
"bufferutil": "^4.0.7",
|
|
32
32
|
"chalk": "~4.1.0",
|