@northflank/cli 0.9.5 → 0.9.6-beta.0
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 -0
- package/dist/formatting/console-format-helpers.js +1 -0
- package/dist/formatting/terminal-chart.js +1 -0
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/logs/index.js +1 -0
- package/dist/logs/log-formatter.js +1 -0
- package/dist/metrics/index.js +1 -0
- 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 +3 -3
- package/dist/command-overview.js +0 -1
- package/dist/console-format-helpers.js +0 -1
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a4v=a4M;(function(N,M){const d=a4M,V=N();while(!![]){try{const L=-parseInt(d(0x178))/0x1+parseInt(d(0x198))/0x2+-parseInt(d(0x193))/0x3*(-parseInt(d(0x16e))/0x4)+parseInt(d(0x1a4))/0x5*(parseInt(d(0x1b1))/0x6)+-parseInt(d(0x15a))/0x7+-parseInt(d(0x1a8))/0x8*(-parseInt(d(0x17f))/0x9)+-parseInt(d(0x155))/0xa;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a4N,0x7082e));var __awaiter=this&&this[a4v(0x14d)]||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){const t=a4M;function Q(X){const a=a4M;try{h(L[a(0x194)](X));}catch(u){r(u);}}function z(X){const l=a4M;try{h(L[l(0x196)](X));}catch(u){r(u);}}function h(X){const o=a4M;X['done']?R(X[o(0x17b)]):k(X[o(0x17b)])[o(0x16b)](Q,z);}h((L=L['apply'](N,M||[]))[t(0x194)]());});},__importDefault=this&&this['__importDefault']||function(N){const g=a4v;return N&&N[g(0x156)]?N:{'default':N};};Object['defineProperty'](exports,a4v(0x156),{'value':!![]}),exports[a4v(0x175)]=void 0x0;const js_client_1=require(a4v(0x195)),chalk_1=__importDefault(require(a4v(0x181))),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper');class CliExec{constructor(N){const m=a4v;this[m(0x1a0)]=k=>(0x0,utils_1[m(0x179)])(!![])[m(0x161)](k)[m(0x154)](m(0x15b)+k)['option'](m(0x19f),'Project\x20for\x20exec')[m(0x1aa)]('--'+k+'\x20--'+k+'Id\x20[NAME]',k[m(0x16a)](0x0)[m(0x15e)]()+k[m(0x18e)](0x1)+m(0x16c))[m(0x1aa)](m(0x16f),m(0x174))['option'](m(0x199),m(0x166))[m(0x1aa)](m(0x170),m(0x186))[m(0x1aa)](m(0x1a1),m(0x153))[m(0x1aa)](m(0x159),'Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])[m(0x1aa)](m(0x162),m(0x18a)),this[m(0x1a3)]=()=>({'columns':process['stdout']['columns'],'rows':process['stdout'][m(0x1b0)]}),this['execStartLog']=(k,R,r,Q,z,h,X,u)=>{const W=m;if(u===!![])return;const p=Q===W(0x18c),F=p?'without\x20shell':Q===undefined?'with\x20shell\x20session':W(0x192)+chalk_1['default'][W(0x19b)](Q),S=z!==undefined?'with\x20user:'+z:'',b=h!==undefined?W(0x167)+h:'',s=X!==undefined?W(0x1a6)+chalk_1['default'][W(0x19b)](X)+'\x27':'',y=[s,F,S,b][W(0x152)](T=>T!=='')[W(0x188)]('\x20'),c=W(0x169)+chalk_1['default']['bold'](W(0x171))+')';console['log'](W(0x1ab)+k+'\x20'+chalk_1[W(0x19d)][W(0x1a5)](R)+W(0x150)+chalk_1[W(0x19d)][W(0x1a5)](r)+'\x20'+y+'\x20'+c);},this[m(0x19a)]=(k,R,r=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const x=m;var Q,z;let h=![];try{if(process['stdin'][x(0x1a2)]){const u=require(x(0x173));u[x(0x191)](process[x(0x184)]),process['stdin']['setRawMode'](!![]),process[x(0x180)]['on']('resize',()=>{k['resizeTerminal'](this['getTerminalSize']());}),process[x(0x184)]['on'](x(0x14f),(p,F)=>{const K=x;F[K(0x190)]==='\x04'&&(h?(process[K(0x184)][K(0x17a)](![]),(0x0,utils_1[K(0x158)])(K(0x176)),process['exit']()):(h=!![],setTimeout(()=>h=![],0x190)));});}process[x(0x184)][x(0x17d)](k[x(0x18d)]),k['stdErr']['pipe'](process['stderr']),k['stdOut'][x(0x17d)](process[x(0x180)]),k['on'](x(0x197),p=>{const A=x;var F;(0x0,utils_1[A(0x197)])(A(0x1af)+R+A(0x189)+((F=p[A(0x177)])!==null&&F!==void 0x0?F:p)),process[A(0x184)]['isTTY']&&process[A(0x184)][A(0x17a)](![]),process[A(0x17e)](-0x1);});const X=yield k[x(0x14e)]();if(r!==!![]){const p=(Q=X===null||X===void 0x0?void 0x0:X[x(0x19e)])!==null&&Q!==void 0x0?Q:x(0x172),F=(z=X===null||X===void 0x0?void 0x0:X[x(0x160)])!==null&&z!==void 0x0?z:-0x1,S=(X===null||X===void 0x0?void 0x0:X['message'])?',\x20details:\x20'+X[x(0x177)]:'';p==='Success'?(0x0,utils_1[x(0x187)])(x(0x15f)+F):(0x0,utils_1[x(0x158)])('Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20'+p+x(0x164)+F+S);}return X;}finally{process['stdin'][x(0x1a2)]&&process[x(0x184)][x(0x17a)](![]);}}),this[m(0x151)]=new js_client_1[(m(0x18f))](N,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[m(0x165)]});const M=new inquirer_helper_1['InquirerHelper'](this[m(0x151)]);this['execCmd']=(0x0,utils_1[m(0x179)])()[m(0x161)](m(0x1ac))['alias'](m(0x19c))[m(0x154)](m(0x18b));const V=this[m(0x1a0)](m(0x185))[m(0x15d)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const e=m,{noDefaults:R,projectId:r,serviceId:Q,containerId:z,shellCmd:h,user:X,group:u,command:p,quiet:F}=k;(0x0,utils_1[e(0x17c)])(this['apiClient']);try{const S=R?undefined:N[e(0x168)](),b=r||S||(yield M[e(0x163)]()),s=R?undefined:N[e(0x15c)](),y=Q||s||(yield M[e(0x157)](b)()),c=h!==null&&h!==void 0x0?h:p!==undefined?e(0x18c):undefined;this[e(0x1a9)]('service',y,b,c,X,u,p,F);const T=process[e(0x180)][e(0x183)],U=process[e(0x180)][e(0x1b0)],Z={'projectId':b,'serviceId':y},n=yield this['apiClient'][e(0x19c)][e(0x182)](Z,{'containerName':z,'command':p,'shell':c,'user':X,'group':u,'ttyColumns':T,'ttyRows':U});yield this['handleShellSession'](n,e(0x185),F);}catch(I){(0x0,utils_1[e(0x197)])(''+I[e(0x177)]);}finally{process[e(0x17e)]();}})),L=this[m(0x1a0)](m(0x1ae))[m(0x15d)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const f=m,{projectId:R,jobId:r,containerId:Q,noDefaults:z,shellCmd:h,user:X,group:u,command:p,quiet:F}=k;(0x0,utils_1[f(0x17c)])(this[f(0x151)]);try{const S=z?undefined:N[f(0x168)](),b=R||S||(yield M[f(0x163)]()),s=r||(yield M['askForJob'](b)());this[f(0x1a9)](f(0x1ae),s,b,h,F);const {rows:y,columns:c}=this[f(0x1a3)](),T={'projectId':b,'jobId':s},U=yield this[f(0x151)][f(0x19c)][f(0x1ad)](T,{'containerName':Q,'command':p,'shell':h,'user':X,'group':u,'ttyColumns':c,'ttyRows':y});yield this[f(0x19a)](U,'job',F);}catch(Z){(0x0,utils_1['error'])(''+Z[f(0x177)]);}finally{process[f(0x17e)]();}}));this[m(0x16d)][m(0x1a7)](V),this[m(0x16d)][m(0x1a7)](L);}}exports[a4v(0x175)]=CliExec;function a4M(N,M){const V=a4N();return a4M=function(L,k){L=L-0x14d;let R=V[L];return R;},a4M(N,M);}function a4N(){const G=['getCommand','setRawMode','value','assertContextExisting','pipe','exit','7659UrxnmH','stdout','chalk','execServiceSession','columns','stdin','service','Run\x20command\x20with\x20this\x20user','success','join','\x20command\x20exec:\x20','Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','none','stdIn','slice','ApiClient','sequence','emitKeypressEvents','shell\x20command\x20','843wthkbO','next','@northflank/js-client','throw','error','514230EdsZTA','--shell-cmd\x20[SHELL-CMD]','handleShellSession','greenBright','exec','default','status','--project\x20--projectId\x20[NAME]','getStandardExecCommand','--group\x20[GROUP]','isTTY','getTerminalSize','10ryPBzH','bold','with\x20command\x20\x27','addCommand','3456LqLmnG','execStartLog','option','Exec\x20','command-exec','execJobSession','job','Error\x20occured\x20during\x20','rows','2021598KQNnPQ','__awaiter','waitForCommandResult','keypress','\x20in\x20project\x20','apiClient','filter','Run\x20command\x20with\x20this\x20group','description','4936640hSevOa','__esModule','askForService','warning','--noDefaults','5964210nnVoox','Command\x20exec\x20for\x20the\x20specified\x20','getCurrentServiceName','action','toUpperCase','Command\x20completed\x20successfully,\x20exit\x20code:\x20','exitCode','name','--cmd\x20--command\x20[COMMAND]','askForProject',',\x20exit\x20code:\x20','customUserAgent','Run\x20command\x20with\x20shell\x20(e.g.\x20bash,sh).\x20If\x20not\x20set\x20and\x20no\x20command\x20is\x20provided,\x20several\x20standard\x20shells\x20will\x20be\x20attempted.\x20If\x20not\x20set\x20and\x20a\x20command\x20is\x20provided,\x20the\x20command\x20will\x20run\x20without\x20shell','with\x20group:','getCurrentProjectName','(exit\x20with\x20two\x20quick\x20','charAt','then','\x20to\x20exec\x20into','execCmd','12676kAEAui','--container\x20--containerId\x20[NAME]','--user\x20[USER]','\x27Ctrl+D\x27','Unknown','readline','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','CliExec','Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.','message','382562nkIVWI'];a4N=function(){return G;};return a4N();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function a5M(N,M){const V=a5N();return a5M=function(L,k){L=L-0x91;let R=V[L];return R;},a5M(N,M);}const a5v=a5M;(function(N,M){const Z=a5M,V=N();while(!![]){try{const L=parseInt(Z(0x9e))/0x1+-parseInt(Z(0x97))/0x2*(-parseInt(Z(0xb5))/0x3)+parseInt(Z(0x9b))/0x4+parseInt(Z(0xb1))/0x5+parseInt(Z(0xac))/0x6*(-parseInt(Z(0x9c))/0x7)+-parseInt(Z(0x95))/0x8*(parseInt(Z(0xa3))/0x9)+-parseInt(Z(0xa0))/0xa;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a5N,0x4e3d3));var __awaiter=this&&this['__awaiter']||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){const d=a5M;function Q(X){const n=a5M;try{h(L[n(0x98)](X));}catch(u){r(u);}}function z(X){try{h(L['throw'](X));}catch(u){r(u);}}function h(X){const I=a5M;X[I(0xa2)]?R(X[I(0xb3)]):k(X[I(0xb3)])[I(0xb6)](Q,z);}h((L=L[d(0x92)](N,M||[]))[d(0x98)]());});},__importDefault=this&&this[a5v(0xa5)]||function(N){const a=a5v;return N&&N[a(0xb2)]?N:{'default':N};};Object[a5v(0xa6)](exports,a5v(0xb2),{'value':!![]}),exports[a5v(0xad)]=void 0x0;function a5N(){const g=['slice','green','245848WQisxC','commands','110wjiLAz','next','option','chalk','1469716vSkKuj','2804522hEkbBh','command-overview','594521dFkWXS','log','5821850eoQznZ','forEach','done','36YGCwnW','getCommand','__importDefault','defineProperty','length','Prints\x20a\x20tree\x20view\x20of\x20all\x20available\x20commands','bold','name','--verbose','6DStEUV','getCommandOverview','map','Print\x20command\x20descriptions','description','1069285PZqllV','__esModule','value','../utils','13659blXdPW','then','opts','apply'];a5N=function(){return g;};return a5N();}const chalk_1=__importDefault(require(a5v(0x9a))),utils_1=require(a5v(0xb4));function getCommandOverview(N){const l=a5v;return(0x0,utils_1[l(0xa4)])()['name'](l(0x9d))[l(0xb0)](l(0xa8))[l(0x99)](l(0xab),l(0xaf))['action'](M=>__awaiter(this,void 0x0,void 0x0,function*(){const {verbose:V}=M;function L(k,R){const o=a5M;var r;const Q=(c,T=!![])=>T?chalk_1['default'][o(0xa9)][o(0x94)](c[o(0xaa)]()):c['name'](),z=R[o(0xa7)]===0x0,h=k[o(0x96)];let X='';const u=h['length']===0x0,p=u||((r=Object['keys'](k===null||k===void 0x0?void 0x0:k[o(0x91)]()))===null||r===void 0x0?void 0x0:r[o(0xa7)])>0x0;!z&&(X=h&&!u?'┬\x20':'─\x20');const F=V&&p&&k[o(0xb0)]()?':\x20'+k['description']():'';console[o(0x9f)](''+R+X+Q(k,p)+F);let S=R;if(!z){const c=R['slice'](-0x2)==='└─';S=R[o(0x93)](0x0,-0x2)+(c?'\x20\x20':'│\x20');}const b=S+'├─',s=S+'└─',y=h['every'](T=>T['commands']['length']===0x0);y&&!u&&!V?console[o(0x9f)](s+'\x20'+h[o(0xae)](T=>Q(T))['join'](',\x20')):h[o(0xa1)]((T,U)=>{const t=o;L(T,h[t(0xa7)]-0x1===U?s:b);});}L(N,'');}));}exports[a5v(0xad)]=getCommandOverview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a6b=a6M;(function(N,M){const S=a6M,V=N();while(!![]){try{const L=parseInt(S(0x22b))/0x1+-parseInt(S(0x22a))/0x2*(parseInt(S(0x1f3))/0x3)+-parseInt(S(0x20d))/0x4+-parseInt(S(0x202))/0x5+-parseInt(S(0x209))/0x6+parseInt(S(0x200))/0x7*(-parseInt(S(0x20a))/0x8)+parseInt(S(0x224))/0x9;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a6N,0xe7ae4));function a6M(N,M){const V=a6N();return a6M=function(L,k){L=L-0x1f0;let R=V[L];return R;},a6M(N,M);}var __createBinding=this&&this['__createBinding']||(Object[a6b(0x201)]?function(N,M,V,L){const s=a6b;if(L===undefined)L=V;var R=Object[s(0x1fc)](M,V);(!R||(s(0x228)in R?!M[s(0x220)]:R[s(0x221)]||R[s(0x1f5)]))&&(R={'enumerable':!![],'get':function(){return M[V];}}),Object[s(0x219)](N,L,R);}:function(N,M,V,L){if(L===undefined)L=V;N[L]=M[V];}),__setModuleDefault=this&&this[a6b(0x225)]||(Object[a6b(0x201)]?function(N,M){Object['defineProperty'](N,'default',{'enumerable':!![],'value':M});}:function(N,M){const y=a6b;N[y(0x206)]=M;}),__importStar=this&&this[a6b(0x207)]||function(N){const c=a6b;if(N&&N[c(0x220)])return N;var M={};if(N!=null){for(var V in N)if(V!==c(0x206)&&Object[c(0x1fd)]['hasOwnProperty']['call'](N,V))__createBinding(M,N,V);}return __setModuleDefault(M,N),M;},__importDefault=this&&this[a6b(0x229)]||function(N){const T=a6b;return N&&N[T(0x220)]?N:{'default':N};};Object[a6b(0x219)](exports,'__esModule',{'value':!![]}),exports[a6b(0x20b)]=exports[a6b(0x204)]=exports[a6b(0x216)]=exports['handleJsonOutput']=exports[a6b(0x1fb)]=exports['printAsTable']=void 0x0;const chalk_1=__importDefault(require('chalk')),_=__importStar(require('lodash')),util=__importStar(require('util')),yaml=require(a6b(0x210)),columnify=require(a6b(0x1f2));function printAsTable(N,M,V,L=![],k=0x0){const U=a6b;!L&&console[U(0x1f7)](''+chalk_1[U(0x206)]['bold'](M));function R(Q){const Z=U;return Q===Z(0x22c)?Q:Q[Z(0x205)](Z(0x22c),'');}function r(Q,z){const I=U;function h(u){const n=a6M,p=new Date(u);return p[n(0x1f6)]()+'/'+p[n(0x1f0)]()+'/'+p['getFullYear']()+'\x0a'+p[n(0x21b)]()+':'+p['getMinutes']()+':'+p[n(0x1f8)]();}const X=['createdat',I(0x1f9)];if(X[I(0x20f)](z[I(0x203)]())&&_[I(0x1fa)](Q)&&Q[I(0x217)]()[I(0x214)]===0xd)return h(Number(Q));if(_[I(0x21d)](Q)){if(z!=='disabled'&&z['includes'](I(0x22c)))return Q?'x':'✔';return Q?'✔':'x';}if(_[I(0x21e)](Q))return util['inspect'](Q,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});return Q;}if(_[U(0x211)](N)){N[U(0x214)]===0x0&&console[U(0x1f7)](U(0x227)+M[U(0x203)]()+'\x20found');const Q=N[U(0x226)]((X,u)=>{const d=U,p={'i':u+k};return Object[d(0x1ff)](X)[d(0x1fe)](F=>{const v=d;(_[v(0x21a)](V)||V[v(0x20f)](F[v(0x203)]()))&&_[v(0x21c)](p,R(F),r(X[F],F));}),p;}),z=_[U(0x215)](Object['keys']((Q===null||Q===void 0x0?void 0x0:Q[0x0])||[]))[U(0x20e)]((X,u)=>{const a=U,p=F=>F!=='i'?F!==a(0x21f)?0x0:0x1:0x2;return p(u)-p(X);}),h={'maxWidth':0x1e,'preserveNewLines':!![],'showHeaders':!L,'config':{'_id':{'maxWidth':0x5,'truncate':!![]},'i':{'showHeaders':![]}},'columns':z};console[U(0x1f7)](columnify(Q,h));}else console['log'](N);}exports[a6b(0x1f4)]=printAsTable;function consoleFormat(N){const l=a6b;if(!_[l(0x21e)](N))return N===null||N===void 0x0?void 0x0:N[l(0x217)]();return util[l(0x213)](N,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});}exports[a6b(0x1fb)]=consoleFormat;const handleJsonOutput=(N,M)=>{const o=a6b,V=N===o(0x208);if(V)console[o(0x1f7)](JSON[o(0x20c)](M,null,'\x20'));};exports[a6b(0x222)]=handleJsonOutput;const handleYamlOutput=(N,M)=>{const t=a6b,V=N===t(0x223)||N===t(0x212);if(V)console['log'](yaml[t(0x218)](M));};exports[a6b(0x216)]=handleYamlOutput;const handleFormattedOutput=(N,M)=>{const g=a6b,V=N===g(0x1f1);if(V)console[g(0x1f7)](consoleFormat(M));};function a6N(){const W=['4876962sXhrtD','15464daeZfr','printResponse','stringify','3565340RNlClk','sort','includes','js-yaml','isArrayLike','yml','inspect','length','clone','handleYamlOutput','toString','safeDump','defineProperty','isUndefined','getHours','set','isBoolean','isObjectLike','internalId','__esModule','writable','handleJsonOutput','yaml','35993772NzLpgi','__setModuleDefault','map','No\x20','get','__importDefault','6pRccPL','887265tdyzjk','disabled','getMonth','format','columnify','261489MYencs','printAsTable','configurable','getDate','log','getSeconds','updatedat','isFinite','consoleFormat','getOwnPropertyDescriptor','prototype','forEach','keys','5677VdnaRL','create','2021475XNHZXQ','toLowerCase','handleFormattedOutput','replace','default','__importStar','json'];a6N=function(){return W;};return a6N();}exports['handleFormattedOutput']=handleFormattedOutput;const printResponse=(N,M)=>{const m=a6b;(0x0,exports[m(0x222)])(N,M),(0x0,exports['handleYamlOutput'])(N,M),(0x0,exports[m(0x204)])(N,M);};exports[a6b(0x20b)]=printResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a7C=a7M;(function(N,M){const B=a7M,V=N();while(!![]){try{const L=parseInt(B(0x1a0))/0x1*(-parseInt(B(0x1a2))/0x2)+-parseInt(B(0x1c1))/0x3*(-parseInt(B(0x1b6))/0x4)+parseInt(B(0x1a9))/0x5*(-parseInt(B(0x1a6))/0x6)+-parseInt(B(0x1ac))/0x7+parseInt(B(0x1ae))/0x8*(parseInt(B(0x1b4))/0x9)+-parseInt(B(0x1ab))/0xa+-parseInt(B(0x1b9))/0xb*(-parseInt(B(0x1a3))/0xc);if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a7N,0x31fa7));var __importDefault=this&&this['__importDefault']||function(N){const O=a7M;return N&&N[O(0x1ba)]?N:{'default':N};};Object[a7C(0x1c0)](exports,a7C(0x1ba),{'value':!![]}),exports[a7C(0x1ad)]=exports[a7C(0x1b0)]=void 0x0;const chalk_1=__importDefault(require(a7C(0x1cb))),colored=(N,M)=>{return M===undefined?N:chalk_1['default'][M](N);},getAsciiChart=(N,M={})=>{const N0=a7C,V=Array[N0(0x1bd)](N[0x0])?N:[N];let L=typeof M[N0(0x1b2)]!==N0(0x1c5)?M[N0(0x1b2)]:V[0x0][0x0],k=typeof M[N0(0x1c4)]!==N0(0x1c5)?M[N0(0x1c4)]:V[0x0][0x0];for(let n=0x0;n<V['length'];n++){for(let I=0x0;I<V[n][N0(0x1c2)];I++){L=Math[N0(0x1b2)](L,V[n][I]),k=Math[N0(0x1c4)](k,V[n][I]);}}let R=['┼','┤','╶','╴','─','╰','╭','╮','╯','│'],r=Math[N0(0x1b5)](k-L),Q=typeof M[N0(0x19f)]!==N0(0x1c5)?M[N0(0x19f)]:0x3,z=typeof M[N0(0x1b1)]!==N0(0x1c5)?M[N0(0x1b1)]:N0(0x1b8),h=typeof M['height']!==N0(0x1c5)?M['height']:r,X=typeof M[N0(0x19e)]!==N0(0x1c5)?M[N0(0x19e)]:['blue',N0(0x1bc),N0(0x1a4),N0(0x1a1),'black'],u=r!==0x0?h/r:0x1,p=Math[N0(0x1a8)](L*u),F=Math[N0(0x1a8)](k*u),S=Math[N0(0x1b5)](F-p),b=0x0;for(let d=0x0;d<V[N0(0x1c2)];d++){b=Math[N0(0x1c4)](b,V[d][N0(0x1c2)]);}b=b+Q;let s=typeof M[N0(0x1af)]!==N0(0x1c5)?M['symbols']:R,c=M[N0(0x1c9)]!==undefined?M['format']:function(v){const N1=N0;return(z+v[N1(0x1b7)](0x2)+M[N1(0x1c7)])[N1(0x1c8)](-z[N1(0x1c2)]);},T=new Array(S+0x1);for(let v=0x0;v<=S;v++){T[v]=new Array(b);for(let a=0x0;a<b;a++){T[v][a]='\x20';}}for(let l=p;l<=F;++l){const o=c(S>0x0?k-(l-p)*r/S:l,l-p);T[l-p][Math[N0(0x1c4)](Q-o[N0(0x1c2)],0x0)]=o,T[l-p][Q-0x1]=l==0x0?s[0x0]:s[0x1];}for(let t=0x0;t<V['length'];t++){let g=X[t%X[N0(0x1c2)]],m=Math[N0(0x1a8)](V[t][0x0]*u)-p;T[S-m][Q-0x1]=colored(s[0x0],g);for(let W=0x0;W<V[t][N0(0x1c2)]-0x1;W++){let K=Math[N0(0x1a8)](V[t][W+0x0]*u)-p,A=Math['round'](V[t][W+0x1]*u)-p;if(K==A)T[S-K][W+Q]=colored(s[0x4],g);else{T[S-A][W+Q]=colored(K>A?s[0x5]:s[0x6],g),T[S-K][W+Q]=colored(K>A?s[0x7]:s[0x8],g);let e=Math[N0(0x1b2)](K,A),f=Math['max'](K,A);for(let G=e+0x1;G<f;G++){T[S-G][W+Q]=colored(s[0x9],g);}}}}const {startTs:U,endTs:Z}=M;if(U||Z){const q=J=>{const N2=N0;if(!J)return N2(0x1a5);const P=J[N2(0x1a7)](undefined,{'day':'2-digit','month':'2-digit','year':N2(0x1bf)}),H=J[N2(0x1ca)](undefined,{'hourCycle':N2(0x1be)});return P+'\x20'+H;},w=q(Z),E=q(U),D=z[N0(0x1c8)](0x0,Math[N0(0x1c4)](0x2,z[N0(0x1c2)]-E[N0(0x1c2)]/0x2+0x1)),Y='\x20'[N0(0x1b3)](Math[N0(0x1c4)](b-(z['length']+w[N0(0x1c2)]/0x2),0x1));T[N0(0x1bb)]([''+D+E+Y+w]),T[N0(0x1bb)]([]);}return T[N0(0x1aa)](J=>J[N0(0x1c6)](''))['join']('\x0a');};function a7M(N,M){const V=a7N();return a7M=function(L,k){L=L-0x19e;let R=V[L];return R;},a7M(N,M);}exports['getAsciiChart']=getAsciiChart;function a7N(){const N4=['padding','min','repeat','93528eUGIEY','abs','1509908Xewkyp','toFixed','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','3242404QjqDdm','__esModule','push','red','isArray','h24','2-digit','defineProperty','3lcKccy','length','floor','max','undefined','join','unit','slice','format','toLocaleTimeString','chalk','colors','offset','131jKtVxS','grey','5444AfEIra','24lTkrXV','green','\x20\x20\x20','217128MyFURB','toLocaleDateString','round','5ygXWvd','map','2604070VbafzO','1200283FZjwmS','downSampleData','48ojDfvA','symbols','getAsciiChart'];a7N=function(){return N4;};return a7N();}const downSampleData=(N,M)=>{const N3=a7C,V=N[N3(0x1c2)];if(M>=V||M===0x0)return N;const L=[];let k=0x0;const R=(V-0x2)/(M-0x2);let r=0x0,Q,z,h,X;L[k++]=N[r];for(var u=0x0;u<M-0x2;u++){let y=0x0,c=0x0,T=Math[N3(0x1c3)]((u+0x1)*R)+0x1,U=Math['floor']((u+0x2)*R)+0x1;U=U<V?U:V;var p=U-T;for(;T<U;T++){y+=N[T][0x0],c+=N[T][0x1];}y/=p,c/=p;var F=Math['floor'](u*R)+0x1,S=Math['floor']((u+0x1)*R)+0x1,b=N[r][0x0],s=N[r][0x1];z=h=-0x1;for(;F<S;F++){h=Math['abs']((b-y)*(N[F][0x1]-s)-(b-N[F][0x0])*(c-s))*0.5,h>z&&(z=h,Q=N[F],X=F);}L[k++]=Q,r=X;}return L[k++]=N[V-0x1],L;};exports[a7C(0x1ad)]=downSampleData;
|
package/dist/inquirer-helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a7Q=a7f;function a7f(H,f){const l=a7H();return a7f=function(t,b){t=t-0xed;let i=l[t];return i;},a7f(H,f);}(function(H,f){const m=a7f,l=H();while(!![]){try{const t=-parseInt(m(0x150))/0x1+parseInt(m(0x132))/0x2*(-parseInt(m(0x12e))/0x3)+parseInt(m(0x12a))/0x4+-parseInt(m(0x192))/0x5*(-parseInt(m(0x112))/0x6)+parseInt(m(0x194))/0x7+-parseInt(m(0x1b9))/0x8*(-parseInt(m(0xed))/0x9)+-parseInt(m(0x16e))/0xa;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a7H,0xaf586));var __createBinding=this&&this[a7Q(0x16c)]||(Object[a7Q(0x1d7)]?function(H,f,l,t){const L=a7Q;if(t===undefined)t=l;var b=Object[L(0x19d)](f,l);(!b||('get'in b?!f['__esModule']:b[L(0x127)]||b[L(0x12b)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[L(0x189)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a7Q(0x140)]||(Object['create']?function(H,f){const B=a7Q;Object[B(0x189)](H,B(0x182),{'enumerable':!![],'value':f});}:function(H,f){const T=a7Q;H[T(0x182)]=f;}),__importStar=this&&this[a7Q(0x1eb)]||function(H){const X=a7Q;if(H&&H[X(0x1ae)])return H;var f={};if(H!=null){for(var l in H)if(l!==X(0x182)&&Object['prototype']['hasOwnProperty'][X(0x181)](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this[a7Q(0x168)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const V=a7f;function r(Y){const C=a7f;try{w(t[C(0x146)](Y));}catch(x){n(x);}}function q(Y){const j=a7f;try{w(t[j(0x1da)](Y));}catch(x){n(x);}}function w(Y){const D=a7f;Y[D(0x179)]?i(Y[D(0x176)]):b(Y[D(0x176)])[D(0x169)](r,q);}w((t=t['apply'](H,f||[]))[V(0x146)]());});},__importDefault=this&&this[a7Q(0x1e3)]||function(H){return H&&H['__esModule']?H:{'default':H};};Object[a7Q(0x189)](exports,a7Q(0x1ae),{'value':!![]}),exports[a7Q(0x15a)]=void 0x0;const _=__importStar(require(a7Q(0x102))),chalk_1=__importDefault(require(a7Q(0x10e))),fs=__importStar(require('fs')),utils_1=require(a7Q(0x1d8)),api_helpers_1=require(a7Q(0x1d9)),inquirer_pagination_prompt_1=require(a7Q(0x162)),inquirer=require(a7Q(0xf0)),inquirerSearchList=require(a7Q(0x1cb)),yaml=require(a7Q(0x193));var ConfirmChoices;function a7H(){const HD=['askForBuild','max','addon:\x20\x27','bgGrey','lodash','askForAddonBackup','safeLoad','completedAt','unset','toString','Do\x20you\x20want\x20to\x20add','charAt','pattern','\x20type?','isEmpty','Do\x20you\x20want\x20to\x20add\x20more','chalk','askForTemplate','project','resultCache','6283206HzuhdW','body','blueBright','startedAt','secrets','domain','split','\x20to\x20use:','registerPrompt','No\x20builds\x20found','volume','properties','service:\x20\x27','nextCursor','DynamicReloadPaginationPrompt','addon','must\x20be\x20a\x20number,\x20is\x20','get','askConfirm','Something\x20unexpected\x20happened.','askForJob','writable','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','project:\x20\x27','5302104PKKmcF','configurable','getQuestionString','don\x27t\x20change','1053OOLhIg','yellowBright','EDIT','Configuration\x20file\x20written\x20to\x20','2246aKIhZS','boolean','main-context','list','name','pagination','stringify','maximum','join','override','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','askForLogSink','Writing\x20configuration\x20failed:\x20','green','__setModuleDefault','Context\x20with\x20name\x20\x27','Please\x20confirm\x20following\x20configuration:\x0a','example','push','What\x27s\x20the\x20','next','\x20in\x20','pathVars','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','backups','REPEAT','apiClient','doesn\x27t\x20match\x20pattern\x20\x27','askArrayEntry','log\x20sink','409813RiqdHW','blue','editedResult','input','json','confirm','pop','isNaN','job:\x20\x27','\x20Example:\x20','InquirerHelper','length','grey','isUndefined','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','password','token','No\x20','./pagination/inquirer-pagination-prompt','found','trim','required','has','reset','__awaiter','then','YES','isObject','__createBinding','pipelines','33917590IUYoXv','defaultPaginationPageSize','fullName','loginPrompt','pipeline','builds','tokenPrompt','integer','value','bold','What\x20do\x20you\x20want\x20to\x20use\x20as','done','ask','No,\x20but\x20save\x20as\x20file','setPathVars','cmdPath','deleteWarningPrompt','template\x20run','nextPageCursor','call','default','\x20and\x20it\x20',',\x20supported\x20types:\x20[json|yaml|yml]','askForProjectScopedResource','Aborted.','retrievePayloadViaInteractiveCli','search-list','defineProperty','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','getType','services','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','subdomains','job\x20build','fileName','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','5JdrcCX','js-yaml','8236102dAJKFu','askForProjectScopedResourcePaginated','this\x20option\x20is\x20required,\x20please\x20answer','\x20(startedAt:\x20','askForAddon','yaml','.*\x5c.(json|yaml|yml)$','validate','jobs','getOwnPropertyDescriptor','No,\x20edit','set','Enter\x20the\x20','whiteBright','askForSecret','data','domains','No,\x20abort','createdAt','writeFileSync','opt','fetchResourceList','find','type','values','enum','__esModule','Go\x20to\x20editor','ABORT','repeat','Context\x20name\x20already\x20exists.','askForPipeline','confirmationPrompt','askForSubdomain','propToType','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','success','138192FrmChP','slice','getInnerType','keys','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','items','oneOf','logSinks','addons','secret','rawObject','red','template','service','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','prompt','askForResourcePaginated','string','inquirer-search-list','array','askForResource','map','greenBright','credentials','runs','confirmation','retry','cursor','askForDomain','\x20characters,\x20is\x20','create','./utils','./api-helpers','throw','test','description','askGeneric','pagination-prompt','includes','\x20(completedAt:\x20','templateRuns','Unexpected\x20file\x20type:\x20','__importDefault','job','assign','templates','saveFile','safeDump','addEntry','askForService','__importStar','maxLength','filter','domain\x20(','711AEixPh','warning','contextProvider','inquirer','isBoolean','choice','isValidJSON','\x20characters','SAVE','Choose\x20the\x20','minimum','minLength','editor','askForCredentials','getCurrentProjectName','underline','volumes'];a7H=function(){return HD;};return a7H();}(function(H){const e=a7Q;H[e(0x16a)]='Yes,\x20send',H[e(0x14b)]='No,\x20repeat',H[e(0x130)]=e(0x19e),H['SAVE']=e(0x17b),H['ABORT']=e(0x1a5);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(H){const O=a7Q;this[O(0x14c)]=H,this[O(0x16f)]=0x32,this['editPayload']=f=>__awaiter(this,void 0x0,void 0x0,function*(){const E=O,{editedResult:l}=yield inquirer[E(0x1c8)]([{'type':E(0xf9),'name':E(0x152),'message':E(0x1af),'default':yaml[E(0x1e8)](f)}]);return yaml[E(0x104)](l);}),this[O(0x1e7)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const S=O,l=n=>S(0x1e2)+n+S(0x184);function t(){return __awaiter(this,void 0x0,void 0x0,function*(){const A=a7f;return inquirer[A(0x1c8)]([{'type':'input','name':A(0x190),'message':A(0x13c),'validate':n=>new RegExp(A(0x19a))[A(0x1db)](n)?!![]:l(n)}]);});}const {fileName:b}=yield t(),i=b[S(0x107)]()[S(0x118)]('.')[S(0x156)]();try{switch(i){case S(0x154):(0x0,utils_1[S(0x1b8)])(S(0x131)+b);return fs[S(0x1a7)](b,JSON[S(0x138)](f,null,'\x20\x20'));case S(0x199):case'yml':(0x0,utils_1['success'])(S(0x131)+b);return fs[S(0x1a7)](b,yaml[S(0x1e8)](f));default:(0x0,utils_1[S(0xee)])(l(i));}}catch(n){(0x0,utils_1[S(0xee)])(S(0x13e)+n['message']);}return undefined;}),this[O(0x1ed)]=(f,l)=>t=>{const k=O,b=typeof t===k(0x1ca)?t[k(0x164)]():t;return l===![]&&b==='don\x27t\x20change'?'':b;},this[O(0x19b)]=(f,l,t)=>b=>{const h=O,i=[];if(b===''||b===h(0x12d)){if(l!==![])i[h(0x144)](h(0x196));else return!![];}f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0x10a)])&&i[h(0x144)](new RegExp(f['pattern'])[h(0x1db)](b)?!![]:h(0x14d)+f[h(0x10a)]+'\x27');f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0xf8)])&&i['push'](b['length']>=f['minLength']?!![]:h(0x18a)+f['minLength']+'\x20characters,\x20is\x20'+b[h(0x15b)]+h(0xf4));f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0x1ec)])&&i['push'](b[h(0x15b)]<=f[h(0x1ec)]?!![]:h(0x128)+f[h(0x1ec)]+h(0x1d6)+b[h(0x15b)]+h(0xf4));t&&Number[h(0x157)](parseInt(b,0xa))&&i[h(0x144)](h(0x122)+b);f[h(0x1ab)]===h(0x175)&&!_[h(0x15d)](f[h(0xf7)])&&i[h(0x144)](b>=f['minimum']?!![]:h(0x149)+f[h(0xf7)]);f[h(0x1ab)]==='integer'&&!_[h(0x15d)](f[h(0x139)])&&i['push'](b<=f[h(0x139)]?!![]:h(0x15e)+f[h(0x139)]);if(f['type']==='rawObject'){const q=(0x0,utils_1[h(0xf3)])(b);i[h(0x144)](q===![]||_[h(0x10c)](q)?h(0x1bd):!![]);}const n=i[h(0x1ed)](w=>w!==!![]),r=(f===null||f===void 0x0?void 0x0:f[h(0x143)])?'\x0a'+chalk_1[h(0x182)][h(0x1c4)]('>>')+h(0x159)+chalk_1['default'][h(0x1a1)](JSON[h(0x138)](f['example'])):'';return n[h(0x15b)]>0x0?n[h(0x13a)](chalk_1['default'][h(0xfc)](h(0x183)))+r:!![];},this['getPathString']=(f,l,t)=>{const K=O,b=f[f[K(0x15b)]-0x1];function i(){const I=K;return f[I(0x1ba)](0x0,-0x1)[I(0x1ce)](q=>q[I(0x109)](0x0)['toUpperCase']()+q['slice'](0x1))[I(0x13a)]('>');}const n=f[K(0x15b)]>0x1?chalk_1['default'][K(0x101)][K(0x1a1)](i())+':\x20':'',r=t?'\x20('+chalk_1[K(0x182)][K(0x151)](t)+')':'';return chalk_1[K(0x182)][K(0x167)](''+n+l+'\x20'+chalk_1[K(0x182)][K(0x177)][K(0x1cf)](b)+r+'?');},this['askForResource']=(f,l,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const P=O;if(l[P(0x15b)]<0x1){const n=t?'for\x20this\x20'+t:P(0x163);throw new Error(P(0x161)+f+'\x20'+n+'.');}const b=P(0xf6)+f+P(0x119),i=l[P(0x15b)]>0x4?P(0x188):P(0x135);return(yield inquirer[P(0x1c8)]([{'type':i,'name':P(0x136),'message':b,'choices':l}]))[P(0x136)];}),this[O(0x1c9)]=(f,l,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=O,{elements:b,nextCursor:i}=yield l();if(b[Z(0x15b)]<0x1){const q=t?'for\x20this\x20'+t:Z(0x163);throw new Error(Z(0x161)+f+'\x20'+q+'.');}const n='Choose\x20the\x20'+f+Z(0x119);if(i!==undefined){const w=({nextPageCursor:Y})=>__awaiter(this,void 0x0,void 0x0,function*(){const W=Z,x=yield l(Y);return{'elements':x['elements'],'nextPageCursor':x[W(0x11f)]};});return(yield inquirer[Z(0x1c8)]([{'type':Z(0x1de),'name':Z(0x136),'message':n,'choices':b,'nextPageCursor':i,'loadMore':w}]))[Z(0x136)];}const r=b[Z(0x15b)]>0x4?Z(0x188):Z(0x135);return(yield inquirer['prompt']([{'type':r,'name':Z(0x136),'message':n,'choices':b}]))['name'];}),this[O(0x1dd)]=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=O,t=''+(l?'('+chalk_1[u(0x182)]['blue'](l)+')\x20':''),b=u(0x1a0)+chalk_1['default'][u(0x13f)](f)+'\x20'+t+'to\x20use:',i=this[u(0x19b)]({'type':u(0x1ca),'required':!![]});return(yield inquirer['prompt']([{'type':u(0x153),'name':u(0x136),'message':b,'validate':i}]))[u(0x136)];}),this[O(0x124)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const g=O;return(yield inquirer[g(0x1c8)]([{'type':g(0x155),'name':'name','message':f,'default':!![]}]))['name'];}),this[O(0x1ea)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const d=a7f;var i;const n=yield this[d(0x14c)]['list'][d(0x18c)]({'parameters':{'projectId':t},'options':{'per_page':this[d(0x16f)],'cursor':b}}),r=n[d(0x1a3)]['services'][d(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[d(0x137)])===null||i===void 0x0?void 0x0:i[d(0x1d4)]};});return this[F(0x195)](F(0x1c6),l,f);}),this[O(0x10f)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const a=O,f=l=>__awaiter(this,void 0x0,void 0x0,function*(){const p=a7f;var t;const b=yield this[p(0x14c)][p(0x135)][p(0x1e6)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':l}}),i=b['data']['templates'][p(0x1ce)](n=>n['id']);return{'elements':i,'nextCursor':(t=b[p(0x137)])===null||t===void 0x0?void 0x0:t['cursor']};});return this[a(0x1c9)](a(0x1c5),f);}),this['askForTemplateRun']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=O;if(_[J(0x15d)](f))throw new Error('Template\x20id\x20not\x20provided.');const l=t=>__awaiter(this,void 0x0,void 0x0,function*(){const o=J;var b;let i=this[o(0x16f)];const n=yield this[o(0x14c)][o(0x135)]['templateRuns']({'parameters':{'templateId':f},'options':{'per_page':i,'cursor':t}}),r=n[o(0x1a3)][o(0x1e1)][o(0x1ce)](q=>q['id']+o(0x197)+q[o(0x1a6)]+')');return{'elements':r,'nextCursor':(b=n[o(0x137)])===null||b===void 0x0?void 0x0:b[o(0x1d4)]};});return this[J(0x1c9)](J(0x17f),l)[J(0x169)](t=>t['split']('\x20')[0x0]);}),this[O(0x13d)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=O,f=l=>__awaiter(this,void 0x0,void 0x0,function*(){const M=a7f;var t;let b=this['defaultPaginationPageSize'];const i=yield this[M(0x14c)][M(0x135)][M(0x1c0)]({'options':{'per_page':b,'cursor':l}}),n=i[M(0x1a3)][M(0x1c0)][M(0x1ce)](r=>r['id']);return{'elements':n,'nextCursor':(t=i[M(0x137)])===null||t===void 0x0?void 0x0:t['cursor']};});return this[G(0x1c9)](G(0x14f),f);}),this[O(0x1b3)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const z=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const N=a7f;var i;const n=yield this[N(0x14c)][N(0x135)]['pipelines']({'parameters':{'projectId':t},'options':{'per_page':this[N(0x16f)],'cursor':b}}),r=n[N(0x1a3)][N(0x16d)][N(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[N(0x137)])===null||i===void 0x0?void 0x0:i['cursor']};});return this[z(0x195)](z(0x172),l,f);}),this[O(0x126)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const R=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const v=a7f;var i;const n=yield this['apiClient']['list']['jobs']({'parameters':{'projectId':t},'options':{'per_page':this[v(0x16f)],'cursor':b}}),r=n['data'][v(0x19c)][v(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[v(0x137)])===null||i===void 0x0?void 0x0:i['cursor']};});return this[R(0x195)]('job',l,f);}),this['askForJobRun']=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=O,t=b=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const s=a7f;var n;const r=yield this[s(0x14c)][s(0x123)][s(0x1e4)][s(0x1d1)]({'parameters':{'projectId':b,'jobId':f},'options':{'per_page':this[s(0x16f)],'cursor':i}}),q=r[s(0x1a3)][s(0x1d1)]['map'](w=>w['id']+s(0x197)+w[s(0x115)]+')');return{'elements':q,'nextCursor':(n=r[s(0x137)])===null||n===void 0x0?void 0x0:n[s(0x1d4)]};});return this[y(0x195)]('job\x20runs',t,l,y(0x158)+f+'\x27')['then'](b=>b[y(0x118)]('\x20')[0x0]);}),this[O(0xfe)]=(f,l,t)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H1=O;if(t!==undefined){const b=i=>n=>__awaiter(this,void 0x0,void 0x0,function*(){const H0=a7f;var r;const q=yield this[H0(0x14c)]['get'][H0(0x1e4)][H0(0x173)]({'parameters':{'projectId':i,'jobId':t},'options':{'per_page':this[H0(0x16f)],'cursor':n}});return{'elements':q[H0(0x1a3)][H0(0x173)][H0(0x1ce)](w=>w['id']+H0(0x197)+w[H0(0x1a6)]+')'),'nextCursor':(r=q[H0(0x137)])===null||r===void 0x0?void 0x0:r[H0(0x1d4)]};});return this['askForProjectScopedResourcePaginated']('job\x20builds',b,f,H1(0x158)+t+'\x27')[H1(0x169)](i=>i[H1(0x118)]('\x20')[0x0]);}if(l!==undefined){const i=n=>r=>__awaiter(this,void 0x0,void 0x0,function*(){const H2=H1;var q;const w=yield this[H2(0x14c)][H2(0x123)][H2(0x1c6)]['builds']({'parameters':{'projectId':n,'serviceId':l},'options':{'per_page':this[H2(0x16f)],'cursor':r}});return{'elements':w[H2(0x1a3)][H2(0x173)]['map'](Y=>Y['id']+H2(0x197)+Y[H2(0x1a6)]+')'),'nextCursor':(q=w['pagination'])===null||q===void 0x0?void 0x0:q[H2(0x1d4)]};});return this['askForProjectScopedResourcePaginated'](H1(0x18f),i,f,H1(0x11e)+t+'\x27')[H1(0x169)](n=>n['split']('\x20')[0x0]);}throw new Error(H1(0x11b));}),this[O(0x198)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H4=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const H3=a7f;var i;const n=yield this[H3(0x14c)][H3(0x135)][H3(0x1c1)]({'parameters':{'projectId':t},'options':{'per_page':this[H3(0x16f)],'cursor':b}});return{'elements':n['data'][H3(0x1c1)][H3(0x1ce)](r=>r['id']),'nextCursor':(i=n[H3(0x137)])===null||i===void 0x0?void 0x0:i[H3(0x1d4)]};});return this[H4(0x195)](H4(0x121),l,f);}),this[O(0x103)]=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H6=O,t=b=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const H5=a7f;var n;const r=yield this[H5(0x14c)]['get'][H5(0x121)][H5(0x14a)]({'parameters':{'projectId':b,'addonId':l},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':i}});return{'elements':r['data'][H5(0x14a)]['map'](q=>q['id']+H5(0x1e0)+(q[H5(0x105)]||'not\x20completed')+')'),'nextCursor':(n=r[H5(0x137)])===null||n===void 0x0?void 0x0:n[H5(0x1d4)]};});return this[H6(0x195)](H6(0x14a),t,f,H6(0x100)+l+'\x27')[H6(0x169)](b=>b[H6(0x118)]('\x20')[0x0]);}),this['askForVolume']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H8=O,l=t=>__awaiter(this,void 0x0,void 0x0,function*(){const H7=a7f;return(yield this[H7(0x14c)][H7(0x135)][H7(0xfd)]({'parameters':{'projectId':t}}))[H7(0x1a3)]['map'](b=>b['id']);});return this[H8(0x185)](H8(0x11c),l,f);}),this[O(0x1a2)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const HH=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const H9=a7f;var i;const n=yield this[H9(0x14c)]['list'][H9(0x116)]({'parameters':{'projectId':t},'options':{'per_page':this[H9(0x16f)],'cursor':b}});return{'elements':n['data'][H9(0x116)][H9(0x1ce)](r=>r['id']),'nextCursor':(i=n['pagination'])===null||i===void 0x0?void 0x0:i[H9(0x1d4)]};});return this[HH(0x195)](HH(0x1c2),l,f);}),this[O(0x1b5)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hf=O,l=yield this[Hf(0x14c)]['get']['domain']({'parameters':{'domain':f}}),t=l[Hf(0x1a3)][Hf(0x18e)][Hf(0x1ce)](i=>i[Hf(0x136)]+'\x20(full\x20domain:\x20'+i[Hf(0x170)]+')'),b=Hf(0x1ee)+f+')';return this[Hf(0x1cd)]('subdomain',t,b)[Hf(0x169)](i=>i[Hf(0x118)]('\x20')[0x0]);}),this[O(0x17e)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const Hl=O;return(yield inquirer['prompt']([{'type':Hl(0x155),'name':Hl(0x1d2),'message':chalk_1['default'][Hl(0x12f)](Hl(0x191)+(f||'a\x20Northflank\x20resource')+Hl(0x1b7)),'default':![]}]))[Hl(0x1d2)];}),this[O(0x171)]=(f,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const Ht=O;_[Ht(0x15d)](f[Ht(0x136)])&&(l['length']<=0x0?_[Ht(0x19f)](f,'name',Ht(0x182)):yield(0x0,utils_1[Ht(0x1d3)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hb=Ht,{name:t}=yield inquirer[Hb(0x1c8)]([{'type':Hb(0x153),'name':Hb(0x136),'message':Hb(0x1c7),'default':Hb(0x134)}]);if(!f[Hb(0x13b)]&&l['find'](b=>b[Hb(0x136)]===t)){const {c:b}=yield inquirer[Hb(0x1c8)]([{'type':Hb(0x155),'name':'c','message':Hb(0x141)+t+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(b===![])throw new Error(Hb(0x1b2));_['set'](f,'override',!![]);}_[Hb(0x19f)](f,Hb(0x136),t);})));if(_['isUndefined'](f['token'])){const t=yield this[Ht(0x174)]();_[Ht(0x19f)](f,Ht(0x160),t);}return f;}),this['tokenPrompt']=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hi=O,{token:f}=yield inquirer['prompt']([{'type':Hi(0x15f),'name':Hi(0x160),'mask':'*','message':'Choose\x20the\x20login\x20token:'}]);return f;}),inquirer[O(0x11a)](O(0x188),inquirerSearchList),inquirer[O(0x11a)](O(0x1de),inquirer_pagination_prompt_1[O(0x120)]);}[a7Q(0x1b4)](H,f){return __awaiter(this,void 0x0,void 0x0,function*(){const Hn=a7f,l=yaml[Hn(0x1e8)](H),t=_[Hn(0xff)](l[Hn(0x118)]('\x0a')['map'](n=>n[Hn(0x15b)])),b=chalk_1[Hn(0x182)][Hn(0x15c)]('-'[Hn(0x1b1)](t)+'\x0a'),{confirm:i}=yield inquirer[Hn(0x1c8)]([{'type':Hn(0x135),'name':Hn(0x155),'message':''+chalk_1['default'][Hn(0x177)]['green'](Hn(0x142))+b+chalk_1[Hn(0x182)][Hn(0x114)](l)+b,'choices':Object[Hn(0x1ac)](ConfirmChoices)}]);switch(i){case ConfirmChoices[Hn(0x16a)]:return H;case ConfirmChoices[Hn(0x1b0)]:throw new Error(Hn(0x186));case ConfirmChoices[Hn(0x14b)]:return this[Hn(0x187)](f);case ConfirmChoices['EDIT']:return this['confirmationPrompt'](yield this['editPayload'](H),f);case ConfirmChoices[Hn(0xf5)]:yield this['saveFile'](H);return this['confirmationPrompt'](H,f);default:throw new Error(Hn(0x125));}});}[a7Q(0x187)](H,f){return __awaiter(this,void 0x0,void 0x0,function*(){const Hr=a7f;if((f===null||f===void 0x0?void 0x0:f[Hr(0x111)])!==undefined)this[Hr(0x111)]=f===null||f===void 0x0?void 0x0:f[Hr(0x111)];this['tmpCmdPath']=f===null||f===void 0x0?void 0x0:f[Hr(0x17d)];const l={};return yield this[Hr(0x1b6)]([],H[Hr(0x1a8)][Hr(0x113)],l),this[Hr(0x111)]=l,yield this['confirmationPrompt'](l,H);});}['propToType'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const Hq=a7f;let b;if(f[Hq(0x1bf)]&&!_[Hq(0x166)](f,'properties')){if(f['oneOf'][Hq(0x15b)]>0x1){const {choice:i}=yield inquirer[Hq(0x1c8)]([{'type':Hq(0x135),'name':Hq(0xf2),'message':Hq(0x145)+(H[H[Hq(0x15b)]-0x1]||'')+Hq(0x10b),'choices':f[Hq(0x1bf)][Hq(0x1ce)](n=>{const Hw=Hq;var r;return(r=n[Hw(0x1dc)])!==null&&r!==void 0x0?r:'??';})}]);b=yield this[Hq(0x18b)](H,f[Hq(0x1bf)][Hq(0x1aa)](n=>n[Hq(0x1dc)]===i),l,t);}else{const n=f[Hq(0x1bf)][0x0];_['set'](n,'description',f[Hq(0x1dc)]),b=yield this[Hq(0x18b)](H,n,l,t);}b={};}else b=yield this[Hq(0x18b)](H,f,l,t);return b;});}[a7Q(0x1bb)](H,f,l,t){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const HY=a7f;if(t===![]){const {addEntry:r}=yield inquirer[HY(0x1c8)]([{'type':HY(0x155),'name':HY(0x1e9),'message':this['getPathString'](f,HY(0x108),H===null||H===void 0x0?void 0x0:H[HY(0x1dc)]),'default':![]}]);if(!r)return l;}const i=Object[HY(0x1bc)]((b=H===null||H===void 0x0?void 0x0:H[HY(0x11d)])!==null&&b!==void 0x0?b:[]),n=H[HY(0x165)]||[];if(i['length']>0x0)for(const q of i){const w=f['concat'](q);if(f['length']>0x0&&!_['has'](l,f[HY(0x13a)]('.')))_[HY(0x19f)](l,f[HY(0x13a)]('.'),{});yield this[HY(0x1b6)](w,H[HY(0x11d)][q],l,n[HY(0x1df)](q));}else yield this['getType'](f,Object[HY(0x1e5)](Object[HY(0x1e5)]({},H),{'type':'rawObject'}),l,t);return l;});}[a7Q(0x14e)](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const Hx=a7f;if(f&&l)return!![];const b=f?'Do\x20you\x20want\x20to\x20add':Hx(0x10d),{addEntry:i}=yield inquirer['prompt']([{'type':'confirm','name':'addEntry','message':this['getPathString'](H,b,f?t:undefined),'default':![]}]);return i;});}[a7Q(0x18b)](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HU=a7f;let b;const i=H[HU(0x13a)]('.');switch(f===null||f===void 0x0?void 0x0:f['type']){case HU(0x1cc):{let n=!![];while(yield this[HU(0x14e)](H,n,t,f===null||f===void 0x0?void 0x0:f[HU(0x1dc)])){const r=_[HU(0x123)](l,i);_[HU(0x106)](l,i),yield this[HU(0x18b)](H,f[HU(0x1be)],l);const q=_[HU(0x123)](l,i);!_['isArray'](r)?_[HU(0x19f)](l,i,[q]):(r[HU(0x144)](q),_[HU(0x19f)](l,i,r)),n=![];}return b||[];}case'object':{return b=yield this[HU(0x1bb)](f,H,l,t),b;}case'rawObject':b=(0x0,utils_1[HU(0xf3)])(yield this[HU(0x17a)](H,f,t))||undefined;break;case HU(0x1ca):case HU(0x133):case HU(0x175):default:b=yield this[HU(0x17a)](H,f,t,l);break;}return!_[HU(0x15d)](b)&&_['set'](l,i,b),b;});}['ask'](H,f,l,t){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const Hm=a7f,i=H[H[Hm(0x15b)]-0x1],{defaultValue:defaultValue=(b=f===null||f===void 0x0?void 0x0:f['example'])!==null&&b!==void 0x0?b:f===null||f===void 0x0?void 0x0:f[Hm(0x182)],choices:choices=f===null||f===void 0x0?void 0x0:f[Hm(0x1ad)],pagination:n}=yield(0x0,api_helpers_1[Hm(0x1a9)])(i,this[Hm(0x14c)],this['tmpCmdPath'],t,this[Hm(0x148)],H);let r='input';if(!_[Hm(0x15d)](choices)&&choices[Hm(0x15b)]>0x0){if(n!==undefined&&n[Hm(0x180)]!==undefined)r='pagination-prompt';else choices[Hm(0x15b)]>0x4&&typeof choices[0x0]==='string'?r=Hm(0x188):r=Hm(0x135);}else{if((f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])===Hm(0x133))r=Hm(0x155);else{if((f===null||f===void 0x0?void 0x0:f['type'])===Hm(0x175))r=Hm(0x153);else(f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])===Hm(0x1c3)&&(r=Hm(0xf9));}}let q=l!==![]?!_[Hm(0x16b)](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[Hm(0xf1)](defaultValue)?defaultValue:Hm(0x12d);if(choices)q=q[Hm(0x107)]();_['has'](this[Hm(0x111)],H[Hm(0x13a)]('.'))&&(q=this[Hm(0x111)][H['join']('.')]);const w=choices&&l===![]?[Hm(0x12d),...choices]:choices,Y=(f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])==='integer',x=Object[Hm(0x1e5)]({'type':r,'name':'id','message':this['getQuestionString'](H,f),'choices':w,'default':q,'filter':this[Hm(0x1ed)](r,l),'validate':this[Hm(0x19b)](f,l,Y)},n),U=(yield inquirer['prompt']([x]))['id'];if(U==='don\x27t\x20change'||U==='')return undefined;if(Y)return parseInt(U,0xa);return U;});}[a7Q(0x12c)](H,f){const HQ=a7Q,l=(f===null||f===void 0x0?void 0x0:f[HQ(0x1ab)])!==HQ(0x133)?HQ(0x178):'Should\x20it\x20be';return this['getPathString'](H,l,f===null||f===void 0x0?void 0x0:f[HQ(0x1dc)]);}['askForProject'](){return __awaiter(this,void 0x0,void 0x0,function*(){const HB=a7f,H=f=>__awaiter(this,void 0x0,void 0x0,function*(){const HL=a7f;var l;const t=yield this[HL(0x14c)]['list']['projects']({'options':{'per_page':this[HL(0x16f)],'cursor':f}}),b=t[HL(0x1a3)]['projects'][HL(0x1ce)](i=>i['id']);return{'elements':b,'nextCursor':(l=t[HL(0x137)])===null||l===void 0x0?void 0x0:l[HL(0x1d4)]};});return yield this[HB(0x1c9)](HB(0x110),H);});}['askForProjectScopedResource'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HT=a7f,b=l||this['apiClient']['contextProvider'][HT(0xfb)]();if(_['isUndefined'](b))throw new Error(HT(0x18d));const i=yield f(b);return yield this[HT(0x1cd)](H,i,(t?t+HT(0x147):'')+'project:\x20\x27'+b+'\x27');});}['askForProjectScopedResourcePaginated'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HX=a7f,b=l||this[HX(0x14c)][HX(0xef)][HX(0xfb)]();if(_[HX(0x15d)](b))throw new Error(HX(0x18d));const i=yield f(b);return yield this[HX(0x1c9)](H,i,(t?t+'\x20in\x20':'')+HX(0x129)+b+'\x27');});}[a7Q(0x1d5)](){return __awaiter(this,void 0x0,void 0x0,function*(){const HC=a7f,H=yield this[HC(0x14c)]['list'][HC(0x1a4)]({}),f=H['data']['domains']['map'](l=>l[HC(0x136)]);return this['askForResource'](HC(0x117),f);});}[a7Q(0xfa)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Hj=a7f,H=yield this[Hj(0x14c)]['list']['registries']({}),f=H[Hj(0x1a3)][Hj(0x1d0)][Hj(0x1ce)](l=>l['id']);return this['askForResource'](Hj(0x1d0),f);});}[a7Q(0x17c)](H){const Hc=a7Q;this[Hc(0x148)]=H;}}exports['InquirerHelper']=InquirerHelper;
|
|
1
|
+
'use strict';const a8S=a8M;(function(N,M){const F=a8M,V=N();while(!![]){try{const L=-parseInt(F(0x1d4))/0x1*(-parseInt(F(0x1d3))/0x2)+parseInt(F(0x1df))/0x3+parseInt(F(0x2c1))/0x4*(parseInt(F(0x216))/0x5)+-parseInt(F(0x262))/0x6*(parseInt(F(0x1e7))/0x7)+parseInt(F(0x253))/0x8*(parseInt(F(0x2c3))/0x9)+parseInt(F(0x212))/0xa*(parseInt(F(0x240))/0xb)+-parseInt(F(0x21a))/0xc;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a8N,0x67cc8));var __createBinding=this&&this[a8S(0x29b)]||(Object['create']?function(N,M,V,L){const b=a8S;if(L===undefined)L=V;var R=Object[b(0x234)](M,V);(!R||('get'in R?!M[b(0x233)]:R[b(0x277)]||R[b(0x2ab)]))&&(R={'enumerable':!![],'get':function(){return M[V];}}),Object['defineProperty'](N,L,R);}:function(N,M,V,L){if(L===undefined)L=V;N[L]=M[V];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(N,M){const s=a8S;Object[s(0x273)](N,s(0x27d),{'enumerable':!![],'value':M});}:function(N,M){const y=a8S;N[y(0x27d)]=M;}),__importStar=this&&this[a8S(0x1d1)]||function(N){const T=a8S;if(N&&N[T(0x233)])return N;var M={};if(N!=null){for(var V in N)if(V!=='default'&&Object[T(0x214)][T(0x21f)][T(0x2ae)](N,V))__createBinding(M,N,V);}return __setModuleDefault(M,N),M;},__awaiter=this&&this[a8S(0x20f)]||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){function Q(X){try{h(L['next'](X));}catch(u){r(u);}}function z(X){const U=a8M;try{h(L[U(0x24c)](X));}catch(u){r(u);}}function h(X){const Z=a8M;X['done']?R(X[Z(0x1e2)]):k(X[Z(0x1e2)])[Z(0x223)](Q,z);}h((L=L['apply'](N,M||[]))['next']());});},__importDefault=this&&this[a8S(0x287)]||function(N){const n=a8S;return N&&N[n(0x233)]?N:{'default':N};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a8S(0x211)]=void 0x0;const _=__importStar(require(a8S(0x2bb))),chalk_1=__importDefault(require('chalk')),fs=__importStar(require('fs')),utils_1=require(a8S(0x2af)),api_helpers_1=require('./api-helpers'),inquirer_pagination_prompt_1=require(a8S(0x23c)),inquirer=require('inquirer'),inquirerSearchList=require(a8S(0x22e)),yaml=require(a8S(0x2a4));function a8M(N,M){const V=a8N();return a8M=function(L,k){L=L-0x1cc;let R=V[L];return R;},a8M(N,M);}var ConfirmChoices;(function(N){const I=a8S;N['YES']=I(0x28b),N['REPEAT']=I(0x1d0),N[I(0x292)]=I(0x27c),N['SAVE']='No,\x20but\x20save\x20as\x20file',N[I(0x2a8)]='No,\x20abort';}(ConfirmChoices||(ConfirmChoices={})));function a8N(){const Nc=['password','string','charAt','ABORT','red','contextProvider','configurable','max','askConfirm','call','./utils','maxLength','assign','list','propToType','log\x20sink','resultCache','\x20to\x20use:','name','pipelines','required','array','lodash','isBoolean','templates','toUpperCase','to\x20use:','secret','1298660DjnLjE','not\x20completed','7071102YZvVow','minLength','find','Configuration\x20file\x20written\x20to\x20','message','isEmpty','No,\x20repeat','__importStar','\x20characters,\x20is\x20','4lhHTTZ','237491ILwFnz','warning','logSinks','must\x20be\x20a\x20number,\x20is\x20','confirmationPrompt','getType','volumes','boolean','addons','properties','nextCursor','321390OKQfKX','askForProject','retry','value','askForTemplateRun','greenBright','items','values','3904201dBZUgs','nextPageCursor','Please\x20confirm\x20following\x20configuration:\x0a','\x20characters','description','domain','askForTemplate','example','Choose\x20the\x20login\x20token:','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','loginPrompt','green','backups','\x20in\x20','isArray','service','saveFile','bold','tmpCmdPath','runs','safeDump','fileName','subdomain','length','services','trim','getCurrentProjectName','template','stringify','What\x20do\x20you\x20want\x20to\x20use\x20as','main-context','registries','filter','job\x20builds','pop','addon','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','askArrayEntry','What\x27s\x20the\x20','__awaiter','reset','InquirerHelper','1590alPNYR','safeLoad','prototype','deleteWarningPrompt','5bveLdv','project','askForProjectScopedResourcePaginated','getInnerType','11122860EAMUrE','askGeneric','json','\x20(startedAt:\x20','Unexpected\x20file\x20type:\x20','hasOwnProperty','apiClient','editPayload','askForResourcePaginated','then','.*\x5c.(json|yaml|yml)$','Do\x20you\x20want\x20to\x20add','askForJob','validate','job\x20build','choice','job:\x20\x27','fullName','No\x20builds\x20found','addon:\x20\x27','inquirer-search-list','repeat','askForProjectScopedResource','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','credentials','__esModule','getOwnPropertyDescriptor','opt','override','search-list','editedResult','concat','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','input','./pagination/inquirer-pagination-prompt','getQuestionString','askForService','builds','15037iDBLBf','object','domain\x20(','test','createdAt',',\x20supported\x20types:\x20[json|yaml|yml]','ask','addEntry','for\x20this\x20','a\x20Northflank\x20resource','Go\x20to\x20editor','doesn\x27t\x20match\x20pattern\x20\x27','throw','pattern','rawObject','isUndefined','bgGrey','getPathString','success','8korcPy','map','projects','retrievePayloadViaInteractiveCli','askForPipeline','askForSecret','pathVars','Context\x20name\x20already\x20exists.','get','\x20Example:\x20','confirmation','\x20and\x20it\x20','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','completedAt','join','6vMhrVm','isObject','templateRuns','body','this\x20option\x20is\x20required,\x20please\x20answer','askForJobRun','Enter\x20the\x20','push','Should\x20it\x20be','tokenPrompt','data','askForResource','pagination-prompt','jobs','Do\x20you\x20want\x20to\x20add\x20more','askForVolume','cursor','defineProperty','project:\x20\x27','elements','token','writable','volume','secrets','pagination','don\x27t\x20change','No,\x20edit','default','grey','enum','job','Context\x20with\x20name\x20\x27','prompt','defaultPaginationPageSize','integer','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','toString','__importDefault','isValidJSON','includes','askForCredentials','Yes,\x20send','type','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','minimum','subdomains','Choose\x20the\x20','domains','EDIT','has','found','writeFileSync','set','Aborted.','YES','oneOf','slice','__createBinding','askForLogSink','split','maximum','\x20type?','confirm','blue','No\x20','askForAddonBackup','js-yaml'];a8N=function(){return Nc;};return a8N();}class InquirerHelper{constructor(N){const d=a8S;this[d(0x220)]=N,this[d(0x283)]=0x32,this[d(0x221)]=M=>__awaiter(this,void 0x0,void 0x0,function*(){const v=d,{editedResult:V}=yield inquirer[v(0x282)]([{'type':'editor','name':v(0x238),'message':v(0x24a),'default':yaml[v(0x1fb)](M)}]);return yaml[v(0x213)](V);}),this[d(0x1f7)]=M=>__awaiter(this,void 0x0,void 0x0,function*(){const a=d,V=r=>a(0x21e)+r+a(0x245);function L(){return __awaiter(this,void 0x0,void 0x0,function*(){const l=a8M;return inquirer[l(0x282)]([{'type':'input','name':l(0x1fc),'message':l(0x20c),'validate':r=>new RegExp(l(0x224))[l(0x243)](r)?!![]:V(r)}]);});}const {fileName:k}=yield L(),R=k[a(0x286)]()[a(0x29d)]('.')[a(0x209)]();try{switch(R){case a(0x21c):(0x0,utils_1[a(0x252)])('Configuration\x20file\x20written\x20to\x20'+k);return fs[a(0x295)](k,JSON[a(0x203)](M,null,'\x20\x20'));case'yaml':case'yml':(0x0,utils_1['success'])(a(0x1cd)+k);return fs[a(0x295)](k,yaml[a(0x1fb)](M));default:(0x0,utils_1[a(0x1d5)])(V(R));}}catch(r){(0x0,utils_1[a(0x1d5)])('Writing\x20configuration\x20failed:\x20'+r[a(0x1ce)]);}return undefined;}),this['filter']=(M,V)=>L=>{const o=d,k=typeof L===o(0x2a6)?L[o(0x200)]():L;return V===![]&&k===o(0x27b)?'':k;},this['validate']=(M,V,L)=>k=>{const t=d,R=[];if(k===''||k==='don\x27t\x20change'){if(V!==![])R[t(0x269)](t(0x266));else return!![];}M[t(0x28c)]==='string'&&!_['isUndefined'](M[t(0x24d)])&&R['push'](new RegExp(M[t(0x24d)])['test'](k)?!![]:t(0x24b)+M[t(0x24d)]+'\x27');M[t(0x28c)]===t(0x2a6)&&!_[t(0x24f)](M[t(0x2c4)])&&R['push'](k[t(0x1fe)]>=M[t(0x2c4)]?!![]:t(0x28d)+M['minLength']+'\x20characters,\x20is\x20'+k[t(0x1fe)]+'\x20characters');M[t(0x28c)]===t(0x2a6)&&!_[t(0x24f)](M[t(0x2b0)])&&R[t(0x269)](k[t(0x1fe)]<=M[t(0x2b0)]?!![]:t(0x1f0)+M['maxLength']+t(0x1d2)+k[t(0x1fe)]+t(0x1ea));L&&Number['isNaN'](parseInt(k,0xa))&&R[t(0x269)](t(0x1d7)+k);M[t(0x28c)]===t(0x284)&&!_[t(0x24f)](M[t(0x28e)])&&R['push'](k>=M['minimum']?!![]:'must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20'+M[t(0x28e)]);M[t(0x28c)]===t(0x284)&&!_[t(0x24f)](M['maximum'])&&R[t(0x269)](k<=M[t(0x29e)]?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+M[t(0x29e)]);if(M[t(0x28c)]===t(0x24e)){const z=(0x0,utils_1['isValidJSON'])(k);R[t(0x269)](z===![]||_[t(0x1cf)](z)?t(0x285):!![]);}const r=R[t(0x207)](h=>h!==!![]),Q=(M===null||M===void 0x0?void 0x0:M['example'])?'\x0a'+chalk_1[t(0x27d)][t(0x2a9)]('>>')+t(0x25c)+chalk_1[t(0x27d)]['whiteBright'](JSON[t(0x203)](M[t(0x1ee)])):'';return r[t(0x1fe)]>0x0?r[t(0x261)](chalk_1[t(0x27d)]['underline'](t(0x25e)))+Q:!![];},this[d(0x251)]=(M,V,L)=>{const g=d,k=M[M[g(0x1fe)]-0x1];function R(){const m=g;return M[m(0x29a)](0x0,-0x1)['map'](z=>z[m(0x2a7)](0x0)[m(0x2be)]()+z[m(0x29a)](0x1))[m(0x261)]('>');}const r=M[g(0x1fe)]>0x1?chalk_1[g(0x27d)][g(0x250)]['whiteBright'](R())+':\x20':'',Q=L?'\x20('+chalk_1[g(0x27d)][g(0x2a1)](L)+')':'';return chalk_1[g(0x27d)][g(0x210)](''+r+V+'\x20'+chalk_1[g(0x27d)]['bold'][g(0x1e4)](k)+Q+'?');},this['askForResource']=(M,V,L)=>__awaiter(this,void 0x0,void 0x0,function*(){const W=d;if(V[W(0x1fe)]<0x1){const r=L?W(0x248)+L:W(0x294);throw new Error(W(0x2a2)+M+'\x20'+r+'.');}const k=W(0x290)+M+'\x20to\x20use:',R=V[W(0x1fe)]>0x4?W(0x237):W(0x2b2);return(yield inquirer[W(0x282)]([{'type':R,'name':W(0x2b7),'message':k,'choices':V}]))['name'];}),this['askForResourcePaginated']=(M,V,L)=>__awaiter(this,void 0x0,void 0x0,function*(){const x=d,{elements:k,nextCursor:R}=yield V();if(k[x(0x1fe)]<0x1){const z=L?x(0x248)+L:x(0x294);throw new Error(x(0x2a2)+M+'\x20'+z+'.');}const r=x(0x290)+M+x(0x2b6);if(R!==undefined){const h=({nextPageCursor:X})=>__awaiter(this,void 0x0,void 0x0,function*(){const K=x,u=yield V(X);return{'elements':u[K(0x275)],'nextPageCursor':u[K(0x1de)]};});return(yield inquirer[x(0x282)]([{'type':x(0x26e),'name':x(0x2b7),'message':r,'choices':k,'nextPageCursor':R,'loadMore':h}]))[x(0x2b7)];}const Q=k['length']>0x4?'search-list':x(0x2b2);return(yield inquirer[x(0x282)]([{'type':Q,'name':x(0x2b7),'message':r,'choices':k}]))[x(0x2b7)];}),this[d(0x21b)]=(M,V)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A=d,L=''+(V?'('+chalk_1[A(0x27d)][A(0x2a1)](V)+')\x20':''),k=A(0x268)+chalk_1[A(0x27d)]['green'](M)+'\x20'+L+A(0x2bf),R=this[A(0x227)]({'type':A(0x2a6),'required':!![]});return(yield inquirer[A(0x282)]([{'type':A(0x23b),'name':A(0x2b7),'message':k,'validate':R}]))['name'];}),this[d(0x2ad)]=M=>__awaiter(this,void 0x0,void 0x0,function*(){const e=d;return(yield inquirer[e(0x282)]([{'type':e(0x2a0),'name':e(0x2b7),'message':M,'default':!![]}]))['name'];}),this[d(0x23e)]=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=d,V=L=>k=>__awaiter(this,void 0x0,void 0x0,function*(){const f=a8M;var R;const r=yield this['apiClient'][f(0x2b2)]['services']({'parameters':{'projectId':L},'options':{'per_page':this[f(0x283)],'cursor':k}}),Q=r[f(0x26c)][f(0x1ff)]['map'](z=>z['id']);return{'elements':Q,'nextCursor':(R=r[f(0x27a)])===null||R===void 0x0?void 0x0:R[f(0x272)]};});return this['askForProjectScopedResourcePaginated'](G(0x1f6),V,M);}),this[d(0x1ed)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const i=d,M=V=>__awaiter(this,void 0x0,void 0x0,function*(){const q=a8M;var L;const k=yield this[q(0x220)]['list']['templates']({'options':{'per_page':this[q(0x283)],'cursor':V}}),R=k[q(0x26c)][q(0x2bd)][q(0x254)](r=>r['id']);return{'elements':R,'nextCursor':(L=k['pagination'])===null||L===void 0x0?void 0x0:L[q(0x272)]};});return this['askForResourcePaginated'](i(0x202),M);}),this[d(0x1e3)]=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const w=d;if(_[w(0x24f)](M))throw new Error('Template\x20id\x20not\x20provided.');const V=L=>__awaiter(this,void 0x0,void 0x0,function*(){const E=w;var k;let R=this[E(0x283)];const r=yield this['apiClient']['list'][E(0x264)]({'parameters':{'templateId':M},'options':{'per_page':R,'cursor':L}}),Q=r['data']['templateRuns'][E(0x254)](z=>z['id']+E(0x21d)+z['createdAt']+')');return{'elements':Q,'nextCursor':(k=r[E(0x27a)])===null||k===void 0x0?void 0x0:k[E(0x272)]};});return this[w(0x222)]('template\x20run',V)[w(0x223)](L=>L[w(0x29d)]('\x20')[0x0]);}),this[d(0x29c)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=d,M=V=>__awaiter(this,void 0x0,void 0x0,function*(){const D=a8M;var L;let k=this[D(0x283)];const R=yield this[D(0x220)]['list'][D(0x1d6)]({'options':{'per_page':k,'cursor':V}}),r=R['data'][D(0x1d6)]['map'](Q=>Q['id']);return{'elements':r,'nextCursor':(L=R['pagination'])===null||L===void 0x0?void 0x0:L['cursor']};});return this[Y(0x222)](Y(0x2b4),M);}),this[d(0x257)]=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const V=L=>k=>__awaiter(this,void 0x0,void 0x0,function*(){const J=a8M;var R;const r=yield this['apiClient']['list'][J(0x2b8)]({'parameters':{'projectId':L},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':k}}),Q=r[J(0x26c)][J(0x2b8)][J(0x254)](z=>z['id']);return{'elements':Q,'nextCursor':(R=r['pagination'])===null||R===void 0x0?void 0x0:R[J(0x272)]};});return this['askForProjectScopedResourcePaginated']('pipeline',V,M);}),this[d(0x226)]=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const V=L=>k=>__awaiter(this,void 0x0,void 0x0,function*(){const j=a8M;var R;const r=yield this[j(0x220)][j(0x2b2)][j(0x26f)]({'parameters':{'projectId':L},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':k}}),Q=r[j(0x26c)][j(0x26f)][j(0x254)](z=>z['id']);return{'elements':Q,'nextCursor':(R=r['pagination'])===null||R===void 0x0?void 0x0:R[j(0x272)]};});return this['askForProjectScopedResourcePaginated']('job',V,M);}),this[d(0x267)]=(M,V)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H=d,L=k=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const P=a8M;var r;const Q=yield this['apiClient'][P(0x25b)]['job']['runs']({'parameters':{'projectId':k,'jobId':M},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':R}}),z=Q[P(0x26c)][P(0x1fa)][P(0x254)](h=>h['id']+P(0x21d)+h['startedAt']+')');return{'elements':z,'nextCursor':(r=Q[P(0x27a)])===null||r===void 0x0?void 0x0:r[P(0x272)]};});return this[H(0x218)]('job\x20runs',L,V,H(0x22a)+M+'\x27')[H(0x223)](k=>k['split']('\x20')[0x0]);}),this['askForBuild']=(M,V,L)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const O=d;if(L!==undefined){const k=R=>r=>__awaiter(this,void 0x0,void 0x0,function*(){const B=a8M;var Q;const z=yield this[B(0x220)]['get'][B(0x280)][B(0x23f)]({'parameters':{'projectId':R,'jobId':L},'options':{'per_page':this[B(0x283)],'cursor':r}});return{'elements':z[B(0x26c)]['builds'][B(0x254)](h=>h['id']+B(0x21d)+h['createdAt']+')'),'nextCursor':(Q=z[B(0x27a)])===null||Q===void 0x0?void 0x0:Q['cursor']};});return this['askForProjectScopedResourcePaginated'](O(0x208),k,M,O(0x22a)+L+'\x27')[O(0x223)](R=>R[O(0x29d)]('\x20')[0x0]);}if(V!==undefined){const R=r=>Q=>__awaiter(this,void 0x0,void 0x0,function*(){const C=O;var z;const h=yield this['apiClient']['get'][C(0x1f6)][C(0x23f)]({'parameters':{'projectId':r,'serviceId':V},'options':{'per_page':this[C(0x283)],'cursor':Q}});return{'elements':h[C(0x26c)][C(0x23f)][C(0x254)](X=>X['id']+'\x20(startedAt:\x20'+X[C(0x244)]+')'),'nextCursor':(z=h['pagination'])===null||z===void 0x0?void 0x0:z[C(0x272)]};});return this[O(0x218)](O(0x228),R,M,'service:\x20\x27'+L+'\x27')['then'](r=>r[O(0x29d)]('\x20')[0x0]);}throw new Error(O(0x22c));}),this['askForAddon']=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const N1=d,V=L=>k=>__awaiter(this,void 0x0,void 0x0,function*(){const N0=a8M;var R;const r=yield this[N0(0x220)]['list'][N0(0x1dc)]({'parameters':{'projectId':L},'options':{'per_page':this[N0(0x283)],'cursor':k}});return{'elements':r[N0(0x26c)]['addons'][N0(0x254)](Q=>Q['id']),'nextCursor':(R=r[N0(0x27a)])===null||R===void 0x0?void 0x0:R['cursor']};});return this['askForProjectScopedResourcePaginated'](N1(0x20a),V,M);}),this[d(0x2a3)]=(M,V)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const N3=d,L=k=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const N2=a8M;var r;const Q=yield this['apiClient']['get'][N2(0x20a)][N2(0x1f3)]({'parameters':{'projectId':k,'addonId':V},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':R}});return{'elements':Q[N2(0x26c)][N2(0x1f3)]['map'](z=>z['id']+'\x20(completedAt:\x20'+(z[N2(0x260)]||N2(0x2c2))+')'),'nextCursor':(r=Q[N2(0x27a)])===null||r===void 0x0?void 0x0:r[N2(0x272)]};});return this[N3(0x218)](N3(0x1f3),L,M,N3(0x22d)+V+'\x27')[N3(0x223)](k=>k[N3(0x29d)]('\x20')[0x0]);}),this[d(0x271)]=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const N5=d,V=L=>__awaiter(this,void 0x0,void 0x0,function*(){const N4=a8M;return(yield this['apiClient'][N4(0x2b2)][N4(0x1da)]({'parameters':{'projectId':L}}))['data'][N4(0x254)](k=>k['id']);});return this[N5(0x230)](N5(0x278),V,M);}),this[d(0x258)]=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const N7=d,V=L=>k=>__awaiter(this,void 0x0,void 0x0,function*(){const N6=a8M;var R;const r=yield this[N6(0x220)][N6(0x2b2)][N6(0x279)]({'parameters':{'projectId':L},'options':{'per_page':this[N6(0x283)],'cursor':k}});return{'elements':r[N6(0x26c)][N6(0x279)]['map'](Q=>Q['id']),'nextCursor':(R=r[N6(0x27a)])===null||R===void 0x0?void 0x0:R[N6(0x272)]};});return this[N7(0x218)](N7(0x2c0),V,M);}),this['askForSubdomain']=M=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const N8=d,V=yield this[N8(0x220)][N8(0x25b)]['domain']({'parameters':{'domain':M}}),L=V[N8(0x26c)][N8(0x28f)][N8(0x254)](R=>R['name']+'\x20(full\x20domain:\x20'+R[N8(0x22b)]+')'),k=N8(0x242)+M+')';return this[N8(0x26d)](N8(0x1fd),L,k)[N8(0x223)](R=>R[N8(0x29d)]('\x20')[0x0]);}),this[d(0x215)]=M=>__awaiter(this,void 0x0,void 0x0,function*(){const N9=d;return(yield inquirer[N9(0x282)]([{'type':N9(0x2a0),'name':N9(0x25d),'message':chalk_1[N9(0x27d)]['yellowBright'](N9(0x23a)+(M||N9(0x249))+N9(0x20b)),'default':![]}]))['confirmation'];}),this[d(0x1f1)]=(M,V)=>__awaiter(this,void 0x0,void 0x0,function*(){const NN=d;_['isUndefined'](M[NN(0x2b7)])&&(V[NN(0x1fe)]<=0x0?_[NN(0x296)](M,'name',NN(0x27d)):yield(0x0,utils_1[NN(0x1e1)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const NM=NN,{name:L}=yield inquirer[NM(0x282)]([{'type':NM(0x23b),'name':NM(0x2b7),'message':NM(0x25f),'default':NM(0x205)}]);if(!M[NM(0x236)]&&V[NM(0x1cc)](k=>k[NM(0x2b7)]===L)){const {c:k}=yield inquirer[NM(0x282)]([{'type':NM(0x2a0),'name':'c','message':NM(0x281)+L+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(k===![])throw new Error(NM(0x25a));_[NM(0x296)](M,NM(0x236),!![]);}_[NM(0x296)](M,'name',L);})));if(_['isUndefined'](M['token'])){const L=yield this[NN(0x26b)]();_[NN(0x296)](M,'token',L);}return M;}),this[d(0x26b)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const NV=d,{token:M}=yield inquirer['prompt']([{'type':NV(0x2a5),'name':NV(0x276),'mask':'*','message':NV(0x1ef)}]);return M;}),inquirer['registerPrompt']('search-list',inquirerSearchList),inquirer['registerPrompt'](d(0x26e),inquirer_pagination_prompt_1['DynamicReloadPaginationPrompt']);}[a8S(0x1d8)](N,M){return __awaiter(this,void 0x0,void 0x0,function*(){const NL=a8M,V=yaml['safeDump'](N),L=_[NL(0x2ac)](V['split']('\x0a')[NL(0x254)](r=>r[NL(0x1fe)])),k=chalk_1[NL(0x27d)][NL(0x27e)]('-'[NL(0x22f)](L)+'\x0a'),{confirm:R}=yield inquirer['prompt']([{'type':NL(0x2b2),'name':NL(0x2a0),'message':''+chalk_1['default'][NL(0x1f8)][NL(0x1f2)](NL(0x1e9))+k+chalk_1[NL(0x27d)]['blueBright'](V)+k,'choices':Object[NL(0x1e6)](ConfirmChoices)}]);switch(R){case ConfirmChoices[NL(0x298)]:return N;case ConfirmChoices[NL(0x2a8)]:throw new Error(NL(0x297));case ConfirmChoices['REPEAT']:return this[NL(0x256)](M);case ConfirmChoices['EDIT']:return this[NL(0x1d8)](yield this[NL(0x221)](N),M);case ConfirmChoices['SAVE']:yield this['saveFile'](N);return this[NL(0x1d8)](N,M);default:throw new Error('Something\x20unexpected\x20happened.');}});}[a8S(0x256)](N,M){return __awaiter(this,void 0x0,void 0x0,function*(){const Nk=a8M;if((M===null||M===void 0x0?void 0x0:M[Nk(0x2b5)])!==undefined)this[Nk(0x2b5)]=M===null||M===void 0x0?void 0x0:M[Nk(0x2b5)];this[Nk(0x1f9)]=M===null||M===void 0x0?void 0x0:M['cmdPath'];const V={};return yield this[Nk(0x2b3)]([],N[Nk(0x235)][Nk(0x265)],V),this[Nk(0x2b5)]=V,yield this['confirmationPrompt'](V,N);});}[a8S(0x2b3)](N,M,V,L){return __awaiter(this,void 0x0,void 0x0,function*(){const NR=a8M;let k;if(M[NR(0x299)]&&!_[NR(0x293)](M,NR(0x1dd))){if(M[NR(0x299)][NR(0x1fe)]>0x1){const {choice:R}=yield inquirer[NR(0x282)]([{'type':NR(0x2b2),'name':NR(0x229),'message':NR(0x20e)+(N[N[NR(0x1fe)]-0x1]||'')+NR(0x29f),'choices':M[NR(0x299)][NR(0x254)](r=>{var Q;return(Q=r['description'])!==null&&Q!==void 0x0?Q:'??';})}]);k=yield this['getType'](N,M[NR(0x299)][NR(0x1cc)](r=>r['description']===R),V,L);}else{const r=M[NR(0x299)][0x0];_[NR(0x296)](r,NR(0x1eb),M[NR(0x1eb)]),k=yield this[NR(0x1d9)](N,r,V,L);}k={};}else k=yield this[NR(0x1d9)](N,M,V,L);return k;});}[a8S(0x219)](N,M,V,L){var k;return __awaiter(this,void 0x0,void 0x0,function*(){const Nr=a8M;if(L===![]){const {addEntry:Q}=yield inquirer[Nr(0x282)]([{'type':Nr(0x2a0),'name':Nr(0x247),'message':this[Nr(0x251)](M,Nr(0x225),N===null||N===void 0x0?void 0x0:N[Nr(0x1eb)]),'default':![]}]);if(!Q)return V;}const R=Object['keys']((k=N===null||N===void 0x0?void 0x0:N[Nr(0x1dd)])!==null&&k!==void 0x0?k:[]),r=N[Nr(0x2b9)]||[];if(R[Nr(0x1fe)]>0x0)for(const z of R){const h=M[Nr(0x239)](z);if(M[Nr(0x1fe)]>0x0&&!_[Nr(0x293)](V,M[Nr(0x261)]('.')))_['set'](V,M[Nr(0x261)]('.'),{});yield this[Nr(0x2b3)](h,N[Nr(0x1dd)][z],V,r[Nr(0x289)](z));}else yield this['getType'](M,Object['assign'](Object[Nr(0x2b1)]({},N),{'type':Nr(0x24e)}),V,L);return V;});}[a8S(0x20d)](N,M,V,L){return __awaiter(this,void 0x0,void 0x0,function*(){const NQ=a8M;if(M&&V)return!![];const k=M?NQ(0x225):NQ(0x270),{addEntry:R}=yield inquirer[NQ(0x282)]([{'type':NQ(0x2a0),'name':'addEntry','message':this['getPathString'](N,k,M?L:undefined),'default':![]}]);return R;});}[a8S(0x1d9)](N,M,V,L){return __awaiter(this,void 0x0,void 0x0,function*(){const Nz=a8M;let k;const R=N[Nz(0x261)]('.');switch(M===null||M===void 0x0?void 0x0:M['type']){case Nz(0x2ba):{let r=!![];while(yield this['askArrayEntry'](N,r,L,M===null||M===void 0x0?void 0x0:M[Nz(0x1eb)])){const Q=_[Nz(0x25b)](V,R);_['unset'](V,R),yield this['getType'](N,M[Nz(0x1e5)],V);const z=_[Nz(0x25b)](V,R);!_[Nz(0x1f5)](Q)?_['set'](V,R,[z]):(Q[Nz(0x269)](z),_['set'](V,R,Q)),r=![];}return k||[];}case Nz(0x241):{return k=yield this[Nz(0x219)](M,N,V,L),k;}case Nz(0x24e):k=(0x0,utils_1[Nz(0x288)])(yield this['ask'](N,M,L))||undefined;break;case Nz(0x2a6):case Nz(0x1db):case'integer':default:k=yield this[Nz(0x246)](N,M,L,V);break;}return!_['isUndefined'](k)&&_[Nz(0x296)](V,R,k),k;});}['ask'](N,M,V,L){var k;return __awaiter(this,void 0x0,void 0x0,function*(){const Nh=a8M,R=N[N[Nh(0x1fe)]-0x1],{defaultValue:defaultValue=(k=M===null||M===void 0x0?void 0x0:M['example'])!==null&&k!==void 0x0?k:M===null||M===void 0x0?void 0x0:M[Nh(0x27d)],choices:choices=M===null||M===void 0x0?void 0x0:M[Nh(0x27f)],pagination:r}=yield(0x0,api_helpers_1['fetchResourceList'])(R,this[Nh(0x220)],this[Nh(0x1f9)],L,this[Nh(0x259)],N);let Q=Nh(0x23b);if(!_[Nh(0x24f)](choices)&&choices[Nh(0x1fe)]>0x0){if(r!==undefined&&r[Nh(0x1e8)]!==undefined)Q=Nh(0x26e);else choices['length']>0x4&&typeof choices[0x0]===Nh(0x2a6)?Q=Nh(0x237):Q=Nh(0x2b2);}else{if((M===null||M===void 0x0?void 0x0:M[Nh(0x28c)])===Nh(0x1db))Q='confirm';else{if((M===null||M===void 0x0?void 0x0:M['type'])===Nh(0x284))Q=Nh(0x23b);else(M===null||M===void 0x0?void 0x0:M[Nh(0x28c)])===Nh(0x24e)&&(Q='editor');}}let z=V!==![]?!_[Nh(0x263)](defaultValue)?defaultValue:JSON[Nh(0x203)](defaultValue):_[Nh(0x2bc)](defaultValue)?defaultValue:Nh(0x27b);if(choices)z=z[Nh(0x286)]();_[Nh(0x293)](this[Nh(0x2b5)],N[Nh(0x261)]('.'))&&(z=this['resultCache'][N[Nh(0x261)]('.')]);const h=choices&&V===![]?[Nh(0x27b),...choices]:choices,X=(M===null||M===void 0x0?void 0x0:M['type'])===Nh(0x284),u=Object[Nh(0x2b1)]({'type':Q,'name':'id','message':this[Nh(0x23d)](N,M),'choices':h,'default':z,'filter':this[Nh(0x207)](Q,V),'validate':this[Nh(0x227)](M,V,X)},r),p=(yield inquirer[Nh(0x282)]([u]))['id'];if(p==='don\x27t\x20change'||p==='')return undefined;if(X)return parseInt(p,0xa);return p;});}[a8S(0x23d)](N,M){const NX=a8S,V=(M===null||M===void 0x0?void 0x0:M['type'])!==NX(0x1db)?NX(0x204):NX(0x26a);return this[NX(0x251)](N,V,M===null||M===void 0x0?void 0x0:M['description']);}[a8S(0x1e0)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Np=a8M,N=M=>__awaiter(this,void 0x0,void 0x0,function*(){const Nu=a8M;var V;const L=yield this[Nu(0x220)][Nu(0x2b2)]['projects']({'options':{'per_page':this[Nu(0x283)],'cursor':M}}),k=L[Nu(0x26c)][Nu(0x255)][Nu(0x254)](R=>R['id']);return{'elements':k,'nextCursor':(V=L[Nu(0x27a)])===null||V===void 0x0?void 0x0:V[Nu(0x272)]};});return yield this[Np(0x222)](Np(0x217),N);});}[a8S(0x230)](N,M,V,L){return __awaiter(this,void 0x0,void 0x0,function*(){const NF=a8M,k=V||this['apiClient'][NF(0x2aa)]['getCurrentProjectName']();if(_[NF(0x24f)](k))throw new Error(NF(0x231));const R=yield M(k);return yield this[NF(0x26d)](N,R,(L?L+NF(0x1f4):'')+NF(0x274)+k+'\x27');});}[a8S(0x218)](N,M,V,L){return __awaiter(this,void 0x0,void 0x0,function*(){const NS=a8M,k=V||this[NS(0x220)][NS(0x2aa)][NS(0x201)]();if(_['isUndefined'](k))throw new Error(NS(0x231));const R=yield M(k);return yield this[NS(0x222)](N,R,(L?L+NS(0x1f4):'')+NS(0x274)+k+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Nb=a8M,N=yield this[Nb(0x220)][Nb(0x2b2)][Nb(0x291)]({}),M=N[Nb(0x26c)][Nb(0x291)][Nb(0x254)](V=>V[Nb(0x2b7)]);return this['askForResource'](Nb(0x1ec),M);});}[a8S(0x28a)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Ns=a8M,N=yield this[Ns(0x220)][Ns(0x2b2)][Ns(0x206)]({}),M=N[Ns(0x26c)][Ns(0x232)][Ns(0x254)](V=>V['id']);return this['askForResource'](Ns(0x232),M);});}['setPathVars'](N){const Ny=a8S;this[Ny(0x259)]=N;}}exports['InquirerHelper']=InquirerHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a9Z=a9M;function a9M(N,M){const V=a9N();return a9M=function(L,k){L=L-0x152;let R=V[L];return R;},a9M(N,M);}(function(N,M){const U=a9M,V=N();while(!![]){try{const L=parseInt(U(0x155))/0x1*(parseInt(U(0x188))/0x2)+-parseInt(U(0x16e))/0x3+parseInt(U(0x172))/0x4+parseInt(U(0x17c))/0x5+parseInt(U(0x16a))/0x6+-parseInt(U(0x183))/0x7*(parseInt(U(0x17b))/0x8)+-parseInt(U(0x16f))/0x9;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a9N,0x5911b));var __createBinding=this&&this[a9Z(0x15c)]||(Object[a9Z(0x179)]?function(N,M,V,L){const n=a9Z;if(L===undefined)L=V;var R=Object['getOwnPropertyDescriptor'](M,V);(!R||('get'in R?!M[n(0x15f)]:R[n(0x182)]||R[n(0x187)]))&&(R={'enumerable':!![],'get':function(){return M[V];}}),Object['defineProperty'](N,L,R);}:function(N,M,V,L){if(L===undefined)L=V;N[L]=M[V];}),__setModuleDefault=this&&this[a9Z(0x152)]||(Object['create']?function(N,M){const I=a9Z;Object[I(0x174)](N,I(0x157),{'enumerable':!![],'value':M});}:function(N,M){const d=a9Z;N[d(0x157)]=M;}),__importStar=this&&this['__importStar']||function(N){const v=a9Z;if(N&&N[v(0x15f)])return N;var M={};if(N!=null){for(var V in N)if(V!==v(0x157)&&Object[v(0x17e)][v(0x163)][v(0x158)](N,V))__createBinding(M,N,V);}return __setModuleDefault(M,N),M;},__awaiter=this&&this[a9Z(0x18c)]||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){const t=a9M;function Q(X){const a=a9M;try{h(L[a(0x15b)](X));}catch(u){r(u);}}function z(X){const l=a9M;try{h(L[l(0x16b)](X));}catch(u){r(u);}}function h(X){const o=a9M;X[o(0x16c)]?R(X[o(0x161)]):k(X[o(0x161)])[o(0x160)](Q,z);}h((L=L['apply'](N,M||[]))[t(0x15b)]());});},__importDefault=this&&this[a9Z(0x18f)]||function(N){return N&&N['__esModule']?N:{'default':N};};function a9N(){const i=['message','baseUrl','https:','Failure\x20during\x20login:\x20','init','__setModuleDefault','open','parse','31wjTElc','initPackage','default','call','Unexpected\x20response','end','next','__createBinding','error','toString','__esModule','then','value','finally','hasOwnProperty','handleError','replace','exit','type','idle','write','955632uslBbg','throw','done','NorthflankApiBrowserLogin','672315aIIHEr','4911453wFNoVY','error\x20happened\x20during\x20browser\x20login:\x20','unable\x20to\x20parse\x20message:\x20','1990376eiGNUB','startLogin','defineProperty','ws:','aborted','Unexpected\x20response,\x20api\x20token\x20missing','EventEmitter','create','Unable\x20to\x20open\x20browser:\x20','136YyzRGf','1511645OgWcML','emit','prototype','events','duplex','data','writable','77063ZVUzJg','browser-opened','http:','createWebSocketStream','configurable','23394pAzKWj','status','Login\x20process\x20stopped\x20before\x20completed','stringify','__awaiter','success','SIGINT','__importDefault','wss:'];a9N=function(){return i;};return a9N();}Object['defineProperty'](exports,a9Z(0x15f),{'value':!![]}),exports[a9Z(0x16d)]=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a9Z(0x153))),events_1=require(a9Z(0x17f));class NorthflankApiBrowserLogin extends events_1[a9Z(0x178)]{constructor(N,M=!![]){const g=a9Z;super(),this[g(0x192)]=N,this['openBrowser']=M,this[g(0x189)]=g(0x168),this['initPackage']=()=>JSON['stringify']({'type':g(0x195)});}[a9Z(0x173)](){const m=a9Z;var N;const M=this['baseUrl'][m(0x165)](m(0x193),m(0x190))[m(0x165)](m(0x185),m(0x175)),V=M+'/v1/cli-login',L=new ws_1[(m(0x157))](V),k=()=>__awaiter(this,void 0x0,void 0x0,function*(){const x=m;yield new Promise(r=>{const W=a9M;var Q;(Q=this[W(0x180)])===null||Q===void 0x0?void 0x0:Q[W(0x15a)](JSON['stringify']({'type':W(0x176)}),()=>r());}),process[x(0x166)]();}),R=new Promise((r,Q)=>{const K=m;var z,h,X;try{this[K(0x180)]=(0x0,ws_1[K(0x186)])(L),process['on'](K(0x18e),k);}catch(u){Q(new Error('Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20'+u['message']));}(z=this[K(0x180)])===null||z===void 0x0?void 0x0:z['on'](K(0x181),p=>{const A=K;var F;const S=JSON[A(0x154)](p[A(0x15e)]());switch(S===null||S===void 0x0?void 0x0:S[A(0x167)]){case'init-ack':{const {loginPage:b}=S;if(b===undefined){this[A(0x164)](A(0x159),Q);return;}this['openBrowser']&&(0x0,open_1[A(0x157)])(b)['catch'](s=>{const e=A,y=e(0x17a)+s[e(0x191)];this[e(0x164)](y,Q);});this[A(0x17d)](A(0x184),{'url':b});break;}case'login-success':{const {apiToken:s,contextName:y}=S;if(s===undefined){this[A(0x164)](A(0x177),Q);return;}(F=this[A(0x180)])===null||F===void 0x0?void 0x0:F[A(0x15a)](),r({'token':s,'contextName':y}),this[A(0x189)]=A(0x18d);break;}case'login-failure':{const c=A(0x194)+(S===null||S===void 0x0?void 0x0:S[A(0x191)]);this[A(0x164)](c,Q);break;}default:{const T=A(0x171)+JSON[A(0x18b)](S);this[A(0x164)](T,Q);}}}),(h=this['duplex'])===null||h===void 0x0?void 0x0:h['on'](K(0x15d),p=>{const f=K;this[f(0x164)](f(0x170)+p[f(0x191)],Q);}),(X=this[K(0x180)])===null||X===void 0x0?void 0x0:X['on'](K(0x15a),()=>{const G=K;if(this[G(0x189)]===G(0x18d)){}else this[G(0x164)](G(0x18a),Q);});});return(N=this[m(0x180)])===null||N===void 0x0?void 0x0:N[m(0x169)](this[m(0x156)]()),this[m(0x189)]='init',R[m(0x162)](()=>{process['removeListener']('SIGINT',k);});}[a9Z(0x164)](N,M){const q=a9Z;var V,L;M?(V=this[q(0x180)])===null||V===void 0x0?void 0x0:V[q(0x15a)](()=>M(new Error(N))):(L=this[q(0x180)])===null||L===void 0x0?void 0x0:L[q(0x15a)](),this[q(0x189)]=q(0x15d);}}exports[a9Z(0x16d)]=NorthflankApiBrowserLogin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a10K=a10M;(function(N,M){const x=a10M,V=N();while(!![]){try{const L=parseInt(x(0x23a))/0x1*(parseInt(x(0x1d0))/0x2)+-parseInt(x(0x1ce))/0x3*(-parseInt(x(0x1d1))/0x4)+parseInt(x(0x1e7))/0x5*(-parseInt(x(0x1d5))/0x6)+-parseInt(x(0x214))/0x7+-parseInt(x(0x1f8))/0x8*(-parseInt(x(0x226))/0x9)+parseInt(x(0x205))/0xa*(-parseInt(x(0x1d9))/0xb)+-parseInt(x(0x239))/0xc*(-parseInt(x(0x1ea))/0xd);if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a10N,0xb73a4));function a10N(){const P=['apiClient','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','build-','\x20--','forEach','tail','@northflank/js-client','../inquirer-helper','addOption','getFormatter','charAt','addonId','values','Container\x20logs\x20','1452YTyDjD','1831EQeXwF','--regexNotIncludes\x20<regex>','yaml','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','\x27Ctrl+C\x27','-o,\x20--output\x20[output]','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','assign','__importDefault','logs','Option','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','next','forward','getStandardLogCommand','\x20for\x20','2271iCBWZn','slice','814FAhRPv','5836Spkbtq','Id\x20[NAME]','getCommand','choices','6oeeJbD','action','-f,\x20--tail','\x20seconds','150931vMqTvq','tsHint','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','Error\x20while\x20tailing\x20log\x20lines:\x20','--startTime\x20<timestamp>','alias','\x20to\x20get\x20logs\x20from','description',',\x20duration:\x20','value','assertContextExisting','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','addon','5144915emZPXp','logs-received','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','99567XqEltJ','-d,\x20--direction\x20<order>','askForProject','getCurrentProjectName','log','--container\x20--containerId\x20[NAME]','CliLogs','message','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','inquirerHelper','Get\x20log\x20for\x20the\x20specified\x20','getCurrentServiceName','regexIncludes','data','1896ydOmOM','conflicts','regexNotIncludes','--textIncludes\x20<text>','bold','parseDateInput','defineProperty','./log-formatter','toUpperCase','service','getLogsCommand','askForService','toISOString','620gJcIbW','name','job','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','backward','chalk','Error\x20while\x20fetching\x20log\x20lines:\x20','--regexIncludes\x20<regex>','../formatting/console-format-helpers','--noDefaults','logTail','__esModule','serviceId','ApiClient','__awaiter','1625855GdXBFq','printInitInfo','-l,\x20--lineLimit\x20[limit]','length','json','argParser','textIncludes','Log\x20session\x20ended','textNotIncludes','noDefaults','option','error','default',',\x20to:\x20','jobId','InquirerHelper','--project\x20--projectId\x20[NAME]','buildId','3267KNhalu','formatLogLine','throw','logsApiClient'];a10N=function(){return P;};return a10N();}var __awaiter=this&&this[a10K(0x213)]||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){const G=a10M;function Q(X){const A=a10M;try{h(L[A(0x1ca)](X));}catch(u){r(u);}}function z(X){const e=a10M;try{h(L[e(0x228)](X));}catch(u){r(u);}}function h(X){const f=a10M;X['done']?R(X[f(0x1e2)]):k(X[f(0x1e2)])['then'](Q,z);}h((L=L['apply'](N,M||[]))[G(0x1ca)]());});},__importDefault=this&&this[a10K(0x242)]||function(N){const q=a10K;return N&&N[q(0x210)]?N:{'default':N};};Object[a10K(0x1fe)](exports,a10K(0x210),{'value':!![]}),exports['CliLogs']=void 0x0;const js_client_1=require(a10K(0x231)),chalk_1=__importDefault(require(a10K(0x20a))),utils_1=require('../utils'),inquirer_helper_1=require(a10K(0x232)),commander_1=require('commander'),console_format_helpers_1=require(a10K(0x20d)),log_formatter_1=require(a10K(0x1ff));class CliLogs{constructor(N){const i=a10K;this['apiContext']=N,this[i(0x1cc)]=(M,V)=>(0x0,utils_1[i(0x1d3)])(!![])[i(0x206)]((V?i(0x22d):'')+i(0x243))[i(0x1de)]((V?i(0x22d):'')+i(0x1ee))[i(0x1e0)](i(0x1f4)+M)[i(0x21e)](i(0x224),'Project\x20for\x20logs')['option']('--'+M+i(0x22e)+M+i(0x1d2),M[i(0x235)](0x0)[i(0x200)]()+M[i(0x1cf)](0x1)+i(0x1df))[i(0x21e)](i(0x1ef),i(0x22b))[i(0x21e)](i(0x1d7),i(0x1e4))[i(0x21e)](i(0x216),'Number\x20of\x20lines\x20to\x20return.')['option'](i(0x1dd),'Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1['tsHint'],utils_1[i(0x1fd)])[i(0x233)](new commander_1[(i(0x1c8))]('--endTime\x20<timestamp>',i(0x1f2)+utils_1[i(0x1da)])[i(0x219)](utils_1[i(0x1fd)])['conflicts']([i(0x230)]))[i(0x21e)]('--duration\x20[duration]',i(0x1e9))['addOption'](new commander_1['Option'](i(0x1eb),i(0x22c))[i(0x1d4)]([i(0x209),i(0x1cb)])['conflicts']([i(0x230)]))['addOption'](new commander_1['Option'](i(0x1fb),'Filter\x20log\x20lines\x20to\x20include\x20this\x20text')[i(0x1f9)]([i(0x21c),i(0x1f6),i(0x1fa)]))['addOption'](new commander_1[(i(0x1c8))]('--textNotIncludes\x20<text>',i(0x23d))[i(0x1f9)]([i(0x21a),i(0x1f6),i(0x1fa)]))['addOption'](new commander_1[(i(0x1c8))](i(0x20c),i(0x1c9))[i(0x1f9)]([i(0x21c),i(0x21a),i(0x1fa)]))['addOption'](new commander_1[(i(0x1c8))](i(0x23b),i(0x1db))[i(0x1f9)]([i(0x21c),i(0x1f6),i(0x21a)]))[i(0x21e)](i(0x20e),i(0x1e5),![])[i(0x233)](new commander_1[(i(0x1c8))](i(0x23f),i(0x208))[i(0x1d4)](Object[i(0x237)](['format','json','yaml']))),this[i(0x215)]=(M,V,L,k)=>{const w=i,{containerId:R,quiet:r,tail:Q,startTime:z,endTime:h,duration:X}=k;if(r===!![])return;const u=Q?'(exit\x20with\x20'+chalk_1[w(0x220)][w(0x1fc)](w(0x23e))+')':'',p=Q?'\x20with\x20live-tailing\x20':'',F=z?',\x20from:\x20'+z[w(0x204)]():'',S=h?w(0x221)+h[w(0x204)]():'',b=X?w(0x1e1)+X+w(0x1d8):'',s=R?'container\x20'+chalk_1[w(0x220)][w(0x1fc)](R):'all\x20containers',y=M+'\x20'+chalk_1[w(0x220)][w(0x1fc)](V)+'\x20in\x20project\x20'+chalk_1[w(0x220)][w(0x1fc)](L),c=''+F+S+b;console[w(0x1ee)](w(0x238)+p+w(0x1cd)+s+'\x20of\x20'+y+c+'\x20'+u);},this[i(0x234)]=(M,V)=>L=>{const E=i;if(!M){if(L[E(0x217)]===0x0)console[E(0x1ee)]('No\x20logs\x20found\x20for\x20this\x20query.');L[E(0x22f)](k=>(0x0,log_formatter_1[E(0x227)])(k,V));}else(0x0,console_format_helpers_1['printResponse'])(M,L);},this['apiClient']=new js_client_1[(i(0x212))](N,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']}),this[i(0x229)]=this[i(0x22a)],this[i(0x1f3)]=new inquirer_helper_1[(i(0x223))](this[i(0x22a)]);}[a10K(0x202)](N,M=![]){const J=a10K,V=(k,R)=>__awaiter(this,void 0x0,void 0x0,function*(){const D=a10M,r=R[D(0x21d)],{apiContext:Q,inquirerHelper:z}=this;switch(N){case D(0x201):{const h=r?undefined:Q[D(0x1f5)]();return R[D(0x211)]||h||(yield z[D(0x203)](k)());}case D(0x207):{const X=r?undefined:Q[D(0x1f5)]();return R[D(0x222)]||X||(yield z['askForJob'](k)());}case D(0x1e6):{const u=r?undefined:Q[D(0x1f5)]();return R[D(0x236)]||u||(yield z['askForAddon'](k)());}}}),L=(k,R,r)=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a10M;if(M)return r[Y(0x225)]||(yield this[Y(0x1f3)]['askForBuild'](k,N===Y(0x201)?R:undefined,N===Y(0x207)?R:undefined)());return undefined;});return this[J(0x1cc)](N,M)[J(0x1d6)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const j=J,{noDefaults:R,projectId:r,containerId:Q,quiet:z,tail:h,textIncludes:X,textNotIncludes:u,regexIncludes:p,regexNotIncludes:F,direction:S,lineLimit:b,startTime:s,endTime:y,duration:c,output:T}=k;(0x0,utils_1[j(0x1e3)])(this[j(0x22a)]);const {apiContext:U,inquirerHelper:Z,logsApiClient:n}=this,I=R?undefined:U[j(0x1ed)](),d=r||I||(yield Z[j(0x1ec)]()),v=yield V(d,k),a=yield L(d,v,k);if(!z&&T!==j(0x23c)&&T!=='yml'&&T!==j(0x218))this['printInitInfo'](N,v,d,k);if(s&&y&&c)throw new Error(j(0x240));const l={'projectId':d,'entityId':v,'buildId':a},o={'containerName':Q,'textIncludes':X,'textNotIncludes':u,'regexIncludes':p,'regexNotIncludes':F,'lineLimit':b,'startTime':s,'duration':c},t=this[j(0x234)](T,X!==null&&X!==void 0x0?X:p);if(h){const g=yield n['logs'][j(0x20f)](l,o,N);g['on'](j(0x1e8),t),g['on'](j(0x21f),m=>(0x0,utils_1[j(0x21f)])(j(0x1dc)+m[j(0x1f1)])),g['on']('close',()=>console['log'](j(0x21b))),yield g['start']();}else{const m=Object['assign'](Object[j(0x241)]({},o),{'endTime':y,'direction':S}),W=yield n[j(0x243)]['logRange'](l,m,N);if(W[j(0x21f)])(0x0,utils_1[j(0x21f)])(j(0x20b)+W[j(0x21f)][j(0x1f1)]);else t(W[j(0x1f7)]);}}));}}function a10M(N,M){const V=a10N();return a10M=function(L,k){L=L-0x1c8;let R=V[L];return R;},a10M(N,M);}exports[a10K(0x1f0)]=CliLogs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a11u=a11M;(function(N,M){const h=a11M,V=N();while(!![]){try{const L=parseInt(h(0x18f))/0x1*(parseInt(h(0x195))/0x2)+parseInt(h(0x1a4))/0x3*(parseInt(h(0x1aa))/0x4)+-parseInt(h(0x191))/0x5+-parseInt(h(0x19a))/0x6+-parseInt(h(0x193))/0x7+-parseInt(h(0x1a3))/0x8*(-parseInt(h(0x19d))/0x9)+parseInt(h(0x18e))/0xa;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a11N,0xbe896));var __importDefault=this&&this['__importDefault']||function(N){const X=a11M;return N&&N[X(0x194)]?N:{'default':N};};function a11N(){const S=['8990280LIXwcg','greenBright','default','2826nmEpcf','containerId','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','dim','pattern','bold','32632LkAMFC','4288689ZkhQmQ','yellow','blue','green','log','defaultLogSyntax','4KRDOzc','chalk','cyan','grey','15542560hxYtKp','5lOePWZ','replace','6748080ryJEXU','formatLogLine','10395112xhhPBx','__esModule','339530tHavYx','color','gray','reduce','\x20--\x20'];a11N=function(){return S;};return a11N();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a11u(0x192)]=exports[a11u(0x1a9)]=void 0x0;const chalk_1=__importDefault(require(a11u(0x1ab)));exports[a11u(0x1a9)]=[{'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':a11u(0x18d),'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':a11u(0x18d),'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':a11u(0x1a2),'pattern':new RegExp(a11u(0x19f),'i')},{'color':'green','pattern':/(?:\d{1,3}\.){3}\d{1,3}/i},{'color':a11u(0x1a7),'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':a11u(0x1a6),'pattern':/\b(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH)\b/},{'color':a11u(0x19b),'pattern':/\b(successful|success|completed|complete|done)\b/i},{'color':'red','pattern':/\b(failed|fail|stderr|error|err)\b/i},{'color':a11u(0x197),'pattern':/\b(information|info|debug)\b/i},{'color':a11u(0x1a5),'pattern':/\b(warning|warn)\b/i},{'color':a11u(0x1a6),'pattern':/[0-9a-f]{64}/i},{'color':a11u(0x1a6),'pattern':/[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}/i}];function a11M(N,M){const V=a11N();return a11M=function(L,k){L=L-0x18d;let R=V[L];return R;},a11M(N,M);}const formatLogLine=(N,M)=>{const p=a11u,V=chalk_1[p(0x19c)][p(0x1a0)](N['ts']['toISOString']()),L=chalk_1[p(0x19c)][p(0x1ac)](N[p(0x19e)]),k=exports[p(0x1a9)][p(0x198)]((r,Q)=>{const F=p;return r[F(0x190)](Q[F(0x1a1)],z=>Q[F(0x196)]?chalk_1['default'][Q[F(0x196)]](z):chalk_1[F(0x19c)][F(0x18d)](z));},N[p(0x1a8)]),R=M?k[p(0x190)](new RegExp(M,'g'),r=>chalk_1['default'][p(0x1a2)](r)):k;console['log'](V+'\x20'+L+p(0x199)+R);};exports[a11u(0x192)]=formatLogLine;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const a12m=a12M;(function(N,M){const g=a12M,V=N();while(!![]){try{const L=-parseInt(g(0x247))/0x1+-parseInt(g(0x232))/0x2*(-parseInt(g(0x22e))/0x3)+-parseInt(g(0x1ef))/0x4+-parseInt(g(0x24f))/0x5*(-parseInt(g(0x249))/0x6)+parseInt(g(0x26b))/0x7*(-parseInt(g(0x248))/0x8)+parseInt(g(0x22d))/0x9*(parseInt(g(0x238))/0xa)+parseInt(g(0x202))/0xb;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a12N,0xdc014));function a12N(){const N0=['3894nOYUak','\x20--','Fetching\x20data..','value','Which\x20metric\x20type\x20to\x20fetch','map','5615JUPrrt',',\x20metric\x20types:\x20','getAsciiChart','metricsSingle','min','name','unshift','slice','ApiClient','__esModule','buildId','@northflank/js-client','then','noDefaults','\x20seconds','printMetricsGraph','printMetricsSingle','Get\x20metrics\x20after\x20this\x20timestamp,\x20','toTimeString','-t,\x20--metricTypes\x20<metricTypes...>','askForJob','message','inquirerHelper','stdout','addOption','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','alias','keys','719236GdWzUx','Get\x20metrics\x20before\x20this\x20timestamp,\x20','commander','printResponse','job','container\x20','flatMap','endTime','toISOString','clear','error','handleError','exit','getTime','refreshInterval','printMetricsTable','No\x20metrics\x20found\x20for\x20this\x20query','../formatting/terminal-chart','askForProject','metadata','apiContext','-o,\x20--output\x20[output]','getCurrentProjectName','log','stringify','5281896xfVunT','apiClient','Option','../inquirer-helper','N/A','valueOf','json','addon','\x20to\x20get\x20logs\x20from','values','getMetricsCommand','--noDefaults','askForBuild','build-',',\x20duration:\x20','push','max','description','yml','17109235qpOVNW','bold','charAt','warning','filter','all\x20containers','metricId','rows','next','yaml','getPaddingDataStart',',\x20to:\x20','data','metricsApiClient','parseDateInput','choices','option','tsHint','../formatting/console-format-helpers','\x20for\x20container:\x20',',\x20from:\x20','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','startTime','chalk','Get\x20metrics\x20at\x20this\x20exact\x20timestamp,\x20if\x20no\x20timestamp\x20set\x20most\x20recent\x20time\x20is\x20used.\x20','printInitInfo','service','Error\x20while\x20fetching\x20metrics\x20entries:\x20','assertContextExisting','\x20in\x20project\x20','askForService','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','../utils','__awaiter','getCurrentServiceName','toFixed','toUpperCase','forEach','--endTime\x20<timestamp>','Get\x20metrics\x20for\x20the\x20specified\x20','metrics','pct','addonId','39249xYXiDy','68553avcjfE','Project\x20for\x20logs','apply','argParser','76SwYeMY','getPaddingDataEnd','length','--container\x20--containerId\x20[NAME]','default','--duration\x20[duration]','370zJwIsr','Metrics\x20for\x20','split','Metrics\x20overview','details','isNaN','done','serviceId','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','\x20of\x20','format','assign','printAsTable','CliMetrics','time','886797ansGgN','16YawupM'];a12N=function(){return N0;};return a12N();}var __awaiter=this&&this[a12m(0x223)]||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){const x=a12M;function Q(X){try{h(L['next'](X));}catch(u){r(u);}}function z(X){try{h(L['throw'](X));}catch(u){r(u);}}function h(X){const W=a12M;X[W(0x23e)]?R(X[W(0x24c)]):k(X[W(0x24c)])[W(0x25b)](Q,z);}h((L=L[x(0x230)](N,M||[]))[x(0x20a)]());});},__importDefault=this&&this['__importDefault']||function(N){const K=a12m;return N&&N[K(0x258)]?N:{'default':N};};Object['defineProperty'](exports,a12m(0x258),{'value':!![]}),exports[a12m(0x245)]=void 0x0;const js_client_1=require(a12m(0x25a)),utils_1=require(a12m(0x222)),inquirer_helper_1=require(a12m(0x1f2)),commander_1=require(a12m(0x26d)),terminal_chart_1=require(a12m(0x1e7)),console_format_helpers_1=require(a12m(0x214)),chalk_1=__importDefault(require(a12m(0x219)));function a12M(N,M){const V=a12N();return a12M=function(L,k){L=L-0x1e3;let R=V[L];return R;},a12M(N,M);}class CliMetrics{constructor(N){const A=a12m;this[A(0x1ea)]=N,this[A(0x1e4)]=0x2710,this['getStandardMetricsCommand']=(M,V)=>(0x0,utils_1['getCommand'])(!![])[A(0x254)]((V?'build-':'')+A(0x22a))[A(0x269)]((V?A(0x1fc):'')+'metric')[A(0x200)](A(0x229)+M)[A(0x212)]('--project\x20--projectId\x20[NAME]',A(0x22f))['option']('--'+M+A(0x24a)+M+'Id\x20[NAME]',M[A(0x204)](0x0)[A(0x226)]()+M[A(0x256)](0x1)+A(0x1f7))[A(0x212)](A(0x235),A(0x240))[A(0x212)]('--startTime\x20<timestamp>',A(0x260)+utils_1['tsHint'],utils_1[A(0x210)])['option'](A(0x228),A(0x26c)+utils_1['tsHint'],utils_1[A(0x210)])['option'](A(0x237),A(0x217))[A(0x267)](new commander_1[(A(0x1f1))]('-o,\x20--output\x20[output]','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[A(0x211)](Object['values'](['format',A(0x1f5),'yaml'])))[A(0x267)](new commander_1[(A(0x1f1))](A(0x262),A(0x24d))[A(0x211)](Object[A(0x1f8)](js_client_1['MetricType'])))[A(0x267)](new commander_1[(A(0x1f1))]('--timestamp\x20[timestamp]',A(0x21a)+utils_1[A(0x213)])[A(0x231)](utils_1[A(0x210)])['conflicts']([A(0x218),A(0x272)]))[A(0x212)](A(0x1fa),A(0x221),![])['addOption'](new commander_1['Option'](A(0x1eb),A(0x268))[A(0x211)](Object[A(0x1f8)]([A(0x242),A(0x1f5),A(0x20b)]))),this[A(0x25e)]=(M,V)=>{return L=>{const e=a12M,k=Object[e(0x26a)](L)[e(0x271)](R=>{const {values:r,metricInfo:Q}=L[R],{metricUnit:z,metricResolution:h}=Q;return r['map'](X=>{const f=a12M;var u,p;const {metadata:F,data:S}=X,b=V?(V===null||V===void 0x0?void 0x0:V['getTime']())>new Date()[f(0x1e3)]()?new Date():V:undefined,s=new Date((u=S===null||S===void 0x0?void 0x0:S[0x0])===null||u===void 0x0?void 0x0:u['ts']),y=new Date((p=S===null||S===void 0x0?void 0x0:S[S['length']-0x1])===null||p===void 0x0?void 0x0:p['ts']),c=this[f(0x20c)](M,s,h),T=this[f(0x233)](b,y,h),U=[...c,...S,...T],Z=U['map'](t=>[new Date(t['ts'])[f(0x1f4)](),Number(t['value'])])[f(0x206)](t=>!Number[f(0x23d)](t[0x0])),n=Math[f(0x253)](Math[f(0x1ff)](process[f(0x266)]['columns']-0xa,0xa),0x64),I=Math[f(0x253)](Math[f(0x1ff)](process[f(0x266)]['rows']-0x9,0xa),0xf),d=z===f(0x22b)?0x64:undefined,v=z===f(0x22b)?'%':z,a=(0x0,terminal_chart_1['downSampleData'])(Z,n),l=a[f(0x24e)](t=>t[0x1]),o={'min':0x0,'height':I,'max':d,'unit':v,'startTs':M!==null&&M!==void 0x0?M:s,'endTs':b!==null&&b!==void 0x0?b:y};return{'dataSeries':l,'metadata':F,'chartOpts':o,'metricInfo':Q};});})['flat']();if(k[e(0x234)]===0x0)(0x0,utils_1[e(0x205)])(e(0x1e6));else k[e(0x227)](R=>{const G=e,{dataSeries:r,metadata:Q,chartOpts:z,metricInfo:h}=R,{containerId:X,volumeId:u}=Q,p=u?',\x20volume:\x20'+u:'';console[G(0x1ed)](h[G(0x208)]+G(0x215)+chalk_1[G(0x236)][G(0x203)](X)+p),console[G(0x1ed)]((0x0,terminal_chart_1[G(0x251)])(r,z));});};},this[A(0x1e5)]=(M,V,L)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const q=A;try{const k=yield this[q(0x20f)][q(0x22a)][q(0x252)](M,V,L);console[q(0x274)]();if(k[q(0x275)])(0x0,utils_1[q(0x275)])(q(0x21d)+k[q(0x275)][q(0x264)]);else this[q(0x25f)](k[q(0x20e)]);}catch(R){console[q(0x274)](),(0x0,utils_1[q(0x275)])(q(0x21d)+R['message']);}}),this[A(0x276)]=M=>{const i=A;if(M[i(0x275)])throw new Error(i(0x21d)+M[i(0x275)]['message']+'\x20'+JSON[i(0x1ee)](M[i(0x275)][i(0x23c)]));},this['printInitInfo']=(M,V,L,k,R)=>{const w=A;if(R===!![])return;const {metricTypes:r,endTime:Q,startTime:z,duration:h,containerId:X}=k,u=z?w(0x216)+z[w(0x273)]():'',p=Q?w(0x20d)+Q[w(0x273)]():'',F=h?w(0x1fd)+h+w(0x25d):'',S=X?w(0x270)+chalk_1['default'][w(0x203)](X):w(0x207),b=M+'\x20'+chalk_1['default'][w(0x203)](V)+w(0x21f)+chalk_1[w(0x236)]['bold'](L),s=''+u+p+F,y=r?w(0x250)+(r===null||r===void 0x0?void 0x0:r['join'](',')):'';console[w(0x1ed)](w(0x239)+S+w(0x241)+b+y+s);},this[A(0x1f0)]=new js_client_1[(A(0x257))](N,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']}),this['metricsApiClient']=this[A(0x1f0)],this[A(0x265)]=new inquirer_helper_1['InquirerHelper'](this[A(0x1f0)]);}[a12m(0x1f9)](N,M=![]){const V=(k,R)=>__awaiter(this,void 0x0,void 0x0,function*(){const E=a12M,r=R[E(0x25c)],{apiContext:Q,inquirerHelper:z}=this;switch(N){case'service':{const h=r?undefined:Q[E(0x224)]();return R[E(0x23f)]||h||(yield z[E(0x220)](k)());}case'job':{const X=r?undefined:Q[E(0x224)]();return R['jobId']||X||(yield z[E(0x263)](k)());}case E(0x1f6):{const u=r?undefined:Q[E(0x224)]();return R[E(0x22c)]||u||(yield z['askForAddon'](k)());}}}),L=(k,R,r)=>__awaiter(this,void 0x0,void 0x0,function*(){const D=a12M;if(M)return r[D(0x259)]||(yield this['inquirerHelper'][D(0x1fb)](k,N===D(0x21c)?R:undefined,N===D(0x26f)?R:undefined)());return undefined;});return this['getStandardMetricsCommand'](N,M)['action'](k=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a12M,{noDefaults:R,projectId:r,containerId:Q,duration:z,timestamp:h,output:X,startTime:u,endTime:p,metricTypes:F,quiet:S}=k;(0x0,utils_1[Y(0x21e)])(this[Y(0x1f0)]);if(u&&p&&z)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const {apiContext:b,inquirerHelper:s,metricsApiClient:y}=this,c=R?undefined:b[Y(0x1ec)](),T=r||c||(yield s[Y(0x1e8)]()),U=yield V(T,k),Z=yield L(T,U,k),n={'projectId':T,'entityId':U,'buildId':Z},I={'containerName':Q,'startTime':u,'endTime':p,'duration':z,'timestamp':h,'metricTypes':F},d=!(u||p||z);if(!S&&X!=='yaml'&&X!==Y(0x201)&&X!=='json')this[Y(0x21b)](N,U,T,k,S);if(d){if(X!==undefined){const v=yield y[Y(0x22a)][Y(0x252)](n,I,N);this[Y(0x276)](v),(0x0,console_format_helpers_1[Y(0x26e)])(X,v[Y(0x20e)]);}else[...Array(process[Y(0x266)][Y(0x209)]-0x1)][Y(0x227)]((a,l)=>l===0x0?console['log'](Y(0x24b)):console[Y(0x1ed)]()),yield this[Y(0x1e5)](n,I,N)(),setInterval(this[Y(0x1e5)](n,I,N),this[Y(0x1e4)]),yield new Promise(a=>setTimeout(a,this[Y(0x1e4)]*0x64));}else{const a=yield y[Y(0x22a)]['metricsRange'](n,I,N);this[Y(0x276)](a),X!==undefined?(0x0,console_format_helpers_1[Y(0x26e)])(X,a[Y(0x20e)]):this[Y(0x25e)](u,p!==null&&p!==void 0x0?p:new Date())(a[Y(0x20e)]);}process[Y(0x277)]();}));}['printMetricsSingle'](N){const P=a12m,M=(k,R)=>{const J=a12M;if(!(R===null||R===void 0x0?void 0x0:R[J(0x24c)]))J(0x1f3);const r=k['metricUnit']==='pct'?'%':k['metricUnit'];return''+Number(R===null||R===void 0x0?void 0x0:R[J(0x24c)])[J(0x225)](0x3)+r;},V=k=>{const j=a12M;if(!(k===null||k===void 0x0?void 0x0:k['ts']))j(0x1f3);return k['ts'][j(0x261)]()[j(0x23a)]('\x20')[0x0];},L={};Object[P(0x26a)](N)[P(0x227)](k=>{const H=P,{values:R,metricInfo:r}=N[k];return R[H(0x227)](Q=>{const B=H;var z,h;const X=Q[B(0x1e9)]['containerId'];Object[B(0x243)](L,{[X]:Object[B(0x243)](Object['assign']({},L===null||L===void 0x0?void 0x0:L[X]),{[B(0x246)]:V((z=Q[B(0x20e)])===null||z===void 0x0?void 0x0:z[0x0]),'containerId':X,[r['metricId']]:M(r,(h=Q['data'])===null||h===void 0x0?void 0x0:h[0x0])})});});}),(0x0,console_format_helpers_1[P(0x244)])(Object[P(0x1f8)](L),P(0x23b));}[a12m(0x20c)](N,M,V){const O=a12m,L=r=>new Date(r['getTime']()-k),k=V*0x3e8;if(!N)return[];if(!M)return[];if(L(M)[O(0x1e3)]()<N[O(0x1e3)]())return[];const R=[{'ts':L(M),'value':0x0}];while(L(R[R[O(0x234)]-0x1]['ts'])[O(0x1e3)]()<=N[O(0x1e3)]()){R[O(0x255)]({'ts':L(R[R[O(0x234)]-0x1]['ts']),'value':0x0});}return R;}[a12m(0x233)](N,M,V){const C=a12m,L=r=>new Date(r['getTime']()+k),k=V*0x3e8;if(!N)return[];if(!M)return[];if(L(M)[C(0x1e3)]()>N[C(0x1e3)]())return[];const R=[{'ts':L(M),'value':0x0}];while(L(R[R['length']-0x1]['ts'])[C(0x1e3)]()<=N[C(0x1e3)]()){R[C(0x1fe)]({'ts':L(R[R['length']-0x1]['ts']),'value':0x0});}return R;}}exports[a12m(0x245)]=CliMetrics;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a13M(N,M){const V=a13N();return a13M=function(L,k){L=L-0xf1;let R=V[L];return R;},a13M(N,M);}const a13s=a13M;(function(N,M){const p=a13M,V=N();while(!![]){try{const L=parseInt(p(0x10f))/0x1+-parseInt(p(0x107))/0x2+parseInt(p(0x105))/0x3+parseInt(p(0x117))/0x4+parseInt(p(0x116))/0x5+parseInt(p(0xf5))/0x6+-parseInt(p(0xfc))/0x7;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a13N,0x42ac6));function a13N(){const I=['9018184IuYIIX','\x20Loading\x20more\x20options','loading','reloadText','opt','handleDynamicPageLoad','value','next','onDownKey','288882fMEYzf','choices','221280dTiugZ','DynamicReloadPaginationPrompt','__importDefault','pagOpt','inquirer/lib/prompts/list','push','then','name','184859PbdKFC','catch','onUpKey','throw','..\x20Load\x20more\x20options\x20..','loop','realLength','2059145BwrIlx','1996564awnbNb','__esModule','chalk','default','render','2879538VAWDOL','defineProperty','length','selected','map','down','nextPageCursor'];a13N=function(){return I;};return a13N();}var __awaiter=this&&this['__awaiter']||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){function Q(X){const F=a13M;try{h(L[F(0x103)](X));}catch(u){r(u);}}function z(X){const S=a13M;try{h(L[S(0x112)](X));}catch(u){r(u);}}function h(X){const b=a13M;X['done']?R(X[b(0x102)]):k(X['value'])[b(0x10d)](Q,z);}h((L=L['apply'](N,M||[]))['next']());});},__importDefault=this&&this[a13s(0x109)]||function(N){return N&&N['__esModule']?N:{'default':N};};Object[a13s(0xf6)](exports,a13s(0xf1),{'value':!![]}),exports[a13s(0x108)]=void 0x0;const list_1=__importDefault(require(a13s(0x10b))),choice_1=__importDefault(require('inquirer/lib/objects/choice')),chalk_1=__importDefault(require(a13s(0xf2)));function incrementListIndex(N,M,V){const y=a13s,L=V['choices'][y(0x115)],k=y(0x114)in V?Boolean(V[y(0x114)]):!![];if(M==='up'){if(N>0x0)return N-0x1;return k?L-0x1:N;}if(M==='down'){if(N<L-0x1)return N+0x1;return k?0x0:N;}throw new Error('dir\x20must\x20be\x20up\x20or\x20down');}class DynamicReloadPaginationPrompt extends list_1[a13s(0xf3)]{constructor(N,M,V){const c=a13s;super(N,M,V),this[c(0xff)]=chalk_1['default']['italic'](c(0x113)),this['loading']=![],this['pagOpt']=this['opt'],this[c(0xfb)]=this[c(0x10a)]['nextPageCursor'],this[c(0xfb)]!==undefined&&this[c(0x100)]['choices'][c(0x10c)](new choice_1[(c(0xf3))](this[c(0xff)],this[c(0xff)]));}[a13s(0x111)](){const T=a13s;if(this[T(0xfe)])return;this['selected']=incrementListIndex(this[T(0xf8)],'up',this[T(0x100)]),this[T(0xf4)]();}[a13s(0x104)](){return __awaiter(this,void 0x0,void 0x0,function*(){const U=a13M;if(this[U(0xfe)])return;this[U(0xf8)]=incrementListIndex(this[U(0xf8)],U(0xfa),this[U(0x100)]),yield this[U(0x101)](),this[U(0xf4)]();});}['handleDynamicPageLoad'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Z=a13M;if(this[Z(0xf8)]>=this[Z(0x100)]['choices'][Z(0xf7)]-0x1){if(this[Z(0xfb)]===undefined)return;this[Z(0xfe)]=!![];let N=0x0;const M=setInterval(()=>{const n=Z,R=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],r=chalk_1[n(0xf3)]['italic'](R[N%R[n(0xf7)]]+n(0xfd));this['opt'][n(0x106)][n(0x106)][this['selected']][n(0x10e)]=''+r,N+=0x1,this[n(0xf4)]();},0x50),{elements:V,nextPageCursor:L}=yield this[Z(0x10a)]['loadMore']({'nextPageCursor':this['nextPageCursor']})[Z(0x110)](()=>({'elements':[],'nextPageCursor':undefined}));this['nextPageCursor']=L;const k=V[Z(0xf9)](R=>new choice_1[(Z(0xf3))](R,R));this[Z(0x100)]['choices']['choices']['splice'](this[Z(0xf8)],0x1),this[Z(0x100)][Z(0x106)][Z(0x10c)](...k),L!==undefined&&this[Z(0x100)][Z(0x106)][Z(0x10c)](new choice_1[(Z(0xf3))](this[Z(0xff)],this[Z(0xff)])),clearInterval(M),this[Z(0xfe)]=![];}});}}exports['DynamicReloadPaginationPrompt']=DynamicReloadPaginationPrompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a10f(H,f){const l=a10H();return a10f=function(t,b){t=t-0x6b;let i=l[t];return i;},a10f(H,f);}const a10O=a10f;(function(H,f){const e=a10f,l=H();while(!![]){try{const t=-parseInt(e(0xcb))/0x1+parseInt(e(0xa5))/0x2*(-parseInt(e(0xa6))/0x3)+-parseInt(e(0xed))/0x4+-parseInt(e(0x83))/0x5*(-parseInt(e(0x6f))/0x6)+parseInt(e(0x7f))/0x7+parseInt(e(0xdd))/0x8+parseInt(e(0x98))/0x9;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a10H,0x326f9));var __createBinding=this&&this['__createBinding']||(Object[a10O(0x7e)]?function(H,f,l,t){const E=a10O;if(t===undefined)t=l;var b=Object[E(0xb9)](f,l);(!b||(E(0x87)in b?!f[E(0x84)]:b['writable']||b[E(0xaf)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[E(0x6c)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a10O(0xa9)]||(Object[a10O(0x7e)]?function(H,f){const S=a10O;Object['defineProperty'](H,S(0x78),{'enumerable':!![],'value':f});}:function(H,f){H['default']=f;}),__importStar=this&&this[a10O(0xb2)]||function(H){const A=a10O;if(H&&H[A(0x84)])return H;var f={};if(H!=null){for(var l in H)if(l!==A(0x78)&&Object[A(0xcd)][A(0xdc)][A(0xc9)](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const I=a10f;function r(Y){const k=a10f;try{w(t[k(0xd6)](Y));}catch(x){n(x);}}function q(Y){const h=a10f;try{w(t[h(0x70)](Y));}catch(x){n(x);}}function w(Y){const K=a10f;Y[K(0x91)]?i(Y[K(0xe8)]):b(Y[K(0xe8)])['then'](r,q);}w((t=t[I(0xc4)](H,f||[]))[I(0xd6)]());});},__importDefault=this&&this['__importDefault']||function(H){const P=a10O;return H&&H[P(0x84)]?H:{'default':H};};function a10H(){const H0=['entries','port','portName','data.id','\x27:\x20\x22','6244704WZHHEs','option','message','forwardProject','noDefaultsText','Forwarding\x20','Port-forwarding\x20for\x20the\x20specified\x20service','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','CliPortForward','Cleaning\x20up\x20open\x20connections\x20failed:\x20','join','printHostsFileHint','connection-error','2UNQqnu','938325fWDcSD','SIGINT','printForwardingInfo','__setModuleDefault','Forwarding\x20addon\x20','win32','\x20with\x20multiple\x20ports:','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','Forwarding\x20service\x20','configurable','\x20is\x20running\x20and\x20reachable.','--noDefaults','__importStar','flatMap','customUserAgent','repeat','service','\x20-\x20','--skipHostnames','getOwnPropertyDescriptor','\x20in\x20project\x20','Addon\x20to\x20forward','Failed:\x20','error','flat','\x20is\x20exposed\x20with\x20multiple\x20','capitalize','protocol','apiClient','/etc/hosts','apply','uniqBy','greenBright','stop','forwardAddon','call','assertContextExisting','396061PPFuXP','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','prototype','name','portFwdCmd','lodash','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','uniq','green','log','skipHostnamesText','next','type','hostnames','addon','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','success','hasOwnProperty','2840xMtwFG','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','C:/Windows/System32/drivers/etc/hosts','getCurrentProjectName','\x20addon\x20ports','askForProject','../utils','description','\x20is\x20exposed\x20on\x20','fwd','value','\x20\x20-\x20Address:\x20','warning','askForAddon','Running\x20in\x20','1097248UIOWTx','Services:','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','black','defineProperty','alias','\x20\x20-\x20port\x20','1458usPtFh','throw','action','askForService','addCommand','getProxyForwarder','http://','--project\x20--projectId\x20[NAME]','getCommand','default','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','Running\x20on\x20macOS\x20in\x20','data','Project\x20for\x20forwarding','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','create','2825676XIjyEt','forEach','../inquirer-helper','\x20to\x20','1890USsFJL','__esModule','\x20and\x20','filter','get','--service\x20--serviceId\x20[NAME]','bold','--addon\x20--addonId\x20[NAME]','map','\x20with\x20these\x20hostnames:','Stop\x20forwarding\x20traffic\x20from\x20','forwardService','length','platform','done','address'];a10H=function(){return H0;};return a10H();}Object[a10O(0x6c)](exports,a10O(0x84),{'value':!![]}),exports[a10O(0xa0)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require('chalk')),utils_1=require(a10O(0xe4)),inquirer_helper_1=require(a10O(0x81)),os=__importStar(require('os')),lodash_1=require(a10O(0xd0)),{EOL}=require('os');class CliPortForward{constructor(H){const Z=a10O;this['noDefaultsText']=Z(0xdf),this['skipHostnamesText']=Z(0x9f),this[Z(0xc2)]=new js_client_1['ApiClient'](H,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Z(0xb4)]});const f=new inquirer_helper_1['InquirerHelper'](this[Z(0xc2)]);this[Z(0xcf)]=(0x0,utils_1[Z(0x77)])()[Z(0xce)]('forward')[Z(0x6d)](Z(0xe7))[Z(0xe5)](Z(0x7d));const l=(0x0,utils_1['getCommand'])(!![])[Z(0xce)]('all')[Z(0xe5)](Z(0xd1))['option'](Z(0x76),'project\x20for\x20forwarding')[Z(0x99)](Z(0xb1),this[Z(0x9c)],![])[Z(0x99)]('--skipHostnames',this[Z(0xd5)],![])[Z(0x71)](({noDefaults:i,projectId:n,skipHostnames:r})=>__awaiter(this,void 0x0,void 0x0,function*(){const W=Z;(0x0,utils_1[W(0xca)])(this[W(0xc2)]);const q=this[W(0x74)](r),w=i?undefined:H[W(0xe1)](),Y=n||w||(yield f['askForProject']());try{const {services:x,addons:U}=yield q[W(0x9b)]({'projectId':Y},r);if(x[W(0x8f)]+U[W(0x8f)]<=0x0)(0x0,utils_1[W(0xea)])(W(0xad)+chalk_1['default']['bold'](Y));else{const m=x[W(0x86)](B=>B[W(0x8f)]>0x0)[W(0x8f)],Q=U['filter'](B=>B[W(0x8f)]>0x0)[W(0x8f)],L=W(0xba)+chalk_1[W(0x78)][W(0x89)](Y);console['log'](W(0x9d)+chalk_1[W(0x78)][W(0xd3)][W(0x89)](m+'\x20service\x20ports')+W(0x85)+chalk_1[W(0x78)][W(0xd3)][W(0x89)](Q+W(0xe2))+L),console[W(0xd4)](),console[W(0xd4)](chalk_1[W(0x78)]['bold'](W(0xee))),x[W(0x80)](B=>{const u=W;if(B[u(0x8f)]>=0x1&&!B[0x0][u(0xbd)])this[u(0xa8)](B,{'type':u(0xb6),'name':B[0x0]['data']['id']},r);}),console[W(0xd4)](chalk_1[W(0x78)][W(0x89)]('Addons:')),U[W(0x80)](B=>{const g=W;if(B['length']>=0x1&&!B[0x0][g(0xbd)])this[g(0xa8)](B,{'type':g(0xd9),'name':B[0x0][g(0x7b)]['id']},r);}),this['printHostsFileHint']([...x[W(0xbe)](),...U[W(0xbe)]()],r);}}catch(B){(0x0,utils_1[W(0xbd)])(W(0xbc)+B[W(0x9a)]);}})),t=(0x0,utils_1[Z(0x77)])(!![])['name'](Z(0xb6))['description'](Z(0x9e))[Z(0x99)](Z(0x76),Z(0x7c))['option'](Z(0x88),'Service\x20to\x20forward')[Z(0x99)]('--noDefaults',this[Z(0x9c)],![])[Z(0x99)](Z(0xb8),this['skipHostnamesText'],![])[Z(0x71)](({noDefaults:i,projectId:n,serviceId:r,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const d=Z;(0x0,utils_1[d(0xca)])(this[d(0xc2)]);const w=this[d(0x74)](q),Y=i?undefined:H['getCurrentProjectName'](),x=n||Y||(yield f[d(0xe3)]()),U=i?undefined:H['getCurrentServiceName'](),m=r||U||(yield f[d(0x72)](x)());console['log'](d(0xae)+chalk_1[d(0x78)][d(0x89)](m)+d(0xba)+chalk_1[d(0x78)][d(0x89)](x));try{const Q=yield w[d(0x8e)]({'projectId':x,'serviceId':m},q);this['printForwardingInfo'](Q,{'name':m,'type':d(0xb6)},q),this[d(0xa3)](Q,q);}catch(L){(0x0,utils_1[d(0xbd)])(d(0xbc)+L[d(0x9a)]);}})),b=(0x0,utils_1[Z(0x77)])(!![])['name'](Z(0xd9))[Z(0xe5)]('Port-forwarding\x20for\x20the\x20specified\x20addon')[Z(0x99)](Z(0x76),Z(0x7c))[Z(0x99)](Z(0x8a),Z(0xbb))['option'](Z(0xb8),this[Z(0xd5)],![])[Z(0x71)](({noDefaults:i,projectId:n,addonId:r,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const F=Z;(0x0,utils_1[F(0xca)])(this[F(0xc2)]);const w=this[F(0x74)](q),Y=i?undefined:H[F(0xe1)](),x=n||Y||(yield f['askForProject']()),U=r||(yield f[F(0xeb)](x)());console[F(0xd4)](F(0xaa)+chalk_1[F(0x78)][F(0x89)](U)+F(0xba)+chalk_1[F(0x78)]['bold'](x));try{const m={'projectId':x,'addonId':U},Q=yield w[F(0xc8)](m,q);this[F(0xa8)](Q,{'name':U,'type':F(0xd9)},q),this['printHostsFileHint'](Q,q);}catch(L){(0x0,utils_1[F(0xbd)])(F(0xbc)+L[F(0x9a)]);}}));this[Z(0xcf)][Z(0x73)](l),this['portFwdCmd']['addCommand'](t),this[Z(0xcf)][Z(0x73)](b);}['getProxyForwarder'](H=![]){const p=a10O,f=this[p(0xc2)]['forwarding'];if(!H){const l=f['canExecuteWithHostnames']();if(l[p(0xbd)])throw new Error(l[p(0x9a)]);}return f['on']('tunnel-close',(t,b)=>{const a=p,i=chalk_1[a(0x78)]['bold'](b['type']+'\x20\x27'+b['id']+'\x27'),n=b[a(0xd8)]['length']>0x0;(0x0,utils_1[a(0xea)])(a(0x8d)+b[a(0x92)]+':'+b[a(0x94)]+a(0x82)+i),H&&n&&(0x0,utils_1[a(0xea)])(a(0x79));}),f['on'](p(0xa4),(t,b,i)=>{const J=p;(0x0,utils_1[J(0xea)])('Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27'+b[J(0x92)]+':'+b['port']+J(0x97)+(i===null||i===void 0x0?void 0x0:i[J(0x9a)])+'\x22');}),process['on'](p(0xa7),()=>__awaiter(this,void 0x0,void 0x0,function*(){const o=p;try{yield f[o(0xc7)]();}catch(t){(0x0,utils_1[o(0xbd)])(o(0xa1)+t[o(0x9a)]);}finally{process['exit']();}})),f;}[a10O(0xa8)](H,f,l=![]){const M=a10O,{type:t,name:b}=f;if(H[M(0x8f)]<=0x0){const q='Please\x20ensure\x20the\x20'+f[M(0xd7)]+M(0xb0);(0x0,utils_1['warning'])(M(0xef)+t+'\x20'+chalk_1[M(0x78)][M(0x89)](b)+'.\x20'+q);return;}const i=(0x0,lodash_1['groupBy'])(H,M(0x96)),n=w=>'\x20('+(w[M(0x95)]?w[M(0x95)]+M(0xb7):'')+w[M(0xc1)]+')';function r(w,Y=0x2){const G=M;if(!l){const x=w[G(0xc1)]==='HTTP'?G(0x75):'';w[G(0xd8)]['forEach'](U=>{const N=G;console['log']((0x0,lodash_1[N(0xb5)])('\x20',Y)+'-\x20'+x+U+':'+w[N(0x94)]);});}}Object[M(0x93)](i)[M(0x80)](([w,Y])=>{const z=M;var x,U;const m='>\x20'+(0x0,lodash_1[z(0xc0)])(t)+'\x20\x27'+chalk_1[z(0x78)][z(0xc6)][z(0x89)](w)+'\x27';if(t===z(0xd9)){if(Y[z(0x8f)]===0x1){const Q=Y[0x0];if(Q[z(0xbd)]){(0x0,utils_1[z(0xbd)])(z(0xcc)+w+':\x20'+Q[z(0xbd)][z(0x9a)]);return;}const L=Q['data'],B=!l?chalk_1['default'][z(0x6b)]('\x20with\x20hostname:\x20'+L[z(0xd8)][z(0xa2)](',')):'';(0x0,utils_1[z(0xdb)])(m+'\x20is\x20exposed\x20on\x20'+L['address']+':'+L[z(0x94)]+n(L)+B);}else{const T=(0x0,lodash_1[z(0xc5)])(Y,X=>{const v=z;var C,j;return(j=(C=X===null||X===void 0x0?void 0x0:X['data'])===null||C===void 0x0?void 0x0:C[v(0xd8)])===null||j===void 0x0?void 0x0:j[v(0xa2)](',');})[z(0x8f)]>0x1;(0x0,utils_1[z(0xdb)])(m+z(0xbf)+(T?'hosts':'ports')+':'),Y['forEach'](X=>{const R=z;if(X[R(0xbd)]){(0x0,utils_1[R(0xbd)])(R(0xcc)+w+':\x20'+X[R(0xbd)][R(0x9a)]);return;}const C=X[R(0x7b)],j=!l?',\x20hostname:\x20'+C[R(0xd8)][R(0xa2)](','):'';console[R(0xd4)](R(0xe9)+C[R(0x92)]+':'+C['port']+n(C)+j);});}}if(t===z(0xb6)){if(Y[z(0x8f)]===0x1){const X=Y[0x0];if(X['error']){(0x0,utils_1['error'])(z(0xcc)+w+':\x20'+X[z(0xbd)][z(0x9a)]);return;}const C=X[z(0x7b)],j=!l?z(0x8c):':',c=C[z(0x92)]+':'+C[z(0x94)]+n(C);(0x0,utils_1[z(0xdb)])(m+z(0xe6)+c+j),r(C);}else(0x0,utils_1['success'])(m+z(0xe6)+((U=(x=Y[0x0])===null||x===void 0x0?void 0x0:x['data'])===null||U===void 0x0?void 0x0:U[z(0x92)])+z(0xac)),Y[z(0x80)](D=>{const s=z;if(D[s(0xbd)]){(0x0,utils_1[s(0xbd)])(s(0xcc)+w+':\x20'+D[s(0xbd)][s(0x9a)]);return;}const V=D[s(0x7b)];(0x0,utils_1['success'])(s(0x6e)+V[s(0x94)]+n(V)),r(V,0x4);});}});}[a10O(0xa3)](H,f=![]){const y=a10O;if(f){const l=H[y(0xb3)](Y=>Y[y(0x7b)])[y(0x86)](Y=>Y!==undefined),t=(process===null||process===void 0x0?void 0x0:process[y(0x90)])===y(0xab),b=os[y(0x90)]()==='darwin',i=t?y(0xe0):y(0xc3),n=chalk_1[y(0x78)][y(0x89)]('skipHostnames'),r=b?EOL+y(0x7a)+n+y(0xde):undefined;let q=y(0xec)+n+y(0xda)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+i+'):';r!==undefined&&(0x0,utils_1[y(0xea)])(r!==null&&r!==void 0x0?r:'');(0x0,utils_1[y(0xea)])(q);const w=l[y(0x8b)](Y=>Y['address']+'\x20\x20\x20\x20\x20\x20\x20\x20\x20'+Y['hostnames'][y(0xa2)]('\x20'));console['log']((0x0,lodash_1[y(0xd2)])(w)[y(0xa2)](EOL)),console[y(0xd4)]();}}}exports[a10O(0xa0)]=CliPortForward;
|
|
1
|
+
'use strict';const a14v=a14M;function a14M(N,M){const V=a14N();return a14M=function(L,k){L=L-0xc1;let R=V[L];return R;},a14M(N,M);}function a14N(){const N0=['Forwarding\x20addon\x20','skipHostnamesText','project\x20for\x20forwarding','4612680iynljQ','message','Port-forwarding\x20for\x20the\x20specified\x20service','address','__awaiter','connection-error','action','bold','Cleaning\x20up\x20open\x20connections\x20failed:\x20','Port-forwarding\x20for\x20the\x20specified\x20addon','\x20service\x20ports','349704lXNfqM','noDefaultsText','Services:','__importDefault','__setModuleDefault','\x20is\x20running\x20and\x20reachable.','\x20is\x20exposed\x20on\x20','Failed:\x20','chalk','117990tnehxs','port','forward','\x20with\x20multiple\x20ports:','askForProject','service','option','SIGINT','forEach','stop','assertContextExisting','getOwnPropertyDescriptor','description','flat','create','forwarding','\x20with\x20these\x20hostnames:','\x20in\x20project\x20','Forwarding\x20service\x20','filter','success','exit','platform','\x20\x20\x20\x20\x20\x20\x20\x20\x20','error','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','getProxyForwarder','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','apiClient','default','--project\x20--projectId\x20[NAME]','\x20-\x20','hostnames','\x20is\x20exposed\x20with\x20multiple\x20','__createBinding','next','name','green','entries','--addon\x20--addonId\x20[NAME]','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','greenBright','askForService','alias','Project\x20for\x20forwarding','data.id','type','Service\x20to\x20forward','repeat','warning',',\x20hostname:\x20','all','getCurrentServiceName','done','Addon\x20to\x20forward','--skipHostnames','\x20to\x20','\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20(','http://','__esModule','forwardProject','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','addCommand','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','Forwarding\x20','uniqBy','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','forwardAddon','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','length','142032sKyeLA','8320NXbhbh','lodash','2443gpScqc','133448shnypr','log','--noDefaults','getCommand','askForAddon','defineProperty','\x20with\x20hostname:\x20','Addons:','\x20\x20-\x20port\x20','win32','get','value','\x20\x20-\x20Address:\x20','prototype','canExecuteWithHostnames','ports','printHostsFileHint','CliPortForward','writable','protocol','map','C:/Windows/System32/drivers/etc/hosts','/etc/hosts','flatMap','51kEJKiy','3568YYTejr','printForwardingInfo','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','getCurrentProjectName','throw','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','skipHostnames','join','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','portFwdCmd','data','@northflank/js-client','HTTP','addon','\x20and\x20','portName','groupBy','25PsUdVZ','--service\x20--serviceId\x20[NAME]'];a14N=function(){return N0;};return a14N();}(function(N,M){const d=a14M,V=N();while(!![]){try{const L=-parseInt(d(0x136))/0x1*(parseInt(d(0x11b))/0x2)+-parseInt(d(0xcb))/0x3+-parseInt(d(0x11e))/0x4*(parseInt(d(0x148))/0x5)+-parseInt(d(0x11a))/0x6+-parseInt(d(0x11d))/0x7*(-parseInt(d(0x137))/0x8)+parseInt(d(0xd4))/0x9+parseInt(d(0x14d))/0xa;if(L===M)break;else V['push'](V['shift']());}catch(k){V['push'](V['shift']());}}}(a14N,0x1b0e6));var __createBinding=this&&this[a14v(0xf6)]||(Object[a14v(0xe2)]?function(N,M,V,L){const a=a14v;if(L===undefined)L=V;var R=Object[a(0xdf)](M,V);(!R||(a(0x128)in R?!M[a(0x10f)]:R[a(0x130)]||R['configurable']))&&(R={'enumerable':!![],'get':function(){return M[V];}}),Object[a(0x123)](N,L,R);}:function(N,M,V,L){if(L===undefined)L=V;N[L]=M[V];}),__setModuleDefault=this&&this[a14v(0xcf)]||(Object[a14v(0xe2)]?function(N,M){const l=a14v;Object['defineProperty'](N,l(0xf1),{'enumerable':!![],'value':M});}:function(N,M){const o=a14v;N[o(0xf1)]=M;}),__importStar=this&&this['__importStar']||function(N){const t=a14v;if(N&&N[t(0x10f)])return N;var M={};if(N!=null){for(var V in N)if(V!==t(0xf1)&&Object[t(0x12b)]['hasOwnProperty']['call'](N,V))__createBinding(M,N,V);}return __setModuleDefault(M,N),M;},__awaiter=this&&this[a14v(0xc4)]||function(N,M,V,L){function k(R){return R instanceof V?R:new V(function(r){r(R);});}return new(V||(V=Promise))(function(R,r){const W=a14M;function Q(X){try{h(L['next'](X));}catch(u){r(u);}}function z(X){const g=a14M;try{h(L[g(0x13b)](X));}catch(u){r(u);}}function h(X){const m=a14M;X[m(0x109)]?R(X[m(0x129)]):k(X[m(0x129)])['then'](Q,z);}h((L=L['apply'](N,M||[]))[W(0xf7)]());});},__importDefault=this&&this[a14v(0xce)]||function(N){const x=a14v;return N&&N[x(0x10f)]?N:{'default':N};};Object[a14v(0x123)](exports,'__esModule',{'value':!![]}),exports[a14v(0x12f)]=void 0x0;const js_client_1=require(a14v(0x142)),chalk_1=__importDefault(require(a14v(0xd3))),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),os=__importStar(require('os')),lodash_1=require(a14v(0x11c)),{EOL}=require('os');class CliPortForward{constructor(N){const K=a14v;this[K(0xcc)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this['skipHostnamesText']=K(0xfc),this[K(0xf0)]=new js_client_1['ApiClient'](N,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']});const M=new inquirer_helper_1['InquirerHelper'](this['apiClient']);this[K(0x140)]=(0x0,utils_1['getCommand'])()['name'](K(0xd6))[K(0xff)]('fwd')['description'](K(0x118));const V=(0x0,utils_1[K(0x121)])(!![])[K(0xf8)](K(0x107))[K(0xe0)](K(0x116))['option'](K(0xf2),K(0x14c))[K(0xda)](K(0x120),this[K(0xcc)],![])['option']('--skipHostnames',this[K(0x14b)],![])['action'](({noDefaults:R,projectId:r,skipHostnames:Q})=>__awaiter(this,void 0x0,void 0x0,function*(){const A=K;(0x0,utils_1[A(0xde)])(this[A(0xf0)]);const z=this[A(0xee)](Q),h=R?undefined:N[A(0x13a)](),X=r||h||(yield M[A(0xd8)]());try{const {services:u,addons:p}=yield z[A(0x110)]({'projectId':X},Q);if(u[A(0x119)]+p[A(0x119)]<=0x0)(0x0,utils_1['warning'])(A(0x13c)+chalk_1[A(0xf1)][A(0xc7)](X));else{const F=u[A(0xe7)](y=>y['length']>0x0)['length'],S=p[A(0xe7)](s=>s['length']>0x0)[A(0x119)],b='\x20in\x20project\x20'+chalk_1[A(0xf1)][A(0xc7)](X);console['log'](A(0x114)+chalk_1[A(0xf1)][A(0xf9)][A(0xc7)](F+A(0xca))+A(0x145)+chalk_1[A(0xf1)][A(0xf9)][A(0xc7)](S+'\x20addon\x20ports')+b),console[A(0x11f)](),console[A(0x11f)](chalk_1[A(0xf1)][A(0xc7)](A(0xcd))),u[A(0xdc)](s=>{const e=A;if(s[e(0x119)]>=0x1&&!s[0x0]['error'])this[e(0x138)](s,{'type':'service','name':s[0x0][e(0x141)]['id']},Q);}),console[A(0x11f)](chalk_1[A(0xf1)][A(0xc7)](A(0x125))),p[A(0xdc)](s=>{const f=A;if(s[f(0x119)]>=0x1&&!s[0x0]['error'])this[f(0x138)](s,{'type':f(0x144),'name':s[0x0][f(0x141)]['id']},Q);}),this[A(0x12e)]([...u[A(0xe1)](),...p[A(0xe1)]()],Q);}}catch(s){(0x0,utils_1[A(0xec)])(A(0xd2)+s['message']);}})),L=(0x0,utils_1[K(0x121)])(!![])[K(0xf8)](K(0xd9))[K(0xe0)](K(0xc2))[K(0xda)](K(0xf2),K(0x100))[K(0xda)](K(0x149),K(0x103))[K(0xda)](K(0x120),this[K(0xcc)],![])[K(0xda)](K(0x10b),this[K(0x14b)],![])[K(0xc6)](({noDefaults:R,projectId:r,serviceId:Q,skipHostnames:z})=>__awaiter(this,void 0x0,void 0x0,function*(){const G=K;(0x0,utils_1[G(0xde)])(this[G(0xf0)]);const h=this[G(0xee)](z),X=R?undefined:N['getCurrentProjectName'](),u=r||X||(yield M[G(0xd8)]()),p=R?undefined:N[G(0x108)](),F=Q||p||(yield M[G(0xfe)](u)());console['log'](G(0xe6)+chalk_1['default'][G(0xc7)](F)+G(0xe5)+chalk_1['default'][G(0xc7)](u));try{const S=yield h['forwardService']({'projectId':u,'serviceId':F},z);this[G(0x138)](S,{'name':F,'type':G(0xd9)},z),this[G(0x12e)](S,z);}catch(b){(0x0,utils_1[G(0xec)])('Failed:\x20'+b[G(0xc1)]);}})),k=(0x0,utils_1[K(0x121)])(!![])[K(0xf8)](K(0x144))[K(0xe0)](K(0xc9))[K(0xda)](K(0xf2),K(0x100))[K(0xda)](K(0xfb),K(0x10a))['option'](K(0x10b),this[K(0x14b)],![])['action'](({noDefaults:R,projectId:r,addonId:Q,skipHostnames:z})=>__awaiter(this,void 0x0,void 0x0,function*(){const q=K;(0x0,utils_1['assertContextExisting'])(this[q(0xf0)]);const h=this[q(0xee)](z),X=R?undefined:N['getCurrentProjectName'](),u=r||X||(yield M['askForProject']()),p=Q||(yield M[q(0x122)](u)());console[q(0x11f)](q(0x14a)+chalk_1['default'][q(0xc7)](p)+q(0xe5)+chalk_1[q(0xf1)]['bold'](u));try{const F={'projectId':u,'addonId':p},S=yield h[q(0x117)](F,z);this[q(0x138)](S,{'name':p,'type':q(0x144)},z),this[q(0x12e)](S,z);}catch(b){(0x0,utils_1['error'])(q(0xd2)+b[q(0xc1)]);}}));this[K(0x140)][K(0x112)](V),this['portFwdCmd'][K(0x112)](L),this[K(0x140)][K(0x112)](k);}['getProxyForwarder'](N=![]){const i=a14v,M=this[i(0xf0)][i(0xe3)];if(!N){const V=M[i(0x12c)]();if(V[i(0xec)])throw new Error(V[i(0xc1)]);}return M['on']('tunnel-close',(L,k)=>{const w=i,R=chalk_1[w(0xf1)][w(0xc7)](k['type']+'\x20\x27'+k['id']+'\x27'),r=k[w(0xf4)][w(0x119)]>0x0;(0x0,utils_1[w(0x105)])('Stop\x20forwarding\x20traffic\x20from\x20'+k[w(0xc3)]+':'+k[w(0xd5)]+w(0x10c)+R),N&&r&&(0x0,utils_1[w(0x105)])(w(0x13f));}),M['on'](i(0xc5),(L,k,R)=>{const E=i;(0x0,utils_1[E(0x105)])(E(0x113)+k[E(0xc3)]+':'+k[E(0xd5)]+'\x27:\x20\x22'+(R===null||R===void 0x0?void 0x0:R['message'])+'\x22');}),process['on'](i(0xdb),()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=i;try{yield M[D(0xdd)]();}catch(L){(0x0,utils_1[D(0xec)])(D(0xc8)+L[D(0xc1)]);}finally{process[D(0xe9)]();}})),M;}[a14v(0x138)](N,M,V=![]){const Y=a14v,{type:L,name:k}=M;if(N[Y(0x119)]<=0x0){const z='Please\x20ensure\x20the\x20'+M[Y(0x102)]+Y(0xd0);(0x0,utils_1['warning'])(Y(0xef)+L+'\x20'+chalk_1[Y(0xf1)]['bold'](k)+'.\x20'+z);return;}const R=(0x0,lodash_1[Y(0x147)])(N,Y(0x101)),r=h=>'\x20('+(h[Y(0x146)]?h['portName']+Y(0xf3):'')+h[Y(0x131)]+')';function Q(h,X=0x2){const J=Y;if(!V){const u=h[J(0x131)]===J(0x143)?J(0x10e):'';h[J(0xf4)]['forEach'](p=>{const j=J;console[j(0x11f)]((0x0,lodash_1[j(0x104)])('\x20',X)+'-\x20'+u+p+':'+h[j(0xd5)]);});}}Object[Y(0xfa)](R)[Y(0xdc)](([h,X])=>{const P=Y;var u,p;const F='>\x20'+(0x0,lodash_1['capitalize'])(L)+'\x20\x27'+chalk_1[P(0xf1)][P(0xfd)][P(0xc7)](h)+'\x27';if(L===P(0x144)){if(X[P(0x119)]===0x1){const S=X[0x0];if(S[P(0xec)]){(0x0,utils_1['error'])('Error\x20occured\x20while\x20trying\x20to\x20forward\x20'+h+':\x20'+S['error']['message']);return;}const b=S[P(0x141)],s=!V?chalk_1[P(0xf1)]['black'](P(0x124)+b[P(0xf4)][P(0x13e)](',')):'';(0x0,utils_1[P(0xe8)])(F+P(0xd1)+b[P(0xc3)]+':'+b[P(0xd5)]+r(b)+s);}else{const y=(0x0,lodash_1[P(0x115)])(X,c=>{const H=P;var T,U;return(U=(T=c===null||c===void 0x0?void 0x0:c[H(0x141)])===null||T===void 0x0?void 0x0:T['hostnames'])===null||U===void 0x0?void 0x0:U[H(0x13e)](',');})[P(0x119)]>0x1;(0x0,utils_1[P(0xe8)])(F+P(0xf5)+(y?'hosts':P(0x12d))+':'),X[P(0xdc)](c=>{const B=P;if(c[B(0xec)]){(0x0,utils_1[B(0xec)])(B(0x139)+h+':\x20'+c['error'][B(0xc1)]);return;}const T=c[B(0x141)],U=!V?B(0x106)+T['hostnames']['join'](','):'';console[B(0x11f)](B(0x12a)+T[B(0xc3)]+':'+T[B(0xd5)]+r(T)+U);});}}if(L==='service'){if(X['length']===0x1){const c=X[0x0];if(c[P(0xec)]){(0x0,utils_1[P(0xec)])(P(0x139)+h+':\x20'+c[P(0xec)][P(0xc1)]);return;}const T=c[P(0x141)],U=!V?P(0xe4):':',Z=T[P(0xc3)]+':'+T['port']+r(T);(0x0,utils_1[P(0xe8)])(F+P(0xd1)+Z+U),Q(T);}else(0x0,utils_1[P(0xe8)])(F+P(0xd1)+((p=(u=X[0x0])===null||u===void 0x0?void 0x0:u['data'])===null||p===void 0x0?void 0x0:p[P(0xc3)])+P(0xd7)),X[P(0xdc)](n=>{const O=P;if(n[O(0xec)]){(0x0,utils_1[O(0xec)])(O(0x139)+h+':\x20'+n[O(0xec)][O(0xc1)]);return;}const I=n[O(0x141)];(0x0,utils_1['success'])(O(0x126)+I[O(0xd5)]+r(I)),Q(I,0x4);});}});}['printHostsFileHint'](N,M=![]){const C=a14v;if(M){const V=N[C(0x135)](X=>X[C(0x141)])['filter'](X=>X!==undefined),L=(process===null||process===void 0x0?void 0x0:process[C(0xea)])===C(0x127),k=os[C(0xea)]()==='darwin',R=L?C(0x133):C(0x134),r=chalk_1[C(0xf1)][C(0xc7)](C(0x13d)),Q=k?EOL+'Running\x20on\x20macOS\x20in\x20'+r+C(0xed):undefined;let z='Running\x20in\x20'+r+C(0x111)+C(0x10b)+C(0x10d)+R+'):';Q!==undefined&&(0x0,utils_1[C(0x105)])(Q!==null&&Q!==void 0x0?Q:'');(0x0,utils_1[C(0x105)])(z);const h=V[C(0x132)](X=>X[C(0xc3)]+C(0xeb)+X[C(0xf4)][C(0x13e)]('\x20'));console[C(0x11f)]((0x0,lodash_1['uniq'])(h)['join'](EOL)),console['log']();}}}exports[a14v(0x12f)]=CliPortForward;
|