@northflank/cli 0.9.1 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use strict';const a6B=a6f;(function(y,f){const q=a6f,a=y();while(!![]){try{const b=parseInt(q(0x11c))/0x1*(-parseInt(q(0x12e))/0x2)+-parseInt(q(0x13e))/0x3+parseInt(q(0x122))/0x4*(parseInt(q(0x13c))/0x5)+-parseInt(q(0x114))/0x6+parseInt(q(0xf6))/0x7+-parseInt(q(0xf2))/0x8+parseInt(q(0xfc))/0x9*(parseInt(q(0x112))/0xa);if(b===f)break;else a['push'](a['shift']());}catch(I){a['push'](a['shift']());}}}(a6y,0x6d4bd));var __awaiter=this&&this['__awaiter']||function(y,f,a,b){function I(G){return G instanceof a?G:new a(function(T){T(G);});}return new(a||(a=Promise))(function(G,T){const V=a6f;function u(F){const p=a6f;try{Z(b[p(0xf3)](F));}catch(d){T(d);}}function t(F){const Y=a6f;try{Z(b[Y(0x13a)](F));}catch(d){T(d);}}function Z(F){const A=a6f;F['done']?G(F[A(0x111)]):I(F[A(0x111)])[A(0x13b)](u,t);}Z((b=b[V(0x106)](y,f||[]))[V(0xf3)]());});},__importDefault=this&&this[a6B(0x123)]||function(y){const S=a6B;return y&&y[S(0xf8)]?y:{'default':y};};Object[a6B(0xeb)](exports,a6B(0xf8),{'value':!![]}),exports[a6B(0xf5)]=void 0x0;function a6y(){const N=['925FbkHSc','alias','2496693VRGbFu','--group\x20[GROUP]','greenBright','name','stdin','pipe','askForService','action','resize','getCurrentProjectName','Run\x20command\x20with\x20this\x20group','columns','message','\x20command\x20exec:\x20','stdOut','addCommand','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','defineProperty','askForJob','setRawMode','stdout','--user\x20[USER]','exit','default','6232384uWSuPq','next','with\x20command\x20\x27','CliExec','5232185YRIkaq','job','__esModule','execServiceSession','stdIn','ApiClient','24966lZvluw','execJobSession','Unknown','getCommand','exec','error','with\x20shell\x20session','isTTY','customUserAgent','apiClient','apply','../inquirer-helper','stdErr','@northflank/js-client','Id\x20[NAME]','getStandardExecCommand','description','bold','rows','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','log','value','3020upZRae','with\x20user:','1467870rCeeVe','--noDefaults','status','execCmd','none','option','shell\x20command\x20','Command\x20exec\x20for\x20the\x20specified\x20','22897bJFdnv','getTerminalSize','Run\x20command\x20with\x20this\x20user','(exit\x20with\x20\x27Ctrl+D\x27)','without\x20shell','exitCode','16028LsMYZt','__importDefault','askForProject','join','service','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','Error\x20occured\x20during\x20','--shell-cmd\x20[SHELL-CMD]','stderr','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','filter','warning','2QPxSWS','\x20to\x20exec\x20into','Project\x20for\x20exec','../utils','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','waitForCommandResult','--cmd\x20--command\x20[COMMAND]','assertContextExisting','handleShellSession','command-exec','--project\x20--projectId\x20[NAME]','charAt','throw','then'];a6y=function(){return N;};return a6y();}function a6f(y,f){const a=a6y();return a6f=function(b,I){b=b-0xeb;let G=a[b];return G;},a6f(y,f);}const js_client_1=require(a6B(0x109)),chalk_1=__importDefault(require('chalk')),utils_1=require(a6B(0x131)),inquirer_helper_1=require(a6B(0x107));class CliExec{constructor(y){const n=a6B;this['getStandardExecCommand']=I=>(0x0,utils_1[n(0xff)])(!![])[n(0x141)](I)[n(0x10c)](n(0x11b)+I)[n(0x119)](n(0x138),n(0x130))[n(0x119)]('--'+I+'\x20--'+I+n(0x10a),I[n(0x139)](0x0)['toUpperCase']()+I['slice'](0x1)+n(0x12f))['option']('--container\x20--containerId\x20[NAME]',n(0x10f))['option'](n(0x129),n(0x132))['option'](n(0xef),n(0x11e))[n(0x119)](n(0x13f),n(0x148))[n(0x119)](n(0x115),n(0x14e),![])[n(0x119)](n(0x134),'Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise'),this[n(0x11d)]=()=>({'columns':process[n(0xee)]['columns'],'rows':process[n(0xee)][n(0x10e)]}),this['execStartLog']=(I,G,T,u,t,Z,F,d)=>{const e=n;if(d===!![])return;const R=u===e(0x118),s=R?e(0x120):u===undefined?e(0x102):e(0x11a)+chalk_1[e(0xf1)]['greenBright'](u),j=t!==undefined?e(0x113)+t:'',U=Z!==undefined?'with\x20group:'+Z:'',g=F!==undefined?e(0xf4)+chalk_1[e(0xf1)][e(0x140)](F)+'\x27':'',o=[g,s,j,U][e(0x12c)](i=>i!=='')[e(0x125)]('\x20'),r=e(0x11f);console[e(0x110)]('Exec\x20'+I+'\x20'+chalk_1['default'][e(0x10d)](G)+'\x20in\x20project\x20'+chalk_1[e(0xf1)][e(0x10d)](T)+'\x20'+o+'\x20'+r);},this[n(0x136)]=(I,G,T=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const J=n;var u,t;try{process[J(0x142)]['isTTY']&&(process[J(0x142)]['setRawMode'](!![]),process['stdout']['on'](J(0x146),()=>{const X=J;I['resizeTerminal'](this[X(0x11d)]());}));process[J(0x142)][J(0x143)](I[J(0xfa)]),I[J(0x108)]['pipe'](process[J(0x12a)]),I[J(0x14c)][J(0x143)](process[J(0xee)]),I['on'](J(0x101),F=>{const M=J;var d;(0x0,utils_1[M(0x101)])(M(0x128)+G+M(0x14b)+((d=F[M(0x14a)])!==null&&d!==void 0x0?d:F)),process[M(0x142)][M(0x103)]&&process['stdin'][M(0xed)](![]),process['exit'](-0x1);});const Z=yield I[J(0x133)]();if(T!==!![]){const F=(u=Z===null||Z===void 0x0?void 0x0:Z[J(0x116)])!==null&&u!==void 0x0?u:J(0xfe),d=(t=Z===null||Z===void 0x0?void 0x0:Z[J(0x121)])!==null&&t!==void 0x0?t:-0x1,R=(Z===null||Z===void 0x0?void 0x0:Z[J(0x14a)])?',\x20details:\x20'+Z[J(0x14a)]:'';F==='Success'?(0x0,utils_1['success'])('Command\x20completed\x20successfully,\x20exit\x20code:\x20'+d):(0x0,utils_1[J(0x12d)])(J(0x127)+F+',\x20exit\x20code:\x20'+d+R);}return Z;}finally{process[J(0x142)][J(0x103)]&&process[J(0x142)][J(0xed)](![]);}}),this[n(0x105)]=new js_client_1[(n(0xfb))](y,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[n(0x104)]});const f=new inquirer_helper_1['InquirerHelper'](this['apiClient']);this[n(0x117)]=(0x0,utils_1[n(0xff)])()['name'](n(0x137))[n(0x13d)](n(0x100))[n(0x10c)](n(0x12b));const a=this[n(0x10b)](n(0x126))['action'](I=>__awaiter(this,void 0x0,void 0x0,function*(){const c=n,{noDefaults:G,projectId:T,serviceId:u,containerId:t,shellCmd:Z,user:F,group:d,command:R,quiet:s}=I;(0x0,utils_1[c(0x135)])(this[c(0x105)]);try{const j=G?undefined:y[c(0x147)](),U=T||j||(yield f[c(0x124)]()),g=G?undefined:y['getCurrentServiceName'](),o=u||g||(yield f[c(0x144)](U)()),r=Z!==null&&Z!==void 0x0?Z:R!==undefined?c(0x118):undefined;this['execStartLog'](c(0x126),o,U,r,F,d,R,s);const i=process[c(0xee)][c(0x149)],l=process[c(0xee)][c(0x10e)],H={'projectId':U,'serviceId':o},v=yield this[c(0x105)][c(0x100)][c(0xf9)](H,{'containerName':t,'command':R,'shell':r,'user':F,'group':d,'ttyColumns':i,'ttyRows':l});yield this[c(0x136)](v,c(0x126),s);}catch(P){(0x0,utils_1['error'])(''+P[c(0x14a)]);}finally{process[c(0xf0)]();}})),b=this['getStandardExecCommand']('job')[n(0x145)](I=>__awaiter(this,void 0x0,void 0x0,function*(){const C=n,{projectId:G,jobId:T,containerId:u,noDefaults:t,shellCmd:Z,user:F,group:d,command:R,quiet:s}=I;(0x0,utils_1[C(0x135)])(this[C(0x105)]);try{const j=t?undefined:y[C(0x147)](),U=G||j||(yield f[C(0x124)]()),g=T||(yield f[C(0xec)](U)());this['execStartLog'](C(0xf7),g,U,Z,s);const {rows:o,columns:r}=this[C(0x11d)](),i={'projectId':U,'jobId':g},l=yield this[C(0x105)][C(0x100)][C(0xfd)](i,{'containerName':u,'command':R,'shell':Z,'user':F,'group':d,'ttyColumns':r,'ttyRows':o});yield this[C(0x136)](l,C(0xf7),s);}catch(H){(0x0,utils_1['error'])(''+H[C(0x14a)]);}finally{process['exit']();}}));this[n(0x117)][n(0x14d)](a),this['execCmd'][n(0x14d)](b);}}exports[a6B(0xf5)]=CliExec;
1
+ 'use strict';const a6b=a6C;(function(n,C){const N=a6C,k=n();while(!![]){try{const H=parseInt(N(0x184))/0x1+parseInt(N(0x1ad))/0x2+parseInt(N(0x1bc))/0x3*(-parseInt(N(0x1c3))/0x4)+parseInt(N(0x1a6))/0x5+parseInt(N(0x1d7))/0x6+parseInt(N(0x194))/0x7+parseInt(N(0x1d4))/0x8*(-parseInt(N(0x1c9))/0x9);if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a6n,0x4c75c));var __awaiter=this&&this['__awaiter']||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const c=a6C;function t(y){const X=a6C;try{M(H[X(0x1b2)](y));}catch(T){i(T);}}function r(y){const E=a6C;try{M(H[E(0x1d8)](y));}catch(T){i(T);}}function M(y){const g=a6C;y[g(0x1c0)]?W(y['value']):R(y[g(0x18a)])[g(0x1a7)](t,r);}M((H=H[c(0x1cc)](n,C||[]))[c(0x1b2)]());});},__importDefault=this&&this[a6b(0x1cf)]||function(n){const L=a6b;return n&&n[L(0x1b7)]?n:{'default':n};};Object[a6b(0x1b5)](exports,a6b(0x1b7),{'value':!![]}),exports[a6b(0x1b4)]=void 0x0;function a6n(){const Y=['--cmd\x20--command\x20[COMMAND]','job','exit','success','execStartLog','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','with\x20user:','log','exec','action','addCommand','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','rows','with\x20shell\x20session','stdErr','message','440155Imwxhw','then','../utils','execJobSession','handleShellSession','getCurrentProjectName','Run\x20command\x20with\x20this\x20user','1019538DOsAkq','askForService','../inquirer-helper','stderr','customUserAgent','next','warning','CliExec','defineProperty','Command\x20exec\x20for\x20the\x20specified\x20','__esModule','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','Id\x20[NAME]','default','service','1532577OaeKvJ','description','assertContextExisting','without\x20shell','done','Error\x20occured\x20during\x20','greenBright','4lGNHyh','execServiceSession','--container\x20--containerId\x20[NAME]','bold','askForJob',',\x20details:\x20','369ZxtclM','stdOut','waitForCommandResult','apply','toUpperCase','alias','__importDefault','name','chalk','Unknown',',\x20exit\x20code:\x20','146136TyVAZQ','getStandardExecCommand','charAt','1708662AgNWgB','throw','isTTY','--user\x20[USER]','error','option','Success','none','setRawMode','Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise','askForProject','Command\x20completed\x20successfully,\x20exit\x20code:\x20','pipe','status','Run\x20command\x20with\x20this\x20group','334780kLiqes','(exit\x20with\x20\x27Ctrl+D\x27)','stdout','columns','apiClient','\x20in\x20project\x20','value','stdin','ApiClient','resizeTerminal','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','@northflank/js-client','slice','execCmd','getTerminalSize','Project\x20for\x20exec','2489403FgyABd','\x20to\x20exec\x20into'];a6n=function(){return Y;};return a6n();}const js_client_1=require(a6b(0x18f)),chalk_1=__importDefault(require(a6b(0x1d1))),utils_1=require(a6b(0x1a8)),inquirer_helper_1=require(a6b(0x1af));class CliExec{constructor(n){const G=a6b;this[G(0x1d5)]=R=>(0x0,utils_1['getCommand'])(!![])[G(0x1d0)](R)[G(0x1bd)](G(0x1b6)+R)[G(0x1dc)]('--project\x20--projectId\x20[NAME]',G(0x193))['option']('--'+R+'\x20--'+R+G(0x1b9),R[G(0x1d6)](0x0)[G(0x1cd)]()+R[G(0x190)](0x1)+G(0x195))[G(0x1dc)](G(0x1c5),G(0x19b))[G(0x1dc)]('--shell-cmd\x20[SHELL-CMD]',G(0x1b8))[G(0x1dc)](G(0x1da),G(0x1ac))[G(0x1dc)]('--group\x20[GROUP]',G(0x183))[G(0x1dc)]('--noDefaults',G(0x18e),![])[G(0x1dc)](G(0x196),G(0x17e)),this[G(0x192)]=()=>({'columns':process[G(0x186)]['columns'],'rows':process[G(0x186)][G(0x1a2)]}),this[G(0x19a)]=(R,W,i,t,r,M,y,T)=>{const Z=G;if(T===!![])return;const V=t==='none',j=V?Z(0x1bf):t===undefined?Z(0x1a3):'shell\x20command\x20'+chalk_1[Z(0x1ba)][Z(0x1c2)](t),U=r!==undefined?Z(0x19c)+r:'',h=M!==undefined?'with\x20group:'+M:'',o=y!==undefined?'with\x20command\x20\x27'+chalk_1[Z(0x1ba)]['greenBright'](y)+'\x27':'',A=[o,j,U,h]['filter'](Q=>Q!=='')['join']('\x20'),d=Z(0x185);console[Z(0x19d)]('Exec\x20'+R+'\x20'+chalk_1[Z(0x1ba)]['bold'](W)+Z(0x189)+chalk_1[Z(0x1ba)][Z(0x1c6)](i)+'\x20'+A+'\x20'+d);},this[G(0x1aa)]=(R,W,i=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const q=G;var t,r;try{process['stdin']['isTTY']&&(process[q(0x18b)][q(0x17d)](!![]),process['stdout']['on']('resize',()=>{const w=q;R[w(0x18d)](this[w(0x192)]());}));process[q(0x18b)]['pipe'](R['stdIn']),R[q(0x1a4)]['pipe'](process[q(0x1b0)]),R[q(0x1ca)][q(0x181)](process[q(0x186)]),R['on'](q(0x1db),y=>{const O=q;var T;(0x0,utils_1[O(0x1db)])(O(0x1c1)+W+'\x20command\x20exec:\x20'+((T=y[O(0x1a5)])!==null&&T!==void 0x0?T:y)),process[O(0x18b)][O(0x1d9)]&&process[O(0x18b)][O(0x17d)](![]),process[O(0x198)](-0x1);});const M=yield R[q(0x1cb)]();if(i!==!![]){const y=(t=M===null||M===void 0x0?void 0x0:M[q(0x182)])!==null&&t!==void 0x0?t:q(0x1d2),T=(r=M===null||M===void 0x0?void 0x0:M['exitCode'])!==null&&r!==void 0x0?r:-0x1,V=(M===null||M===void 0x0?void 0x0:M[q(0x1a5)])?q(0x1c8)+M[q(0x1a5)]:'';y===q(0x1dd)?(0x0,utils_1[q(0x199)])(q(0x180)+T):(0x0,utils_1[q(0x1b3)])('Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20'+y+q(0x1d3)+T+V);}return M;}finally{process[q(0x18b)][q(0x1d9)]&&process[q(0x18b)]['setRawMode'](![]);}}),this['apiClient']=new js_client_1[(G(0x18c))](n,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[G(0x1b1)]});const C=new inquirer_helper_1['InquirerHelper'](this[G(0x188)]);this['execCmd']=(0x0,utils_1['getCommand'])()[G(0x1d0)]('command-exec')[G(0x1ce)](G(0x19e))['description'](G(0x1a1));const k=this['getStandardExecCommand']('service')[G(0x19f)](R=>__awaiter(this,void 0x0,void 0x0,function*(){const F=G,{noDefaults:W,projectId:i,serviceId:t,containerId:r,shellCmd:M,user:y,group:T,command:V,quiet:j}=R;(0x0,utils_1[F(0x1be)])(this[F(0x188)]);try{const U=W?undefined:n[F(0x1ab)](),h=i||U||(yield C[F(0x17f)]()),o=W?undefined:n['getCurrentServiceName'](),A=t||o||(yield C[F(0x1ae)](h)()),d=M!==null&&M!==void 0x0?M:V!==undefined?F(0x1de):undefined;this[F(0x19a)]('service',A,h,d,y,T,V,j);const Q=process['stdout'][F(0x187)],l=process['stdout'][F(0x1a2)],K={'projectId':h,'serviceId':A},m=yield this[F(0x188)][F(0x19e)][F(0x1c4)](K,{'containerName':r,'command':V,'shell':d,'user':y,'group':T,'ttyColumns':Q,'ttyRows':l});yield this[F(0x1aa)](m,F(0x1bb),j);}catch(a){(0x0,utils_1['error'])(''+a[F(0x1a5)]);}finally{process[F(0x198)]();}})),H=this[G(0x1d5)](G(0x197))['action'](R=>__awaiter(this,void 0x0,void 0x0,function*(){const D=G,{projectId:W,jobId:i,containerId:t,noDefaults:r,shellCmd:M,user:y,group:T,command:V,quiet:j}=R;(0x0,utils_1[D(0x1be)])(this[D(0x188)]);try{const U=r?undefined:n[D(0x1ab)](),h=W||U||(yield C[D(0x17f)]()),o=i||(yield C[D(0x1c7)](h)());this[D(0x19a)](D(0x197),o,h,M,j);const {rows:A,columns:d}=this[D(0x192)](),Q={'projectId':h,'jobId':o},l=yield this[D(0x188)][D(0x19e)][D(0x1a9)](Q,{'containerName':t,'command':V,'shell':M,'user':y,'group':T,'ttyColumns':d,'ttyRows':A});yield this[D(0x1aa)](l,'job',j);}catch(K){(0x0,utils_1[D(0x1db)])(''+K[D(0x1a5)]);}finally{process[D(0x198)]();}}));this[G(0x191)][G(0x1a0)](k),this['execCmd'][G(0x1a0)](H);}}function a6C(n,C){const k=a6n();return a6C=function(H,R){H=H-0x17d;let W=k[H];return W;},a6C(n,C);}exports[a6b(0x1b4)]=CliExec;
@@ -1 +1 @@
1
- 'use strict';function a7y(){const ys=['nextCursor','23184788ROcTAg','doesn\x27t\x20match\x20pattern\x20\x27','whiteBright','isNaN','value','jobs','askForJob','askForSubdomain','found','inquirer-search-list','getCurrentProjectName','ABORT','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','example','stringify','credentials','blueBright','10286460qlVqqE','isEmpty','grey','builds','volume','isObject','pattern','minLength','confirmationPrompt','token','isArray','Please\x20confirm\x20following\x20configuration:\x0a','has','set','job\x20build','resultCache','don\x27t\x20change','registerPrompt','unset','askForResource','REPEAT','required','nextPageCursor','14moMUOm','retry','defaultPaginationPageSize','oneOf','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','deleteWarningPrompt','rawObject','confirmation','apply','get','safeDump','must\x20be\x20a\x20number,\x20is\x20','toUpperCase','102qTMLqF','prompt','job','createdAt','defineProperty','trim','YES','getOwnPropertyDescriptor','message','project:\x20\x27','join','98755WMmqKp','566424ZlcjbK','__importStar','__awaiter','Aborted.',',\x20supported\x20types:\x20[json|yaml|yml]','writeFileSync','assign','then','fullName','prototype','askForResourcePaginated','data','What\x27s\x20the\x20','keys','override','\x20(full\x20domain:\x20','88QkemZv','search-list','\x20type?','Choose\x20the\x20login\x20token:','find','default','services','SAVE','askForProjectScopedResource','2820321IyMQhq','service','lodash','create','description','properties','.*\x5c.(json|yaml|yml)$','Configuration\x20file\x20written\x20to\x20','fileName','yellowBright','askForBuild','\x20characters,\x20is\x20','projects','completedAt','confirm','isValidJSON','test','editedResult','name','green','choice','askGeneric','this\x20option\x20is\x20required,\x20please\x20answer','hasOwnProperty','subdomain','InquirerHelper','chalk','minimum','Writing\x20configuration\x20failed:\x20','next','retrievePayloadViaInteractiveCli','volumes','pop','./utils','inquirer','editPayload','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','tokenPrompt','type','getPathString','body','isBoolean','isUndefined','askForService','askForDomain','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','\x20in\x20','warning','\x20(startedAt:\x20','includes','success','Choose\x20the\x20','pagination-prompt','No\x20builds\x20found','input','maximum','addon','split','Do\x20you\x20want\x20to\x20add','askConfirm','getQuestionString','Context\x20name\x20already\x20exists.','project','to\x20use:','getInnerType','No\x20','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','askForSecret','domains','yaml','addons','slice','boolean','getType','pagination','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','map','./api-helpers','271028aVvadY','askForProject','repeat','__esModule','done','underline','39nhMowK','\x20to\x20use:','domain','Unexpected\x20file\x20type:\x20','for\x20this\x20','push','ask','concat','writable','__importDefault','EDIT','safeLoad','red','runs','No,\x20edit','list','object','DynamicReloadPaginationPrompt','saveFile','No,\x20but\x20save\x20as\x20file','filter','secrets','integer','subdomains','yml','toString','call','maxLength','askForProjectScopedResourcePaginated','js-yaml','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','backups','domain\x20(','secret','__setModuleDefault','loginPrompt','string','pathVars','No,\x20abort','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','Enter\x20the\x20','askForCredentials','length','Something\x20unexpected\x20happened.','propToType','__createBinding','opt','bold','No,\x20repeat','editor','4911ErBcUS','\x20and\x20it\x20','cursor','elements','apiClient','enum','job:\x20\x27','cmdPath','askArrayEntry'];a7y=function(){return ys;};return a7y();}const a7j=a7f;(function(y,f){const s=a7f,a=y();while(!![]){try{const b=parseInt(s(0xd4))/0x1*(parseInt(s(0x12f))/0x2)+-parseInt(s(0xa2))/0x3*(-parseInt(s(0x9c))/0x4)+-parseInt(s(0x11e))/0x5*(-parseInt(s(0x113))/0x6)+-parseInt(s(0x106))/0x7*(-parseInt(s(0x11f))/0x8)+parseInt(s(0x138))/0x9+parseInt(s(0xef))/0xa+-parseInt(s(0xde))/0xb;if(b===f)break;else a['push'](a['shift']());}catch(I){a['push'](a['shift']());}}}(a7y,0xc569d));var __createBinding=this&&this[a7j(0xcf)]||(Object[a7j(0x13b)]?function(y,f,a,b){const U=a7j;if(b===undefined)b=a;var I=Object[U(0x11a)](f,a);(!I||(U(0x10f)in I?!f[U(0x9f)]:I[U(0xaa)]||I['configurable']))&&(I={'enumerable':!![],'get':function(){return f[a];}}),Object['defineProperty'](y,b,I);}:function(y,f,a,b){if(b===undefined)b=a;y[b]=f[a];}),__setModuleDefault=this&&this[a7j(0xc4)]||(Object['create']?function(y,f){const g=a7j;Object[g(0x117)](y,g(0x134),{'enumerable':!![],'value':f});}:function(y,f){const o=a7j;y[o(0x134)]=f;}),__importStar=this&&this[a7j(0x120)]||function(y){const r=a7j;if(y&&y[r(0x9f)])return y;var f={};if(y!=null){for(var a in y)if(a!=='default'&&Object[r(0x128)][r(0x14f)][r(0xbc)](y,a))__createBinding(f,y,a);}return __setModuleDefault(f,y),f;},__awaiter=this&&this[a7j(0x121)]||function(y,f,a,b){function I(G){return G instanceof a?G:new a(function(T){T(G);});}return new(a||(a=Promise))(function(G,T){const H=a7f;function u(F){const i=a7f;try{Z(b[i(0x6b)](F));}catch(d){T(d);}}function t(F){try{Z(b['throw'](F));}catch(d){T(d);}}function Z(F){const l=a7f;F[l(0xa0)]?G(F[l(0xe2)]):I(F[l(0xe2)])[l(0x126)](u,t);}Z((b=b[H(0x10e)](y,f||[]))['next']());});},__importDefault=this&&this[a7j(0xab)]||function(y){const v=a7j;return y&&y[v(0x9f)]?y:{'default':y};};Object[a7j(0x117)](exports,a7j(0x9f),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a7j(0x13a))),chalk_1=__importDefault(require(a7j(0x68))),fs=__importStar(require('fs')),utils_1=require(a7j(0x6f)),api_helpers_1=require(a7j(0x9b)),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require(a7j(0x70)),inquirerSearchList=require(a7j(0xe7)),yaml=require(a7j(0xbf));var ConfirmChoices;function a7f(y,f){const a=a7y();return a7f=function(b,I){b=b-0x68;let G=a[b];return G;},a7f(y,f);}(function(y){const P=a7j;y[P(0x119)]='Yes,\x20send',y[P(0x103)]=P(0xd2),y[P(0xac)]=P(0xb0),y['SAVE']=P(0xb5),y['ABORT']=P(0xc8);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(y){const q=a7j;this[q(0xd8)]=y,this[q(0x108)]=0x32,this[q(0x71)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const p=q,{editedResult:a}=yield inquirer[p(0x114)]([{'type':p(0xd3),'name':p(0x149),'message':'Go\x20to\x20editor','default':yaml[p(0x110)](f)}]);return yaml[p(0xad)](a);}),this[q(0xb4)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=q,a=T=>Y(0xa5)+T+Y(0x123);function b(){return __awaiter(this,void 0x0,void 0x0,function*(){const A=a7f;return inquirer['prompt']([{'type':A(0x84),'name':A(0x140),'message':'Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','validate':T=>new RegExp(A(0x13e))[A(0x148)](T)?!![]:a(T)}]);});}const {fileName:I}=yield b(),G=I[Y(0xbb)]()[Y(0x87)]('.')[Y(0x6e)]();try{switch(G){case'json':(0x0,utils_1[Y(0x80)])('Configuration\x20file\x20written\x20to\x20'+I);return fs[Y(0x124)](I,JSON[Y(0xec)](f,null,'\x20\x20'));case Y(0x93):case Y(0xba):(0x0,utils_1[Y(0x80)])(Y(0x13f)+I);return fs[Y(0x124)](I,yaml[Y(0x110)](f));default:(0x0,utils_1[Y(0x7d)])(a(G));}}catch(T){(0x0,utils_1['warning'])(Y(0x6a)+T[Y(0x11b)]);}return undefined;}),this[q(0xb6)]=(f,a)=>b=>{const V=q,I=typeof b===V(0xc6)?b[V(0x118)]():b;return a===![]&&I===V(0xff)?'':I;},this['validate']=(f,a,b)=>I=>{const B=q,G=[];if(I===''||I===B(0xff)){if(a!==![])G[B(0xa7)](B(0x14e));else return!![];}f[B(0x74)]===B(0xc6)&&!_[B(0x78)](f[B(0xf5)])&&G['push'](new RegExp(f['pattern'])[B(0x148)](I)?!![]:B(0xdf)+f[B(0xf5)]+'\x27');f[B(0x74)]==='string'&&!_[B(0x78)](f[B(0xf6)])&&G[B(0xa7)](I[B(0xcc)]>=f[B(0xf6)]?!![]:'must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20'+f['minLength']+B(0x143)+I[B(0xcc)]+'\x20characters');f['type']===B(0xc6)&&!_[B(0x78)](f[B(0xbd)])&&G['push'](I[B(0xcc)]<=f[B(0xbd)]?!![]:B(0x90)+f['maxLength']+B(0x143)+I[B(0xcc)]+'\x20characters');b&&Number[B(0xe1)](parseInt(I,0xa))&&G[B(0xa7)](B(0x111)+I);f[B(0x74)]===B(0xb8)&&!_['isUndefined'](f[B(0x69)])&&G[B(0xa7)](I>=f[B(0x69)]?!![]:B(0x72)+f[B(0x69)]);f[B(0x74)]===B(0xb8)&&!_[B(0x78)](f[B(0x85)])&&G[B(0xa7)](I<=f[B(0x85)]?!![]:B(0xc9)+f[B(0x85)]);if(f['type']===B(0x10c)){const t=(0x0,utils_1[B(0x147)])(I);G[B(0xa7)](t===![]||_[B(0xf0)](t)?B(0xc0):!![]);}const T=G[B(0xb6)](Z=>Z!==!![]),u=(f===null||f===void 0x0?void 0x0:f[B(0xeb)])?'\x0a'+chalk_1['default'][B(0xae)]('>>')+'\x20Example:\x20'+chalk_1['default']['whiteBright'](JSON[B(0xec)](f[B(0xeb)])):'';return T[B(0xcc)]>0x0?T[B(0x11d)](chalk_1[B(0x134)][B(0xa1)](B(0xd5)))+u:!![];},this[q(0x75)]=(f,a,b)=>{const S=q,I=f[f[S(0xcc)]-0x1];function G(){const n=S;return f['slice'](0x0,-0x1)[n(0x9a)](t=>t['charAt'](0x0)[n(0x112)]()+t[n(0x95)](0x1))['join']('>');}const T=f[S(0xcc)]>0x1?chalk_1[S(0x134)]['bgGrey'][S(0xe0)](G())+':\x20':'',u=b?'\x20('+chalk_1[S(0x134)]['blue'](b)+')':'';return chalk_1[S(0x134)]['reset'](''+T+a+'\x20'+chalk_1[S(0x134)]['bold']['greenBright'](I)+u+'?');},this[q(0x102)]=(f,a,b)=>__awaiter(this,void 0x0,void 0x0,function*(){const e=q;if(a[e(0xcc)]<0x1){const T=b?e(0xa6)+b:e(0xe6);throw new Error(e(0x8f)+f+'\x20'+T+'.');}const I=e(0x81)+f+e(0xa3),G=a[e(0xcc)]>0x4?'search-list':e(0xb1);return(yield inquirer[e(0x114)]([{'type':G,'name':e(0x14a),'message':I,'choices':a}]))[e(0x14a)];}),this[q(0x129)]=(f,a,b)=>__awaiter(this,void 0x0,void 0x0,function*(){const J=q,{elements:I,nextCursor:G}=yield a();if(I[J(0xcc)]<0x1){const t=b?J(0xa6)+b:J(0xe6);throw new Error('No\x20'+f+'\x20'+t+'.');}const T='Choose\x20the\x20'+f+J(0xa3);if(G!==undefined){const Z=({nextPageCursor:F})=>__awaiter(this,void 0x0,void 0x0,function*(){const X=J,d=yield a(F);return{'elements':d[X(0xd7)],'nextPageCursor':d[X(0xdd)]};});return(yield inquirer[J(0x114)]([{'type':J(0x82),'name':J(0x14a),'message':T,'choices':I,'nextPageCursor':G,'loadMore':Z}]))[J(0x14a)];}const u=I[J(0xcc)]>0x4?J(0x130):J(0xb1);return(yield inquirer[J(0x114)]([{'type':u,'name':J(0x14a),'message':T,'choices':I}]))[J(0x14a)];}),this[q(0x14d)]=(f,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const M=q,b=''+(a?'('+chalk_1[M(0x134)]['blue'](a)+')\x20':''),I=M(0xca)+chalk_1[M(0x134)][M(0x14b)](f)+'\x20'+b+M(0x8d),G=this['validate']({'type':M(0xc6),'required':!![]});return(yield inquirer['prompt']([{'type':M(0x84),'name':M(0x14a),'message':I,'validate':G}]))[M(0x14a)];}),this[q(0x89)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const C=q;return(yield inquirer[C(0x114)]([{'type':C(0x146),'name':'name','message':f,'default':!![]}]))[C(0x14a)];}),this[q(0x79)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=q,a=b=>I=>__awaiter(this,void 0x0,void 0x0,function*(){const N=a7f;var G;const T=yield this[N(0xd8)][N(0xb1)][N(0x135)]({'parameters':{'projectId':b},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}}),u=T[N(0x12a)][N(0x135)][N(0x9a)](t=>t['id']);return{'elements':u,'nextCursor':(G=T[N(0x98)])===null||G===void 0x0?void 0x0:G[N(0xd6)]};});return this[K(0xbe)](K(0x139),a,f);}),this[q(0xe4)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const O=q,a=b=>I=>__awaiter(this,void 0x0,void 0x0,function*(){const x=a7f;var G;const T=yield this['apiClient']['list'][x(0xe3)]({'parameters':{'projectId':b},'options':{'per_page':this[x(0x108)],'cursor':I}}),u=T[x(0x12a)][x(0xe3)][x(0x9a)](t=>t['id']);return{'elements':u,'nextCursor':(G=T['pagination'])===null||G===void 0x0?void 0x0:G[x(0xd6)]};});return this[O(0xbe)]('job',a,f);}),this['askForJobRun']=(f,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const W=q,b=I=>G=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=a7f;var T;const u=yield this[Q(0xd8)][Q(0x10f)][Q(0x115)]['runs']({'parameters':{'projectId':I,'jobId':f},'options':{'per_page':this[Q(0x108)],'cursor':G}}),t=u['data'][Q(0xaf)][Q(0x9a)](Z=>Z['id']+Q(0x7e)+Z['startedAt']+')');return{'elements':t,'nextCursor':(T=u[Q(0x98)])===null||T===void 0x0?void 0x0:T[Q(0xd6)]};});return this[W(0xbe)]('job\x20runs',b,a,W(0xda)+f+'\x27')[W(0x126)](I=>I['split']('\x20')[0x0]);}),this[q(0x142)]=(f,a,b)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const w=q;if(b!==undefined){const I=G=>T=>__awaiter(this,void 0x0,void 0x0,function*(){const k=a7f;var u;const t=yield this['apiClient']['get'][k(0x115)][k(0xf2)]({'parameters':{'projectId':G,'jobId':b},'options':{'per_page':this[k(0x108)],'cursor':T}});return{'elements':t[k(0x12a)][k(0xf2)][k(0x9a)](Z=>Z['id']+k(0x7e)+Z['createdAt']+')'),'nextCursor':(u=t[k(0x98)])===null||u===void 0x0?void 0x0:u['cursor']};});return this[w(0xbe)]('job\x20builds',I,f,w(0xda)+b+'\x27')[w(0x126)](G=>G['split']('\x20')[0x0]);}if(a!==undefined){const G=T=>u=>__awaiter(this,void 0x0,void 0x0,function*(){const m=w;var t;const Z=yield this['apiClient'][m(0x10f)][m(0x139)][m(0xf2)]({'parameters':{'projectId':T,'serviceId':a},'options':{'per_page':this[m(0x108)],'cursor':u}});return{'elements':Z[m(0x12a)][m(0xf2)][m(0x9a)](F=>F['id']+m(0x7e)+F[m(0x116)]+')'),'nextCursor':(t=Z[m(0x98)])===null||t===void 0x0?void 0x0:t[m(0xd6)]};});return this[w(0xbe)](w(0xfd),G,f,'service:\x20\x27'+b+'\x27')[w(0x126)](T=>T[w(0x87)]('\x20')[0x0]);}throw new Error(w(0x83));}),this['askForAddon']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const z=q,a=b=>I=>__awaiter(this,void 0x0,void 0x0,function*(){const E=a7f;var G;const T=yield this[E(0xd8)][E(0xb1)][E(0x94)]({'parameters':{'projectId':b},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}});return{'elements':T[E(0x12a)]['addons']['map'](u=>u['id']),'nextCursor':(G=T[E(0x98)])===null||G===void 0x0?void 0x0:G[E(0xd6)]};});return this[z(0xbe)](z(0x86),a,f);}),this['askForAddonBackup']=(f,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const h=q,b=I=>G=>__awaiter(this,void 0x0,void 0x0,function*(){const L=a7f;var T;const u=yield this[L(0xd8)][L(0x10f)][L(0x86)]['backups']({'parameters':{'projectId':I,'addonId':a},'options':{'per_page':this[L(0x108)],'cursor':G}});return{'elements':u['data'][L(0xc1)]['map'](t=>t['id']+'\x20(completedAt:\x20'+(t[L(0x145)]||'not\x20completed')+')'),'nextCursor':(T=u[L(0x98)])===null||T===void 0x0?void 0x0:T[L(0xd6)]};});return this[h(0xbe)](h(0xc1),b,f,'addon:\x20\x27'+a+'\x27')[h(0x126)](I=>I['split']('\x20')[0x0]);}),this['askForVolume']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y0=q,a=b=>__awaiter(this,void 0x0,void 0x0,function*(){const D=a7f;return(yield this[D(0xd8)][D(0xb1)][D(0x6d)]({'parameters':{'projectId':b}}))[D(0x12a)][D(0x9a)](I=>I['id']);});return this[y0(0x137)](y0(0xf3),a,f);}),this[q(0x91)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y2=q,a=b=>I=>__awaiter(this,void 0x0,void 0x0,function*(){const y1=a7f;var G;const T=yield this[y1(0xd8)]['list']['secrets']({'parameters':{'projectId':b},'options':{'per_page':this[y1(0x108)],'cursor':I}});return{'elements':T['data'][y1(0xb7)]['map'](u=>u['id']),'nextCursor':(G=T[y1(0x98)])===null||G===void 0x0?void 0x0:G[y1(0xd6)]};});return this[y2(0xbe)](y2(0xc3),a,f);}),this[q(0xe5)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y3=q,a=yield this[y3(0xd8)][y3(0x10f)][y3(0xa4)]({'parameters':{'domain':f}}),b=a[y3(0x12a)][y3(0xb9)]['map'](G=>G[y3(0x14a)]+y3(0x12e)+G[y3(0x127)]+')'),I=y3(0xc2)+f+')';return this[y3(0x102)](y3(0x150),b,I)[y3(0x126)](G=>G[y3(0x87)]('\x20')[0x0]);}),this[q(0x10b)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const y4=q;return(yield inquirer[y4(0x114)]([{'type':'confirm','name':y4(0x10d),'message':chalk_1[y4(0x134)][y4(0x141)](y4(0x7b)+(f||'a\x20Northflank\x20resource')+'.\x20This\x20is\x20irreversible.\x20Please\x20confirm!'),'default':![]}]))[y4(0x10d)];}),this[q(0xc5)]=(f,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const y5=q;_['isUndefined'](f[y5(0x14a)])&&(a['length']<=0x0?_[y5(0xfc)](f,y5(0x14a),y5(0x134)):yield(0x0,utils_1[y5(0x107)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const y6=y5,{name:b}=yield inquirer[y6(0x114)]([{'type':y6(0x84),'name':y6(0x14a),'message':y6(0x10a),'default':'main-context'}]);if(!f['override']&&a['find'](I=>I[y6(0x14a)]===b)){const {c:I}=yield inquirer[y6(0x114)]([{'type':y6(0x146),'name':'c','message':'Context\x20with\x20name\x20\x27'+b+y6(0xea),'default':![]}]);if(I===![])throw new Error(y6(0x8b));_['set'](f,y6(0x12d),!![]);}_[y6(0xfc)](f,y6(0x14a),b);})));if(_[y5(0x78)](f['token'])){const b=yield this[y5(0x73)]();_['set'](f,'token',b);}return f;}),this[q(0x73)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const y7=q,{token:f}=yield inquirer['prompt']([{'type':'password','name':y7(0xf8),'mask':'*','message':y7(0x132)}]);return f;}),inquirer[q(0x100)](q(0x130),inquirerSearchList),inquirer[q(0x100)](q(0x82),inquirer_pagination_prompt_1[q(0xb3)]);}[a7j(0xf7)](y,f){return __awaiter(this,void 0x0,void 0x0,function*(){const y8=a7f,a=yaml['safeDump'](y),b=_['max'](a[y8(0x87)]('\x0a')[y8(0x9a)](T=>T['length'])),I=chalk_1[y8(0x134)][y8(0xf1)]('-'[y8(0x9e)](b)+'\x0a'),{confirm:G}=yield inquirer[y8(0x114)]([{'type':y8(0xb1),'name':y8(0x146),'message':''+chalk_1['default'][y8(0xd1)][y8(0x14b)](y8(0xfa))+I+chalk_1[y8(0x134)][y8(0xee)](a)+I,'choices':Object['values'](ConfirmChoices)}]);switch(G){case ConfirmChoices['YES']:return y;case ConfirmChoices[y8(0xe9)]:throw new Error(y8(0x122));case ConfirmChoices[y8(0x103)]:return this[y8(0x6c)](f);case ConfirmChoices[y8(0xac)]:return this['confirmationPrompt'](yield this[y8(0x71)](y),f);case ConfirmChoices[y8(0x136)]:yield this['saveFile'](y);return this[y8(0xf7)](y,f);default:throw new Error(y8(0xcd));}});}['retrievePayloadViaInteractiveCli'](y,f){return __awaiter(this,void 0x0,void 0x0,function*(){const y9=a7f;if((f===null||f===void 0x0?void 0x0:f[y9(0xfe)])!==undefined)this[y9(0xfe)]=f===null||f===void 0x0?void 0x0:f[y9(0xfe)];this['tmpCmdPath']=f===null||f===void 0x0?void 0x0:f[y9(0xdb)];const a={};return yield this['propToType']([],y[y9(0xd0)][y9(0x76)],a),this[y9(0xfe)]=a,yield this[y9(0xf7)](a,y);});}[a7j(0xce)](y,f,a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const yy=a7f;let I;if(f[yy(0x109)]&&!_[yy(0xfb)](f,'properties')){if(f[yy(0x109)][yy(0xcc)]>0x1){const {choice:G}=yield inquirer[yy(0x114)]([{'type':'list','name':yy(0x14c),'message':yy(0x12b)+(y[y['length']-0x1]||'')+yy(0x131),'choices':f['oneOf'][yy(0x9a)](T=>T['description'])}]);I=yield this[yy(0x97)](y,f[yy(0x109)][yy(0x133)](T=>T['description']===G),a,b);}else{const T=f['oneOf'][0x0];_[yy(0xfc)](T,yy(0x13c),f['description']),I=yield this[yy(0x97)](y,T,a,b);}I={};}else I=yield this[yy(0x97)](y,f,a,b);return I;});}[a7j(0x8e)](y,f,a,b){var I;return __awaiter(this,void 0x0,void 0x0,function*(){const yf=a7f;if(b===![]){const {addEntry:u}=yield inquirer[yf(0x114)]([{'type':yf(0x146),'name':'addEntry','message':this[yf(0x75)](f,'Do\x20you\x20want\x20to\x20add',y===null||y===void 0x0?void 0x0:y[yf(0x13c)]),'default':![]}]);if(!u)return a;}const G=Object[yf(0x12c)]((I=y===null||y===void 0x0?void 0x0:y[yf(0x13d)])!==null&&I!==void 0x0?I:[]),T=y[yf(0x104)]||[];if(G[yf(0xcc)]>0x0)for(const t of G){const Z=f[yf(0xa9)](t);if(f['length']>0x0&&!_[yf(0xfb)](a,f['join']('.')))_['set'](a,f[yf(0x11d)]('.'),{});yield this[yf(0xce)](Z,y[yf(0x13d)][t],a,T[yf(0x7f)](t));}else yield this[yf(0x97)](f,Object[yf(0x125)](Object[yf(0x125)]({},y),{'type':'rawObject'}),a,b);return a;});}[a7j(0xdc)](y,f,a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const ya=a7f;if(f&&a)return!![];const I=f?ya(0x88):'Do\x20you\x20want\x20to\x20add\x20more',{addEntry:G}=yield inquirer[ya(0x114)]([{'type':ya(0x146),'name':'addEntry','message':this[ya(0x75)](y,I,f?b:undefined),'default':![]}]);return G;});}[a7j(0x97)](y,f,a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const yb=a7f;let I;const G=y[yb(0x11d)]('.');switch(f===null||f===void 0x0?void 0x0:f[yb(0x74)]){case'array':{let T=!![];while(yield this[yb(0xdc)](y,T,b,f===null||f===void 0x0?void 0x0:f['description'])){const u=_[yb(0x10f)](a,G);_[yb(0x101)](a,G),yield this[yb(0x97)](y,f['items'],a);const t=_[yb(0x10f)](a,G);!_[yb(0xf9)](u)?_['set'](a,G,[t]):(u[yb(0xa7)](t),_[yb(0xfc)](a,G,u)),T=![];}return I||[];}case yb(0xb2):{return I=yield this[yb(0x8e)](f,y,a,b),I;}case yb(0x10c):I=(0x0,utils_1[yb(0x147)])(yield this[yb(0xa8)](y,f,b))||undefined;break;case'string':case yb(0x96):case'integer':default:I=yield this['ask'](y,f,b,a);break;}return!_[yb(0x78)](I)&&_[yb(0xfc)](a,G,I),I;});}[a7j(0xa8)](y,f,a,b){var I;return __awaiter(this,void 0x0,void 0x0,function*(){const yI=a7f,G=y[y['length']-0x1],{defaultValue:defaultValue=(I=f===null||f===void 0x0?void 0x0:f[yI(0xeb)])!==null&&I!==void 0x0?I:f===null||f===void 0x0?void 0x0:f[yI(0x134)],choices:choices=f===null||f===void 0x0?void 0x0:f[yI(0xd9)],pagination:T}=yield(0x0,api_helpers_1['fetchResourceList'])(G,this['apiClient'],this['tmpCmdPath'],b,this[yI(0xc7)],y);let u='input';if(!_['isUndefined'](choices)&&choices[yI(0xcc)]>0x0){if(T!==undefined&&T[yI(0x105)]!==undefined)u=yI(0x82);else choices[yI(0xcc)]>0x4&&typeof choices[0x0]==='string'?u=yI(0x130):u=yI(0xb1);}else{if((f===null||f===void 0x0?void 0x0:f[yI(0x74)])===yI(0x96))u=yI(0x146);else{if((f===null||f===void 0x0?void 0x0:f['type'])===yI(0xb8))u=yI(0x84);else(f===null||f===void 0x0?void 0x0:f[yI(0x74)])===yI(0x10c)&&(u=yI(0xd3));}}let t=a!==![]?!_[yI(0xf4)](defaultValue)?defaultValue:JSON[yI(0xec)](defaultValue):_[yI(0x77)](defaultValue)?defaultValue:yI(0xff);if(choices)t=t['toString']();_[yI(0xfb)](this[yI(0xfe)],y[yI(0x11d)]('.'))&&(t=this['resultCache'][y['join']('.')]);const Z=choices&&a===![]?[yI(0xff),...choices]:choices,F=(f===null||f===void 0x0?void 0x0:f[yI(0x74)])==='integer',d=Object[yI(0x125)]({'type':u,'name':'id','message':this[yI(0x8a)](y,f),'choices':Z,'default':t,'filter':this[yI(0xb6)](u,a),'validate':this['validate'](f,a,F)},T),R=(yield inquirer[yI(0x114)]([d]))['id'];if(R===yI(0xff)||R==='')return undefined;if(F)return parseInt(R,0xa);return R;});}[a7j(0x8a)](y,f){const yG=a7j,a=(f===null||f===void 0x0?void 0x0:f[yG(0x74)])!==yG(0x96)?'What\x20do\x20you\x20want\x20to\x20use\x20as':'Should\x20it\x20be';return this['getPathString'](y,a,f===null||f===void 0x0?void 0x0:f['description']);}[a7j(0x9d)](){return __awaiter(this,void 0x0,void 0x0,function*(){const yu=a7f,y=f=>__awaiter(this,void 0x0,void 0x0,function*(){const yT=a7f;var a;const b=yield this[yT(0xd8)][yT(0xb1)][yT(0x144)]({'options':{'per_page':this[yT(0x108)],'cursor':f}}),I=b[yT(0x12a)][yT(0x144)][yT(0x9a)](G=>G['id']);return{'elements':I,'nextCursor':(a=b['pagination'])===null||a===void 0x0?void 0x0:a['cursor']};});return yield this['askForResourcePaginated'](yu(0x8c),y);});}[a7j(0x137)](y,f,a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const yt=a7f,I=a||this[yt(0xd8)]['contextProvider'][yt(0xe8)]();if(_['isUndefined'](I))throw new Error(yt(0x99));const G=yield f(I);return yield this[yt(0x102)](y,G,(b?b+yt(0x7c):'')+yt(0x11c)+I+'\x27');});}[a7j(0xbe)](y,f,a,b){return __awaiter(this,void 0x0,void 0x0,function*(){const yZ=a7f,I=a||this[yZ(0xd8)]['contextProvider'][yZ(0xe8)]();if(_[yZ(0x78)](I))throw new Error(yZ(0x99));const G=yield f(I);return yield this[yZ(0x129)](y,G,(b?b+yZ(0x7c):'')+yZ(0x11c)+I+'\x27');});}[a7j(0x7a)](){return __awaiter(this,void 0x0,void 0x0,function*(){const yF=a7f,y=yield this['apiClient']['list'][yF(0x92)]({}),f=y[yF(0x12a)]['domains'][yF(0x9a)](a=>a[yF(0x14a)]);return this[yF(0x102)](yF(0xa4),f);});}[a7j(0xcb)](){return __awaiter(this,void 0x0,void 0x0,function*(){const yd=a7f,y=yield this[yd(0xd8)][yd(0xb1)]['registries']({}),f=y[yd(0x12a)][yd(0xed)][yd(0x9a)](a=>a['id']);return this[yd(0x102)]('credentials',f);});}['setPathVars'](y){const yR=a7j;this[yR(0xc7)]=y;}}exports[a7j(0x151)]=InquirerHelper;
1
+ 'use strict';const a7U=a7C;(function(n,C){const j=a7C,k=n();while(!![]){try{const H=parseInt(j(0x1f3))/0x1+parseInt(j(0x1fa))/0x2+-parseInt(j(0x274))/0x3*(parseInt(j(0x22e))/0x4)+-parseInt(j(0x212))/0x5*(parseInt(j(0x24e))/0x6)+-parseInt(j(0x20f))/0x7+parseInt(j(0x272))/0x8+parseInt(j(0x202))/0x9*(parseInt(j(0x197))/0xa);if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a7n,0xf0dfe));var __createBinding=this&&this['__createBinding']||(Object[a7U(0x23c)]?function(n,C,H,R){const h=a7U;if(R===undefined)R=H;var W=Object['getOwnPropertyDescriptor'](C,H);(!W||(h(0x23f)in W?!C[h(0x18d)]:W[h(0x1a2)]||W[h(0x20b)]))&&(W={'enumerable':!![],'get':function(){return C[H];}}),Object[h(0x1ba)](n,R,W);}:function(n,C,H,R){if(R===undefined)R=H;n[R]=C[H];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(n,C){const o=a7U;Object[o(0x1ba)](n,o(0x1ec),{'enumerable':!![],'value':C});}:function(n,C){const A=a7U;n[A(0x1ec)]=C;}),__importStar=this&&this[a7U(0x247)]||function(n){const d=a7U;if(n&&n[d(0x18d)])return n;var C={};if(n!=null){for(var H in n)if(H!==d(0x1ec)&&Object[d(0x269)][d(0x203)][d(0x23b)](n,H))__createBinding(C,n,H);}return __setModuleDefault(C,n),C;},__awaiter=this&&this[a7U(0x240)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const m=a7C;function t(y){const Q=a7C;try{M(H[Q(0x20e)](y));}catch(T){i(T);}}function r(y){const l=a7C;try{M(H[l(0x195)](y));}catch(T){i(T);}}function M(y){const K=a7C;y[K(0x243)]?W(y['value']):R(y[K(0x280)])[K(0x234)](t,r);}M((H=H[m(0x261)](n,C||[]))['next']());});},__importDefault=this&&this[a7U(0x1ea)]||function(n){const a=a7U;return n&&n[a(0x18d)]?n:{'default':n};};function a7n(){const nl=['getType','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','description','editor','Choose\x20the\x20','editPayload','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','join','values','chalk','pagination-prompt','askForBuild','this\x20option\x20is\x20required,\x20please\x20answer','for\x20this\x20','askForTemplateRun','subdomains','blue','askGeneric','REPEAT','whiteBright','5260708MgfhpI','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','askForJobRun','slice','Aborted.','\x20type?','then','yml','length','integer','templateRuns','isNaN','keys','call','create','repeat','ABORT','get','__awaiter','includes','confirmation','done','askForLogSink','example','enum','__importStar','filter','lodash','domain','defaultPaginationPageSize','askForSecret','prompt','2898sOOTCR','propToType','credentials','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','askForResourcePaginated','Should\x20it\x20be','pathVars','Choose\x20the\x20login\x20token:','retry','project:\x20\x27','set','safeDump','No\x20','template\x20run','Please\x20confirm\x20following\x20configuration:\x0a','password','\x20characters,\x20is\x20','underline','message','apply','No,\x20abort','getPathString','isArray','job\x20builds','max','isBoolean','trim','prototype','What\x20do\x20you\x20want\x20to\x20use\x20as','job\x20build','validate','toUpperCase','retrievePayloadViaInteractiveCli','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','askForResource','json','8415408WGhisC','.*\x5c.(json|yaml|yml)$','3iHeyBw','job:\x20\x27','./api-helpers','addons','\x20and\x20it\x20','backups','./utils','EDIT','cmdPath','getInnerType','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','value','stringify','No,\x20edit','project','map','__esModule','confirmationPrompt','grey','push','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','contextProvider','domain\x20(','assign','throw','items','10XWtcjd','list','logSinks','unset','maximum','properties','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','test','getCurrentProjectName','askForDomain','maxLength','writable','createdAt','nextPageCursor','search-list','addEntry','service:\x20\x27','volume','askForProjectScopedResource','askForVolume','service','inquirer','Yes,\x20send','tmpCmdPath','Do\x20you\x20want\x20to\x20add','fullName','YES','askForService','runs','Template\x20id\x20not\x20provided.','name','string','writeFileSync','data','startedAt','defineProperty','subdomain','apiClient','nextCursor','askArrayEntry','volumes','getQuestionString','bold','builds','deleteWarningPrompt','split','\x20(startedAt:\x20','opt','override','SAVE','success','isUndefined','tokenPrompt','Something\x20unexpected\x20happened.','don\x27t\x20change','services','minimum','bgGrey','yaml','completedAt','minLength','saveFile','registerPrompt','log\x20sink','\x20(full\x20domain:\x20','rawObject','greenBright','job','inquirer-search-list','a\x20Northflank\x20resource','askForProject','Enter\x20the\x20','Configuration\x20file\x20written\x20to\x20','ask','secret','cursor','templates','warning','to\x20use:','\x20characters','registries','isValidJSON','pop','__importDefault','No,\x20but\x20save\x20as\x20file','default','found','Context\x20name\x20already\x20exists.',',\x20supported\x20types:\x20[json|yaml|yml]','askForAddon','askForJob','domains','1460477dARfoA','main-context','secrets','\x20Example:\x20','isEmpty','pagination','Writing\x20configuration\x20failed:\x20','1061920DpuzDI','type','No,\x20repeat','doesn\x27t\x20match\x20pattern\x20\x27','yellowBright','js-yaml','has','resultCache','11061009IzwkRT','hasOwnProperty','fetchResourceList','template','not\x20completed','jobs','editedResult','safeLoad','oneOf','configurable','green','askForProjectScopedResourcePaginated','next','11423874wCpcJa','toString','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','3505sKsKOD','confirm','boolean','elements','token','input','\x20in\x20','\x20to\x20use:'];a7n=function(){return nl;};return a7n();}Object[a7U(0x1ba)](exports,a7U(0x18d),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a7U(0x249))),chalk_1=__importDefault(require(a7U(0x223))),fs=__importStar(require('fs')),utils_1=require(a7U(0x27a)),api_helpers_1=require(a7U(0x276)),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require(a7U(0x1ac)),inquirerSearchList=require(a7U(0x1db)),yaml=require(a7U(0x1ff));var ConfirmChoices;(function(n){const N=a7U;n['YES']=N(0x1ad),n[N(0x22c)]=N(0x1fc),n[N(0x27b)]=N(0x282),n[N(0x1c8)]=N(0x1eb),n[N(0x23e)]=N(0x262);}(ConfirmChoices||(ConfirmChoices={})));function a7C(n,C){const k=a7n();return a7C=function(H,R){H=H-0x18b;let W=k[H];return W;},a7C(n,C);}class InquirerHelper{constructor(n){const X=a7U;this[X(0x1bc)]=n,this['defaultPaginationPageSize']=0x32,this['editPayload']=C=>__awaiter(this,void 0x0,void 0x0,function*(){const E=X,{editedResult:k}=yield inquirer[E(0x24d)]([{'type':E(0x21d),'name':E(0x208),'message':'Go\x20to\x20editor','default':yaml[E(0x259)](C)}]);return yaml[E(0x209)](k);}),this['saveFile']=C=>__awaiter(this,void 0x0,void 0x0,function*(){const g=X,k=i=>'Unexpected\x20file\x20type:\x20'+i+g(0x1ef);function H(){return __awaiter(this,void 0x0,void 0x0,function*(){const b=a7C;return inquirer[b(0x24d)]([{'type':b(0x217),'name':'fileName','message':b(0x27f),'validate':i=>new RegExp(b(0x273))[b(0x19e)](i)?!![]:k(i)}]);});}const {fileName:R}=yield H(),W=R[g(0x210)]()['split']('.')[g(0x1e9)]();try{switch(W){case g(0x271):(0x0,utils_1[g(0x1c9)])(g(0x1df)+R);return fs['writeFileSync'](R,JSON['stringify'](C,null,'\x20\x20'));case g(0x1d1):case g(0x235):(0x0,utils_1[g(0x1c9)])(g(0x1df)+R);return fs[g(0x1b7)](R,yaml[g(0x259)](C));default:(0x0,utils_1[g(0x1e4)])(k(W));}}catch(i){(0x0,utils_1[g(0x1e4)])(g(0x1f9)+i[g(0x260)]);}return undefined;}),this['filter']=(C,k)=>H=>{const L=X,R=typeof H===L(0x1b6)?H[L(0x268)]():H;return k===![]&&R==='don\x27t\x20change'?'':R;},this['validate']=(C,k,H)=>R=>{const G=X,W=[];if(R===''||R===G(0x1cd)){if(k!==![])W[G(0x190)](G(0x226));else return!![];}C[G(0x1fb)]==='string'&&!_[G(0x1ca)](C['pattern'])&&W['push'](new RegExp(C['pattern'])[G(0x19e)](R)?!![]:G(0x1fd)+C['pattern']+'\x27');C['type']===G(0x1b6)&&!_['isUndefined'](C[G(0x1d3)])&&W[G(0x190)](R[G(0x236)]>=C['minLength']?!![]:G(0x26f)+C[G(0x1d3)]+G(0x25e)+R['length']+G(0x1e6));C['type']===G(0x1b6)&&!_[G(0x1ca)](C[G(0x1a1)])&&W[G(0x190)](R['length']<=C[G(0x1a1)]?!![]:G(0x22f)+C[G(0x1a1)]+G(0x25e)+R[G(0x236)]+G(0x1e6));H&&Number[G(0x239)](parseInt(R,0xa))&&W[G(0x190)]('must\x20be\x20a\x20number,\x20is\x20'+R);C[G(0x1fb)]===G(0x237)&&!_[G(0x1ca)](C[G(0x1cf)])&&W[G(0x190)](R>=C[G(0x1cf)]?!![]:'must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20'+C[G(0x1cf)]);C['type']===G(0x237)&&!_[G(0x1ca)](C[G(0x19b)])&&W[G(0x190)](R<=C[G(0x19b)]?!![]:G(0x211)+C[G(0x19b)]);if(C[G(0x1fb)]==='rawObject'){const r=(0x0,utils_1[G(0x1e8)])(R);W[G(0x190)](r===![]||_[G(0x1f7)](r)?G(0x19d):!![]);}const i=W[G(0x248)](M=>M!==!![]),t=(C===null||C===void 0x0?void 0x0:C[G(0x245)])?'\x0a'+chalk_1['default']['red']('>>')+G(0x1f6)+chalk_1[G(0x1ec)][G(0x22d)](JSON[G(0x281)](C[G(0x245)])):'';return i['length']>0x0?i['join'](chalk_1[G(0x1ec)][G(0x25f)](G(0x278)))+t:!![];},this[X(0x263)]=(C,k,H)=>{const q=X,R=C[C['length']-0x1];function W(){const Z=a7C;return C[Z(0x231)](0x0,-0x1)['map'](r=>r['charAt'](0x0)[Z(0x26d)]()+r[Z(0x231)](0x1))['join']('>');}const i=C[q(0x236)]>0x1?chalk_1[q(0x1ec)][q(0x1d0)][q(0x22d)](W())+':\x20':'',t=H?'\x20('+chalk_1[q(0x1ec)][q(0x22a)](H)+')':'';return chalk_1[q(0x1ec)]['reset'](''+i+k+'\x20'+chalk_1['default'][q(0x1c1)][q(0x1d9)](R)+t+'?');},this[X(0x270)]=(C,k,H)=>__awaiter(this,void 0x0,void 0x0,function*(){const w=X;if(k[w(0x236)]<0x1){const i=H?'for\x20this\x20'+H:w(0x1ed);throw new Error(w(0x25a)+C+'\x20'+i+'.');}const R=w(0x21e)+C+w(0x219),W=k[w(0x236)]>0x4?w(0x1a5):w(0x198);return(yield inquirer[w(0x24d)]([{'type':W,'name':'name','message':R,'choices':k}]))[w(0x1b5)];}),this[X(0x252)]=(C,k,H)=>__awaiter(this,void 0x0,void 0x0,function*(){const O=X,{elements:R,nextCursor:W}=yield k();if(R[O(0x236)]<0x1){const r=H?O(0x227)+H:O(0x1ed);throw new Error(O(0x25a)+C+'\x20'+r+'.');}const i=O(0x21e)+C+O(0x219);if(W!==undefined){const M=({nextPageCursor:y})=>__awaiter(this,void 0x0,void 0x0,function*(){const F=O,T=yield k(y);return{'elements':T[F(0x215)],'nextPageCursor':T[F(0x1bd)]};});return(yield inquirer[O(0x24d)]([{'type':'pagination-prompt','name':O(0x1b5),'message':i,'choices':R,'nextPageCursor':W,'loadMore':M}]))['name'];}const t=R[O(0x236)]>0x4?O(0x1a5):O(0x198);return(yield inquirer['prompt']([{'type':t,'name':'name','message':i,'choices':R}]))['name'];}),this[X(0x22b)]=(C,k)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=X,H=''+(k?'('+chalk_1[D(0x1ec)][D(0x22a)](k)+')\x20':''),R=D(0x1de)+chalk_1['default'][D(0x20c)](C)+'\x20'+H+D(0x1e5),W=this[D(0x26c)]({'type':'string','required':!![]});return(yield inquirer[D(0x24d)]([{'type':'input','name':'name','message':R,'validate':W}]))[D(0x1b5)];}),this['askConfirm']=C=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=X;return(yield inquirer[Y(0x24d)]([{'type':Y(0x213),'name':Y(0x1b5),'message':C,'default':!![]}]))[Y(0x1b5)];}),this[X(0x1b2)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const x=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const S=a7C;var W;const i=yield this['apiClient'][S(0x198)][S(0x1ce)]({'parameters':{'projectId':H},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':R}}),t=i[S(0x1b8)][S(0x1ce)][S(0x18c)](r=>r['id']);return{'elements':t,'nextCursor':(W=i[S(0x1f8)])===null||W===void 0x0?void 0x0:W[S(0x1e2)]};});return this[x(0x20d)](x(0x1ab),k,C);}),this['askForTemplate']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const z=X,C=k=>__awaiter(this,void 0x0,void 0x0,function*(){const J=a7C;var H;const R=yield this[J(0x1bc)][J(0x198)][J(0x1e3)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':k}}),W=R['data'][J(0x1e3)][J(0x18c)](i=>i['id']);return{'elements':W,'nextCursor':(H=R[J(0x1f8)])===null||H===void 0x0?void 0x0:H[J(0x1e2)]};});return this['askForResourcePaginated'](z(0x205),C);}),this[X(0x228)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=X;if(_[u(0x1ca)](C))throw new Error(u(0x1b4));const k=H=>__awaiter(this,void 0x0,void 0x0,function*(){const f=u;var R;let W=this[f(0x24b)];const i=yield this[f(0x1bc)][f(0x198)][f(0x238)]({'parameters':{'templateId':C},'options':{'per_page':W,'cursor':H}}),t=i[f(0x1b8)][f(0x238)][f(0x18c)](r=>r['id']+f(0x1c5)+r[f(0x1a3)]+')');return{'elements':t,'nextCursor':(R=i[f(0x1f8)])===null||R===void 0x0?void 0x0:R[f(0x1e2)]};});return this[u(0x252)](u(0x25b),k)[u(0x234)](H=>H[u(0x1c4)]('\x20')[0x0]);}),this[X(0x244)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const e=X,C=k=>__awaiter(this,void 0x0,void 0x0,function*(){const B=a7C;var H;let R=this[B(0x24b)];const W=yield this['apiClient'][B(0x198)][B(0x199)]({'options':{'per_page':R,'cursor':k}}),i=W[B(0x1b8)]['logSinks']['map'](t=>t['id']);return{'elements':i,'nextCursor':(H=W[B(0x1f8)])===null||H===void 0x0?void 0x0:H['cursor']};});return this['askForResourcePaginated'](e(0x1d6),C);}),this[X(0x1f1)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const v=a7C;var W;const i=yield this['apiClient'][v(0x198)][v(0x207)]({'parameters':{'projectId':H},'options':{'per_page':this[v(0x24b)],'cursor':R}}),t=i[v(0x1b8)]['jobs'][v(0x18c)](r=>r['id']);return{'elements':t,'nextCursor':(W=i[v(0x1f8)])===null||W===void 0x0?void 0x0:W[v(0x1e2)]};});return this['askForProjectScopedResourcePaginated'](P(0x1da),k,C);}),this[X(0x230)]=(C,k)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const s=X,H=R=>W=>__awaiter(this,void 0x0,void 0x0,function*(){const I=a7C;var i;const t=yield this[I(0x1bc)]['get'][I(0x1da)][I(0x1b3)]({'parameters':{'projectId':R,'jobId':C},'options':{'per_page':this[I(0x24b)],'cursor':W}}),r=t['data']['runs'][I(0x18c)](M=>M['id']+I(0x1c5)+M[I(0x1b9)]+')');return{'elements':r,'nextCursor':(i=t[I(0x1f8)])===null||i===void 0x0?void 0x0:i[I(0x1e2)]};});return this['askForProjectScopedResourcePaginated']('job\x20runs',H,k,s(0x275)+C+'\x27')[s(0x234)](R=>R[s(0x1c4)]('\x20')[0x0]);}),this[X(0x225)]=(C,k,H)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n0=X;if(H!==undefined){const R=W=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const p=a7C;var t;const r=yield this[p(0x1bc)][p(0x23f)][p(0x1da)][p(0x1c2)]({'parameters':{'projectId':W,'jobId':H},'options':{'per_page':this[p(0x24b)],'cursor':i}});return{'elements':r['data']['builds'][p(0x18c)](M=>M['id']+p(0x1c5)+M['createdAt']+')'),'nextCursor':(t=r[p(0x1f8)])===null||t===void 0x0?void 0x0:t[p(0x1e2)]};});return this['askForProjectScopedResourcePaginated'](n0(0x265),R,C,n0(0x275)+H+'\x27')['then'](W=>W['split']('\x20')[0x0]);}if(k!==undefined){const W=i=>t=>__awaiter(this,void 0x0,void 0x0,function*(){const n1=n0;var r;const M=yield this[n1(0x1bc)][n1(0x23f)][n1(0x1ab)]['builds']({'parameters':{'projectId':i,'serviceId':k},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':t}});return{'elements':M['data']['builds'][n1(0x18c)](y=>y['id']+n1(0x1c5)+y['createdAt']+')'),'nextCursor':(r=M[n1(0x1f8)])===null||r===void 0x0?void 0x0:r[n1(0x1e2)]};});return this[n0(0x20d)](n0(0x26b),W,C,n0(0x1a7)+H+'\x27')[n0(0x234)](i=>i[n0(0x1c4)]('\x20')[0x0]);}throw new Error('No\x20builds\x20found');}),this[X(0x1f0)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n3=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const n2=a7C;var W;const i=yield this[n2(0x1bc)][n2(0x198)]['addons']({'parameters':{'projectId':H},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':R}});return{'elements':i['data'][n2(0x277)][n2(0x18c)](t=>t['id']),'nextCursor':(W=i[n2(0x1f8)])===null||W===void 0x0?void 0x0:W['cursor']};});return this[n3(0x20d)]('addon',k,C);}),this['askForAddonBackup']=(C,k)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n5=X,H=R=>W=>__awaiter(this,void 0x0,void 0x0,function*(){const n4=a7C;var i;const t=yield this['apiClient']['get']['addon'][n4(0x279)]({'parameters':{'projectId':R,'addonId':k},'options':{'per_page':this[n4(0x24b)],'cursor':W}});return{'elements':t['data'][n4(0x279)][n4(0x18c)](r=>r['id']+'\x20(completedAt:\x20'+(r[n4(0x1d2)]||n4(0x206))+')'),'nextCursor':(i=t[n4(0x1f8)])===null||i===void 0x0?void 0x0:i[n4(0x1e2)]};});return this[n5(0x20d)](n5(0x279),H,C,'addon:\x20\x27'+k+'\x27')[n5(0x234)](R=>R[n5(0x1c4)]('\x20')[0x0]);}),this[X(0x1aa)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n7=X,k=H=>__awaiter(this,void 0x0,void 0x0,function*(){const n6=a7C;return(yield this[n6(0x1bc)][n6(0x198)][n6(0x1bf)]({'parameters':{'projectId':H}}))[n6(0x1b8)][n6(0x18c)](R=>R['id']);});return this[n7(0x1a9)](n7(0x1a8),k,C);}),this[X(0x24c)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n9=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const n8=a7C;var W;const i=yield this[n8(0x1bc)][n8(0x198)]['secrets']({'parameters':{'projectId':H},'options':{'per_page':this[n8(0x24b)],'cursor':R}});return{'elements':i[n8(0x1b8)][n8(0x1f5)][n8(0x18c)](t=>t['id']),'nextCursor':(W=i[n8(0x1f8)])===null||W===void 0x0?void 0x0:W['cursor']};});return this[n9(0x20d)](n9(0x1e1),k,C);}),this['askForSubdomain']=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const nn=X,k=yield this[nn(0x1bc)]['get'][nn(0x24a)]({'parameters':{'domain':C}}),H=k[nn(0x1b8)][nn(0x229)][nn(0x18c)](W=>W[nn(0x1b5)]+nn(0x1d7)+W[nn(0x1b0)]+')'),R=nn(0x193)+C+')';return this['askForResource'](nn(0x1bb),H,R)['then'](W=>W['split']('\x20')[0x0]);}),this[X(0x1c3)]=C=>__awaiter(this,void 0x0,void 0x0,function*(){const nC=X;return(yield inquirer['prompt']([{'type':nC(0x213),'name':nC(0x242),'message':chalk_1[nC(0x1ec)][nC(0x1fe)](nC(0x251)+(C||nC(0x1dc))+nC(0x27e)),'default':![]}]))[nC(0x242)];}),this['loginPrompt']=(C,k)=>__awaiter(this,void 0x0,void 0x0,function*(){const nk=X;_[nk(0x1ca)](C['name'])&&(k['length']<=0x0?_[nk(0x258)](C,nk(0x1b5),nk(0x1ec)):yield(0x0,utils_1[nk(0x256)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const nH=nk,{name:H}=yield inquirer['prompt']([{'type':nH(0x217),'name':nH(0x1b5),'message':nH(0x21b),'default':nH(0x1f4)}]);if(!C[nH(0x1c7)]&&k['find'](R=>R[nH(0x1b5)]===H)){const {c:R}=yield inquirer[nH(0x24d)]([{'type':nH(0x213),'name':'c','message':'Context\x20with\x20name\x20\x27'+H+nH(0x220),'default':![]}]);if(R===![])throw new Error(nH(0x1ee));_[nH(0x258)](C,'override',!![]);}_[nH(0x258)](C,nH(0x1b5),H);})));if(_[nk(0x1ca)](C['token'])){const H=yield this[nk(0x1cb)]();_[nk(0x258)](C,nk(0x216),H);}return C;}),this[X(0x1cb)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const nR=X,{token:C}=yield inquirer['prompt']([{'type':nR(0x25d),'name':nR(0x216),'mask':'*','message':nR(0x255)}]);return C;}),inquirer[X(0x1d5)]('search-list',inquirerSearchList),inquirer['registerPrompt'](X(0x224),inquirer_pagination_prompt_1['DynamicReloadPaginationPrompt']);}['confirmationPrompt'](n,C){return __awaiter(this,void 0x0,void 0x0,function*(){const nW=a7C,k=yaml[nW(0x259)](n),H=_[nW(0x266)](k[nW(0x1c4)]('\x0a')[nW(0x18c)](i=>i[nW(0x236)])),R=chalk_1[nW(0x1ec)][nW(0x18f)]('-'[nW(0x23d)](H)+'\x0a'),{confirm:W}=yield inquirer['prompt']([{'type':'list','name':nW(0x213),'message':''+chalk_1[nW(0x1ec)][nW(0x1c1)][nW(0x20c)](nW(0x25c))+R+chalk_1[nW(0x1ec)]['blueBright'](k)+R,'choices':Object[nW(0x222)](ConfirmChoices)}]);switch(W){case ConfirmChoices[nW(0x1b1)]:return n;case ConfirmChoices[nW(0x23e)]:throw new Error(nW(0x232));case ConfirmChoices[nW(0x22c)]:return this[nW(0x26e)](C);case ConfirmChoices[nW(0x27b)]:return this[nW(0x18e)](yield this[nW(0x21f)](n),C);case ConfirmChoices[nW(0x1c8)]:yield this[nW(0x1d4)](n);return this[nW(0x18e)](n,C);default:throw new Error(nW(0x1cc));}});}[a7U(0x26e)](n,C){return __awaiter(this,void 0x0,void 0x0,function*(){const ni=a7C;if((C===null||C===void 0x0?void 0x0:C[ni(0x201)])!==undefined)this['resultCache']=C===null||C===void 0x0?void 0x0:C['resultCache'];this[ni(0x1ae)]=C===null||C===void 0x0?void 0x0:C[ni(0x27c)];const k={};return yield this[ni(0x24f)]([],n[ni(0x1c6)]['body'],k),this[ni(0x201)]=k,yield this[ni(0x18e)](k,n);});}[a7U(0x24f)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const nt=a7C;let R;if(C[nt(0x20a)]&&!_[nt(0x200)](C,nt(0x19c))){if(C['oneOf']['length']>0x1){const {choice:W}=yield inquirer[nt(0x24d)]([{'type':nt(0x198),'name':'choice','message':'What\x27s\x20the\x20'+(n[n[nt(0x236)]-0x1]||'')+nt(0x233),'choices':C['oneOf'][nt(0x18c)](i=>{var t;return(t=i['description'])!==null&&t!==void 0x0?t:'??';})}]);R=yield this[nt(0x21a)](n,C[nt(0x20a)]['find'](i=>i[nt(0x21c)]===W),k,H);}else{const i=C[nt(0x20a)][0x0];_['set'](i,'description',C[nt(0x21c)]),R=yield this[nt(0x21a)](n,i,k,H);}R={};}else R=yield this['getType'](n,C,k,H);return R;});}[a7U(0x27d)](n,C,k,H){var R;return __awaiter(this,void 0x0,void 0x0,function*(){const nr=a7C;if(H===![]){const {addEntry:t}=yield inquirer['prompt']([{'type':nr(0x213),'name':nr(0x1a6),'message':this[nr(0x263)](C,nr(0x1af),n===null||n===void 0x0?void 0x0:n['description']),'default':![]}]);if(!t)return k;}const W=Object[nr(0x23a)]((R=n===null||n===void 0x0?void 0x0:n[nr(0x19c)])!==null&&R!==void 0x0?R:[]),i=n['required']||[];if(W['length']>0x0)for(const r of W){const M=C['concat'](r);if(C['length']>0x0&&!_['has'](k,C[nr(0x221)]('.')))_[nr(0x258)](k,C['join']('.'),{});yield this[nr(0x24f)](M,n[nr(0x19c)][r],k,i[nr(0x241)](r));}else yield this['getType'](C,Object[nr(0x194)](Object[nr(0x194)]({},n),{'type':'rawObject'}),k,H);return k;});}[a7U(0x1be)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const nM=a7C;if(C&&k)return!![];const R=C?nM(0x1af):'Do\x20you\x20want\x20to\x20add\x20more',{addEntry:W}=yield inquirer[nM(0x24d)]([{'type':nM(0x213),'name':'addEntry','message':this[nM(0x263)](n,R,C?H:undefined),'default':![]}]);return W;});}['getType'](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const ny=a7C;let R;const W=n['join']('.');switch(C===null||C===void 0x0?void 0x0:C[ny(0x1fb)]){case'array':{let i=!![];while(yield this[ny(0x1be)](n,i,H,C===null||C===void 0x0?void 0x0:C[ny(0x21c)])){const t=_['get'](k,W);_[ny(0x19a)](k,W),yield this['getType'](n,C[ny(0x196)],k);const r=_[ny(0x23f)](k,W);!_[ny(0x264)](t)?_['set'](k,W,[r]):(t[ny(0x190)](r),_[ny(0x258)](k,W,t)),i=![];}return R||[];}case'object':{return R=yield this[ny(0x27d)](C,n,k,H),R;}case ny(0x1d8):R=(0x0,utils_1[ny(0x1e8)])(yield this['ask'](n,C,H))||undefined;break;case ny(0x1b6):case ny(0x214):case'integer':default:R=yield this['ask'](n,C,H,k);break;}return!_[ny(0x1ca)](R)&&_[ny(0x258)](k,W,R),R;});}[a7U(0x1e0)](n,C,k,H){var R;return __awaiter(this,void 0x0,void 0x0,function*(){const nT=a7C,W=n[n[nT(0x236)]-0x1],{defaultValue:defaultValue=(R=C===null||C===void 0x0?void 0x0:C[nT(0x245)])!==null&&R!==void 0x0?R:C===null||C===void 0x0?void 0x0:C[nT(0x1ec)],choices:choices=C===null||C===void 0x0?void 0x0:C[nT(0x246)],pagination:i}=yield(0x0,api_helpers_1[nT(0x204)])(W,this['apiClient'],this[nT(0x1ae)],H,this['pathVars'],n);let t=nT(0x217);if(!_[nT(0x1ca)](choices)&&choices['length']>0x0){if(i!==undefined&&i[nT(0x1a4)]!==undefined)t=nT(0x224);else choices[nT(0x236)]>0x4&&typeof choices[0x0]===nT(0x1b6)?t=nT(0x1a5):t=nT(0x198);}else{if((C===null||C===void 0x0?void 0x0:C[nT(0x1fb)])===nT(0x214))t=nT(0x213);else{if((C===null||C===void 0x0?void 0x0:C[nT(0x1fb)])==='integer')t=nT(0x217);else(C===null||C===void 0x0?void 0x0:C[nT(0x1fb)])===nT(0x1d8)&&(t=nT(0x21d));}}let r=k!==![]?!_['isObject'](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[nT(0x267)](defaultValue)?defaultValue:nT(0x1cd);if(choices)r=r['toString']();_[nT(0x200)](this['resultCache'],n['join']('.'))&&(r=this[nT(0x201)][n[nT(0x221)]('.')]);const M=choices&&k===![]?[nT(0x1cd),...choices]:choices,y=(C===null||C===void 0x0?void 0x0:C['type'])==='integer',T=Object['assign']({'type':t,'name':'id','message':this[nT(0x1c0)](n,C),'choices':M,'default':r,'filter':this[nT(0x248)](t,k),'validate':this['validate'](C,k,y)},i),V=(yield inquirer[nT(0x24d)]([T]))['id'];if(V===nT(0x1cd)||V==='')return undefined;if(y)return parseInt(V,0xa);return V;});}[a7U(0x1c0)](n,C){const nV=a7U,k=(C===null||C===void 0x0?void 0x0:C[nV(0x1fb)])!==nV(0x214)?nV(0x26a):nV(0x253);return this[nV(0x263)](n,k,C===null||C===void 0x0?void 0x0:C[nV(0x21c)]);}[a7U(0x1dd)](){return __awaiter(this,void 0x0,void 0x0,function*(){const nU=a7C,n=C=>__awaiter(this,void 0x0,void 0x0,function*(){const nj=a7C;var k;const H=yield this[nj(0x1bc)][nj(0x198)]['projects']({'options':{'per_page':this[nj(0x24b)],'cursor':C}}),R=H['data']['projects'][nj(0x18c)](W=>W['id']);return{'elements':R,'nextCursor':(k=H[nj(0x1f8)])===null||k===void 0x0?void 0x0:k[nj(0x1e2)]};});return yield this[nU(0x252)](nU(0x18b),n);});}[a7U(0x1a9)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const nh=a7C,R=k||this[nh(0x1bc)][nh(0x192)][nh(0x19f)]();if(_['isUndefined'](R))throw new Error(nh(0x191));const W=yield C(R);return yield this[nh(0x270)](n,W,(H?H+nh(0x218):'')+nh(0x257)+R+'\x27');});}[a7U(0x20d)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const no=a7C,R=k||this[no(0x1bc)]['contextProvider'][no(0x19f)]();if(_[no(0x1ca)](R))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const W=yield C(R);return yield this[no(0x252)](n,W,(H?H+'\x20in\x20':'')+'project:\x20\x27'+R+'\x27');});}[a7U(0x1a0)](){return __awaiter(this,void 0x0,void 0x0,function*(){const nA=a7C,n=yield this[nA(0x1bc)][nA(0x198)][nA(0x1f2)]({}),C=n[nA(0x1b8)][nA(0x1f2)][nA(0x18c)](k=>k[nA(0x1b5)]);return this[nA(0x270)](nA(0x24a),C);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const nd=a7C,n=yield this[nd(0x1bc)][nd(0x198)][nd(0x1e7)]({}),C=n['data'][nd(0x250)][nd(0x18c)](k=>k['id']);return this[nd(0x270)](nd(0x250),C);});}['setPathVars'](n){const nQ=a7U;this[nQ(0x254)]=n;}}exports['InquirerHelper']=InquirerHelper;
@@ -1 +1 @@
1
- 'use strict';function a8y(){const x=['1155128pSRSns','45GjCsrd','removeListener','getOwnPropertyDescriptor','status','__importDefault','Failure\x20during\x20login:\x20','browser-opened','8hcFKkR','success','Unexpected\x20response','baseUrl','done','78430AHJbVI','defineProperty','__setModuleDefault','login-success','__esModule','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','1317uWLHxO','throw','initPackage','init-ack','prototype','replace','1007470SeLDxt','init','EventEmitter','type','stringify','get','113940spmIKS','__importStar','ws:','error','data','NorthflankApiBrowserLogin','message','create','Unable\x20to\x20open\x20browser:\x20','Unexpected\x20response,\x20api\x20token\x20missing','duplex','__awaiter','open','hasOwnProperty','parse','end','33offOsI','next','writable','SIGINT','208PIdVih','write','8617FHRCjp','unable\x20to\x20parse\x20message:\x20','/v1/cli-login','createWebSocketStream','emit','openBrowser','events','http:','finally','default','421178wtdHuL','toString','idle','https:','aborted','2082SuurJV','handleError','__createBinding'];a8y=function(){return x;};return a8y();}const a8H=a8f;(function(y,f){const l=a8f,a=y();while(!![]){try{const b=-parseInt(l(0x150))/0x1+parseInt(l(0x144))/0x2*(-parseInt(l(0x16b))/0x3)+-parseInt(l(0x160))/0x4*(parseInt(l(0x165))/0x5)+-parseInt(l(0x155))/0x6*(-parseInt(l(0x146))/0x7)+-parseInt(l(0x158))/0x8+parseInt(l(0x159))/0x9*(parseInt(l(0x12a))/0xa)+-parseInt(l(0x140))/0xb*(parseInt(l(0x130))/0xc);if(b===f)break;else a['push'](a['shift']());}catch(I){a['push'](a['shift']());}}}(a8y,0x3f6e2));var __createBinding=this&&this[a8H(0x157)]||(Object[a8H(0x137)]?function(y,f,a,b){const v=a8H;if(b===undefined)b=a;var I=Object[v(0x15b)](f,a);(!I||(v(0x12f)in I?!f[v(0x169)]:I[v(0x142)]||I['configurable']))&&(I={'enumerable':!![],'get':function(){return f[a];}}),Object['defineProperty'](y,b,I);}:function(y,f,a,b){if(b===undefined)b=a;y[b]=f[a];}),__setModuleDefault=this&&this[a8H(0x167)]||(Object['create']?function(y,f){const P=a8H;Object[P(0x166)](y,P(0x14f),{'enumerable':!![],'value':f});}:function(y,f){y['default']=f;}),__importStar=this&&this[a8H(0x131)]||function(y){const q=a8H;if(y&&y[q(0x169)])return y;var f={};if(y!=null){for(var a in y)if(a!=='default'&&Object[q(0x16f)][q(0x13d)]['call'](y,a))__createBinding(f,y,a);}return __setModuleDefault(f,y),f;},__awaiter=this&&this[a8H(0x13b)]||function(y,f,a,b){function I(G){return G instanceof a?G:new a(function(T){T(G);});}return new(a||(a=Promise))(function(G,T){const V=a8f;function u(F){const p=a8f;try{Z(b[p(0x141)](F));}catch(d){T(d);}}function t(F){const Y=a8f;try{Z(b[Y(0x16c)](F));}catch(d){T(d);}}function Z(F){const A=a8f;F[A(0x164)]?G(F['value']):I(F['value'])['then'](u,t);}Z((b=b['apply'](y,f||[]))[V(0x141)]());});},__importDefault=this&&this[a8H(0x15d)]||function(y){const B=a8H;return y&&y[B(0x169)]?y:{'default':y};};function a8f(y,f){const a=a8y();return a8f=function(b,I){b=b-0x129;let G=a[b];return G;},a8f(y,f);}Object[a8H(0x166)](exports,a8H(0x169),{'value':!![]}),exports[a8H(0x135)]=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a8H(0x13c))),events_1=require(a8H(0x14c));class NorthflankApiBrowserLogin extends events_1[a8H(0x12c)]{constructor(y,f=!![]){const S=a8H;super(),this[S(0x163)]=y,this[S(0x14b)]=f,this['status']=S(0x152),this[S(0x16d)]=()=>JSON[S(0x12e)]({'type':S(0x12b)});}['startLogin'](){const n=a8H;var y;const f=this[n(0x163)][n(0x129)](n(0x153),'wss:')[n(0x129)](n(0x14d),n(0x132)),a=f+n(0x148),b=new ws_1['default'](a),I=()=>__awaiter(this,void 0x0,void 0x0,function*(){yield new Promise(T=>{const e=a8f;var u;(u=this[e(0x13a)])===null||u===void 0x0?void 0x0:u[e(0x13f)](JSON['stringify']({'type':e(0x154)}),()=>T());}),process['exit']();}),G=new Promise((T,u)=>{const J=n;var t,Z,F;try{this[J(0x13a)]=(0x0,ws_1[J(0x149)])(b),process['on'](J(0x143),I);}catch(d){u(new Error(J(0x16a)+d[J(0x136)]));}(t=this[J(0x13a)])===null||t===void 0x0?void 0x0:t['on'](J(0x134),R=>{const X=J;var s;const j=JSON[X(0x13e)](R[X(0x151)]());switch(j===null||j===void 0x0?void 0x0:j[X(0x12d)]){case X(0x16e):{const {loginPage:U}=j;if(U===undefined){this[X(0x156)](X(0x162),u);return;}this['openBrowser']&&(0x0,open_1[X(0x14f)])(U)['catch'](g=>{const M=X,o=M(0x138)+g[M(0x136)];this[M(0x156)](o,u);});this[X(0x14a)](X(0x15f),{'url':U});break;}case X(0x168):{const {apiToken:g,contextName:o}=j;if(g===undefined){this[X(0x156)](X(0x139),u);return;}(s=this[X(0x13a)])===null||s===void 0x0?void 0x0:s[X(0x13f)](),T({'token':g,'contextName':o}),this[X(0x15c)]=X(0x161);break;}case'login-failure':{const r=X(0x15e)+(j===null||j===void 0x0?void 0x0:j['message']);this[X(0x156)](r,u);break;}default:{const i=X(0x147)+JSON['stringify'](j);this[X(0x156)](i,u);}}}),(Z=this[J(0x13a)])===null||Z===void 0x0?void 0x0:Z['on'](J(0x133),R=>{const c=J;this[c(0x156)]('error\x20happened\x20during\x20browser\x20login:\x20'+R[c(0x136)],u);}),(F=this['duplex'])===null||F===void 0x0?void 0x0:F['on'](J(0x13f),()=>{const C=J;if(this[C(0x15c)]===C(0x161)){}else this['handleError']('Login\x20process\x20stopped\x20before\x20completed',u);});});return(y=this[n(0x13a)])===null||y===void 0x0?void 0x0:y[n(0x145)](this[n(0x16d)]()),this[n(0x15c)]='init',G[n(0x14e)](()=>{const N=n;process[N(0x15a)]('SIGINT',I);});}[a8H(0x156)](y,f){const K=a8H;var a,b;f?(a=this[K(0x13a)])===null||a===void 0x0?void 0x0:a[K(0x13f)](()=>f(new Error(y))):(b=this[K(0x13a)])===null||b===void 0x0?void 0x0:b['end'](),this[K(0x15c)]=K(0x133);}}exports[a8H(0x135)]=NorthflankApiBrowserLogin;
1
+ 'use strict';const a8K=a8C;function a8C(n,C){const k=a8n();return a8C=function(H,R){H=H-0x117;let W=k[H];return W;},a8C(n,C);}(function(n,C){const l=a8C,k=n();while(!![]){try{const H=parseInt(l(0x13c))/0x1+-parseInt(l(0x149))/0x2+parseInt(l(0x11d))/0x3+-parseInt(l(0x14c))/0x4+parseInt(l(0x13e))/0x5*(-parseInt(l(0x14d))/0x6)+-parseInt(l(0x14e))/0x7*(parseInt(l(0x118))/0x8)+parseInt(l(0x152))/0x9;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a8n,0x9da44));var __createBinding=this&&this[a8K(0x156)]||(Object[a8K(0x157)]?function(n,C,H,R){const m=a8K;if(R===undefined)R=H;var W=Object[m(0x155)](C,H);(!W||('get'in W?!C[m(0x150)]:W[m(0x11b)]||W[m(0x13a)]))&&(W={'enumerable':!![],'get':function(){return C[H];}}),Object[m(0x123)](n,R,W);}:function(n,C,H,R){if(R===undefined)R=H;n[R]=C[H];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(n,C){const a=a8K;Object[a(0x123)](n,a(0x148),{'enumerable':!![],'value':C});}:function(n,C){const N=a8K;n[N(0x148)]=C;}),__importStar=this&&this[a8K(0x12b)]||function(n){const X=a8K;if(n&&n[X(0x150)])return n;var C={};if(n!=null){for(var H in n)if(H!==X(0x148)&&Object[X(0x124)]['hasOwnProperty'][X(0x12d)](n,H))__createBinding(C,n,H);}return __setModuleDefault(C,n),C;},__awaiter=this&&this[a8K(0x143)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const c=a8C;function t(y){const E=a8C;try{M(H[E(0x128)](y));}catch(T){i(T);}}function r(y){try{M(H['throw'](y));}catch(T){i(T);}}function M(y){const g=a8C;y[g(0x153)]?W(y[g(0x154)]):R(y[g(0x154)])['then'](t,r);}M((H=H[c(0x138)](n,C||[]))['next']());});},__importDefault=this&&this[a8K(0x139)]||function(n){return n&&n['__esModule']?n:{'default':n};};function a8n(){const S=['Failure\x20during\x20login:\x20','init','apply','__importDefault','configurable','finally','94487nmzRYe','unable\x20to\x20parse\x20message:\x20','820sQEUtl','open','data','end','stringify','__awaiter','login-success','catch','initPackage','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','default','290458yaqKBt','message','wss:','580420DxYNAL','27942mQlOHo','35xXKWue','SIGINT','__esModule','EventEmitter','18091989daukHk','done','value','getOwnPropertyDescriptor','__createBinding','create','init-ack','1978696UjpTPb','baseUrl','status','writable','aborted','2495277uAsIse','replace','Unable\x20to\x20open\x20browser:\x20','http:','NorthflankApiBrowserLogin','handleError','defineProperty','prototype','success','error','openBrowser','next','/v1/cli-login','idle','__importStar','type','call','Unexpected\x20response','startLogin','duplex','emit','removeListener','createWebSocketStream','error\x20happened\x20during\x20browser\x20login:\x20','ws:'];a8n=function(){return S;};return a8n();}Object[a8K(0x123)](exports,'__esModule',{'value':!![]}),exports[a8K(0x121)]=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a8K(0x13f))),events_1=require('events');class NorthflankApiBrowserLogin extends events_1[a8K(0x151)]{constructor(n,C=!![]){const b=a8K;super(),this[b(0x119)]=n,this[b(0x127)]=C,this[b(0x11a)]=b(0x12a),this[b(0x146)]=()=>JSON[b(0x142)]({'type':b(0x137)});}[a8K(0x12f)](){const L=a8K;var n;const C=this[L(0x119)][L(0x11e)]('https:',L(0x14b))[L(0x11e)](L(0x120),L(0x135)),k=C+L(0x129),H=new ws_1['default'](k),R=()=>__awaiter(this,void 0x0,void 0x0,function*(){yield new Promise(i=>{const G=a8C;var t;(t=this[G(0x130)])===null||t===void 0x0?void 0x0:t[G(0x141)](JSON[G(0x142)]({'type':G(0x11c)}),()=>i());}),process['exit']();}),W=new Promise((i,t)=>{const Z=L;var r,M,y;try{this[Z(0x130)]=(0x0,ws_1[Z(0x133)])(H),process['on'](Z(0x14f),R);}catch(T){t(new Error(Z(0x147)+T[Z(0x14a)]));}(r=this[Z(0x130)])===null||r===void 0x0?void 0x0:r['on'](Z(0x140),V=>{const q=Z;var j;const U=JSON['parse'](V['toString']());switch(U===null||U===void 0x0?void 0x0:U[q(0x12c)]){case q(0x117):{const {loginPage:h}=U;if(h===undefined){this['handleError'](q(0x12e),t);return;}this[q(0x127)]&&(0x0,open_1[q(0x148)])(h)[q(0x145)](o=>{const w=q,A=w(0x11f)+o['message'];this[w(0x122)](A,t);});this[q(0x131)]('browser-opened',{'url':h});break;}case q(0x144):{const {apiToken:o,contextName:A}=U;if(o===undefined){this[q(0x122)]('Unexpected\x20response,\x20api\x20token\x20missing',t);return;}(j=this['duplex'])===null||j===void 0x0?void 0x0:j[q(0x141)](),i({'token':o,'contextName':A}),this[q(0x11a)]='success';break;}case'login-failure':{const d=q(0x136)+(U===null||U===void 0x0?void 0x0:U['message']);this[q(0x122)](d,t);break;}default:{const Q=q(0x13d)+JSON['stringify'](U);this[q(0x122)](Q,t);}}}),(M=this[Z(0x130)])===null||M===void 0x0?void 0x0:M['on']('error',V=>{const O=Z;this[O(0x122)](O(0x134)+V[O(0x14a)],t);}),(y=this['duplex'])===null||y===void 0x0?void 0x0:y['on'](Z(0x141),()=>{const F=Z;if(this[F(0x11a)]===F(0x125)){}else this[F(0x122)]('Login\x20process\x20stopped\x20before\x20completed',t);});});return(n=this[L(0x130)])===null||n===void 0x0?void 0x0:n['write'](this['initPackage']()),this[L(0x11a)]=L(0x137),W[L(0x13b)](()=>{const D=L;process[D(0x132)](D(0x14f),R);});}[a8K(0x122)](n,C){const Y=a8K;var k,H;C?(k=this['duplex'])===null||k===void 0x0?void 0x0:k['end'](()=>C(new Error(n))):(H=this[Y(0x130)])===null||H===void 0x0?void 0x0:H[Y(0x141)](),this[Y(0x11a)]=Y(0x126);}}exports[a8K(0x121)]=NorthflankApiBrowserLogin;
@@ -1 +1 @@
1
- 'use strict';const a9g=a9f;function a9y(){const P=['opt','loop','down','choices','name','8wCVpbW','onDownKey','push','4RAWgrT','chalk','6486WADqWN','57515821tceVVS','3545301ZYeKDq','default','9VobqzF','realLength','reloadText','nextPageCursor','length','__importDefault','..\x20Load\x20more\x20options\x20..','6923orCFLE','next','dir\x20must\x20be\x20up\x20or\x20down','defineProperty','loading','1467210aUsYBN','loadMore','__esModule','111702ioHknw','render','DynamicReloadPaginationPrompt','pagOpt','5823730EQuyIs','selected','handleDynamicPageLoad','value','\x20Loading\x20more\x20options','8009376cZUBdS'];a9y=function(){return P;};return a9y();}(function(y,f){const R=a9f,a=y();while(!![]){try{const b=-parseInt(R(0x1d6))/0x1*(parseInt(R(0x1e5))/0x2)+-parseInt(R(0x1c5))/0x3*(parseInt(R(0x1c1))/0x4)+-parseInt(R(0x1d3))/0x5+-parseInt(R(0x1c3))/0x6*(parseInt(R(0x1ce))/0x7)+-parseInt(R(0x1df))/0x8+-parseInt(R(0x1c7))/0x9*(parseInt(R(0x1da))/0xa)+parseInt(R(0x1c4))/0xb;if(b===f)break;else a['push'](a['shift']());}catch(I){a['push'](a['shift']());}}}(a9y,0x9fad8));var __awaiter=this&&this['__awaiter']||function(y,f,a,b){function I(G){return G instanceof a?G:new a(function(T){T(G);});}return new(a||(a=Promise))(function(G,T){const U=a9f;function u(F){const s=a9f;try{Z(b[s(0x1cf)](F));}catch(d){T(d);}}function t(F){try{Z(b['throw'](F));}catch(d){T(d);}}function Z(F){const j=a9f;F['done']?G(F[j(0x1dd)]):I(F[j(0x1dd)])['then'](u,t);}Z((b=b['apply'](y,f||[]))[U(0x1cf)]());});},__importDefault=this&&this[a9g(0x1cc)]||function(y){return y&&y['__esModule']?y:{'default':y};};Object[a9g(0x1d1)](exports,a9g(0x1d5),{'value':!![]}),exports[a9g(0x1d8)]=void 0x0;const list_1=__importDefault(require('inquirer/lib/prompts/list')),choice_1=__importDefault(require('inquirer/lib/objects/choice')),chalk_1=__importDefault(require(a9g(0x1c2)));function incrementListIndex(y,f,a){const o=a9g,b=a[o(0x1e3)][o(0x1c8)],I=o(0x1e1)in a?Boolean(a[o(0x1e1)]):!![];if(f==='up'){if(y>0x0)return y-0x1;return I?b-0x1:y;}if(f===o(0x1e2)){if(y<b-0x1)return y+0x1;return I?0x0:y;}throw new Error(o(0x1d0));}class DynamicReloadPaginationPrompt extends list_1['default']{constructor(y,f,b){const r=a9g;super(y,f,b),this[r(0x1c9)]=chalk_1[r(0x1c6)]['italic'](r(0x1cd)),this[r(0x1d2)]=![],this[r(0x1d9)]=this[r(0x1e0)],this[r(0x1ca)]=this[r(0x1d9)][r(0x1ca)],this[r(0x1ca)]!==undefined&&this['opt'][r(0x1e3)][r(0x1c0)](new choice_1['default'](this[r(0x1c9)],this[r(0x1c9)]));}['onUpKey'](){const i=a9g;if(this['loading'])return;this[i(0x1db)]=incrementListIndex(this[i(0x1db)],'up',this[i(0x1e0)]),this['render']();}[a9g(0x1bf)](){return __awaiter(this,void 0x0,void 0x0,function*(){const l=a9f;if(this[l(0x1d2)])return;this[l(0x1db)]=incrementListIndex(this[l(0x1db)],l(0x1e2),this[l(0x1e0)]),yield this[l(0x1dc)](),this[l(0x1d7)]();});}[a9g(0x1dc)](){return __awaiter(this,void 0x0,void 0x0,function*(){const H=a9f;if(this[H(0x1db)]>=this['opt'][H(0x1e3)][H(0x1cb)]-0x1){if(this['nextPageCursor']===undefined)return;this[H(0x1d2)]=!![];let y=0x0;const f=setInterval(()=>{const v=H,G=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],T=chalk_1[v(0x1c6)]['italic'](G[y%G[v(0x1cb)]]+v(0x1de));this[v(0x1e0)][v(0x1e3)]['choices'][this['selected']][v(0x1e4)]=''+T,y+=0x1,this[v(0x1d7)]();},0x50),{elements:a,nextPageCursor:b}=yield this[H(0x1d9)][H(0x1d4)]({'nextPageCursor':this[H(0x1ca)]})['catch'](()=>({'elements':[],'nextPageCursor':undefined}));this[H(0x1ca)]=b;const I=a['map'](G=>new choice_1['default'](G,G));this[H(0x1e0)][H(0x1e3)]['choices']['splice'](this[H(0x1db)],0x1),this['opt']['choices']['push'](...I),b!==undefined&&this[H(0x1e0)][H(0x1e3)][H(0x1c0)](new choice_1[(H(0x1c6))](this['reloadText'],this['reloadText'])),clearInterval(f),this[H(0x1d2)]=![];}});}}function a9f(y,f){const a=a9y();return a9f=function(b,I){b=b-0x1bf;let G=a[b];return G;},a9f(y,f);}exports[a9g(0x1d8)]=DynamicReloadPaginationPrompt;
1
+ 'use strict';const a9A=a9C;function a9n(){const N=['loadMore','down','359964oXxKAp','1918788pXzJwK','640872Ldqtti','__esModule','reloadText','realLength','opt','5mxczqy','handleDynamicPageLoad','inquirer/lib/objects/choice','italic','default','..\x20Load\x20more\x20options\x20..','2578542fRhBVK','selected','19774250uXgYBU','inquirer/lib/prompts/list','DynamicReloadPaginationPrompt','then','done','8jMqxqr','__importDefault','nextPageCursor','render','choices','splice','1205328NGCdBw','8696793NXWHsh','push','length','map','pagOpt','catch','apply','loading','chalk','throw','defineProperty','next','loop','9xDojcP'];a9n=function(){return N;};return a9n();}(function(n,C){const V=a9C,k=n();while(!![]){try{const H=parseInt(V(0xb3))/0x1+-parseInt(V(0xa2))/0x2+-parseInt(V(0xb0))/0x3*(-parseInt(V(0xb4))/0x4)+parseInt(V(0xba))/0x5*(parseInt(V(0x95))/0x6)+-parseInt(V(0xa3))/0x7*(-parseInt(V(0x9c))/0x8)+-parseInt(V(0xb5))/0x9+-parseInt(V(0x97))/0xa;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a9n,0xc82ca));function a9C(n,C){const k=a9n();return a9C=function(H,R){H=H-0x92;let W=k[H];return W;},a9C(n,C);}var __awaiter=this&&this['__awaiter']||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const o=a9C;function t(y){const j=a9C;try{M(H[j(0xae)](y));}catch(T){i(T);}}function r(y){const U=a9C;try{M(H[U(0xac)](y));}catch(T){i(T);}}function M(y){const h=a9C;y[h(0x9b)]?W(y['value']):R(y['value'])[h(0x9a)](t,r);}M((H=H[o(0xa9)](n,C||[]))['next']());});},__importDefault=this&&this[a9A(0x9d)]||function(n){return n&&n['__esModule']?n:{'default':n};};Object[a9A(0xad)](exports,a9A(0xb6),{'value':!![]}),exports[a9A(0x99)]=void 0x0;const list_1=__importDefault(require(a9A(0x98))),choice_1=__importDefault(require(a9A(0xbc))),chalk_1=__importDefault(require(a9A(0xab)));function incrementListIndex(n,C,k){const d=a9A,H=k['choices'][d(0xb8)],R=d(0xaf)in k?Boolean(k[d(0xaf)]):!![];if(C==='up'){if(n>0x0)return n-0x1;return R?H-0x1:n;}if(C==='down'){if(n<H-0x1)return n+0x1;return R?0x0:n;}throw new Error('dir\x20must\x20be\x20up\x20or\x20down');}class DynamicReloadPaginationPrompt extends list_1[a9A(0x93)]{constructor(n,C,k){const Q=a9A;super(n,C,k),this[Q(0xb7)]=chalk_1[Q(0x93)][Q(0x92)](Q(0x94)),this[Q(0xaa)]=![],this[Q(0xa7)]=this['opt'],this['nextPageCursor']=this['pagOpt']['nextPageCursor'],this[Q(0x9e)]!==undefined&&this[Q(0xb9)][Q(0xa0)][Q(0xa4)](new choice_1[(Q(0x93))](this[Q(0xb7)],this[Q(0xb7)]));}['onUpKey'](){const l=a9A;if(this[l(0xaa)])return;this['selected']=incrementListIndex(this[l(0x96)],'up',this['opt']),this[l(0x9f)]();}['onDownKey'](){return __awaiter(this,void 0x0,void 0x0,function*(){const K=a9C;if(this[K(0xaa)])return;this[K(0x96)]=incrementListIndex(this[K(0x96)],K(0xb2),this['opt']),yield this[K(0xbb)](),this[K(0x9f)]();});}[a9A(0xbb)](){return __awaiter(this,void 0x0,void 0x0,function*(){const m=a9C;if(this[m(0x96)]>=this['opt']['choices'][m(0xa5)]-0x1){if(this[m(0x9e)]===undefined)return;this[m(0xaa)]=!![];let n=0x0;const C=setInterval(()=>{const a=m,W=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],t=chalk_1[a(0x93)][a(0x92)](W[n%W['length']]+'\x20Loading\x20more\x20options');this[a(0xb9)][a(0xa0)][a(0xa0)][this['selected']]['name']=''+t,n+=0x1,this['render']();},0x50),{elements:k,nextPageCursor:H}=yield this[m(0xa7)][m(0xb1)]({'nextPageCursor':this[m(0x9e)]})[m(0xa8)](()=>({'elements':[],'nextPageCursor':undefined}));this[m(0x9e)]=H;const R=k[m(0xa6)](W=>new choice_1[(m(0x93))](W,W));this[m(0xb9)][m(0xa0)][m(0xa0)][m(0xa1)](this['selected'],0x1),this[m(0xb9)]['choices']['push'](...R),H!==undefined&&this[m(0xb9)]['choices'][m(0xa4)](new choice_1[(m(0x93))](this[m(0xb7)],this[m(0xb7)])),clearInterval(C),this['loading']=![];}});}}exports['DynamicReloadPaginationPrompt']=DynamicReloadPaginationPrompt;
@@ -1 +1 @@
1
- 'use strict';const a10U=a10f;(function(y,f){const j=a10f,a=y();while(!![]){try{const b=-parseInt(j(0x116))/0x1*(parseInt(j(0x149))/0x2)+parseInt(j(0x13c))/0x3+parseInt(j(0x156))/0x4+parseInt(j(0x161))/0x5*(-parseInt(j(0x139))/0x6)+parseInt(j(0x159))/0x7*(-parseInt(j(0x146))/0x8)+-parseInt(j(0x14b))/0x9+-parseInt(j(0x140))/0xa*(-parseInt(j(0x16b))/0xb);if(b===f)break;else a['push'](a['shift']());}catch(I){a['push'](a['shift']());}}}(a10y,0x33f75));var __awaiter=this&&this[a10U(0x13a)]||function(y,f,a,b){function I(G){return G instanceof a?G:new a(function(T){T(G);});}return new(a||(a=Promise))(function(G,T){const i=a10f;function u(F){const g=a10f;try{Z(b[g(0x138)](F));}catch(d){T(d);}}function t(F){const o=a10f;try{Z(b[o(0x135)](F));}catch(d){T(d);}}function Z(F){const r=a10f;F['done']?G(F[r(0x119)]):I(F[r(0x119)])[r(0x150)](u,t);}Z((b=b[i(0x12b)](y,f||[]))[i(0x138)]());});},__importDefault=this&&this[a10U(0x166)]||function(y){const l=a10U;return y&&y[l(0x113)]?y:{'default':y};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a10U(0x12c)]=void 0x0;const js_client_1=require(a10U(0x164)),chalk_1=__importDefault(require(a10U(0x167))),utils_1=require(a10U(0x12a)),inquirer_helper_1=require(a10U(0x14d));class CliPortForward{constructor(y){const H=a10U;this[H(0x16e)]=H(0x148),this[H(0x13b)]=new js_client_1['ApiClient'](y,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[H(0x128)]});const f=new inquirer_helper_1[(H(0x162))](this['apiClient']);this['portFwdCmd']=(0x0,utils_1['getCommand'])()[H(0x168)]('forward')[H(0x15a)]('fwd')[H(0x14e)](H(0x127));const a=(0x0,utils_1['getCommand'])(!![])['name']('all')[H(0x14e)](H(0x11c))['option'](H(0x16a),'project\x20for\x20forwarding')[H(0x121)](H(0x154),this[H(0x16e)],![])[H(0x11a)](({noDefaults:G,projectId:T})=>__awaiter(this,void 0x0,void 0x0,function*(){const v=H;(0x0,utils_1['assertContextExisting'])(this[v(0x13b)]);const u=this['getProxyForwarder'](),t=G?undefined:y[v(0x158)](),Z=T||t||(yield f[v(0x136)]());try{const {services:F,addons:d}=yield u[v(0x15c)]({'projectId':Z},![]);F['length']+d[v(0x152)]<=0x0?(0x0,utils_1[v(0x142)])(v(0x11e)+chalk_1[v(0x11b)][v(0x15d)](Z)):(console['log'](v(0x153)+chalk_1[v(0x11b)][v(0x12f)]['bold'](F[v(0x152)]+v(0x11f))+v(0x123)+chalk_1['default'][v(0x12f)][v(0x15d)](d[v(0x152)]+v(0x14c))+v(0x15e)+chalk_1[v(0x11b)]['bold'](Z)),yield Promise['all']([...F,...d]));}catch(R){(0x0,utils_1[v(0x13d)])(v(0x143)+R[v(0x130)]);}})),b=(0x0,utils_1[H(0x163)])(!![])[H(0x168)](H(0x12d))['description']('Port-forwarding\x20for\x20the\x20specified\x20service')[H(0x121)]('--project\x20--projectId\x20[NAME]','Project\x20for\x20forwarding')[H(0x121)](H(0x120),H(0x134))['option'](H(0x154),this[H(0x16e)],![])[H(0x11a)](({noDefaults:G,projectId:T,serviceId:u})=>__awaiter(this,void 0x0,void 0x0,function*(){const P=H;(0x0,utils_1[P(0x160)])(this[P(0x13b)]);const t=this['getProxyForwarder'](),Z=G?undefined:y[P(0x158)](),F=T||Z||(yield f[P(0x136)]()),d=G?undefined:y['getCurrentServiceName'](),R=u||d||(yield f[P(0x133)](F)());console[P(0x169)]('Forwarding\x20service\x20'+chalk_1[P(0x11b)][P(0x15d)](R)+P(0x15e)+chalk_1[P(0x11b)]['bold'](F));try{yield t['forwardService']({'projectId':F,'serviceId':R},![]);}catch(s){(0x0,utils_1[P(0x13d)])(P(0x143)+s[P(0x130)]);}})),I=(0x0,utils_1['getCommand'])(!![])[H(0x168)](H(0x144))[H(0x14e)](H(0x137))[H(0x121)]('--project\x20--projectId\x20[NAME]','Project\x20for\x20forwarding')[H(0x121)](H(0x129),'Addon\x20to\x20forward')[H(0x121)](H(0x154),this['noDefaultsText'],![])[H(0x11a)](({projectId:G,addonId:T,noDefaults:u})=>__awaiter(this,void 0x0,void 0x0,function*(){const q=H;(0x0,utils_1[q(0x160)])(this['apiClient']);const t=u?undefined:y[q(0x158)](),Z=G||t||(yield f[q(0x136)]()),F=T||(yield f['askForAddon'](Z)());console[q(0x169)](q(0x117)+chalk_1[q(0x11b)]['bold'](F)+q(0x15e)+chalk_1[q(0x11b)][q(0x15d)](Z));const d=this[q(0x13e)]();try{yield d[q(0x118)]({'projectId':Z,'addonId':F},![]);}catch(R){(0x0,utils_1[q(0x13d)])(q(0x143)+R[q(0x130)]);}}));this[H(0x12e)][H(0x11d)](a),this[H(0x12e)][H(0x11d)](b),this[H(0x12e)]['addCommand'](I);}[a10U(0x13e)](){const p=a10U,y=this[p(0x13b)]['forwarding'],f=y[p(0x125)]();if(f[p(0x13d)])throw new Error(f[p(0x130)]);return y['on'](p(0x115),(a,b)=>{const Y=p,I=chalk_1[Y(0x11b)][Y(0x15b)][Y(0x15d)](b[Y(0x16c)]+'\x20\x27'+b['id']+'\x27'),G=b[Y(0x165)]===Y(0x131)?Y(0x14f):'';(0x0,utils_1[Y(0x155)])(Y(0x157)+I+Y(0x124)+b[Y(0x147)]+':'+b['port']+'\x20('+b['protocol']+Y(0x14a)),b['hostnames'][Y(0x126)](T=>{const A=Y;(0x0,utils_1['success'])('\x20\x20'+G+T+':'+b[A(0x151)]);}),(0x0,utils_1[Y(0x155)])('');}),y['on'](p(0x16d),(a,b)=>{const V=p,I=chalk_1['default'][V(0x15b)][V(0x15d)](b['type']+'\x20\x27'+b['id']+'\x27');(0x0,utils_1['warning'])(V(0x114)+b['address']+':'+b[V(0x151)]+'\x20to\x20'+I+V(0x145)),b['hostnames'][V(0x126)](G=>{const B=V;(0x0,utils_1[B(0x142)])('\x20\x20'+G+':'+b['port']);}),(0x0,utils_1[V(0x142)])('');}),y['on'](p(0x122),(a,b,I)=>{const S=p;(0x0,utils_1[S(0x142)])(S(0x132)+b[S(0x147)]+':'+b[S(0x151)]+'\x27:\x20\x22'+(I===null||I===void 0x0?void 0x0:I[S(0x130)])+'\x22');}),process['on'](p(0x141),()=>__awaiter(this,void 0x0,void 0x0,function*(){const n=p;try{yield y['stop']();}catch(a){(0x0,utils_1['error'])(n(0x13f)+a[n(0x130)]);}finally{process[n(0x15f)]();}})),y;}}exports[a10U(0x12c)]=CliPortForward;function a10f(y,f){const a=a10y();return a10f=function(b,I){b=b-0x113;let G=a[b];return G;},a10f(y,f);}function a10y(){const e=['Failed:\x20','addon','\x20for\x20these\x20hostnames:','8VWMNPc','address','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','84746HkqJHk',')\x20with\x20these\x20hostnames:','3105324Blorog','\x20addon\x20ports','../inquirer-helper','description','http://','then','port','length','Forwarding\x20','--noDefaults','success','1413008vEuyMq','Exposing\x20','getCurrentProjectName','2096423yLyUFv','alias','greenBright','forwardProject','bold','\x20in\x20project\x20','exit','assertContextExisting','28315DimhMp','InquirerHelper','getCommand','@northflank/js-client','protocol','__importDefault','chalk','name','log','--project\x20--projectId\x20[NAME]','506ZzlxUh','type','tunnel-close','noDefaultsText','__esModule','Stop\x20forwarding\x20traffic\x20from\x20','tunnel-open','7RbhIDH','Forwarding\x20addon\x20','forwardAddon','value','action','default','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','addCommand','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','\x20service\x20ports','--service\x20--serviceId\x20[NAME]','option','connection-error','\x20and\x20','\x20on\x20','canExecuteWithHostnames','forEach','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','customUserAgent','--addon\x20--addonId\x20[NAME]','../utils','apply','CliPortForward','service','portFwdCmd','green','message','HTTP','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','askForService','Service\x20to\x20forward','throw','askForProject','Port-forwarding\x20for\x20the\x20specified\x20addon','next','186zFxIee','__awaiter','apiClient','643866ogzWSa','error','getProxyForwarder','Cleaning\x20up\x20open\x20connections\x20failed:\x20','165580zKtxgl','SIGINT','warning'];a10y=function(){return e;};return a10y();}
1
+ 'use strict';function a10C(n,C){const k=a10n();return a10C=function(H,R){H=H-0xb8;let W=k[H];return W;},a10C(n,C);}const a10h=a10C;(function(n,C){const U=a10C,k=n();while(!![]){try{const H=parseInt(U(0xb9))/0x1+-parseInt(U(0xdf))/0x2+parseInt(U(0xbf))/0x3*(parseInt(U(0xdd))/0x4)+-parseInt(U(0xec))/0x5*(-parseInt(U(0xe3))/0x6)+parseInt(U(0xd4))/0x7+parseInt(U(0xe9))/0x8*(parseInt(U(0xfe))/0x9)+-parseInt(U(0xfc))/0xa;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a10n,0x4204e));function a10n(){const Z=['198lygOjD','fwd','addon','value','Forwarding\x20addon\x20','apiClient','Service\x20to\x20forward','type','\x20on\x20','then','length','message','apply','success','protocol','--noDefaults','\x20addon\x20ports','63539kZTLMj','\x20to\x20','option','\x20and\x20','name','addCommand','15VnUWGP','askForAddon','forEach','throw','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','forwarding','defineProperty','__esModule','greenBright','connection-error','green','address','port','portFwdCmd','getCommand','done','Port-forwarding\x20for\x20the\x20specified\x20addon','askForProject','getCurrentProjectName','CliPortForward','service','878626ecacck','canExecuteWithHostnames','noDefaultsText','@northflank/js-client','SIGINT','Failed:\x20','all','hostnames','action','386024wbgxTZ','tunnel-open','833520knmHqu','\x20for\x20these\x20hostnames:','alias','\x20in\x20project\x20','6CfGJPj','../inquirer-helper','getProxyForwarder','bold','__awaiter','InquirerHelper','25048SuGEHl','forward','Project\x20for\x20forwarding','1329980Fvydvq','Exposing\x20','error','assertContextExisting','getCurrentServiceName','description','log','customUserAgent','ApiClient','next','forwardProject','warning','--addon\x20--addonId\x20[NAME]','default','\x20service\x20ports','--project\x20--projectId\x20[NAME]','3192910ULbLEl','\x27:\x20\x22'];a10n=function(){return Z;};return a10n();}var __awaiter=this&&this[a10h(0xe7)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const Q=a10C;function t(y){const o=a10C;try{M(H[o(0xf5)](y));}catch(T){i(T);}}function r(y){const A=a10C;try{M(H[A(0xc2)](y));}catch(T){i(T);}}function M(y){const d=a10C;y[d(0xce)]?W(y[d(0x101)]):R(y[d(0x101)])[d(0x107)](t,r);}M((H=H[Q(0x10a)](n,C||[]))[Q(0xf5)]());});},__importDefault=this&&this['__importDefault']||function(n){const l=a10h;return n&&n[l(0xc6)]?n:{'default':n};};Object[a10h(0xc5)](exports,a10h(0xc6),{'value':!![]}),exports[a10h(0xd2)]=void 0x0;const js_client_1=require(a10h(0xd7)),chalk_1=__importDefault(require('chalk')),utils_1=require('../utils'),inquirer_helper_1=require(a10h(0xe4));class CliPortForward{constructor(n){const K=a10h;this[K(0xd6)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this[K(0x103)]=new js_client_1[(K(0xf4))](n,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[K(0xf3)]});const C=new inquirer_helper_1[(K(0xe8))](this[K(0x103)]);this[K(0xcc)]=(0x0,utils_1['getCommand'])()[K(0xbd)](K(0xea))[K(0xe1)](K(0xff))[K(0xf1)](K(0xc3));const k=(0x0,utils_1[K(0xcd)])(!![])[K(0xbd)](K(0xda))[K(0xf1)]('Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project')['option'](K(0xfb),'project\x20for\x20forwarding')['option'](K(0x10d),this[K(0xd6)],![])['action'](({noDefaults:W,projectId:i})=>__awaiter(this,void 0x0,void 0x0,function*(){const m=K;(0x0,utils_1['assertContextExisting'])(this[m(0x103)]);const t=this[m(0xe5)](),r=W?undefined:n[m(0xd1)](),M=i||r||(yield C['askForProject']());try{const {services:y,addons:T}=yield t[m(0xf6)]({'projectId':M},![]);y['length']+T['length']<=0x0?(0x0,utils_1['warning'])('No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20'+chalk_1[m(0xf9)][m(0xe6)](M)):(console[m(0xf2)]('Forwarding\x20'+chalk_1[m(0xf9)][m(0xc9)]['bold'](y[m(0x108)]+m(0xfa))+m(0xbc)+chalk_1[m(0xf9)][m(0xc9)]['bold'](T[m(0x108)]+m(0xb8))+m(0xe2)+chalk_1[m(0xf9)][m(0xe6)](M)),yield Promise['all']([...y,...T]));}catch(V){(0x0,utils_1[m(0xee)])(m(0xd9)+V[m(0x109)]);}})),H=(0x0,utils_1[K(0xcd)])(!![])['name'](K(0xd3))[K(0xf1)]('Port-forwarding\x20for\x20the\x20specified\x20service')[K(0xbb)](K(0xfb),'Project\x20for\x20forwarding')[K(0xbb)]('--service\x20--serviceId\x20[NAME]',K(0x104))[K(0xbb)](K(0x10d),this['noDefaultsText'],![])[K(0xdc)](({noDefaults:W,projectId:i,serviceId:t})=>__awaiter(this,void 0x0,void 0x0,function*(){const a=K;(0x0,utils_1[a(0xef)])(this[a(0x103)]);const r=this[a(0xe5)](),M=W?undefined:n['getCurrentProjectName'](),y=i||M||(yield C[a(0xd0)]()),T=W?undefined:n[a(0xf0)](),V=t||T||(yield C['askForService'](y)());console[a(0xf2)]('Forwarding\x20service\x20'+chalk_1[a(0xf9)][a(0xe6)](V)+'\x20in\x20project\x20'+chalk_1[a(0xf9)]['bold'](y));try{yield r['forwardService']({'projectId':y,'serviceId':V},![]);}catch(j){(0x0,utils_1['error'])('Failed:\x20'+j[a(0x109)]);}})),R=(0x0,utils_1[K(0xcd)])(!![])[K(0xbd)](K(0x100))[K(0xf1)](K(0xcf))[K(0xbb)](K(0xfb),K(0xeb))[K(0xbb)](K(0xf8),'Addon\x20to\x20forward')[K(0xbb)](K(0x10d),this[K(0xd6)],![])['action'](({projectId:W,addonId:i,noDefaults:t})=>__awaiter(this,void 0x0,void 0x0,function*(){const N=K;(0x0,utils_1[N(0xef)])(this['apiClient']);const r=t?undefined:n['getCurrentProjectName'](),M=W||r||(yield C[N(0xd0)]()),y=i||(yield C[N(0xc0)](M)());console[N(0xf2)](N(0x102)+chalk_1[N(0xf9)][N(0xe6)](y)+N(0xe2)+chalk_1[N(0xf9)][N(0xe6)](M));const T=this[N(0xe5)]();try{yield T['forwardAddon']({'projectId':M,'addonId':y},![]);}catch(V){(0x0,utils_1[N(0xee)])(N(0xd9)+V['message']);}}));this[K(0xcc)][K(0xbe)](k),this['portFwdCmd']['addCommand'](H),this['portFwdCmd'][K(0xbe)](R);}[a10h(0xe5)](){const X=a10h,n=this['apiClient'][X(0xc4)],C=n[X(0xd5)]();if(C[X(0xee)])throw new Error(C[X(0x109)]);return n['on'](X(0xde),(k,H)=>{const E=X,R=chalk_1[E(0xf9)][E(0xc7)][E(0xe6)](H[E(0x105)]+'\x20\x27'+H['id']+'\x27'),W=H[E(0x10c)]==='HTTP'?'http://':'';(0x0,utils_1[E(0x10b)])(E(0xed)+R+E(0x106)+H[E(0xca)]+':'+H[E(0xcb)]+'\x20('+H[E(0x10c)]+')\x20with\x20these\x20hostnames:'),H[E(0xdb)][E(0xc1)](i=>{const g=E;(0x0,utils_1['success'])('\x20\x20'+W+i+':'+H[g(0xcb)]);}),(0x0,utils_1[E(0x10b)])('');}),n['on']('tunnel-close',(k,H)=>{const c=X,R=chalk_1[c(0xf9)][c(0xc7)]['bold'](H['type']+'\x20\x27'+H['id']+'\x27');(0x0,utils_1[c(0xf7)])('Stop\x20forwarding\x20traffic\x20from\x20'+H['address']+':'+H[c(0xcb)]+c(0xba)+R+c(0xe0)),H['hostnames']['forEach'](W=>{const b=c;(0x0,utils_1['warning'])('\x20\x20'+W+':'+H[b(0xcb)]);}),(0x0,utils_1[c(0xf7)])('');}),n['on'](X(0xc8),(k,H,R)=>{const L=X;(0x0,utils_1['warning'])('Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27'+H[L(0xca)]+':'+H[L(0xcb)]+L(0xfd)+(R===null||R===void 0x0?void 0x0:R['message'])+'\x22');}),process['on'](X(0xd8),()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=X;try{yield n['stop']();}catch(k){(0x0,utils_1[G(0xee)])('Cleaning\x20up\x20open\x20connections\x20failed:\x20'+k[G(0x109)]);}finally{process['exit']();}})),n;}}exports[a10h(0xd2)]=CliPortForward;
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a11s=a11f;(function(y,f){const R=a11f,a=y();while(!![]){try{const b=parseInt(R(0xae))/0x1+-parseInt(R(0xc9))/0x2*(-parseInt(R(0xa6))/0x3)+-parseInt(R(0xc8))/0x4+-parseInt(R(0xa3))/0x5*(parseInt(R(0xe8))/0x6)+-parseInt(R(0xab))/0x7*(-parseInt(R(0xaf))/0x8)+parseInt(R(0xc3))/0x9+-parseInt(R(0xc5))/0xa*(-parseInt(R(0xc0))/0xb);if(b===f)break;else a['push'](a['shift']());}catch(I){a['push'](a['shift']());}}}(a11y,0x20347));var __awaiter=this&&this[a11s(0xb8)]||function(y,f,a,b){function I(G){return G instanceof a?G:new a(function(T){T(G);});}return new(a||(a=Promise))(function(G,T){const g=a11f;function u(F){const j=a11f;try{Z(b[j(0xb7)](F));}catch(d){T(d);}}function t(F){try{Z(b['throw'](F));}catch(d){T(d);}}function Z(F){const U=a11f;F[U(0xd5)]?G(F[U(0xa7)]):I(F[U(0xa7)])[U(0xdb)](u,t);}Z((b=b[g(0xc1)](y,f||[]))[g(0xb7)]());});},__importDefault=this&&this[a11s(0xe3)]||function(y){const o=a11s;return y&&y[o(0xa5)]?y:{'default':y};};function a11f(y,f){const a=a11y();return a11f=function(b,I){b=b-0xa2;let G=a[b];return G;},a11f(y,f);}Object[a11s(0xbc)](exports,'__esModule',{'value':!![]}),exports['assertContextExisting']=exports[a11s(0xd1)]=exports['asyncSequential']=exports[a11s(0xbd)]=exports[a11s(0xbe)]=exports[a11s(0xe2)]=exports['warning']=exports[a11s(0xb5)]=exports['checkUpdate']=exports[a11s(0xda)]=void 0x0;const node_fetch_1=__importDefault(require(a11s(0xd0))),chalk_1=__importDefault(require('chalk')),commander_1=require(a11s(0xa4)),pgk=require(a11s(0xea));exports[a11s(0xda)]=a11s(0xd7)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a11s(0xb0)]);function checkUpdate(y){return __awaiter(this,void 0x0,void 0x0,function*(){const i=a11f;function f(a,b){const r=a11f,I=new Date(Number(a));return I['setDate'](I[r(0xac)]()+b),I;}try{if(f(y[i(0xa9)](),0x1)>new Date())return;const a=pgk[i(0xb0)],{name:b}=pgk;if(!a)return;const I=i(0xaa)+b+i(0xe1),G=yield(0x0,node_fetch_1[i(0xcf)])(I,{'method':i(0xe9),'timeout':0x1388}),T=(yield G[i(0xe4)]())['version'];needsUpdate(a,T)&&warning(i(0xc4)+a+i(0xb1)+T+'.'+(i(0xcb)+b+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+b+'\x27\x20**')),yield y[i(0xd9)](new Date());}catch(u){}});}exports[a11s(0xbb)]=checkUpdate;function needsUpdate(y,f){const l=a11s,a=/(\.0+)+$/,b=y[l(0xc6)](a,'')['split']('.'),I=f[l(0xc6)](a,'')[l(0xb2)]('.');for(let G=0x0;G<Math[l(0xc7)](b['length'],I[l(0xe0)]);G+=0x1){const T=parseInt(I[G],0xa)-parseInt(b[G],0xa);if(T>0x0)return!![];if(T<0x0)return![];}return I[l(0xe0)]>b[l(0xe0)];}function error(y){const H=a11s;console[H(0xb5)](chalk_1[H(0xcf)][H(0xca)](H(0xc2)+y));}exports[a11s(0xb5)]=error;function warning(y){const v=a11s;console[v(0xb5)](chalk_1[v(0xcf)][v(0xbf)](''+y));}exports[a11s(0xe5)]=warning;function success(y){const P=a11s;console[P(0xcd)](chalk_1[P(0xcf)][P(0xdf)](''+y));}exports[a11s(0xe2)]=success;function a11y(){const V=['/latest','success','__importDefault','json','warning','Verbose\x20output','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','546CClWqb','GET','../package.json','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','6560rCAhnW','commander','__esModule','9tZqWoM','value','reduce','getLastUpdateCheck','https://registry.npmjs.org/','7EAKqML','getDate','resolve','60451whzbit','528376pYhRYP','version',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','split','storeOptionsAsProperties','allowUnknownOption','error','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','next','__awaiter','getCurrentBaseUrl','option','checkUpdate','defineProperty','retry','getCommand','yellow','25069ZnqYlN','apply','Failed:\x20','689184MEsXaz','**\x20You\x27re\x20running\x20on\x20version\x20','400NqbqTh','replace','min','185308fgJunG','2264PVwyOU','redBright','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','getCurrentToken','log','parse','default','node-fetch','isValidJSON','allowExcessArguments','--quiet','enablePositionalOptions','done','contextProvider','northflank-cli/','getCurrentContext','setLastUpdateCheck','customUserAgent','then','--verbose','asyncSequential','Command','green','length'];a11y=function(){return V;};return a11y();}function getCommand(y=![]){const q=a11s,f=new commander_1[(q(0xde))]();return f[q(0xb3)](![]),f[q(0xb4)](![]),f[q(0xd2)](![]),f[q(0xd4)](!![]),y&&(f[q(0xba)](q(0xdc),q(0xe6),![]),f[q(0xba)](q(0xd3),'No\x20console\x20output',![])),f;}exports[a11s(0xbe)]=getCommand;const retry=(y,f=0x32)=>a=>{let b=y;const I=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield a();}catch(G){if(b<=0x0)throw G;return b-=0x1,yield new Promise(T=>setTimeout(()=>T(),f)),I();}});return I();};exports['retry']=retry;const asyncSequential=(y,f)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const p=a11s,a=Promise[p(0xad)]([]);return y[p(0xa8)]((b,I)=>b[p(0xdb)](G=>f(I)[p(0xdb)](T=>{return G['push'](T),G;})),a);});exports[a11s(0xdd)]=asyncSequential;function isValidJSON(y){const Y=a11s;try{return JSON[Y(0xce)](y);}catch(f){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(y){const A=a11s;if(y['contextProvider'][A(0xd8)]()===undefined)throw new Error(A(0xb6));if(y[A(0xd6)][A(0xb9)]()===undefined)throw new Error(A(0xe7));if(y[A(0xd6)][A(0xcc)]()===undefined)throw new Error(A(0xa2));}exports['assertContextExisting']=assertContextExisting;
1
+ 'use strict';const a11A=a11C;(function(n,C){const V=a11C,k=n();while(!![]){try{const H=parseInt(V(0x1a2))/0x1*(parseInt(V(0x1ae))/0x2)+-parseInt(V(0x1a5))/0x3+parseInt(V(0x1a7))/0x4*(parseInt(V(0x18d))/0x5)+parseInt(V(0x1c4))/0x6+-parseInt(V(0x1b3))/0x7+parseInt(V(0x18b))/0x8+-parseInt(V(0x1bf))/0x9;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a11n,0x242e7));var __awaiter=this&&this['__awaiter']||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const o=a11C;function t(y){const j=a11C;try{M(H[j(0x1a6)](y));}catch(T){i(T);}}function r(y){const U=a11C;try{M(H[U(0x19d)](y));}catch(T){i(T);}}function M(y){const h=a11C;y[h(0x18c)]?W(y[h(0x190)]):R(y[h(0x190)])[h(0x18e)](t,r);}M((H=H['apply'](n,C||[]))[o(0x1a6)]());});},__importDefault=this&&this[a11A(0x1a4)]||function(n){return n&&n['__esModule']?n:{'default':n};};Object[a11A(0x1c3)](exports,a11A(0x1a8),{'value':!![]}),exports[a11A(0x1c5)]=exports[a11A(0x1b6)]=exports[a11A(0x1b7)]=exports[a11A(0x197)]=exports[a11A(0x1ac)]=exports['success']=exports['warning']=exports[a11A(0x192)]=exports[a11A(0x1b0)]=exports[a11A(0x1af)]=void 0x0;const node_fetch_1=__importDefault(require('node-fetch')),chalk_1=__importDefault(require(a11A(0x19a))),commander_1=require(a11A(0x199)),pgk=require(a11A(0x19c));function a11C(n,C){const k=a11n();return a11C=function(H,R){H=H-0x18a;let W=k[H];return W;},a11C(n,C);}exports[a11A(0x1af)]=a11A(0x198)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a11A(0x18f)]);function checkUpdate(n){return __awaiter(this,void 0x0,void 0x0,function*(){const Q=a11C;function C(k,H){const d=a11C,R=new Date(Number(k));return R[d(0x1b1)](R[d(0x1bc)]()+H),R;}try{if(C(n[Q(0x1a1)](),0x1)>new Date())return;const k=pgk[Q(0x18f)],{name:H}=pgk;if(!k)return;const R='https://registry.npmjs.org/'+H+'/latest',W=yield(0x0,node_fetch_1[Q(0x194)])(R,{'method':Q(0x19e),'timeout':0x1388}),i=(yield W[Q(0x1ab)]())[Q(0x18f)];needsUpdate(k,i)&&warning(Q(0x1bd)+k+Q(0x196)+i+'.'+('\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20'+H+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+H+Q(0x1aa))),yield n[Q(0x1c1)](new Date());}catch(t){}});}exports[a11A(0x1b0)]=checkUpdate;function a11n(){const g=['default','getCurrentToken',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','retry','northflank-cli/','commander','chalk','warning','../package.json','throw','GET','No\x20console\x20output','parse','getLastUpdateCheck','1TvSgvL','storeOptionsAsProperties','__importDefault','796095kppYEa','next','337196kzxLie','__esModule','Verbose\x20output','\x27\x20**','json','getCommand','getCurrentContext','443018TnQHis','customUserAgent','checkUpdate','setDate','resolve','867041RxmGlp','getCurrentBaseUrl','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','isValidJSON','asyncSequential','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','min','length','green','getDate','**\x20You\x27re\x20running\x20on\x20version\x20','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','818703UPWUMb','Command','setLastUpdateCheck','contextProvider','defineProperty','906480flPeQR','assertContextExisting','option','1372048svkqki','done','5JYbaWP','then','version','value','split','error','allowExcessArguments'];a11n=function(){return g;};return a11n();}function needsUpdate(n,C){const l=a11A,k=/(\.0+)+$/,H=n['replace'](k,'')[l(0x191)]('.'),R=C['replace'](k,'')[l(0x191)]('.');for(let W=0x0;W<Math[l(0x1b9)](H[l(0x1ba)],R[l(0x1ba)]);W+=0x1){const t=parseInt(R[W],0xa)-parseInt(H[W],0xa);if(t>0x0)return!![];if(t<0x0)return![];}return R[l(0x1ba)]>H['length'];}function error(n){const K=a11A;console[K(0x192)](chalk_1['default']['redBright']('Failed:\x20'+n));}exports[a11A(0x192)]=error;function warning(n){console['error'](chalk_1['default']['yellow'](''+n));}exports[a11A(0x19b)]=warning;function success(n){const m=a11A;console['log'](chalk_1[m(0x194)][m(0x1bb)](''+n));}exports['success']=success;function getCommand(n=![]){const a=a11A,C=new commander_1[(a(0x1c0))]();return C[a(0x1a3)](![]),C['allowUnknownOption'](![]),C[a(0x193)](![]),C['enablePositionalOptions'](!![]),n&&(C['option']('--verbose',a(0x1a9),![]),C[a(0x18a)]('--quiet',a(0x19f),![])),C;}exports[a11A(0x1ac)]=getCommand;const retry=(n,C=0x32)=>k=>{let H=n;const R=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield k();}catch(W){if(H<=0x0)throw W;return H-=0x1,yield new Promise(i=>setTimeout(()=>i(),C)),R();}});return R();};exports[a11A(0x197)]=retry;const asyncSequential=(n,C)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const N=a11A,k=Promise[N(0x1b2)]([]);return n['reduce']((H,R)=>H[N(0x18e)](W=>C(R)[N(0x18e)](i=>{return W['push'](i),W;})),k);});exports[a11A(0x1b7)]=asyncSequential;function isValidJSON(n){const X=a11A;try{return JSON[X(0x1a0)](n);}catch(C){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(n){const E=a11A;if(n[E(0x1c2)][E(0x1ad)]()===undefined)throw new Error(E(0x1b8));if(n[E(0x1c2)][E(0x1b4)]()===undefined)throw new Error(E(0x1be));if(n[E(0x1c2)][E(0x195)]()===undefined)throw new Error(E(0x1b5));}exports['assertContextExisting']=assertContextExisting;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northflank/cli",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "author": "Marco Suter",
5
5
  "description": "Provides a command-line interface to the Northflank platform.",
6
6
  "homepage": "https://www.northflank.com",
@@ -10,9 +10,9 @@
10
10
  "scripts": {
11
11
  "build": "tsc",
12
12
  "clin": "node dist/cli.js",
13
- "cli": "babel-node --root-mode upward --ignore \"node_modules\" --extensions \".js,.ts\" src/cli.ts",
14
- "inq-pag": "babel-node --root-mode upward --ignore \"node_modules\" --extensions \".js,.ts\" src/pagination/_dev/index.ts",
15
- "gen-fig-spec": "babel-node --root-mode upward --ignore \"node_modules\" --extensions \".js,.ts\" src/_dev/gen-fig-spec.ts",
13
+ "cli": "ts-node src/cli.ts",
14
+ "inq-pag": "ts-node src/pagination/_dev/index.ts",
15
+ "gen-fig-spec": "ts-node src/_dev/gen-fig-spec.ts",
16
16
  "lint": "eslint .",
17
17
  "postinstall": "node postinstall.js"
18
18
  },
@@ -26,8 +26,9 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "dependencies": {
29
- "@northflank/js-client": "0.7.0",
29
+ "@northflank/js-client": "0.7.1",
30
30
  "ajv": "8.6.3",
31
+ "bufferutil": "^4.0.7",
31
32
  "chalk": "~4.1.0",
32
33
  "columnify": "^1.5.4",
33
34
  "commander": "8.2.0",
@@ -37,6 +38,7 @@
37
38
  "lodash": "^4.17.15",
38
39
  "node-fetch": "2.6.7",
39
40
  "open": "^8.4.0",
41
+ "utf-8-validate": "^5.0.10",
40
42
  "ws": "^8.2.1"
41
43
  },
42
44
  "devDependencies": {