@northflank/cli 0.9.19 → 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.
- 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/pagination/pagination-helper.js +1 -1
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a11Z=a11o;(function(e,o){const I=a11o,h=e();while(!![]){try{const p=-parseInt(I(0x19c))/0x1*(parseInt(I(0x19a))/0x2)+-parseInt(I(0x185))/0x3+parseInt(I(0x18b))/0x4*(parseInt(I(0x19b))/0x5)+parseInt(I(0x196))/0x6+-parseInt(I(0x190))/0x7*(-parseInt(I(0x199))/0x8)+-parseInt(I(0x19f))/0x9+-parseInt(I(0x186))/0xa;if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a11e,0x86bb0));var __importDefault=this&&this[a11Z(0x183)]||function(e){const k=a11Z;return e&&e[k(0x194)]?e:{'default':e};};Object['defineProperty'](exports,a11Z(0x194),{'value':!![]}),exports[a11Z(0x198)]=exports[a11Z(0x18e)]=void 0x0;const chalk_1=__importDefault(require(a11Z(0x191)));exports[a11Z(0x18e)]=[{'color':'grey','pattern':/\[[0-9]{1,2}\/[a-z]{3}\/[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{2} \+[0-9]{4}\]/i},{'color':a11Z(0x189),'pattern':/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]+)?Z/i},{'color':'grey','pattern':/[0-9]{4}\/[0-9]{2}\/[0-9]{2}/i},{'color':'grey','pattern':/\s\b([0-9]{2}:){1,2}[0-9]{2}\b\s/i},{'color':a11Z(0x195),'pattern':new RegExp('s\x08(?!mailto:)(?:(?:http|https|ftp)://)(?:\x5cS+(?::\x5cS*)?@)?(?:(?:(?:[1-9]\x5cd?|1\x5cd\x5cd|2[01]\x5cd|22[0-3])(?:\x5c.(?:1?\x5cd{1,2}|2[0-4]\x5cd|25[0-5])){2}(?:\x5c.(?:[0-9]\x5cd?|1\x5cd\x5cd|2[0-4]\x5cd|25[0-4]))|(?:(?:[a-z\x5cu00a1-\x5cuffff0-9]+-?)*[a-z\x5cu00a1-\x5cuffff0-9]+)(?:\x5c.(?:[a-z\x5cu00a1-\x5cuffff0-9]+-?)*[a-z\x5cu00a1-\x5cuffff0-9]+)*(?:\x5c.(?:[a-z\x5cu00a1-\x5cuffff]{2,})))|localhost)(?::\x5cd{2,5})?(?:(/|\x5c?|#)[^\x5cs]*)?\x08s','i')},{'color':'green','pattern':/(?:\d{1,3}\.){3}\d{1,3}/i},{'color':a11Z(0x19d),'pattern':/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/},{'color':a11Z(0x1a1),'pattern':/\b(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH)\b/},{'color':'greenBright','pattern':/\b(successful|success|completed|complete|done)\b/i},{'color':a11Z(0x18d),'pattern':/\b(failed|fail|stderr|error|err)\b/i},{'color':a11Z(0x188),'pattern':/\b(information|info|debug)\b/i},{'color':'yellow','pattern':/\b(warning|warn)\b/i},{'color':'blue','pattern':/[0-9a-f]{64}/i},{'color':a11Z(0x1a1),'pattern':/[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}/i}];function a11e(){const W=['\x20--\x20','1393VBjLNF','chalk','color','default','__esModule','bold','3765786ckBOyo','reduce','formatLogLine','22496nNqaKm','2ISzrTJ','4168950ZfoCrz','11017QvZQpc','green','toISOString','8021637jgRJMD','pattern','blue','__importDefault','log','86511xOmMyL','5380060Nkoyey','cyan','gray','grey','replace','4XRgKQV','containerId','red','defaultLogSyntax'];a11e=function(){return W;};return a11e();}function a11o(e,o){const h=a11e();return a11o=function(p,Y){p=p-0x183;let q=h[p];return q;},a11o(e,o);}const formatLogLine=(e,o)=>{const L=a11Z,h=chalk_1[L(0x193)]['dim'](e['ts'][L(0x19e)]()),p=chalk_1[L(0x193)][L(0x187)](e[L(0x18c)]),Y=exports[L(0x18e)][L(0x197)]((J,v)=>{const F=L;return J[F(0x18a)](v[F(0x1a0)],s=>v[F(0x192)]?chalk_1[F(0x193)][v[F(0x192)]](s):chalk_1[F(0x193)]['grey'](s));},e[L(0x184)]),q=o?Y[L(0x18a)](new RegExp(o,'g'),J=>chalk_1[L(0x193)]['bold'](J)):Y;console[L(0x184)](h+'\x20'+p+L(0x18f)+q);};exports[a11Z(0x198)]=formatLogLine;
|
package/dist/metrics/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a12J=a12I;function a12I(u,I){const a=a12u();return a12I=function(x,D){x=x-0xe5;let K=a[x];return K;},a12I(u,I);}(function(u,I){const B=a12I,a=u();while(!![]){try{const x=-parseInt(B(0x158))/0x1+parseInt(B(0x10b))/0x2+-parseInt(B(0xe5))/0x3+parseInt(B(0x134))/0x4*(parseInt(B(0x105))/0x5)+parseInt(B(0x135))/0x6*(-parseInt(B(0xed))/0x7)+parseInt(B(0x16d))/0x8*(-parseInt(B(0x123))/0x9)+-parseInt(B(0x147))/0xa*(-parseInt(B(0x10f))/0xb);if(x===I)break;else a['push'](a['shift']());}catch(D){a['push'](a['shift']());}}}(a12u,0x50652));var __awaiter=this&&this[a12J(0x15a)]||function(u,I,a,x){function D(K){return K instanceof a?K:new a(function(z){z(K);});}return new(a||(a=Promise))(function(K,z){const U=a12I;function H(p){const V=a12I;try{C(x[V(0xea)](p));}catch(b){z(b);}}function s(p){const y=a12I;try{C(x[y(0x156)](p));}catch(b){z(b);}}function C(p){const e=a12I;p['done']?K(p[e(0xfc)]):D(p[e(0xfc)])['then'](H,s);}C((x=x[U(0x16f)](u,I||[]))['next']());});},__importDefault=this&&this[a12J(0x144)]||function(u){return u&&u['__esModule']?u:{'default':u};};Object['defineProperty'](exports,a12J(0xee),{'value':!![]}),exports[a12J(0x138)]=void 0x0;const js_client_1=require(a12J(0x112)),utils_1=require(a12J(0x101)),inquirer_helper_1=require(a12J(0x116)),commander_1=require(a12J(0x172)),terminal_chart_1=require(a12J(0x143)),console_format_helpers_1=require('../formatting/console-format-helpers'),chalk_1=__importDefault(require(a12J(0xf9)));function a12u(){const u9=['askForAddon','pct','alias','containerId','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','getCurrentProjectName','chalk','startTime','description','value','getAsciiChart','clear','askForBuild','getMetricsCommand','../utils',',\x20from:\x20','InquirerHelper','error','565uDyyrw','parseDateInput','argParser','Which\x20metric\x20type\x20to\x20fetch','getStandardMetricsCommand','conflicts','507836sYXfWG','details','Get\x20metrics\x20for\x20the\x20specified\x20','noDefaults','66awhPJl','--build\x20--buildId\x20[buildId]',',\x20to:\x20','@northflank/js-client',',\x20volume:\x20','-o,\x20--output\x20[output]','-t,\x20--metricTypes\x20<metricTypes...>','../inquirer-helper','printMetricsSingle','handleError','tsHint','warning','yaml','No\x20metrics\x20found\x20for\x20this\x20query','Deployment\x20id,\x20example:\x20my-service-54785f4','min','ApiClient','N/A','deploymentId','log','198UurZuL','assign','option','getPaddingDataEnd','Get\x20metrics\x20after\x20this\x20timestamp,\x20','Error\x20while\x20fetching\x20metrics\x20entries:\x20','forEach','getTime','printResponse','length','\x20for\x20container:\x20','askForProject','flat','map','stdout','printInitInfo','data','3756WvdWDc','151302KlacRR','isNaN','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','CliMetrics','message','Metrics\x20overview','job','\x20to\x20get\x20logs\x20from','downSampleData','printMetricsTable','split','printMetricsGraph','metricsRange','bold','../formatting/terminal-chart','__importDefault','service','toTimeString','1147610zCJtOK','inquirerHelper','customUserAgent','Id\x20[NAME]','--noDefaults','default','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','values','toUpperCase','getCurrentServiceName','MetricType','format','json','metrics','Project\x20for\x20logs','throw','toISOString','206731OMLDmo','addOption','__awaiter','apiClient','askForContainer','build-','--timestamp\x20[timestamp]','metadata','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','metricUnit','flatMap','--endTime\x20<timestamp>','\x20--','Fetching\x20data..','all\x20containers','Option','columns','--container\x20--containerId\x20[NAME]','metricsApiClient','printAsTable','toFixed','22624pvcXzV','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','apply','push','rows','commander','metricId','metricsSingle','addonId','metric','670179VaXHMF','\x20seconds','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','choices','yml','next','getPaddingDataStart','askForJob','63tyLAVX','__esModule','\x20in\x20project\x20','--project\x20--projectId\x20[NAME]','refreshInterval','stringify'];a12u=function(){return u9;};return a12u();}class CliMetrics{constructor(u){const S=a12J;this['apiContext']=u,this[S(0xf1)]=0x2710,this['getStandardMetricsCommand']=(I,a)=>{const n=S,x=(0x0,utils_1['getCommand'])(!![])['name']((a?'build-':'')+n(0x154))[n(0xf5)]((a?n(0x15d):'')+n(0x176))[n(0xfb)](n(0x10d)+I)[n(0x125)](n(0xf0),n(0x155))[n(0x125)]('--'+I+n(0x164)+I+n(0x14a),I['charAt'](0x0)[n(0x14f)]()+I['slice'](0x1)+n(0x13c))[n(0x125)](n(0x169),n(0xf7))['option']('--startTime\x20<timestamp>',n(0x127)+utils_1['tsHint'],utils_1['parseDateInput'])['option'](n(0x163),'Get\x20metrics\x20before\x20this\x20timestamp,\x20'+utils_1['tsHint'],utils_1[n(0x106)])['option']('--duration\x20[duration]',n(0x16e))[n(0x159)](new commander_1[(n(0x167))](n(0x114),n(0xe7))[n(0xe8)](Object['values']([n(0x152),n(0x153),'yaml'])))[n(0x159)](new commander_1[(n(0x167))](n(0x115),n(0x108))[n(0xe8)](Object['values'](js_client_1[n(0x151)])))[n(0x159)](new commander_1[(n(0x167))](n(0x15e),n(0x160)+utils_1[n(0x119)])[n(0x107)](utils_1[n(0x106)])[n(0x10a)]([n(0xfa),'endTime']))[n(0x125)](n(0x14b),n(0x137),![])[n(0x159)](new commander_1[(n(0x167))](n(0x114),'Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[n(0xe8)](Object[n(0x14e)](['format',n(0x153),n(0x11b)])));if(a)x[n(0x125)](n(0x110),'Build\x20to\x20get\x20logs\x20from');if(I==='job')x[n(0x125)]('--run\x20--runId\x20[runId]','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0');if(I==='service')x[n(0x125)]('--deployment\x20--deploymentId\x20[deploymentId]',n(0x11d));return x;},this['printMetricsGraph']=(I,a)=>{return x=>{const L=a12I,D=Object['keys'](x)[L(0x162)](K=>{const {values:z,metricInfo:H}=x[K],{metricUnit:s,metricResolution:C}=H;return z['map'](p=>{const g=a12I;var b,i;const {metadata:j,data:A}=p,F=a?(a===null||a===void 0x0?void 0x0:a[g(0x12a)]())>new Date()['getTime']()?new Date():a:undefined,X=new Date((b=A===null||A===void 0x0?void 0x0:A[0x0])===null||b===void 0x0?void 0x0:b['ts']),T=new Date((i=A===null||A===void 0x0?void 0x0:A[A[g(0x12c)]-0x1])===null||i===void 0x0?void 0x0:i['ts']),E=this['getPaddingDataStart'](I,X,C),f=this[g(0x126)](F,T,C),N=[...E,...A,...f],P=N[g(0x130)](o=>[new Date(o['ts'])['valueOf'](),Number(o['value'])])['filter'](o=>!Number[g(0x136)](o[0x0])),m=Math[g(0x11e)](Math['max'](process[g(0x131)][g(0x168)]-0xa,0xa),0x64),k=Math[g(0x11e)](Math['max'](process[g(0x131)]['rows']-0x9,0xa),0xf),R=s===g(0xf4)?0x64:undefined,q=s===g(0xf4)?'%':s,c=(0x0,terminal_chart_1[g(0x13d)])(P,m),M=c[g(0x130)](o=>o[0x1]),r={'min':0x0,'height':k,'max':R,'unit':q,'startTs':I!==null&&I!==void 0x0?I:X,'endTs':F!==null&&F!==void 0x0?F:T};return{'dataSeries':M,'metadata':j,'chartOpts':r,'metricInfo':H};});})[L(0x12f)]();if(D[L(0x12c)]===0x0)(0x0,utils_1[L(0x11a)])(L(0x11c));else D['forEach'](K=>{const l=L,{dataSeries:z,metadata:H,chartOpts:s,metricInfo:C}=K,{containerId:p,volumeId:b}=H,i=b?l(0x113)+b:'';console[l(0x122)](C['metricId']+l(0x12d)+chalk_1['default'][l(0x142)](p)+i),console[l(0x122)]((0x0,terminal_chart_1[l(0xfd)])(z,s));});};},this[S(0x13e)]=(I,a,x)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=S;try{const D=yield this[Z(0x16a)][Z(0x154)][Z(0x174)](I,a,x);console[Z(0xfe)]();if(D[Z(0x104)])(0x0,utils_1['error'])(Z(0x128)+D[Z(0x104)][Z(0x139)]);else this['printMetricsSingle'](D[Z(0x133)]);}catch(K){console['clear'](),(0x0,utils_1[Z(0x104)])(Z(0x128)+K[Z(0x139)]);}}),this[S(0x118)]=I=>{const G=S;if(I[G(0x104)]){const a=JSON[G(0xf2)](I[G(0x104)][G(0x10c)]);throw new Error(G(0x128)+I[G(0x104)]['message']+'\x20'+a);}},this[S(0x132)]=(I,a,x,D,K)=>{const O=S;if(K===!![])return;const {metricTypes:z,endTime:H,startTime:s,duration:C,containerId:p}=D,b=s?O(0x102)+s[O(0x157)]():'',i=H?O(0x111)+H[O(0x157)]():'',j=C?',\x20duration:\x20'+C+O(0xe6):'',A=p?'container\x20'+chalk_1['default'][O(0x142)](p):O(0x166),F=I+'\x20'+chalk_1[O(0x14c)][O(0x142)](a)+O(0xef)+chalk_1[O(0x14c)]['bold'](x),X=''+b+i+j,T=z?',\x20metric\x20types:\x20'+(z===null||z===void 0x0?void 0x0:z['join'](',')):'';console[O(0x122)]('Metrics\x20for\x20'+A+'\x20of\x20'+F+T+X);},this[S(0x15b)]=new js_client_1[(S(0x11f))](u,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[S(0x149)]}),this[S(0x16a)]=this['apiClient'],this[S(0x148)]=new inquirer_helper_1[(S(0x103))](this['apiClient']);}[a12J(0x100)](u,I=![]){const u0=a12J,a=(H,s)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=a12I,C=s[Q(0x10e)],{apiContext:p,inquirerHelper:b}=this;switch(u){case Q(0x145):{const i=C?undefined:p[Q(0x150)]();return s['serviceId']||i||(yield b['askForService'](H)());}case Q(0x13b):{const j=C?undefined:p[Q(0x150)]();return s['jobId']||j||(yield b[Q(0xec)](H)());}case'addon':{const A=C?undefined:p['getCurrentServiceName']();return s[Q(0x175)]||A||(yield b[Q(0xf3)](H)());}}}),x=(H,s,C)=>__awaiter(this,void 0x0,void 0x0,function*(){const d=a12I;if(I)return C['buildId']||(yield this[d(0x148)][d(0xff)](H,u===d(0x145)?s:undefined,u===d(0x13b)?s:undefined,!![])());return undefined;}),D=(H,s,C)=>__awaiter(this,void 0x0,void 0x0,function*(){const v=a12I;if(!I&&C['containerId']!==undefined){if(C[v(0xf6)]!==!![])return C[v(0xf6)];return yield this[v(0x148)][v(0x15c)](H,u===v(0x145)?s:undefined,u===v(0x13b)?s:undefined,!![])();}return undefined;}),K=(H,s,C)=>__awaiter(this,void 0x0,void 0x0,function*(){const t=a12I;if(u===t(0x13b))return C['runId']||(yield this['inquirerHelper']['askForJobRun'](s,H,!![])());return undefined;}),z=(H,s,C)=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a12I;if(u===Y(0x145)){if(C[Y(0x121)]!==!![])return C[Y(0x121)];return C[Y(0x121)];}return undefined;});return this[u0(0x109)](u,I)['action'](H=>__awaiter(this,void 0x0,void 0x0,function*(){const u1=u0,{noDefaults:s,projectId:C,duration:p,timestamp:b,output:i,startTime:j,endTime:A,metricTypes:F,quiet:X}=H;(0x0,utils_1['assertContextExisting'])(this['apiClient']);if(j&&A&&p)throw new Error(u1(0x14d));const {apiContext:T,inquirerHelper:E,metricsApiClient:f}=this,N=s?undefined:T[u1(0xf8)](),P=C||N||(yield E[u1(0x12e)]()),m=yield a(P,H),k=yield x(P,m,H),R=yield K(P,m,H),q=yield z(P,m,H),c=yield D(P,m,H),M={'projectId':P,'entityId':m},r={'containerName':c,'startTime':j,'endTime':A,'duration':p,'timestamp':b,'metricTypes':F,'runId':R,'buildId':k,'deploymentId':q,'isBuild':I!==null&&I!==void 0x0?I:![]},o=!(j||A||p);if(!X&&i!==u1(0x11b)&&i!==u1(0xe9)&&i!==u1(0x153))this[u1(0x132)](u,m,P,r,X);if(o){if(i!==undefined){const w=yield f[u1(0x154)]['metricsSingle'](M,r,u);this[u1(0x118)](w),(0x0,console_format_helpers_1[u1(0x12b)])(i,w[u1(0x133)]);}else[...Array(process[u1(0x131)][u1(0x171)]-0x1)]['forEach']((h,W)=>W===0x0?console[u1(0x122)](u1(0x165)):console['log']()),yield this[u1(0x13e)](M,r,u)(),setInterval(this[u1(0x13e)](M,r,u),this[u1(0xf1)]),yield new Promise(h=>setTimeout(h,this[u1(0xf1)]*0x64));}else{const h=yield f['metrics'][u1(0x141)](M,r,u);this['handleError'](h),i!==undefined?(0x0,console_format_helpers_1[u1(0x12b)])(i,h['data']):this[u1(0x140)](j,A!==null&&A!==void 0x0?A:new Date())(h[u1(0x133)]);}process['exit']();}));}[a12J(0x117)](u){const u6=a12J,I=(D,K)=>{const u2=a12I;if(!(K===null||K===void 0x0?void 0x0:K[u2(0xfc)]))'N/A';const z=D[u2(0x161)]===u2(0xf4)?'%':D[u2(0x161)];return''+Number(K===null||K===void 0x0?void 0x0:K[u2(0xfc)])[u2(0x16c)](0x3)+z;},a=D=>{const u3=a12I;if(!(D===null||D===void 0x0?void 0x0:D['ts']))u3(0x120);return D['ts'][u3(0x146)]()[u3(0x13f)]('\x20')[0x0];},x={};Object['keys'](u)['forEach'](D=>{const u4=a12I,{values:K,metricInfo:z}=u[D];return K[u4(0x129)](H=>{const u5=u4;var s,C;const p=H[u5(0x15f)][u5(0xf6)];Object[u5(0x124)](x,{[p]:Object['assign'](Object[u5(0x124)]({},x===null||x===void 0x0?void 0x0:x[p]),{['time']:a((s=H[u5(0x133)])===null||s===void 0x0?void 0x0:s[0x0]),'containerId':p,[z[u5(0x173)]]:I(z,(C=H[u5(0x133)])===null||C===void 0x0?void 0x0:C[0x0])})});});}),(0x0,console_format_helpers_1[u6(0x16b)])(Object[u6(0x14e)](x),u6(0x13a));}[a12J(0xeb)](u,I,a){const u7=a12J,x=z=>new Date(z[u7(0x12a)]()-D),D=a*0x3e8;if(!u)return[];if(!I)return[];if(x(I)[u7(0x12a)]()<u['getTime']())return[];const K=[{'ts':x(I),'value':0x0}];while(x(K[K[u7(0x12c)]-0x1]['ts'])[u7(0x12a)]()<=u[u7(0x12a)]()){K['unshift']({'ts':x(K[K[u7(0x12c)]-0x1]['ts']),'value':0x0});}return K;}[a12J(0x126)](u,I,a){const u8=a12J,x=z=>new Date(z['getTime']()+D),D=a*0x3e8;if(!u)return[];if(!I)return[];if(x(I)[u8(0x12a)]()>u['getTime']())return[];const K=[{'ts':x(I),'value':0x0}];while(x(K[K['length']-0x1]['ts'])[u8(0x12a)]()<=u['getTime']()){K[u8(0x170)]({'ts':x(K[K[u8(0x12c)]-0x1]['ts']),'value':0x0});}return K;}}exports[a12J(0x138)]=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';const
|
|
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';
|
|
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 a15q=a15I;(function(u,I){const R=a15I,a=u();while(!![]){try{const x=parseInt(R(0x174))/0x1+-parseInt(R(0x175))/0x2+parseInt(R(0x1b8))/0x3*(-parseInt(R(0x1a3))/0x4)+-parseInt(R(0x170))/0x5+-parseInt(R(0x1db))/0x6+-parseInt(R(0x165))/0x7*(parseInt(R(0x1d5))/0x8)+parseInt(R(0x169))/0x9;if(x===I)break;else a['push'](a['shift']());}catch(D){a['push'](a['shift']());}}}(a15u,0xbdecd));function a15I(u,I){const a=a15u();return a15I=function(x,D){x=x-0x15e;let K=a[x];return K;},a15I(u,I);}var __createBinding=this&&this[a15q(0x162)]||(Object[a15q(0x1d1)]?function(u,I,a,x){const c=a15q;if(x===undefined)x=a;var D=Object[c(0x1a5)](I,a);(!D||('get'in D?!I[c(0x16a)]:D['writable']||D[c(0x186)]))&&(D={'enumerable':!![],'get':function(){return I[a];}}),Object['defineProperty'](u,x,D);}:function(u,I,a,x){if(x===undefined)x=a;u[x]=I[a];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a15q(0x1d1)]?function(u,I){const M=a15q;Object[M(0x164)](u,M(0x1b1),{'enumerable':!![],'value':I});}:function(u,I){const r=a15q;u[r(0x1b1)]=I;}),__importStar=this&&this[a15q(0x19b)]||function(u){const o=a15q;if(u&&u[o(0x16a)])return u;var I={};if(u!=null){for(var a in u)if(a!==o(0x1b1)&&Object['prototype'][o(0x1ac)][o(0x1e3)](u,a))__createBinding(I,u,a);}return __setModuleDefault(I,u),I;},__awaiter=this&&this[a15q(0x1af)]||function(u,I,a,x){function D(K){return K instanceof a?K:new a(function(z){z(K);});}return new(a||(a=Promise))(function(K,z){const W=a15I;function H(p){const w=a15I;try{C(x[w(0x188)](p));}catch(b){z(b);}}function s(p){try{C(x['throw'](p));}catch(b){z(b);}}function C(p){const h=a15I;p['done']?K(p[h(0x1b0)]):D(p[h(0x1b0)])[h(0x1c6)](H,s);}C((x=x[W(0x1d0)](u,I||[]))[W(0x188)]());});},__importDefault=this&&this[a15q(0x1c8)]||function(u){const B=a15q;return u&&u[B(0x16a)]?u:{'default':u};};Object['defineProperty'](exports,a15q(0x16a),{'value':!![]}),exports[a15q(0x1d9)]=void 0x0;const js_client_1=require(a15q(0x1a8)),chalk_1=__importDefault(require(a15q(0x1b5))),utils_1=require(a15q(0x1c0)),inquirer_helper_1=require(a15q(0x173)),os=__importStar(require('os')),lodash_1=require(a15q(0x18f)),{EOL}=require('os');function a15u(){const u0=['addon','groupBy','__importStar','error','getCommand','portName','map','portFwdCmd','Running\x20in\x20','all','8xdKyCu','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','getOwnPropertyDescriptor','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','@northflank/js-client','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','--service\x20--serviceId\x20[NAME]','alias','hasOwnProperty','type','apiClient','__awaiter','value','default','description','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','project\x20for\x20forwarding','chalk','warning','\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20(','406707azKHeW','reset','log','--addon\x20--addonId\x20[NAME]','HTTP','askForService','tunnel-close','greenBright','../utils','darwin','\x20with\x20these\x20hostnames:','\x20is\x20exposed\x20with\x20multiple\x20','exit','hostnames','then','win32','__importDefault','\x20\x20-\x20port\x20','length','printHostsFileHint','SIGINT','flatMap','with\x20hostname:\x20','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','apply','create','capitalize','addCommand','--skipHostnames','9111064rkUAQt','repeat','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','Project\x20for\x20forwarding','CliPortForward','action','3989046QJrwLz','forwardAddon','platform','\x20in\x20project\x20','Service\x20to\x20forward','service','port','\x20\x20-\x20Address:\x20','call','stop','Addon\x20to\x20forward','bold','Failed:\x20','Forwarding\x20service\x20','Please\x20ensure\x20the\x20','Port-forwarding\x20for\x20the\x20specified\x20addon','__createBinding','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','defineProperty','7woVLdp','Port-forwarding\x20for\x20the\x20specified\x20service','ApiClient','uniq','32772402nPVumI','__esModule','noDefaultsText','Services:','flat','skipHostnamesText','join','1314995eWerLA','\x20and\x20','assertContextExisting','../inquirer-helper','859583oChSyT','2770334QZrUqN',',\x20hostname:\x20','http://','filter','forward','\x27:\x20\x22','option','\x20-\x20','forEach','C:/Windows/System32/drivers/etc/hosts','success','protocol','data.id','\x20addon\x20ports','name','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','\x20is\x20exposed\x20on\x20','configurable','askForProject','next','getCurrentProjectName','message','hosts','green','printForwardingInfo','--project\x20--projectId\x20[NAME]','lodash','canExecuteWithHostnames','getProxyForwarder','Forwarding\x20','getCurrentServiceName','--noDefaults','data','address','entries','\x20is\x20running\x20and\x20reachable.'];a15u=function(){return u0;};return a15u();}class CliPortForward{constructor(u){const J=a15q;this[J(0x16b)]=J(0x184),this[J(0x16e)]='Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.',this[J(0x1ae)]=new js_client_1[(J(0x167))](u,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']});const I=new inquirer_helper_1['InquirerHelper'](this[J(0x1ae)]);this[J(0x1a0)]=(0x0,utils_1[J(0x19d)])()[J(0x183)](J(0x179))[J(0x1ab)]('fwd')[J(0x1b2)](J(0x1a6));const a=(0x0,utils_1[J(0x19d)])(!![])['name'](J(0x1a2))[J(0x1b2)](J(0x1a4))[J(0x17b)](J(0x18e),J(0x1b4))['option'](J(0x194),this[J(0x16b)],![])[J(0x17b)](J(0x1d4),this[J(0x16e)],![])['action'](({noDefaults:K,projectId:z,skipHostnames:H})=>__awaiter(this,void 0x0,void 0x0,function*(){const V=J;(0x0,utils_1[V(0x172)])(this[V(0x1ae)]);const s=this[V(0x191)](H),C=K?undefined:u[V(0x189)](),p=z||C||(yield I[V(0x187)]());try{const {services:b,addons:i}=yield s['forwardProject']({'projectId':p},H);if(b['length']+i['length']<=0x0)(0x0,utils_1['warning'])(V(0x1d7)+chalk_1[V(0x1b1)]['bold'](p));else{const j=b[V(0x178)](X=>X[V(0x1ca)]>0x0)[V(0x1ca)],A=i['filter'](X=>X['length']>0x0)[V(0x1ca)],F=V(0x1de)+chalk_1['default']['bold'](p);console['log'](V(0x192)+chalk_1['default'][V(0x18c)][V(0x1e6)](j+'\x20service\x20ports')+V(0x171)+chalk_1[V(0x1b1)][V(0x18c)][V(0x1e6)](A+V(0x182))+F),console[V(0x1ba)](),console[V(0x1ba)](chalk_1[V(0x1b1)][V(0x1e6)](V(0x16c))),b[V(0x17d)](X=>{const y=V;if(X['length']>=0x1&&!X[0x0][y(0x19c)])this[y(0x18d)](X,{'type':y(0x1e0),'name':X[0x0]['data']['id']},H);}),console[V(0x1ba)](chalk_1[V(0x1b1)][V(0x1e6)]('Addons:')),i[V(0x17d)](X=>{const e=V;if(X['length']>=0x1&&!X[0x0][e(0x19c)])this[e(0x18d)](X,{'type':e(0x199),'name':X[0x0][e(0x195)]['id']},H);}),this['printHostsFileHint']([...b['flat'](),...i[V(0x16d)]()],H);}}catch(X){(0x0,utils_1['error'])(V(0x15e)+X[V(0x18a)]);}})),x=(0x0,utils_1[J(0x19d)])(!![])[J(0x183)](J(0x1e0))['description'](J(0x166))[J(0x17b)](J(0x18e),J(0x1d8))[J(0x17b)](J(0x1aa),J(0x1df))[J(0x17b)](J(0x194),this[J(0x16b)],![])['option'](J(0x1d4),this[J(0x16e)],![])[J(0x1da)](({noDefaults:K,projectId:z,serviceId:H,skipHostnames:s})=>__awaiter(this,void 0x0,void 0x0,function*(){const U=J;(0x0,utils_1['assertContextExisting'])(this[U(0x1ae)]);const C=this[U(0x191)](s),p=K?undefined:u['getCurrentProjectName'](),b=z||p||(yield I['askForProject']()),i=K?undefined:u[U(0x193)](),j=H||i||(yield I[U(0x1bd)](b)());console['log'](U(0x15f)+chalk_1['default'][U(0x1e6)](j)+U(0x1de)+chalk_1['default'][U(0x1e6)](b));try{const A=yield C['forwardService']({'projectId':b,'serviceId':j},s);this['printForwardingInfo'](A,{'name':j,'type':U(0x1e0)},s),this[U(0x1cb)](A,s);}catch(F){(0x0,utils_1[U(0x19c)])(U(0x15e)+F[U(0x18a)]);}})),D=(0x0,utils_1[J(0x19d)])(!![])[J(0x183)](J(0x199))[J(0x1b2)](J(0x161))[J(0x17b)](J(0x18e),J(0x1d8))[J(0x17b)](J(0x1bb),J(0x1e5))[J(0x17b)](J(0x1d4),this[J(0x16e)],![])[J(0x1da)](({noDefaults:K,projectId:z,addonId:H,skipHostnames:s})=>__awaiter(this,void 0x0,void 0x0,function*(){const S=J;(0x0,utils_1[S(0x172)])(this['apiClient']);const C=this['getProxyForwarder'](s),p=K?undefined:u['getCurrentProjectName'](),b=z||p||(yield I[S(0x187)]()),i=H||(yield I['askForAddon'](b)());console[S(0x1ba)]('Forwarding\x20addon\x20'+chalk_1[S(0x1b1)][S(0x1e6)](i)+S(0x1de)+chalk_1[S(0x1b1)][S(0x1e6)](b));try{const j={'projectId':b,'addonId':i},A=yield C[S(0x1dc)](j,s);this[S(0x18d)](A,{'name':i,'type':S(0x199)},s),this[S(0x1cb)](A,s);}catch(F){(0x0,utils_1[S(0x19c)])(S(0x15e)+F[S(0x18a)]);}}));this['portFwdCmd'][J(0x1d3)](a),this['portFwdCmd']['addCommand'](x),this['portFwdCmd']['addCommand'](D);}[a15q(0x191)](u=![]){const n=a15q,I=this['apiClient']['forwarding'];if(!u){const a=I[n(0x190)]();if(a[n(0x19c)])throw new Error(a[n(0x18a)]);}return I['on'](n(0x1be),(x,D)=>{const L=n,K=chalk_1[L(0x1b1)]['bold'](D[L(0x1ad)]+'\x20\x27'+D['id']+'\x27'),z=D['hostnames'][L(0x1ca)]>0x0;(0x0,utils_1[L(0x1b6)])('Stop\x20forwarding\x20traffic\x20from\x20'+D[L(0x196)]+':'+D[L(0x1e1)]+'\x20to\x20'+K),u&&z&&(0x0,utils_1[L(0x1b6)])('\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.');}),I['on']('connection-error',(x,D,K)=>{const g=n;(0x0,utils_1[g(0x1b6)])(g(0x1a7)+D['address']+':'+D['port']+g(0x17a)+(K===null||K===void 0x0?void 0x0:K[g(0x18a)])+'\x22');}),process['on'](n(0x1cc),()=>__awaiter(this,void 0x0,void 0x0,function*(){const l=n;try{yield I[l(0x1e4)]();}catch(x){(0x0,utils_1[l(0x19c)])('Cleaning\x20up\x20open\x20connections\x20failed:\x20'+x[l(0x18a)]);}finally{process[l(0x1c4)]();}})),I;}[a15q(0x18d)](u,I,a=![]){const Z=a15q,{type:x,name:D}=I;if(u[Z(0x1ca)]<=0x0){const s=Z(0x160)+I[Z(0x1ad)]+Z(0x198);(0x0,utils_1['warning'])(Z(0x1cf)+x+'\x20'+chalk_1[Z(0x1b1)][Z(0x1e6)](D)+'.\x20'+s);return;}const K=(0x0,lodash_1[Z(0x19a)])(u,Z(0x181)),z=C=>'\x20('+(C[Z(0x19e)]?C[Z(0x19e)]+Z(0x17c):'')+C[Z(0x180)]+')';function H(C,p=0x2){const G=Z;if(!a){const b=C[G(0x180)]===G(0x1bc)?G(0x177):'';C[G(0x1c5)][G(0x17d)](i=>{const O=G;console[O(0x1ba)]((0x0,lodash_1[O(0x1d6)])('\x20',p)+'-\x20'+b+i+':'+C['port']);});}}Object[Z(0x197)](K)['forEach'](([C,p])=>{const Q=Z;var b,i;const j='>\x20'+(0x0,lodash_1[Q(0x1d2)])(x)+'\x20\x27'+chalk_1[Q(0x1b1)][Q(0x1bf)][Q(0x1e6)](C)+'\x27';if(x===Q(0x199)){if(p[Q(0x1ca)]===0x1){const A=p[0x0];if(A[Q(0x19c)]){(0x0,utils_1[Q(0x19c)])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+C+':\x20'+A[Q(0x19c)][Q(0x18a)]);return;}const F=A['data'],X=!a?'\x20'+chalk_1['default'][Q(0x1b9)](Q(0x1ce)+F[Q(0x1c5)][Q(0x16f)](',')):'';(0x0,utils_1['success'])(j+Q(0x185)+F[Q(0x196)]+':'+F[Q(0x1e1)]+z(F)+X);}else{const T=(0x0,lodash_1['uniqBy'])(p,E=>{const d=Q;var f,N;return(N=(f=E===null||E===void 0x0?void 0x0:E['data'])===null||f===void 0x0?void 0x0:f['hostnames'])===null||N===void 0x0?void 0x0:N[d(0x16f)](',');})[Q(0x1ca)]>0x1;(0x0,utils_1[Q(0x17f)])(j+Q(0x1c3)+(T?Q(0x18b):'ports')+':'),p[Q(0x17d)](E=>{const v=Q;if(E[v(0x19c)]){(0x0,utils_1[v(0x19c)])(v(0x1a9)+C+':\x20'+E[v(0x19c)][v(0x18a)]);return;}const f=E['data'],N=!a?v(0x176)+f['hostnames'][v(0x16f)](','):'';console['log'](v(0x1e2)+f[v(0x196)]+':'+f['port']+z(f)+N);});}}if(x===Q(0x1e0)){if(p[Q(0x1ca)]===0x1){const E=p[0x0];if(E[Q(0x19c)]){(0x0,utils_1[Q(0x19c)])(Q(0x1a9)+C+':\x20'+E['error'][Q(0x18a)]);return;}const f=E['data'],N=!a?Q(0x1c2):':',P=f[Q(0x196)]+':'+f[Q(0x1e1)]+z(f);(0x0,utils_1['success'])(j+'\x20is\x20exposed\x20on\x20'+P+N),H(f);}else(0x0,utils_1['success'])(j+Q(0x185)+((i=(b=p[0x0])===null||b===void 0x0?void 0x0:b[Q(0x195)])===null||i===void 0x0?void 0x0:i['address'])+'\x20with\x20multiple\x20ports:'),p[Q(0x17d)](m=>{const t=Q;if(m[t(0x19c)]){(0x0,utils_1[t(0x19c)])(t(0x1a9)+C+':\x20'+m['error'][t(0x18a)]);return;}const k=m['data'];(0x0,utils_1[t(0x17f)])(t(0x1c9)+k[t(0x1e1)]+z(k)),H(k,0x4);});}});}[a15q(0x1cb)](u,I=![]){const Y=a15q;if(I){const a=u[Y(0x1cd)](p=>p['data'])[Y(0x178)](p=>p!==undefined),x=(process===null||process===void 0x0?void 0x0:process[Y(0x1dd)])===Y(0x1c7),D=os['platform']()===Y(0x1c1),K=x?Y(0x17e):'/etc/hosts',z=chalk_1['default']['bold']('skipHostnames'),H=D?EOL+'Running\x20on\x20macOS\x20in\x20'+z+Y(0x1b3):undefined;let s=Y(0x1a1)+z+Y(0x163)+'--skipHostnames'+Y(0x1b7)+K+'):';H!==undefined&&(0x0,utils_1[Y(0x1b6)])(H!==null&&H!==void 0x0?H:'');(0x0,utils_1[Y(0x1b6)])(s);const C=a[Y(0x19f)](p=>p[Y(0x196)]+'\x20\x20\x20\x20\x20\x20\x20\x20\x20'+p[Y(0x1c5)]['join']('\x20'));console[Y(0x1ba)]((0x0,lodash_1[Y(0x168)])(C)[Y(0x16f)](EOL)),console[Y(0x1ba)]();}}}exports[a15q(0x1d9)]=CliPortForward;
|
|
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
|
|
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.
|
|
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.
|
|
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",
|