@northflank/cli 0.9.4 → 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 a7T=a7G;(function(l,G){const o=a7G,s=l();while(!![]){try{const I=parseInt(o(0x1df))/0x1+parseInt(o(0x1c8))/0x2+-parseInt(o(0x247))/0x3*(-parseInt(o(0x1f9))/0x4)+-parseInt(o(0x26e))/0x5+-parseInt(o(0x1d7))/0x6+-parseInt(o(0x258))/0x7*(-parseInt(o(0x1b6))/0x8)+-parseInt(o(0x1c5))/0x9*(parseInt(o(0x1a3))/0xa);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a7l,0xb51c4));var __createBinding=this&&this[a7T(0x238)]||(Object['create']?function(l,G,s,I){const d=a7T;if(I===undefined)I=s;var z=Object[d(0x1b4)](G,s);(!z||('get'in z?!G['__esModule']:z['writable']||z[d(0x216)]))&&(z={'enumerable':!![],'get':function(){return G[s];}}),Object[d(0x215)](l,I,z);}:function(l,G,s,I){if(I===undefined)I=s;l[I]=G[s];}),__setModuleDefault=this&&this[a7T(0x20e)]||(Object[a7T(0x19e)]?function(l,G){const W=a7T;Object[W(0x215)](l,W(0x212),{'enumerable':!![],'value':G});}:function(l,G){const B=a7T;l[B(0x212)]=G;}),__importStar=this&&this[a7T(0x219)]||function(l){const R=a7T;if(l&&l[R(0x1b3)])return l;var G={};if(l!=null){for(var s in l)if(s!==R(0x212)&&Object[R(0x26d)][R(0x277)][R(0x285)](l,s))__createBinding(G,l,s);}return __setModuleDefault(G,l),G;},__awaiter=this&&this[a7T(0x1d1)]||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const J=a7G;function A(p){const y=a7G;try{n(I[y(0x250)](p));}catch(m){N(m);}}function a(p){const K=a7G;try{n(I[K(0x23e)](p));}catch(m){N(m);}}function n(p){const i=a7G;p[i(0x18d)]?X(p[i(0x1d6)]):z(p[i(0x1d6)])['then'](A,a);}n((I=I[J(0x1d8)](l,G||[]))[J(0x250)]());});},__importDefault=this&&this[a7T(0x23f)]||function(l){const Q=a7T;return l&&l[Q(0x1b3)]?l:{'default':l};};Object[a7T(0x215)](exports,a7T(0x1b3),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a7T(0x1f3))),chalk_1=__importDefault(require(a7T(0x23b))),fs=__importStar(require('fs')),utils_1=require(a7T(0x1f4)),api_helpers_1=require(a7T(0x209)),inquirer_pagination_prompt_1=require(a7T(0x1ce)),inquirer=require(a7T(0x24f)),inquirerSearchList=require('inquirer-search-list'),yaml=require('js-yaml');function a7l(){const lR=['default','askForResource','ask','defineProperty','configurable','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','No\x20builds\x20found','__importStar','Unexpected\x20file\x20type:\x20','whiteBright','type','toUpperCase','saveFile','No,\x20but\x20save\x20as\x20file','Writing\x20configuration\x20failed:\x20','Something\x20unexpected\x20happened.','nextPageCursor','bgGrey','secret','domains','volume','backups','message','job\x20runs','What\x27s\x20the\x20','askForProjectScopedResource','addon:\x20\x27','Please\x20confirm\x20following\x20configuration:\x0a','must\x20be\x20a\x20number,\x20is\x20','split','\x20and\x20it\x20','builds','max','service','has','required','job','logSinks','__createBinding','project','askForJobRun','chalk','askArrayEntry','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','throw','__importDefault','.*\x5c.(json|yaml|yml)$','concat','\x20characters,\x20is\x20','Go\x20to\x20editor','array','confirmation','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','3309087bQMXxr','askForProjectScopedResourcePaginated','Aborted.','writeFileSync','charAt','No,\x20repeat','then','json','inquirer','next','\x20characters','warning','credentials','Choose\x20the\x20login\x20token:','to\x20use:','EDIT','isObject','3045875GrvlqU','get','DynamicReloadPaginationPrompt','domain\x20(','loginPrompt','success','length','addons','jobs','\x20type?','SAVE','pagination','What\x20do\x20you\x20want\x20to\x20use\x20as','project:\x20\x27','askForSubdomain','isEmpty','don\x27t\x20change','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','description','boolean','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','prototype','2344130JglYXz','askForDomain','askForBuild','Configuration\x20file\x20written\x20to\x20','retry','object','bold',',\x20supported\x20types:\x20[json|yaml|yml]','blue','hasOwnProperty','createdAt','unset','resultCache','items','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','greenBright','getPathString','cmdPath','filter','editPayload','editedResult','reset','yellowBright','call','for\x20this\x20','data','this\x20option\x20is\x20required,\x20please\x20answer','done','assign','template\x20run','pop','values','isValidJSON','yaml','toString','body','No\x20','nextCursor','subdomains','projects','\x20to\x20use:','askForLogSink','pathVars','\x20(startedAt:\x20','create','\x20in\x20','No,\x20edit','rawObject','askForJob','70PpgnLc','cursor','list','slice','getInnerType','addEntry','askForResourcePaginated','minimum','Choose\x20the\x20','find','askGeneric','templates','isBoolean','fetchResourceList','templateRuns','red','__esModule','getOwnPropertyDescriptor','YES','16CmZJrw','Yes,\x20send','maxLength','repeat','defaultPaginationPageSize','domain','tmpCmdPath','safeLoad','getCurrentProjectName','runs','confirmationPrompt','askForProject','tokenPrompt','job\x20builds','\x20(completedAt:\x20','2272383QgocMs','doesn\x27t\x20match\x20pattern\x20\x27','getType','1085966HOmlLD','isUndefined','main-context','string','Context\x20name\x20already\x20exists.','name','./pagination/inquirer-pagination-prompt','setPathVars','isNaN','__awaiter','example','password','askConfirm','addon','value','1529046KDPmhW','apply','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','pattern','trim','propToType','getQuestionString','integer','716642iRqHRS','test','deleteWarningPrompt','set','keys','join','job:\x20\x27','\x20(full\x20domain:\x20','minLength','askForVolume','token','search-list','override','grey','services','askForAddon','completedAt','isArray','prompt','askForTemplateRun','lodash','./utils','REPEAT','ABORT','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','4AsbfRj','No,\x20abort','green','Template\x20id\x20not\x20provided.','opt','Context\x20with\x20name\x20\x27','push','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','volumes','retrievePayloadViaInteractiveCli','validate','pagination-prompt','map','askForTemplate','editor','askForAddonBackup','./api-helpers','apiClient','properties','confirm','input','__setModuleDefault','oneOf','maximum','\x20Example:\x20'];a7l=function(){return lR;};return a7l();}var ConfirmChoices;(function(l){const r=a7T;l[r(0x1b5)]=r(0x1b7),l[r(0x1f5)]=r(0x24c),l[r(0x256)]=r(0x1a0),l[r(0x262)]=r(0x21f),l[r(0x1f6)]=r(0x1fa);}(ConfirmChoices||(ConfirmChoices={})));function a7G(l,G){const s=a7l();return a7G=function(I,z){I=I-0x18d;let X=s[I];return X;},a7G(l,G);}class InquirerHelper{constructor(l){const E=a7T;this['apiClient']=l,this[E(0x1ba)]=0x32,this['editPayload']=G=>__awaiter(this,void 0x0,void 0x0,function*(){const V=E,{editedResult:s}=yield inquirer[V(0x1f1)]([{'type':V(0x207),'name':V(0x282),'message':V(0x243),'default':yaml['safeDump'](G)}]);return yaml[V(0x1bd)](s);}),this[E(0x21e)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const M=E,s=N=>M(0x21a)+N+M(0x275);function I(){return __awaiter(this,void 0x0,void 0x0,function*(){const e=a7G;return inquirer['prompt']([{'type':e(0x20d),'name':'fileName','message':e(0x1f8),'validate':N=>new RegExp(e(0x240))[e(0x1e0)](N)?!![]:s(N)}]);});}const {fileName:z}=yield I(),X=z[M(0x194)]()[M(0x22f)]('.')[M(0x190)]();try{switch(X){case M(0x24e):(0x0,utils_1['success'])(M(0x271)+z);return fs[M(0x24a)](z,JSON['stringify'](G,null,'\x20\x20'));case M(0x193):case'yml':(0x0,utils_1[M(0x25d)])(M(0x271)+z);return fs[M(0x24a)](z,yaml['safeDump'](G));default:(0x0,utils_1['warning'])(s(X));}}catch(N){(0x0,utils_1[M(0x252)])(M(0x220)+N[M(0x228)]);}return undefined;}),this[E(0x280)]=(G,s)=>I=>{const w=E,z=typeof I==='string'?I[w(0x1db)]():I;return s===![]&&z===w(0x268)?'':z;},this['validate']=(G,s,I)=>z=>{const q=E,X=[];if(z===''||z===q(0x268)){if(s!==![])X[q(0x1ff)](q(0x288));else return!![];}G[q(0x21c)]===q(0x1cb)&&!_[q(0x1c9)](G[q(0x1da)])&&X[q(0x1ff)](new RegExp(G[q(0x1da)])['test'](z)?!![]:q(0x1c6)+G[q(0x1da)]+'\x27');G[q(0x21c)]===q(0x1cb)&&!_[q(0x1c9)](G[q(0x1e7)])&&X[q(0x1ff)](z[q(0x25e)]>=G[q(0x1e7)]?!![]:'must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20'+G['minLength']+q(0x242)+z['length']+q(0x251));G[q(0x21c)]==='string'&&!_[q(0x1c9)](G[q(0x1b8)])&&X[q(0x1ff)](z[q(0x25e)]<=G['maxLength']?!![]:q(0x269)+G['maxLength']+q(0x242)+z[q(0x25e)]+'\x20characters');I&&Number[q(0x1d0)](parseInt(z,0xa))&&X[q(0x1ff)](q(0x22e)+z);G[q(0x21c)]===q(0x1de)&&!_[q(0x1c9)](G[q(0x1aa)])&&X[q(0x1ff)](z>=G['minimum']?!![]:q(0x217)+G[q(0x1aa)]);G[q(0x21c)]===q(0x1de)&&!_[q(0x1c9)](G[q(0x210)])&&X['push'](z<=G[q(0x210)]?!![]:q(0x23d)+G['maximum']);if(G[q(0x21c)]===q(0x1a1)){const a=(0x0,utils_1[q(0x192)])(z);X[q(0x1ff)](a===![]||_[q(0x267)](a)?q(0x26c):!![]);}const N=X['filter'](n=>n!==!![]),A=(G===null||G===void 0x0?void 0x0:G[q(0x1d2)])?'\x0a'+chalk_1[q(0x212)][q(0x1b2)]('>>')+q(0x211)+chalk_1['default'][q(0x21b)](JSON['stringify'](G['example'])):'';return N['length']>0x0?N['join'](chalk_1[q(0x212)]['underline'](q(0x230)))+A:!![];},this[E(0x27e)]=(G,s,I)=>{const O=E,z=G[G[O(0x25e)]-0x1];function X(){const U=O;return G['slice'](0x0,-0x1)[U(0x205)](a=>a[U(0x24b)](0x0)[U(0x21d)]()+a[U(0x1a6)](0x1))[U(0x1e4)]('>');}const N=G['length']>0x1?chalk_1[O(0x212)][O(0x223)][O(0x21b)](X())+':\x20':'',A=I?'\x20('+chalk_1[O(0x212)][O(0x276)](I)+')':'';return chalk_1[O(0x212)][O(0x283)](''+N+s+'\x20'+chalk_1[O(0x212)][O(0x274)][O(0x27d)](z)+A+'?');},this[E(0x213)]=(G,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=E;if(s['length']<0x1){const N=I?Z(0x286)+I:'found';throw new Error('No\x20'+G+'\x20'+N+'.');}const z=Z(0x1ab)+G+Z(0x19a),X=s[Z(0x25e)]>0x4?Z(0x1ea):Z(0x1a5);return(yield inquirer['prompt']([{'type':X,'name':Z(0x1cd),'message':z,'choices':s}]))['name'];}),this[E(0x1a9)]=(G,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const v=E,{elements:z,nextCursor:X}=yield s();if(z[v(0x25e)]<0x1){const a=I?v(0x286)+I:'found';throw new Error(v(0x196)+G+'\x20'+a+'.');}const N=v(0x1ab)+G+v(0x19a);if(X!==undefined){const n=({nextPageCursor:p})=>__awaiter(this,void 0x0,void 0x0,function*(){const S=v,m=yield s(p);return{'elements':m['elements'],'nextPageCursor':m[S(0x197)]};});return(yield inquirer[v(0x1f1)]([{'type':v(0x204),'name':v(0x1cd),'message':N,'choices':z,'nextPageCursor':X,'loadMore':n}]))['name'];}const A=z['length']>0x4?v(0x1ea):v(0x1a5);return(yield inquirer[v(0x1f1)]([{'type':A,'name':v(0x1cd),'message':N,'choices':z}]))[v(0x1cd)];}),this[E(0x1ad)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const g=E,I=''+(s?'('+chalk_1[g(0x212)]['blue'](s)+')\x20':''),z='Enter\x20the\x20'+chalk_1['default'][g(0x1fb)](G)+'\x20'+I+g(0x255),X=this[g(0x203)]({'type':'string','required':!![]});return(yield inquirer[g(0x1f1)]([{'type':g(0x20d),'name':g(0x1cd),'message':z,'validate':X}]))['name'];}),this[E(0x1d4)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const j=E;return(yield inquirer['prompt']([{'type':j(0x20c),'name':j(0x1cd),'message':G,'default':!![]}]))[j(0x1cd)];}),this['askForService']=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const f=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const C=a7G;var X;const N=yield this['apiClient'][C(0x1a5)][C(0x1ed)]({'parameters':{'projectId':I},'options':{'per_page':this[C(0x1ba)],'cursor':z}}),A=N[C(0x287)]['services'][C(0x205)](a=>a['id']);return{'elements':A,'nextCursor':(X=N[C(0x263)])===null||X===void 0x0?void 0x0:X[C(0x1a4)]};});return this[f(0x248)](f(0x233),s,G);}),this[E(0x206)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=s=>__awaiter(this,void 0x0,void 0x0,function*(){const h=a7G;var I;const z=yield this[h(0x20a)][h(0x1a5)][h(0x1ae)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':s}}),X=z[h(0x287)]['templates'][h(0x205)](N=>N['id']);return{'elements':X,'nextCursor':(I=z[h(0x263)])===null||I===void 0x0?void 0x0:I[h(0x1a4)]};});return this['askForResourcePaginated']('template',G);}),this[E(0x1f2)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=E;if(_[F(0x1c9)](G))throw new Error(F(0x1fc));const s=I=>__awaiter(this,void 0x0,void 0x0,function*(){const P=F;var z;let X=this[P(0x1ba)];const N=yield this['apiClient'][P(0x1a5)][P(0x1b1)]({'parameters':{'templateId':G},'options':{'per_page':X,'cursor':I}}),A=N[P(0x287)][P(0x1b1)]['map'](a=>a['id']+'\x20(startedAt:\x20'+a['createdAt']+')');return{'elements':A,'nextCursor':(z=N['pagination'])===null||z===void 0x0?void 0x0:z[P(0x1a4)]};});return this[F(0x1a9)](F(0x18f),s)[F(0x24d)](I=>I[F(0x22f)]('\x20')[0x0]);}),this[E(0x19b)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=s=>__awaiter(this,void 0x0,void 0x0,function*(){const L=a7G;var I;let z=this['defaultPaginationPageSize'];const X=yield this['apiClient']['list'][L(0x237)]({'options':{'per_page':z,'cursor':s}}),N=X[L(0x287)]['logSinks'][L(0x205)](A=>A['id']);return{'elements':N,'nextCursor':(I=X[L(0x263)])===null||I===void 0x0?void 0x0:I[L(0x1a4)]};});return this['askForResourcePaginated']('log\x20sink',G);}),this[E(0x1a2)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const k=a7G;var X;const N=yield this['apiClient'][k(0x1a5)][k(0x260)]({'parameters':{'projectId':I},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':z}}),A=N[k(0x287)][k(0x260)][k(0x205)](a=>a['id']);return{'elements':A,'nextCursor':(X=N[k(0x263)])===null||X===void 0x0?void 0x0:X[k(0x1a4)]};});return this['askForProjectScopedResourcePaginated'](Y(0x236),s,G);}),this[E(0x23a)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=E,I=z=>X=>__awaiter(this,void 0x0,void 0x0,function*(){const x=a7G;var N;const A=yield this['apiClient'][x(0x259)][x(0x236)][x(0x1bf)]({'parameters':{'projectId':z,'jobId':G},'options':{'per_page':this[x(0x1ba)],'cursor':X}}),a=A[x(0x287)][x(0x1bf)][x(0x205)](n=>n['id']+x(0x19d)+n['startedAt']+')');return{'elements':a,'nextCursor':(N=A[x(0x263)])===null||N===void 0x0?void 0x0:N[x(0x1a4)]};});return this[u(0x248)](u(0x229),I,s,u(0x1e5)+G+'\x27')['then'](z=>z[u(0x22f)]('\x20')[0x0]);}),this[E(0x270)]=(G,s,I)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const t=E;if(I!==undefined){const z=X=>N=>__awaiter(this,void 0x0,void 0x0,function*(){const b=a7G;var A;const a=yield this[b(0x20a)]['get'][b(0x236)][b(0x231)]({'parameters':{'projectId':X,'jobId':I},'options':{'per_page':this[b(0x1ba)],'cursor':N}});return{'elements':a[b(0x287)][b(0x231)][b(0x205)](n=>n['id']+b(0x19d)+n[b(0x278)]+')'),'nextCursor':(A=a[b(0x263)])===null||A===void 0x0?void 0x0:A['cursor']};});return this[t(0x248)](t(0x1c3),z,G,t(0x1e5)+I+'\x27')['then'](X=>X['split']('\x20')[0x0]);}if(s!==undefined){const X=N=>A=>__awaiter(this,void 0x0,void 0x0,function*(){const H=t;var a;const n=yield this['apiClient'][H(0x259)]['service']['builds']({'parameters':{'projectId':N,'serviceId':s},'options':{'per_page':this[H(0x1ba)],'cursor':A}});return{'elements':n[H(0x287)][H(0x231)][H(0x205)](p=>p['id']+H(0x19d)+p[H(0x278)]+')'),'nextCursor':(a=n[H(0x263)])===null||a===void 0x0?void 0x0:a[H(0x1a4)]};});return this[t(0x248)]('job\x20build',X,G,'service:\x20\x27'+I+'\x27')[t(0x24d)](N=>N['split']('\x20')[0x0]);}throw new Error(t(0x218));}),this[E(0x1ee)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l1=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const l0=a7G;var X;const N=yield this['apiClient'][l0(0x1a5)][l0(0x25f)]({'parameters':{'projectId':I},'options':{'per_page':this[l0(0x1ba)],'cursor':z}});return{'elements':N[l0(0x287)][l0(0x25f)]['map'](A=>A['id']),'nextCursor':(X=N[l0(0x263)])===null||X===void 0x0?void 0x0:X['cursor']};});return this[l1(0x248)](l1(0x1d5),s,G);}),this[E(0x208)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l3=E,I=z=>X=>__awaiter(this,void 0x0,void 0x0,function*(){const l2=a7G;var N;const A=yield this[l2(0x20a)][l2(0x259)][l2(0x1d5)]['backups']({'parameters':{'projectId':z,'addonId':s},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':X}});return{'elements':A['data'][l2(0x227)][l2(0x205)](a=>a['id']+l2(0x1c4)+(a[l2(0x1ef)]||'not\x20completed')+')'),'nextCursor':(N=A[l2(0x263)])===null||N===void 0x0?void 0x0:N['cursor']};});return this[l3(0x248)]('backups',I,G,l3(0x22c)+s+'\x27')['then'](z=>z['split']('\x20')[0x0]);}),this[E(0x1e8)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l5=E,s=I=>__awaiter(this,void 0x0,void 0x0,function*(){const l4=a7G;return(yield this['apiClient'][l4(0x1a5)][l4(0x201)]({'parameters':{'projectId':I}}))[l4(0x287)][l4(0x205)](z=>z['id']);});return this[l5(0x22b)](l5(0x226),s,G);}),this['askForSecret']=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l7=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const l6=a7G;var X;const N=yield this[l6(0x20a)][l6(0x1a5)]['secrets']({'parameters':{'projectId':I},'options':{'per_page':this[l6(0x1ba)],'cursor':z}});return{'elements':N[l6(0x287)]['secrets'][l6(0x205)](A=>A['id']),'nextCursor':(X=N[l6(0x263)])===null||X===void 0x0?void 0x0:X[l6(0x1a4)]};});return this[l7(0x248)](l7(0x224),s,G);}),this[E(0x266)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l8=E,s=yield this[l8(0x20a)][l8(0x259)][l8(0x1bb)]({'parameters':{'domain':G}}),I=s[l8(0x287)][l8(0x198)][l8(0x205)](X=>X['name']+l8(0x1e6)+X['fullName']+')'),z=l8(0x25b)+G+')';return this['askForResource']('subdomain',I,z)['then'](X=>X[l8(0x22f)]('\x20')[0x0]);}),this[E(0x1e1)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const l9=E;return(yield inquirer['prompt']([{'type':'confirm','name':l9(0x245),'message':chalk_1[l9(0x212)][l9(0x284)](l9(0x27c)+(G||'a\x20Northflank\x20resource')+l9(0x1d9)),'default':![]}]))[l9(0x245)];}),this[E(0x25c)]=(G,s)=>__awaiter(this,void 0x0,void 0x0,function*(){const ll=E;_[ll(0x1c9)](G[ll(0x1cd)])&&(s[ll(0x25e)]<=0x0?_[ll(0x1e2)](G,ll(0x1cd),ll(0x212)):yield(0x0,utils_1[ll(0x272)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const lG=ll,{name:I}=yield inquirer[lG(0x1f1)]([{'type':lG(0x20d),'name':lG(0x1cd),'message':lG(0x246),'default':lG(0x1ca)}]);if(!G[lG(0x1eb)]&&s[lG(0x1ac)](z=>z[lG(0x1cd)]===I)){const {c:z}=yield inquirer[lG(0x1f1)]([{'type':lG(0x20c),'name':'c','message':lG(0x1fe)+I+lG(0x200),'default':![]}]);if(z===![])throw new Error(lG(0x1cc));_[lG(0x1e2)](G,lG(0x1eb),!![]);}_['set'](G,lG(0x1cd),I);})));if(_[ll(0x1c9)](G[ll(0x1e9)])){const I=yield this[ll(0x1c2)]();_['set'](G,'token',I);}return G;}),this[E(0x1c2)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const ls=E,{token:G}=yield inquirer[ls(0x1f1)]([{'type':ls(0x1d3),'name':ls(0x1e9),'mask':'*','message':ls(0x254)}]);return G;}),inquirer['registerPrompt'](E(0x1ea),inquirerSearchList),inquirer['registerPrompt'](E(0x204),inquirer_pagination_prompt_1[E(0x25a)]);}[a7T(0x1c0)](l,G){return __awaiter(this,void 0x0,void 0x0,function*(){const lI=a7G,s=yaml['safeDump'](l),I=_[lI(0x232)](s[lI(0x22f)]('\x0a')['map'](N=>N[lI(0x25e)])),z=chalk_1['default'][lI(0x1ec)]('-'[lI(0x1b9)](I)+'\x0a'),{confirm:X}=yield inquirer[lI(0x1f1)]([{'type':lI(0x1a5),'name':'confirm','message':''+chalk_1['default'][lI(0x274)][lI(0x1fb)](lI(0x22d))+z+chalk_1[lI(0x212)]['blueBright'](s)+z,'choices':Object[lI(0x191)](ConfirmChoices)}]);switch(X){case ConfirmChoices['YES']:return l;case ConfirmChoices['ABORT']:throw new Error(lI(0x249));case ConfirmChoices[lI(0x1f5)]:return this['retrievePayloadViaInteractiveCli'](G);case ConfirmChoices[lI(0x256)]:return this[lI(0x1c0)](yield this[lI(0x281)](l),G);case ConfirmChoices[lI(0x262)]:yield this['saveFile'](l);return this[lI(0x1c0)](l,G);default:throw new Error(lI(0x221));}});}[a7T(0x202)](l,G){return __awaiter(this,void 0x0,void 0x0,function*(){const lz=a7G;if((G===null||G===void 0x0?void 0x0:G[lz(0x27a)])!==undefined)this[lz(0x27a)]=G===null||G===void 0x0?void 0x0:G[lz(0x27a)];this['tmpCmdPath']=G===null||G===void 0x0?void 0x0:G[lz(0x27f)];const s={};return yield this['propToType']([],l[lz(0x1fd)][lz(0x195)],s),this[lz(0x27a)]=s,yield this['confirmationPrompt'](s,l);});}[a7T(0x1dc)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lX=a7G;let z;if(G[lX(0x20f)]&&!_[lX(0x234)](G,'properties')){if(G[lX(0x20f)][lX(0x25e)]>0x1){const {choice:X}=yield inquirer[lX(0x1f1)]([{'type':lX(0x1a5),'name':'choice','message':lX(0x22a)+(l[l[lX(0x25e)]-0x1]||'')+lX(0x261),'choices':G[lX(0x20f)][lX(0x205)](N=>{var A;return(A=N['description'])!==null&&A!==void 0x0?A:'??';})}]);z=yield this[lX(0x1c7)](l,G['oneOf'][lX(0x1ac)](N=>N[lX(0x26a)]===X),s,I);}else{const N=G['oneOf'][0x0];_[lX(0x1e2)](N,'description',G[lX(0x26a)]),z=yield this[lX(0x1c7)](l,N,s,I);}z={};}else z=yield this[lX(0x1c7)](l,G,s,I);return z;});}[a7T(0x1a7)](l,G,s,I){var z;return __awaiter(this,void 0x0,void 0x0,function*(){const lN=a7G;if(I===![]){const {addEntry:A}=yield inquirer['prompt']([{'type':lN(0x20c),'name':lN(0x1a8),'message':this[lN(0x27e)](G,'Do\x20you\x20want\x20to\x20add',l===null||l===void 0x0?void 0x0:l[lN(0x26a)]),'default':![]}]);if(!A)return s;}const X=Object[lN(0x1e3)]((z=l===null||l===void 0x0?void 0x0:l[lN(0x20b)])!==null&&z!==void 0x0?z:[]),N=l[lN(0x235)]||[];if(X[lN(0x25e)]>0x0)for(const a of X){const n=G[lN(0x241)](a);if(G[lN(0x25e)]>0x0&&!_['has'](s,G['join']('.')))_[lN(0x1e2)](s,G[lN(0x1e4)]('.'),{});yield this['propToType'](n,l[lN(0x20b)][a],s,N['includes'](a));}else yield this['getType'](G,Object['assign'](Object[lN(0x18e)]({},l),{'type':lN(0x1a1)}),s,I);return s;});}[a7T(0x23c)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lA=a7G;if(G&&s)return!![];const z=G?'Do\x20you\x20want\x20to\x20add':'Do\x20you\x20want\x20to\x20add\x20more',{addEntry:X}=yield inquirer[lA(0x1f1)]([{'type':'confirm','name':lA(0x1a8),'message':this['getPathString'](l,z,G?I:undefined),'default':![]}]);return X;});}['getType'](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const la=a7G;let z;const X=l['join']('.');switch(G===null||G===void 0x0?void 0x0:G['type']){case la(0x244):{let N=!![];while(yield this[la(0x23c)](l,N,I,G===null||G===void 0x0?void 0x0:G['description'])){const A=_[la(0x259)](s,X);_[la(0x279)](s,X),yield this['getType'](l,G[la(0x27b)],s);const a=_[la(0x259)](s,X);!_[la(0x1f0)](A)?_[la(0x1e2)](s,X,[a]):(A[la(0x1ff)](a),_['set'](s,X,A)),N=![];}return z||[];}case la(0x273):{return z=yield this['getInnerType'](G,l,s,I),z;}case'rawObject':z=(0x0,utils_1[la(0x192)])(yield this[la(0x214)](l,G,I))||undefined;break;case la(0x1cb):case'boolean':case la(0x1de):default:z=yield this[la(0x214)](l,G,I,s);break;}return!_[la(0x1c9)](z)&&_['set'](s,X,z),z;});}['ask'](l,G,s,I){var z;return __awaiter(this,void 0x0,void 0x0,function*(){const ln=a7G,X=l[l[ln(0x25e)]-0x1],{defaultValue:defaultValue=(z=G===null||G===void 0x0?void 0x0:G[ln(0x1d2)])!==null&&z!==void 0x0?z:G===null||G===void 0x0?void 0x0:G['default'],choices:choices=G===null||G===void 0x0?void 0x0:G['enum'],pagination:N}=yield(0x0,api_helpers_1[ln(0x1b0)])(X,this[ln(0x20a)],this[ln(0x1bc)],I,this[ln(0x19c)],l);let A=ln(0x20d);if(!_[ln(0x1c9)](choices)&&choices['length']>0x0){if(N!==undefined&&N[ln(0x222)]!==undefined)A=ln(0x204);else choices['length']>0x4&&typeof choices[0x0]===ln(0x1cb)?A=ln(0x1ea):A=ln(0x1a5);}else{if((G===null||G===void 0x0?void 0x0:G[ln(0x21c)])===ln(0x26b))A=ln(0x20c);else{if((G===null||G===void 0x0?void 0x0:G[ln(0x21c)])===ln(0x1de))A=ln(0x20d);else(G===null||G===void 0x0?void 0x0:G['type'])==='rawObject'&&(A=ln(0x207));}}let a=s!==![]?!_[ln(0x257)](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[ln(0x1af)](defaultValue)?defaultValue:ln(0x268);if(choices)a=a['toString']();_[ln(0x234)](this[ln(0x27a)],l[ln(0x1e4)]('.'))&&(a=this[ln(0x27a)][l[ln(0x1e4)]('.')]);const n=choices&&s===![]?['don\x27t\x20change',...choices]:choices,p=(G===null||G===void 0x0?void 0x0:G[ln(0x21c)])==='integer',m=Object[ln(0x18e)]({'type':A,'name':'id','message':this[ln(0x1dd)](l,G),'choices':n,'default':a,'filter':this[ln(0x280)](A,s),'validate':this[ln(0x203)](G,s,p)},N),D=(yield inquirer[ln(0x1f1)]([m]))['id'];if(D===ln(0x268)||D==='')return undefined;if(p)return parseInt(D,0xa);return D;});}[a7T(0x1dd)](l,G){const lp=a7T,s=(G===null||G===void 0x0?void 0x0:G[lp(0x21c)])!=='boolean'?lp(0x264):'Should\x20it\x20be';return this[lp(0x27e)](l,s,G===null||G===void 0x0?void 0x0:G[lp(0x26a)]);}[a7T(0x1c1)](){return __awaiter(this,void 0x0,void 0x0,function*(){const lD=a7G,l=G=>__awaiter(this,void 0x0,void 0x0,function*(){const lm=a7G;var s;const I=yield this['apiClient'][lm(0x1a5)][lm(0x199)]({'options':{'per_page':this[lm(0x1ba)],'cursor':G}}),z=I[lm(0x287)][lm(0x199)]['map'](X=>X['id']);return{'elements':z,'nextCursor':(s=I[lm(0x263)])===null||s===void 0x0?void 0x0:s[lm(0x1a4)]};});return yield this[lD(0x1a9)](lD(0x239),l);});}[a7T(0x22b)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lo=a7G,z=s||this[lo(0x20a)]['contextProvider'][lo(0x1be)]();if(_['isUndefined'](z))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const X=yield G(z);return yield this[lo(0x213)](l,X,(I?I+lo(0x19f):'')+lo(0x265)+z+'\x27');});}['askForProjectScopedResourcePaginated'](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lT=a7G,z=s||this['apiClient']['contextProvider']['getCurrentProjectName']();if(_[lT(0x1c9)](z))throw new Error(lT(0x1f7));const X=yield G(z);return yield this['askForResourcePaginated'](l,X,(I?I+lT(0x19f):'')+lT(0x265)+z+'\x27');});}[a7T(0x26f)](){return __awaiter(this,void 0x0,void 0x0,function*(){const ld=a7G,l=yield this[ld(0x20a)]['list'][ld(0x225)]({}),G=l['data']['domains'][ld(0x205)](s=>s[ld(0x1cd)]);return this['askForResource'](ld(0x1bb),G);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const lW=a7G,l=yield this[lW(0x20a)][lW(0x1a5)]['registries']({}),G=l[lW(0x287)][lW(0x253)][lW(0x205)](s=>s['id']);return this[lW(0x213)](lW(0x253),G);});}[a7T(0x1cf)](l){const lB=a7T;this[lB(0x19c)]=l;}}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';const a10W=a10G;(function(l,G){const d=a10G,s=l();while(!![]){try{const I=parseInt(d(0xe2))/0x1+parseInt(d(0x10f))/0x2+parseInt(d(0x119))/0x3*(parseInt(d(0xf6))/0x4)+-parseInt(d(0xcf))/0x5*(parseInt(d(0xbb))/0x6)+parseInt(d(0x11f))/0x7*(parseInt(d(0xdb))/0x8)+parseInt(d(0xd3))/0x9*(parseInt(d(0x108))/0xa)+parseInt(d(0x122))/0xb*(-parseInt(d(0x111))/0xc);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a10l,0xaa0ab));var __createBinding=this&&this[a10W(0xd2)]||(Object[a10W(0x11c)]?function(l,G,s,I){const B=a10W;if(I===undefined)I=s;var z=Object[B(0xb8)](G,s);(!z||('get'in z?!G[B(0xf4)]:z[B(0xd4)]||z[B(0xc9)]))&&(z={'enumerable':!![],'get':function(){return G[s];}}),Object[B(0xc5)](l,I,z);}:function(l,G,s,I){if(I===undefined)I=s;l[I]=G[s];}),__setModuleDefault=this&&this[a10W(0xf7)]||(Object[a10W(0x11c)]?function(l,G){Object['defineProperty'](l,'default',{'enumerable':!![],'value':G});}:function(l,G){const R=a10W;l[R(0xfb)]=G;}),__importStar=this&&this[a10W(0x113)]||function(l){const y=a10W;if(l&&l[y(0xf4)])return l;var G={};if(l!=null){for(var s in l)if(s!==y(0xfb)&&Object[y(0xfd)][y(0x12b)][y(0xc2)](l,s))__createBinding(G,l,s);}return __setModuleDefault(G,l),G;},__awaiter=this&&this['__awaiter']||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const Q=a10G;function A(p){const K=a10G;try{n(I[K(0xec)](p));}catch(m){N(m);}}function a(p){const i=a10G;try{n(I[i(0x128)](p));}catch(m){N(m);}}function n(p){const J=a10G;p['done']?X(p[J(0x10a)]):z(p['value'])[J(0x12d)](A,a);}n((I=I[Q(0x109)](l,G||[]))[Q(0xec)]());});},__importDefault=this&&this['__importDefault']||function(l){const r=a10W;return l&&l[r(0xf4)]?l:{'default':l};};function a10G(l,G){const s=a10l();return a10G=function(I,z){I=I-0xb5;let X=s[I];return X;},a10G(l,G);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a10W(0xcd)]=void 0x0;function a10l(){const g=['Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','__importStar','description','forwardAddon','message','project\x20for\x20forwarding','\x20with\x20these\x20hostnames:','6471ecPxOg','protocol','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','create','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','port','8713873fqyvlB','http://','all','286gAnffs','assertContextExisting','hostnames','addCommand','fwd','Port-forwarding\x20for\x20the\x20specified\x20addon','throw','getCurrentServiceName','canExecuteWithHostnames','hasOwnProperty','--skipHostnames','then','\x20\x20Running\x20on\x20macOS\x20in\x20','green','chalk','../inquirer-helper','getOwnPropertyDescriptor','forwardProject','noDefaultsText','5882454gWzVNf','Service\x20to\x20forward','platform','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20your\x20','getCommand','warning','apiClient','call','customUserAgent','@northflank/js-client','defineProperty','getCurrentProjectName','stop','name','configurable','\x20for\x20these\x20hostnames:','ApiClient','Forwarding\x20service\x20','CliPortForward','type','5PrcNTV','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','Port-forwarding\x20for\x20the\x20specified\x20service','__createBinding','414qLICoK','writable','forward','bold','Project\x20for\x20forwarding','win32','--noDefaults','\x20in\x20project\x20','8YjpsYY','askForProject','alias','darwin','addon','askForAddon','address','1293721lTgveT','--service\x20--serviceId\x20[NAME]','tunnel-close','\x20to\x20','\x20on\x20','getProxyForwarder','SIGINT','option','C:/Windows/System32/drivers/etc/hosts','--project\x20--projectId\x20[NAME]','next','length','join','\x20addon\x20ports','skipHostnamesText','Failed:\x20','log','InquirerHelper','__esModule','action','1700EdCftq','__setModuleDefault','Stop\x20forwarding\x20traffic\x20from\x20','error','\x20and\x20','default','tunnel-open','prototype','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','service','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','\x20service\x20ports','Forwarding\x20','forEach','HTTP','--addon\x20--addonId\x20[NAME]','Forwarding\x20addon\x20','251450yQkUac','apply','value','success','askForService','portFwdCmd','/etc/hosts','1679926PNgmWu','\x20\x20\x20\x20\x20\x20\x20\x20\x20','1742316BpyMQP'];a10l=function(){return g;};return a10l();}const js_client_1=require(a10W(0xc4)),chalk_1=__importDefault(require(a10W(0xb6))),utils_1=require('../utils'),inquirer_helper_1=require(a10W(0xb7)),os=__importStar(require('os'));class CliPortForward{constructor(l){const E=a10W;this['noDefaultsText']=E(0x11d),this[E(0xf0)]=E(0xd0),this[E(0xc1)]=new js_client_1[(E(0xcb))](l,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[E(0xc3)]});const G=new inquirer_helper_1[(E(0xf3))](this[E(0xc1)]);this[E(0x10d)]=(0x0,utils_1[E(0xbf)])()[E(0xc8)](E(0xd5))[E(0xdd)](E(0x126))[E(0x114)](E(0x112));const s=(0x0,utils_1[E(0xbf)])(!![])['name']('all')[E(0x114)]('Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project')[E(0xe9)](E(0xeb),E(0x117))[E(0xe9)](E(0xd9),this[E(0xba)],![])[E(0xe9)](E(0x12c),this[E(0xf0)],![])['action'](({noDefaults:X,projectId:N,skipHostnames:A})=>__awaiter(this,void 0x0,void 0x0,function*(){const V=E;(0x0,utils_1[V(0x123)])(this[V(0xc1)]);const a=this[V(0xe7)](A),n=X?undefined:l[V(0xc6)](),p=N||n||(yield G[V(0xdc)]());try{const {services:m,addons:D}=yield a[V(0xb9)]({'projectId':p},A);m['length']+D[V(0xed)]<=0x0?(0x0,utils_1[V(0xc0)])(V(0x11b)+chalk_1['default'][V(0xd6)](p)):(console[V(0xf2)](V(0x103)+chalk_1[V(0xfb)]['green'][V(0xd6)](m['length']+V(0x102))+V(0xfa)+chalk_1['default'][V(0xb5)][V(0xd6)](D[V(0xed)]+V(0xef))+'\x20in\x20project\x20'+chalk_1[V(0xfb)][V(0xd6)](p)),yield Promise[V(0x121)]([...m,...D]));}catch(o){(0x0,utils_1[V(0xf9)])(V(0xf1)+o[V(0x116)]);}})),I=(0x0,utils_1[E(0xbf)])(!![])[E(0xc8)](E(0x100))[E(0x114)](E(0xd1))[E(0xe9)](E(0xeb),E(0xd7))[E(0xe9)](E(0xe3),E(0xbc))[E(0xe9)]('--noDefaults',this[E(0xba)],![])['option'](E(0x12c),this[E(0xf0)],![])[E(0xf5)](({noDefaults:X,projectId:N,serviceId:A,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const M=E;(0x0,utils_1[M(0x123)])(this['apiClient']);const n=this[M(0xe7)](a),p=X?undefined:l[M(0xc6)](),m=N||p||(yield G[M(0xdc)]()),D=X?undefined:l[M(0x129)](),o=A||D||(yield G[M(0x10c)](m)());console[M(0xf2)](M(0xcc)+chalk_1['default'][M(0xd6)](o)+M(0xda)+chalk_1['default'][M(0xd6)](m));try{yield n['forwardService']({'projectId':m,'serviceId':o},a);}catch(T){(0x0,utils_1[M(0xf9)])('Failed:\x20'+T[M(0x116)]);}})),z=(0x0,utils_1['getCommand'])(!![])['name'](E(0xdf))['description'](E(0x127))[E(0xe9)](E(0xeb),E(0xd7))['option'](E(0x106),'Addon\x20to\x20forward')[E(0xe9)]('--skipHostnames',this[E(0xf0)],![])[E(0xf5)](({noDefaults:X,projectId:N,addonId:A,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const e=E;(0x0,utils_1[e(0x123)])(this[e(0xc1)]);const n=this[e(0xe7)](a),p=X?undefined:l[e(0xc6)](),m=N||p||(yield G[e(0xdc)]()),D=A||(yield G[e(0xe0)](m)());console[e(0xf2)](e(0x107)+chalk_1['default'][e(0xd6)](D)+e(0xda)+chalk_1[e(0xfb)][e(0xd6)](m));try{yield n[e(0x115)]({'projectId':m,'addonId':D},a);}catch(o){(0x0,utils_1[e(0xf9)])(e(0xf1)+o[e(0x116)]);}}));this['portFwdCmd'][E(0x125)](s),this[E(0x10d)][E(0x125)](I),this[E(0x10d)]['addCommand'](z);}['getProxyForwarder'](l=![]){const w=a10W,G=this['apiClient']['forwarding'];if(!l){const s=G[w(0x12a)]();if(s[w(0xf9)])throw new Error(s[w(0x116)]);}return G['on'](w(0xfc),(I,z)=>{const q=w,X=chalk_1[q(0xfb)]['greenBright'][q(0xd6)](z[q(0xce)]+'\x20\x27'+z['id']+'\x27'),N=z[q(0x124)]['length']>0x0,A=''+(!l?q(0x118):'.'),a=z['protocol']===q(0x105)?q(0x120):'';(0x0,utils_1['success'])('Exposing\x20'+X+q(0xe6)+z[q(0xe1)]+':'+z[q(0x11e)]+'\x20('+z[q(0x11a)]+')'+A);if(!l)z[q(0x124)][q(0x104)](n=>{const O=q;(0x0,utils_1[O(0x10b)])('\x20\x20'+a+n+':'+z[O(0x11e)]);});else{if(N){const n=process[q(0xbd)]===q(0xd8),p=os[q(0xbd)]()===q(0xde),m=n?q(0xea):q(0x10e),D=chalk_1[q(0xfb)]['bold']('skipHostnames'),o=p?q(0x12e)+D+q(0xbe)+z['type']+'.':undefined;let T='\x20\x20Running\x20in\x20'+D+q(0xff)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+m+'):';if(o!==undefined)(0x0,utils_1[q(0xc0)])(o);(0x0,utils_1['warning'])(T),console[q(0xf2)](z['address']+q(0x110)+z[q(0x124)][q(0xee)]('\x20'));}}(0x0,utils_1[q(0x10b)])('');}),G['on'](w(0xe4),(I,z)=>{const U=w,X=chalk_1['default']['greenBright'][U(0xd6)](z[U(0xce)]+'\x20\x27'+z['id']+'\x27'),N=z[U(0x124)][U(0xed)]>0x0,A=''+(!l?U(0xca):'.');(0x0,utils_1[U(0xc0)])(U(0xf8)+z['address']+':'+z[U(0x11e)]+U(0xe5)+X+A);if(!l)z['hostnames'][U(0x104)](a=>{const Z=U;(0x0,utils_1[Z(0xc0)])('\x20\x20'+a+':'+z['port']);});else N&&(0x0,utils_1['warning'])(U(0xfe));(0x0,utils_1['warning'])('');}),G['on']('connection-error',(I,z,X)=>{const v=w;(0x0,utils_1[v(0xc0)])(v(0x101)+z[v(0xe1)]+':'+z['port']+'\x27:\x20\x22'+(X===null||X===void 0x0?void 0x0:X[v(0x116)])+'\x22');}),process['on'](w(0xe8),()=>__awaiter(this,void 0x0,void 0x0,function*(){const S=w;try{yield G[S(0xc7)]();}catch(I){(0x0,utils_1[S(0xf9)])('Cleaning\x20up\x20open\x20connections\x20failed:\x20'+I['message']);}finally{process['exit']();}})),G;}}exports['CliPortForward']=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;
|