@northflank/cli 0.9.2 → 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 a6Y=a6p;function a6i(){const S=['__awaiter','without\x20shell','238830ksKcOX','value','columns','__esModule','job','stderr','with\x20user:','none','message','Run\x20command\x20with\x20this\x20group','--user\x20[USER]','pipe','--noDefaults','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','execStartLog','\x20--','exit','@northflank/js-client','../inquirer-helper','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','handleShellSession','default','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','command-exec','getStandardExecCommand','Error\x20occured\x20during\x20','getCurrentServiceName',',\x20details:\x20','Run\x20command\x20with\x20this\x20user','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','then','option','306xxIceb','slice','addCommand','waitForCommandResult','error','chalk','with\x20command\x20\x27','done','Unknown','1702216ovFIFb','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','rows','with\x20group:','bold','CliExec','\x20to\x20exec\x20into','action','askForProject','69011VVAbOr','askForService','exitCode',',\x20exit\x20code:\x20','getCommand','23498222gUiLTa','success','42nFfRwE','Id\x20[NAME]','stdout','Command\x20exec\x20for\x20the\x20specified\x20','--container\x20--containerId\x20[NAME]','5330610SZEvDi','charAt','106108nrkPuU','with\x20shell\x20session','\x20command\x20exec:\x20','getTerminalSize','7xkLcgh','exec','__importDefault','next','setRawMode','--cmd\x20--command\x20[COMMAND]','service','toUpperCase','--group\x20[GROUP]','4MgphDX','apiClient','getCurrentProjectName','stdOut','Exec\x20','Command\x20completed\x20successfully,\x20exit\x20code:\x20','\x20in\x20project\x20','apply','1830540OIPNOV','isTTY','defineProperty','name','greenBright','log','Project\x20for\x20exec','execCmd','stdin','ApiClient','askForJob','warning','InquirerHelper','assertContextExisting'];a6i=function(){return S;};return a6i();}(function(i,p){const J=a6p,B=i();while(!![]){try{const H=parseInt(J(0x1d4))/0x1*(parseInt(J(0x1ef))/0x2)+-parseInt(J(0x1db))/0x3*(parseInt(J(0x1e2))/0x4)+-parseInt(J(0x1e0))/0x5+-parseInt(J(0x1f7))/0x6*(-parseInt(J(0x1e6))/0x7)+parseInt(J(0x1cb))/0x8+parseInt(J(0x1c2))/0x9*(-parseInt(J(0x1a2))/0xa)+parseInt(J(0x1d9))/0xb;if(H===p)break;else B['push'](B['shift']());}catch(j){B['push'](B['shift']());}}}(a6i,0x84769));var __awaiter=this&&this[a6Y(0x1a0)]||function(i,p,B,H){function j(l){return l instanceof B?l:new B(function(a){a(l);});}return new(B||(B=Promise))(function(l,a){const M=a6p;function D(E){try{L(H['next'](E));}catch(C){a(C);}}function f(E){try{L(H['throw'](E));}catch(C){a(C);}}function L(E){const k=a6p;E[k(0x1c9)]?l(E[k(0x1a3)]):j(E[k(0x1a3)])[k(0x1c0)](D,f);}L((H=H[M(0x1f6)](i,p||[]))[M(0x1e9)]());});},__importDefault=this&&this[a6Y(0x1e8)]||function(i){const F=a6Y;return i&&i[F(0x1a5)]?i:{'default':i};};Object[a6Y(0x194)](exports,'__esModule',{'value':!![]}),exports[a6Y(0x1d0)]=void 0x0;function a6p(i,p){const B=a6i();return a6p=function(H,j){H=H-0x193;let l=B[H];return l;},a6p(i,p);}const js_client_1=require(a6Y(0x1b3)),chalk_1=__importDefault(require(a6Y(0x1c7))),utils_1=require('../utils'),inquirer_helper_1=require(a6Y(0x1b4));class CliExec{constructor(i){const q=a6Y;this['getStandardExecCommand']=j=>(0x0,utils_1[q(0x1d8)])(!![])[q(0x195)](j)['description'](q(0x1de)+j)[q(0x1c1)]('--project\x20--projectId\x20[NAME]',q(0x198))[q(0x1c1)]('--'+j+q(0x1b1)+j+q(0x1dc),j[q(0x1e1)](0x0)[q(0x1ed)]()+j[q(0x1c3)](0x1)+q(0x1d1))[q(0x1c1)](q(0x1df),q(0x1bf))[q(0x1c1)]('--shell-cmd\x20[SHELL-CMD]',q(0x1b5))[q(0x1c1)](q(0x1ac),q(0x1be))['option'](q(0x1ee),q(0x1ab))[q(0x1c1)](q(0x1ae),q(0x1cc),![])[q(0x1c1)](q(0x1eb),'Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise'),this[q(0x1e5)]=()=>({'columns':process[q(0x1dd)][q(0x1a4)],'rows':process[q(0x1dd)][q(0x1cd)]}),this[q(0x1b0)]=(j,l,a,D,f,L,E,C)=>{const g=q;if(C===!![])return;const v=D==='none',O=v?g(0x1a1):D===undefined?g(0x1e3):'shell\x20command\x20'+chalk_1['default'][g(0x196)](D),Q=f!==undefined?g(0x1a8)+f:'',U=L!==undefined?g(0x1ce)+L:'',e=E!==undefined?g(0x1c8)+chalk_1[g(0x1b7)][g(0x196)](E)+'\x27':'',G=[e,O,Q,U]['filter'](b=>b!=='')['join']('\x20'),x='(exit\x20with\x20\x27Ctrl+D\x27)';console[g(0x197)](g(0x1f3)+j+'\x20'+chalk_1[g(0x1b7)][g(0x1cf)](l)+g(0x1f5)+chalk_1[g(0x1b7)]['bold'](a)+'\x20'+G+'\x20'+x);},this[q(0x1b6)]=(j,l,a=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const r=q;var D,f;try{process[r(0x19a)]['isTTY']&&(process[r(0x19a)][r(0x1ea)](!![]),process[r(0x1dd)]['on']('resize',()=>{const W=r;j['resizeTerminal'](this[W(0x1e5)]());}));process[r(0x19a)]['pipe'](j['stdIn']),j['stdErr'][r(0x1ad)](process[r(0x1a7)]),j[r(0x1f2)][r(0x1ad)](process[r(0x1dd)]),j['on'](r(0x1c6),E=>{const R=r;var C;(0x0,utils_1[R(0x1c6)])(R(0x1bb)+l+R(0x1e4)+((C=E[R(0x1aa)])!==null&&C!==void 0x0?C:E)),process['stdin'][R(0x193)]&&process['stdin'][R(0x1ea)](![]),process[R(0x1b2)](-0x1);});const L=yield j[r(0x1c5)]();if(a!==!![]){const E=(D=L===null||L===void 0x0?void 0x0:L['status'])!==null&&D!==void 0x0?D:r(0x1ca),C=(f=L===null||L===void 0x0?void 0x0:L[r(0x1d6)])!==null&&f!==void 0x0?f:-0x1,v=(L===null||L===void 0x0?void 0x0:L[r(0x1aa)])?r(0x1bd)+L[r(0x1aa)]:'';E==='Success'?(0x0,utils_1[r(0x1da)])(r(0x1f4)+C):(0x0,utils_1[r(0x19d)])(r(0x1af)+E+r(0x1d7)+C+v);}return L;}finally{process[r(0x19a)][r(0x193)]&&process['stdin']['setRawMode'](![]);}}),this[q(0x1f0)]=new js_client_1[(q(0x19b))](i,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']});const p=new inquirer_helper_1[(q(0x19e))](this[q(0x1f0)]);this[q(0x199)]=(0x0,utils_1[q(0x1d8)])()[q(0x195)](q(0x1b9))['alias']('exec')['description'](q(0x1b8));const B=this[q(0x1ba)]('service')[q(0x1d2)](j=>__awaiter(this,void 0x0,void 0x0,function*(){const n=q,{noDefaults:l,projectId:a,serviceId:D,containerId:f,shellCmd:L,user:E,group:C,command:v,quiet:O}=j;(0x0,utils_1['assertContextExisting'])(this[n(0x1f0)]);try{const Q=l?undefined:i['getCurrentProjectName'](),U=a||Q||(yield p[n(0x1d3)]()),G=l?undefined:i[n(0x1bc)](),x=D||G||(yield p[n(0x1d5)](U)()),b=L!==null&&L!==void 0x0?L:v!==undefined?n(0x1a9):undefined;this[n(0x1b0)]('service',x,U,b,E,C,v,O);const w=process[n(0x1dd)][n(0x1a4)],X=process[n(0x1dd)][n(0x1cd)],K={'projectId':U,'serviceId':x},N=yield this['apiClient'][n(0x1e7)]['execServiceSession'](K,{'containerName':f,'command':v,'shell':b,'user':E,'group':C,'ttyColumns':w,'ttyRows':X});yield this[n(0x1b6)](N,n(0x1ec),O);}catch(m){(0x0,utils_1[n(0x1c6)])(''+m[n(0x1aa)]);}finally{process[n(0x1b2)]();}})),H=this[q(0x1ba)]('job')[q(0x1d2)](j=>__awaiter(this,void 0x0,void 0x0,function*(){const s=q,{projectId:l,jobId:a,containerId:D,noDefaults:f,shellCmd:L,user:E,group:C,command:v,quiet:O}=j;(0x0,utils_1[s(0x19f)])(this[s(0x1f0)]);try{const Q=f?undefined:i[s(0x1f1)](),U=l||Q||(yield p[s(0x1d3)]()),G=a||(yield p[s(0x19c)](U)());this['execStartLog'](s(0x1a6),G,U,L,O);const {rows:x,columns:b}=this['getTerminalSize'](),w={'projectId':U,'jobId':G},X=yield this['apiClient'][s(0x1e7)]['execJobSession'](w,{'containerName':D,'command':v,'shell':L,'user':E,'group':C,'ttyColumns':b,'ttyRows':x});yield this[s(0x1b6)](X,s(0x1a6),O);}catch(K){(0x0,utils_1['error'])(''+K['message']);}finally{process['exit']();}}));this['execCmd'][q(0x1c4)](B),this['execCmd'][q(0x1c4)](H);}}exports[a6Y(0x1d0)]=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';const a7Q=a7p;(function(i,p){const O=a7p,B=i();while(!![]){try{const H=parseInt(O(0x145))/0x1+-parseInt(O(0x194))/0x2+parseInt(O(0xec))/0x3*(-parseInt(O(0xf8))/0x4)+parseInt(O(0x137))/0x5+parseInt(O(0x165))/0x6+-parseInt(O(0x17b))/0x7*(-parseInt(O(0x138))/0x8)+-parseInt(O(0x15b))/0x9;if(H===p)break;else B['push'](B['shift']());}catch(j){B['push'](B['shift']());}}}(a7i,0x1eebf));var __createBinding=this&&this[a7Q(0x14b)]||(Object[a7Q(0x19e)]?function(i,p,B,H){const U=a7Q;if(H===undefined)H=B;var j=Object[U(0x169)](p,B);(!j||(U(0x161)in j?!p['__esModule']:j['writable']||j[U(0x14e)]))&&(j={'enumerable':!![],'get':function(){return p[B];}}),Object['defineProperty'](i,H,j);}:function(i,p,B,H){if(H===undefined)H=B;i[H]=p[B];}),__setModuleDefault=this&&this[a7Q(0x115)]||(Object['create']?function(i,p){const e=a7Q;Object[e(0x142)](i,'default',{'enumerable':!![],'value':p});}:function(i,p){const G=a7Q;i[G(0x13d)]=p;}),__importStar=this&&this[a7Q(0xe0)]||function(i){const x=a7Q;if(i&&i[x(0xde)])return i;var p={};if(i!=null){for(var B in i)if(B!=='default'&&Object[x(0x1a8)][x(0x191)]['call'](i,B))__createBinding(p,i,B);}return __setModuleDefault(p,i),p;},__awaiter=this&&this[a7Q(0x1a5)]||function(i,p,B,H){function j(l){return l instanceof B?l:new B(function(a){a(l);});}return new(B||(B=Promise))(function(l,a){function D(E){const b=a7p;try{L(H[b(0xdd)](E));}catch(C){a(C);}}function f(E){try{L(H['throw'](E));}catch(C){a(C);}}function L(E){const w=a7p;E[w(0xf6)]?l(E[w(0x187)]):j(E[w(0x187)])[w(0x146)](D,f);}L((H=H['apply'](i,p||[]))['next']());});},__importDefault=this&&this[a7Q(0x12f)]||function(i){const X=a7Q;return i&&i[X(0xde)]?i:{'default':i};};function a7i(){const iv=['isArray','__setModuleDefault','chalk','found','reset','Enter\x20the\x20','retry','safeLoad','registries','maxLength','createdAt','validate','runs','\x20in\x20','Yes,\x20send','Should\x20it\x20be','SAVE','array','No\x20builds\x20found','\x20characters,\x20is\x20','domains','has','jobs','\x20characters','DynamicReloadPaginationPrompt','toString','Do\x20you\x20want\x20to\x20add\x20more','__importDefault','integer','blue','askForProjectScopedResource','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','pattern','service','saveFile','1064365ziVhWp','8FpgKYV','askForDomain','minimum','startedAt','doesn\x27t\x20match\x20pattern\x20\x27','default','stringify','push','./pagination/inquirer-pagination-prompt','ask','defineProperty','pagination-prompt','retrievePayloadViaInteractiveCli','69585VdghxT','then','resultCache','YES','confirmationPrompt','domain','__createBinding','token','grey','configurable','maximum','split','charAt','editor','subdomains','secret','confirm','success','job:\x20\x27','addons','credentials','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','1662561MPgaaC','project','main-context','Do\x20you\x20want\x20to\x20add','askForService','safeDump','get','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','Unexpected\x20file\x20type:\x20','\x20to\x20use:','1096794AEJsOJ','pathVars','Configuration\x20file\x20written\x20to\x20','items','getOwnPropertyDescriptor','askForResourcePaginated','a\x20Northflank\x20resource','this\x20option\x20is\x20required,\x20please\x20answer','getType','minLength','apiClient','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','green','.*\x5c.(json|yaml|yml)$','EDIT','fetchResourceList','map','name','whiteBright','filter','max','963494UVPoTF','concat','includes','body','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','askForBuild','underline','defaultPaginationPageSize','isUndefined','values','getInnerType','askForProject','value','prompt','length','ABORT','isNaN','greenBright','don\x27t\x20change','InquirerHelper','fileName','getCurrentProjectName','hasOwnProperty','Context\x20with\x20name\x20\x27','unset','417790DpTxph','object','\x20(startedAt:\x20','askForResource','tokenPrompt','toUpperCase','What\x27s\x20the\x20','registerPrompt','builds','type','create','addon','bold','getQuestionString','addEntry','propToType','nextCursor','__awaiter','rawObject','getPathString','prototype','find','editPayload','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','description','askForProjectScopedResourcePaginated','js-yaml','domain\x20(','assign','set','job\x20build','job\x20runs','must\x20be\x20a\x20number,\x20is\x20','isObject','test','search-list','askForVolume','isEmpty','No,\x20edit','slice','projects','blueBright','loginPrompt','What\x20do\x20you\x20want\x20to\x20use\x20as','confirmation','for\x20this\x20','string','next','__esModule','askForJobRun','__importStar','trim','boolean','askArrayEntry','example','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','yml','oneOf','writeFileSync','isBoolean','yellowBright','pagination','540VEdRow','askForCredentials','required','volumes',',\x20supported\x20types:\x20[json|yaml|yml]','backups','No\x20','No,\x20repeat','Choose\x20the\x20login\x20token:','warning','done','join','1836KkKjSv','service:\x20\x27','to\x20use:','fullName','services','Choose\x20the\x20','project:\x20\x27','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','REPEAT','deleteWarningPrompt','data','secrets','askConfirm','askForSubdomain','askForJob','job','Aborted.','job\x20builds','list','contextProvider','askGeneric','Writing\x20configuration\x20failed:\x20','cursor','password','input','No,\x20abort','isValidJSON','elements'];a7i=function(){return iv;};return a7i();}Object[a7Q(0x142)](exports,a7Q(0xde),{'value':!![]}),exports[a7Q(0x18e)]=void 0x0;function a7p(i,p){const B=a7i();return a7p=function(H,j){H=H-0xc8;let l=B[H];return l;},a7p(i,p);}const _=__importStar(require('lodash')),chalk_1=__importDefault(require(a7Q(0x116))),fs=__importStar(require('fs')),utils_1=require('./utils'),api_helpers_1=require('./api-helpers'),inquirer_pagination_prompt_1=require(a7Q(0x140)),inquirer=require('inquirer'),inquirerSearchList=require('inquirer-search-list'),yaml=require(a7Q(0xc8));var ConfirmChoices;(function(i){const K=a7Q;i[K(0x148)]=K(0x122),i[K(0x100)]=K(0xf3),i[K(0x174)]=K(0xd4),i[K(0x124)]='No,\x20but\x20save\x20as\x20file',i[K(0x18a)]=K(0x111);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(i){const N=a7Q;this[N(0x16f)]=i,this[N(0x182)]=0x32,this[N(0x1aa)]=p=>__awaiter(this,void 0x0,void 0x0,function*(){const m=N,{editedResult:B}=yield inquirer[m(0x188)]([{'type':'editor','name':'editedResult','message':'Go\x20to\x20editor','default':yaml['safeDump'](p)}]);return yaml[m(0x11b)](B);}),this[N(0x136)]=p=>__awaiter(this,void 0x0,void 0x0,function*(){const J=N,B=a=>J(0x163)+a+J(0xf0);function H(){return __awaiter(this,void 0x0,void 0x0,function*(){const Y=a7p;return inquirer[Y(0x188)]([{'type':Y(0x110),'name':Y(0x18f),'message':Y(0x1ab),'validate':a=>new RegExp(Y(0x173))['test'](a)?!![]:B(a)}]);});}const {fileName:j}=yield H(),l=j[J(0x12d)]()[J(0x150)]('.')['pop']();try{switch(l){case'json':(0x0,utils_1[J(0x156)])(J(0x167)+j);return fs['writeFileSync'](j,JSON[J(0x13e)](p,null,'\x20\x20'));case'yaml':case J(0xe6):(0x0,utils_1[J(0x156)])(J(0x167)+j);return fs[J(0xe8)](j,yaml[J(0x160)](p));default:(0x0,utils_1[J(0xf5)])(B(l));}}catch(a){(0x0,utils_1[J(0xf5)])(J(0x10d)+a['message']);}return undefined;}),this[N(0x179)]=(p,B)=>H=>{const k=N,j=typeof H===k(0xdc)?H[k(0xe1)]():H;return B===![]&&j==='don\x27t\x20change'?'':j;},this[N(0x11f)]=(p,B,H)=>j=>{const M=N,l=[];if(j===''||j===M(0x18d)){if(B!==![])l[M(0x13f)](M(0x16c));else return!![];}p[M(0x19d)]===M(0xdc)&&!_['isUndefined'](p[M(0x134)])&&l[M(0x13f)](new RegExp(p[M(0x134)])[M(0xd0)](j)?!![]:M(0x13c)+p[M(0x134)]+'\x27');p[M(0x19d)]===M(0xdc)&&!_[M(0x183)](p[M(0x16e)])&&l[M(0x13f)](j['length']>=p[M(0x16e)]?!![]:M(0x171)+p[M(0x16e)]+M(0x127)+j[M(0x189)]+M(0x12b));p['type']===M(0xdc)&&!_[M(0x183)](p[M(0x11d)])&&l[M(0x13f)](j[M(0x189)]<=p[M(0x11d)]?!![]:M(0xe5)+p['maxLength']+M(0x127)+j['length']+'\x20characters');H&&Number[M(0x18b)](parseInt(j,0xa))&&l[M(0x13f)](M(0xce)+j);p[M(0x19d)]===M(0x130)&&!_['isUndefined'](p['minimum'])&&l['push'](j>=p['minimum']?!![]:M(0x170)+p[M(0x13a)]);p['type']===M(0x130)&&!_[M(0x183)](p[M(0x14f)])&&l[M(0x13f)](j<=p[M(0x14f)]?!![]:M(0x17f)+p[M(0x14f)]);if(p[M(0x19d)]==='rawObject'){const f=(0x0,utils_1[M(0x112)])(j);l[M(0x13f)](f===![]||_[M(0xd3)](f)?'must\x20be\x20a\x20valid\x20non-empty\x20json\x20string':!![]);}const a=l[M(0x179)](L=>L!==!![]),D=(p===null||p===void 0x0?void 0x0:p[M(0xe4)])?'\x0a'+chalk_1[M(0x13d)]['red']('>>')+'\x20Example:\x20'+chalk_1[M(0x13d)][M(0x178)](JSON[M(0x13e)](p[M(0xe4)])):'';return a[M(0x189)]>0x0?a[M(0xf7)](chalk_1['default'][M(0x181)]('\x20and\x20it\x20'))+D:!![];},this[N(0x1a7)]=(p,B,H)=>{const F=N,j=p[p[F(0x189)]-0x1];function l(){const q=F;return p[q(0xd5)](0x0,-0x1)['map'](f=>f[q(0x151)](0x0)[q(0x199)]()+f[q(0xd5)](0x1))[q(0xf7)]('>');}const a=p[F(0x189)]>0x1?chalk_1[F(0x13d)]['bgGrey'][F(0x178)](l())+':\x20':'',D=H?'\x20('+chalk_1[F(0x13d)][F(0x131)](H)+')':'';return chalk_1['default'][F(0x118)](''+a+B+'\x20'+chalk_1[F(0x13d)][F(0x1a0)][F(0x18c)](j)+D+'?');},this[N(0x197)]=(p,B,H)=>__awaiter(this,void 0x0,void 0x0,function*(){const g=N;if(B[g(0x189)]<0x1){const a=H?g(0xdb)+H:g(0x117);throw new Error(g(0xf2)+p+'\x20'+a+'.');}const j=g(0xfd)+p+'\x20to\x20use:',l=B[g(0x189)]>0x4?g(0xd1):g(0x10a);return(yield inquirer[g(0x188)]([{'type':l,'name':g(0x177),'message':j,'choices':B}]))[g(0x177)];}),this[N(0x16a)]=(p,B,H)=>__awaiter(this,void 0x0,void 0x0,function*(){const r=N,{elements:j,nextCursor:l}=yield B();if(j[r(0x189)]<0x1){const f=H?r(0xdb)+H:r(0x117);throw new Error('No\x20'+p+'\x20'+f+'.');}const a=r(0xfd)+p+r(0x164);if(l!==undefined){const L=({nextPageCursor:E})=>__awaiter(this,void 0x0,void 0x0,function*(){const W=r,C=yield B(E);return{'elements':C[W(0x113)],'nextPageCursor':C[W(0x1a4)]};});return(yield inquirer[r(0x188)]([{'type':r(0x143),'name':r(0x177),'message':a,'choices':j,'nextPageCursor':l,'loadMore':L}]))[r(0x177)];}const D=j[r(0x189)]>0x4?r(0xd1):r(0x10a);return(yield inquirer[r(0x188)]([{'type':D,'name':r(0x177),'message':a,'choices':j}]))['name'];}),this[N(0x10c)]=(p,B)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const R=N,H=''+(B?'('+chalk_1[R(0x13d)][R(0x131)](B)+')\x20':''),j=R(0x119)+chalk_1[R(0x13d)][R(0x172)](p)+'\x20'+H+R(0xfa),l=this[R(0x11f)]({'type':R(0xdc),'required':!![]});return(yield inquirer[R(0x188)]([{'type':R(0x110),'name':R(0x177),'message':j,'validate':l}]))['name'];}),this[N(0x104)]=p=>__awaiter(this,void 0x0,void 0x0,function*(){const n=N;return(yield inquirer[n(0x188)]([{'type':n(0x155),'name':n(0x177),'message':p,'default':!![]}]))[n(0x177)];}),this[N(0x15f)]=p=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const S=N,B=H=>j=>__awaiter(this,void 0x0,void 0x0,function*(){const s=a7p;var l;const a=yield this[s(0x16f)]['list'][s(0xfc)]({'parameters':{'projectId':H},'options':{'per_page':this[s(0x182)],'cursor':j}}),D=a['data'][s(0xfc)]['map'](f=>f['id']);return{'elements':D,'nextCursor':(l=a[s(0xeb)])===null||l===void 0x0?void 0x0:l[s(0x10e)]};});return this[S(0x1ad)](S(0x135),B,p);}),this[N(0x106)]=p=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const V=N,B=H=>j=>__awaiter(this,void 0x0,void 0x0,function*(){const T=a7p;var l;const a=yield this[T(0x16f)]['list'][T(0x12a)]({'parameters':{'projectId':H},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':j}}),D=a[T(0x102)][T(0x12a)][T(0x176)](f=>f['id']);return{'elements':D,'nextCursor':(l=a[T(0xeb)])===null||l===void 0x0?void 0x0:l['cursor']};});return this['askForProjectScopedResourcePaginated'](V(0x107),B,p);}),this[N(0xdf)]=(p,B)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const o=N,H=j=>l=>__awaiter(this,void 0x0,void 0x0,function*(){const I=a7p;var a;const D=yield this['apiClient'][I(0x161)][I(0x107)]['runs']({'parameters':{'projectId':j,'jobId':p},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':l}}),f=D['data'][I(0x120)][I(0x176)](L=>L['id']+I(0x196)+L[I(0x13b)]+')');return{'elements':f,'nextCursor':(a=D[I(0xeb)])===null||a===void 0x0?void 0x0:a[I(0x10e)]};});return this[o(0x1ad)](o(0xcd),H,B,'job:\x20\x27'+p+'\x27')[o(0x146)](l=>l['split']('\x20')[0x0]);}),this[N(0x180)]=(p,B,H)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=N;if(H!==undefined){const j=l=>a=>__awaiter(this,void 0x0,void 0x0,function*(){const y=a7p;var D;const f=yield this[y(0x16f)][y(0x161)][y(0x107)][y(0x19c)]({'parameters':{'projectId':l,'jobId':H},'options':{'per_page':this[y(0x182)],'cursor':a}});return{'elements':f['data']['builds'][y(0x176)](L=>L['id']+y(0x196)+L['createdAt']+')'),'nextCursor':(D=f[y(0xeb)])===null||D===void 0x0?void 0x0:D[y(0x10e)]};});return this[u(0x1ad)](u(0x109),j,p,u(0x157)+H+'\x27')[u(0x146)](l=>l[u(0x150)]('\x20')[0x0]);}if(B!==undefined){const l=a=>D=>__awaiter(this,void 0x0,void 0x0,function*(){const A=u;var f;const L=yield this[A(0x16f)][A(0x161)][A(0x135)][A(0x19c)]({'parameters':{'projectId':a,'serviceId':B},'options':{'per_page':this[A(0x182)],'cursor':D}});return{'elements':L[A(0x102)]['builds'][A(0x176)](E=>E['id']+A(0x196)+E[A(0x11e)]+')'),'nextCursor':(f=L[A(0xeb)])===null||f===void 0x0?void 0x0:f[A(0x10e)]};});return this[u(0x1ad)](u(0xcc),l,p,u(0xf9)+H+'\x27')['then'](a=>a['split']('\x20')[0x0]);}throw new Error(u(0x126));}),this['askForAddon']=p=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const h=N,B=H=>j=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=a7p;var l;const a=yield this['apiClient'][Z(0x10a)][Z(0x158)]({'parameters':{'projectId':H},'options':{'per_page':this[Z(0x182)],'cursor':j}});return{'elements':a[Z(0x102)][Z(0x158)][Z(0x176)](D=>D['id']),'nextCursor':(l=a[Z(0xeb)])===null||l===void 0x0?void 0x0:l[Z(0x10e)]};});return this[h(0x1ad)](h(0x19f),B,p);}),this['askForAddonBackup']=(p,B)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const d=N,H=j=>l=>__awaiter(this,void 0x0,void 0x0,function*(){const P=a7p;var a;const D=yield this['apiClient'][P(0x161)]['addon'][P(0xf1)]({'parameters':{'projectId':j,'addonId':B},'options':{'per_page':this[P(0x182)],'cursor':l}});return{'elements':D[P(0x102)]['backups'][P(0x176)](f=>f['id']+'\x20(completedAt:\x20'+(f['completedAt']||'not\x20completed')+')'),'nextCursor':(a=D[P(0xeb)])===null||a===void 0x0?void 0x0:a['cursor']};});return this[d(0x1ad)]('backups',H,p,'addon:\x20\x27'+B+'\x27')[d(0x146)](l=>l[d(0x150)]('\x20')[0x0]);}),this[N(0xd2)]=p=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const B=H=>__awaiter(this,void 0x0,void 0x0,function*(){const z=a7p;return(yield this['apiClient'][z(0x10a)][z(0xef)]({'parameters':{'projectId':H}}))[z(0x102)][z(0x176)](j=>j['id']);});return this['askForProjectScopedResource']('volume',B,p);}),this['askForSecret']=p=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const i0=N,B=H=>j=>__awaiter(this,void 0x0,void 0x0,function*(){const t=a7p;var l;const a=yield this[t(0x16f)][t(0x10a)][t(0x103)]({'parameters':{'projectId':H},'options':{'per_page':this[t(0x182)],'cursor':j}});return{'elements':a[t(0x102)][t(0x103)][t(0x176)](D=>D['id']),'nextCursor':(l=a['pagination'])===null||l===void 0x0?void 0x0:l[t(0x10e)]};});return this[i0(0x1ad)](i0(0x154),B,p);}),this[N(0x105)]=p=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const i1=N,B=yield this['apiClient'][i1(0x161)]['domain']({'parameters':{'domain':p}}),H=B[i1(0x102)][i1(0x153)][i1(0x176)](l=>l['name']+'\x20(full\x20domain:\x20'+l[i1(0xfb)]+')'),j=i1(0xc9)+p+')';return this[i1(0x197)]('subdomain',H,j)[i1(0x146)](l=>l[i1(0x150)]('\x20')[0x0]);}),this[N(0x101)]=p=>__awaiter(this,void 0x0,void 0x0,function*(){const i2=N;return(yield inquirer[i2(0x188)]([{'type':'confirm','name':i2(0xda),'message':chalk_1['default'][i2(0xea)](i2(0x133)+(p||i2(0x16b))+'.\x20This\x20is\x20irreversible.\x20Please\x20confirm!'),'default':![]}]))[i2(0xda)];}),this[N(0xd8)]=(p,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const i3=N;_[i3(0x183)](p[i3(0x177)])&&(B['length']<=0x0?_[i3(0xcb)](p,i3(0x177),i3(0x13d)):yield(0x0,utils_1[i3(0x11a)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const i4=i3,{name:H}=yield inquirer[i4(0x188)]([{'type':'input','name':i4(0x177),'message':i4(0x162),'default':i4(0x15d)}]);if(!p['override']&&B[i4(0x1a9)](j=>j['name']===H)){const {c:j}=yield inquirer[i4(0x188)]([{'type':'confirm','name':'c','message':i4(0x192)+H+i4(0x15a),'default':![]}]);if(j===![])throw new Error('Context\x20name\x20already\x20exists.');_[i4(0xcb)](p,'override',!![]);}_[i4(0xcb)](p,'name',H);})));if(_[i3(0x183)](p[i3(0x14c)])){const H=yield this['tokenPrompt']();_[i3(0xcb)](p,i3(0x14c),H);}return p;}),this[N(0x198)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const i5=N,{token:p}=yield inquirer[i5(0x188)]([{'type':i5(0x10f),'name':i5(0x14c),'mask':'*','message':i5(0xf4)}]);return p;}),inquirer[N(0x19b)]('search-list',inquirerSearchList),inquirer[N(0x19b)]('pagination-prompt',inquirer_pagination_prompt_1[N(0x12c)]);}[a7Q(0x149)](i,p){return __awaiter(this,void 0x0,void 0x0,function*(){const i6=a7p,B=yaml[i6(0x160)](i),H=_[i6(0x17a)](B['split']('\x0a')['map'](a=>a[i6(0x189)])),j=chalk_1[i6(0x13d)][i6(0x14d)]('-'['repeat'](H)+'\x0a'),{confirm:l}=yield inquirer[i6(0x188)]([{'type':i6(0x10a),'name':i6(0x155),'message':''+chalk_1[i6(0x13d)][i6(0x1a0)][i6(0x172)]('Please\x20confirm\x20following\x20configuration:\x0a')+j+chalk_1[i6(0x13d)][i6(0xd7)](B)+j,'choices':Object[i6(0x184)](ConfirmChoices)}]);switch(l){case ConfirmChoices[i6(0x148)]:return i;case ConfirmChoices[i6(0x18a)]:throw new Error(i6(0x108));case ConfirmChoices[i6(0x100)]:return this[i6(0x144)](p);case ConfirmChoices[i6(0x174)]:return this['confirmationPrompt'](yield this['editPayload'](i),p);case ConfirmChoices[i6(0x124)]:yield this[i6(0x136)](i);return this['confirmationPrompt'](i,p);default:throw new Error('Something\x20unexpected\x20happened.');}});}[a7Q(0x144)](i,p){return __awaiter(this,void 0x0,void 0x0,function*(){const i7=a7p;if((p===null||p===void 0x0?void 0x0:p[i7(0x147)])!==undefined)this['resultCache']=p===null||p===void 0x0?void 0x0:p['resultCache'];this['tmpCmdPath']=p===null||p===void 0x0?void 0x0:p['cmdPath'];const B={};return yield this[i7(0x1a3)]([],i['opt'][i7(0x17e)],B),this[i7(0x147)]=B,yield this['confirmationPrompt'](B,i);});}[a7Q(0x1a3)](i,p,B,H){return __awaiter(this,void 0x0,void 0x0,function*(){const i8=a7p;let j;if(p[i8(0xe7)]&&!_[i8(0x129)](p,'properties')){if(p[i8(0xe7)]['length']>0x1){const {choice:l}=yield inquirer[i8(0x188)]([{'type':i8(0x10a),'name':'choice','message':i8(0x19a)+(i[i[i8(0x189)]-0x1]||'')+'\x20type?','choices':p[i8(0xe7)][i8(0x176)](a=>a[i8(0x1ac)])}]);j=yield this[i8(0x16d)](i,p[i8(0xe7)][i8(0x1a9)](a=>a[i8(0x1ac)]===l),B,H);}else{const a=p[i8(0xe7)][0x0];_[i8(0xcb)](a,i8(0x1ac),p[i8(0x1ac)]),j=yield this[i8(0x16d)](i,a,B,H);}j={};}else j=yield this['getType'](i,p,B,H);return j;});}[a7Q(0x185)](i,p,B,H){var j;return __awaiter(this,void 0x0,void 0x0,function*(){const i9=a7p;if(H===![]){const {addEntry:D}=yield inquirer['prompt']([{'type':i9(0x155),'name':i9(0x1a2),'message':this[i9(0x1a7)](p,i9(0x15e),i===null||i===void 0x0?void 0x0:i[i9(0x1ac)]),'default':![]}]);if(!D)return B;}const l=Object['keys']((j=i===null||i===void 0x0?void 0x0:i['properties'])!==null&&j!==void 0x0?j:[]),a=i[i9(0xee)]||[];if(l[i9(0x189)]>0x0)for(const f of l){const L=p[i9(0x17c)](f);if(p['length']>0x0&&!_[i9(0x129)](B,p[i9(0xf7)]('.')))_['set'](B,p[i9(0xf7)]('.'),{});yield this[i9(0x1a3)](L,i['properties'][f],B,a[i9(0x17d)](f));}else yield this['getType'](p,Object[i9(0xca)](Object[i9(0xca)]({},i),{'type':i9(0x1a6)}),B,H);return B;});}[a7Q(0xe3)](i,p,B,H){return __awaiter(this,void 0x0,void 0x0,function*(){const ii=a7p;if(p&&B)return!![];const j=p?ii(0x15e):ii(0x12e),{addEntry:l}=yield inquirer[ii(0x188)]([{'type':'confirm','name':ii(0x1a2),'message':this['getPathString'](i,j,p?H:undefined),'default':![]}]);return l;});}[a7Q(0x16d)](i,p,B,H){return __awaiter(this,void 0x0,void 0x0,function*(){const ip=a7p;let j;const l=i[ip(0xf7)]('.');switch(p===null||p===void 0x0?void 0x0:p[ip(0x19d)]){case ip(0x125):{let a=!![];while(yield this[ip(0xe3)](i,a,H,p===null||p===void 0x0?void 0x0:p['description'])){const D=_[ip(0x161)](B,l);_[ip(0x193)](B,l),yield this[ip(0x16d)](i,p[ip(0x168)],B);const f=_[ip(0x161)](B,l);!_[ip(0x114)](D)?_['set'](B,l,[f]):(D[ip(0x13f)](f),_[ip(0xcb)](B,l,D)),a=![];}return j||[];}case ip(0x195):{return j=yield this[ip(0x185)](p,i,B,H),j;}case'rawObject':j=(0x0,utils_1['isValidJSON'])(yield this[ip(0x141)](i,p,H))||undefined;break;case'string':case ip(0xe2):case ip(0x130):default:j=yield this[ip(0x141)](i,p,H,B);break;}return!_[ip(0x183)](j)&&_[ip(0xcb)](B,l,j),j;});}['ask'](i,p,B,H){var j;return __awaiter(this,void 0x0,void 0x0,function*(){const iB=a7p,l=i[i[iB(0x189)]-0x1],{defaultValue:defaultValue=(j=p===null||p===void 0x0?void 0x0:p[iB(0xe4)])!==null&&j!==void 0x0?j:p===null||p===void 0x0?void 0x0:p['default'],choices:choices=p===null||p===void 0x0?void 0x0:p['enum'],pagination:a}=yield(0x0,api_helpers_1[iB(0x175)])(l,this[iB(0x16f)],this['tmpCmdPath'],H,this['pathVars'],i);let D=iB(0x110);if(!_[iB(0x183)](choices)&&choices[iB(0x189)]>0x0){if(a!==undefined&&a['nextPageCursor']!==undefined)D='pagination-prompt';else choices[iB(0x189)]>0x4&&typeof choices[0x0]==='string'?D='search-list':D=iB(0x10a);}else{if((p===null||p===void 0x0?void 0x0:p[iB(0x19d)])===iB(0xe2))D=iB(0x155);else{if((p===null||p===void 0x0?void 0x0:p[iB(0x19d)])===iB(0x130))D=iB(0x110);else(p===null||p===void 0x0?void 0x0:p[iB(0x19d)])===iB(0x1a6)&&(D=iB(0x152));}}let f=B!==![]?!_[iB(0xcf)](defaultValue)?defaultValue:JSON[iB(0x13e)](defaultValue):_[iB(0xe9)](defaultValue)?defaultValue:iB(0x18d);if(choices)f=f[iB(0x12d)]();_[iB(0x129)](this[iB(0x147)],i['join']('.'))&&(f=this['resultCache'][i[iB(0xf7)]('.')]);const L=choices&&B===![]?[iB(0x18d),...choices]:choices,E=(p===null||p===void 0x0?void 0x0:p[iB(0x19d)])===iB(0x130),C=Object[iB(0xca)]({'type':D,'name':'id','message':this[iB(0x1a1)](i,p),'choices':L,'default':f,'filter':this[iB(0x179)](D,B),'validate':this['validate'](p,B,E)},a),v=(yield inquirer['prompt']([C]))['id'];if(v===iB(0x18d)||v==='')return undefined;if(E)return parseInt(v,0xa);return v;});}['getQuestionString'](i,p){const iH=a7Q,B=(p===null||p===void 0x0?void 0x0:p['type'])!==iH(0xe2)?iH(0xd9):iH(0x123);return this[iH(0x1a7)](i,B,p===null||p===void 0x0?void 0x0:p['description']);}[a7Q(0x186)](){return __awaiter(this,void 0x0,void 0x0,function*(){const il=a7p,i=p=>__awaiter(this,void 0x0,void 0x0,function*(){const ij=a7p;var B;const H=yield this[ij(0x16f)][ij(0x10a)][ij(0xd6)]({'options':{'per_page':this[ij(0x182)],'cursor':p}}),j=H[ij(0x102)][ij(0xd6)][ij(0x176)](l=>l['id']);return{'elements':j,'nextCursor':(B=H[ij(0xeb)])===null||B===void 0x0?void 0x0:B[ij(0x10e)]};});return yield this['askForResourcePaginated'](il(0x15c),i);});}[a7Q(0x132)](i,p,B,H){return __awaiter(this,void 0x0,void 0x0,function*(){const ia=a7p,j=B||this['apiClient'][ia(0x10b)][ia(0x190)]();if(_['isUndefined'](j))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const l=yield p(j);return yield this['askForResource'](i,l,(H?H+ia(0x121):'')+'project:\x20\x27'+j+'\x27');});}['askForProjectScopedResourcePaginated'](i,p,B,H){return __awaiter(this,void 0x0,void 0x0,function*(){const iD=a7p,j=B||this[iD(0x16f)][iD(0x10b)][iD(0x190)]();if(_[iD(0x183)](j))throw new Error(iD(0xff));const l=yield p(j);return yield this['askForResourcePaginated'](i,l,(H?H+iD(0x121):'')+iD(0xfe)+j+'\x27');});}[a7Q(0x139)](){return __awaiter(this,void 0x0,void 0x0,function*(){const iL=a7p,i=yield this['apiClient'][iL(0x10a)][iL(0x128)]({}),p=i[iL(0x102)]['domains']['map'](B=>B['name']);return this[iL(0x197)](iL(0x14a),p);});}[a7Q(0xed)](){return __awaiter(this,void 0x0,void 0x0,function*(){const iE=a7p,i=yield this[iE(0x16f)][iE(0x10a)][iE(0x11c)]({}),p=i[iE(0x102)][iE(0x159)][iE(0x176)](B=>B['id']);return this[iE(0x197)]('credentials',p);});}['setPathVars'](i){const iC=a7Q;this[iC(0x166)]=i;}}exports[a7Q(0x18e)]=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';const a8K=a8p;(function(i,p){const X=a8p,B=i();while(!![]){try{const H=parseInt(X(0x1b5))/0x1*(-parseInt(X(0x195))/0x2)+-parseInt(X(0x1be))/0x3*(-parseInt(X(0x1cb))/0x4)+-parseInt(X(0x192))/0x5*(-parseInt(X(0x18f))/0x6)+parseInt(X(0x1c7))/0x7+parseInt(X(0x1ca))/0x8+-parseInt(X(0x18c))/0x9*(parseInt(X(0x1b4))/0xa)+-parseInt(X(0x197))/0xb*(parseInt(X(0x199))/0xc);if(H===p)break;else B['push'](B['shift']());}catch(j){B['push'](B['shift']());}}}(a8i,0x68b7b));var __createBinding=this&&this[a8K(0x191)]||(Object['create']?function(i,p,B,H){const N=a8K;if(H===undefined)H=B;var j=Object[N(0x1b1)](p,B);(!j||('get'in j?!p[N(0x1b6)]:j[N(0x19a)]||j[N(0x18d)]))&&(j={'enumerable':!![],'get':function(){return p[B];}}),Object[N(0x1bf)](i,H,j);}:function(i,p,B,H){if(H===undefined)H=B;i[H]=p[B];}),__setModuleDefault=this&&this[a8K(0x1bd)]||(Object['create']?function(i,p){const m=a8K;Object[m(0x1bf)](i,m(0x1cd),{'enumerable':!![],'value':p});}:function(i,p){const J=a8K;i[J(0x1cd)]=p;}),__importStar=this&&this['__importStar']||function(i){const Y=a8K;if(i&&i[Y(0x1b6)])return i;var p={};if(i!=null){for(var B in i)if(B!==Y(0x1cd)&&Object[Y(0x19f)][Y(0x1a7)]['call'](i,B))__createBinding(p,i,B);}return __setModuleDefault(p,i),p;},__awaiter=this&&this[a8K(0x19b)]||function(i,p,B,H){function j(l){return l instanceof B?l:new B(function(a){a(l);});}return new(B||(B=Promise))(function(l,a){const F=a8p;function D(E){try{L(H['next'](E));}catch(C){a(C);}}function f(E){const k=a8p;try{L(H[k(0x198)](E));}catch(C){a(C);}}function L(E){const M=a8p;E[M(0x1a8)]?l(E[M(0x1c4)]):j(E['value'])['then'](D,f);}L((H=H[F(0x1a3)](i,p||[]))[F(0x1cc)]());});},__importDefault=this&&this[a8K(0x1c2)]||function(i){const q=a8K;return i&&i[q(0x1b6)]?i:{'default':i};};Object[a8K(0x1bf)](exports,'__esModule',{'value':!![]}),exports['NorthflankApiBrowserLogin']=void 0x0;function a8p(i,p){const B=a8i();return a8p=function(H,j){H=H-0x18c;let l=B[H];return l;},a8p(i,p);}const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a8K(0x1ac))),events_1=require(a8K(0x1ae));class NorthflankApiBrowserLogin extends events_1['EventEmitter']{constructor(i,p=!![]){const g=a8K;super(),this[g(0x1b0)]=i,this[g(0x1a2)]=p,this[g(0x1a4)]='idle',this[g(0x1b3)]=()=>JSON[g(0x19c)]({'type':'init'});}[a8K(0x1b2)](){const r=a8K;var i;const p=this['baseUrl'][r(0x18e)](r(0x1c1),r(0x19e))['replace'](r(0x190),'ws:'),B=p+r(0x1ba),H=new ws_1[(r(0x1cd))](B),j=()=>__awaiter(this,void 0x0,void 0x0,function*(){const R=r;yield new Promise(a=>{const W=a8p;var D;(D=this[W(0x1a6)])===null||D===void 0x0?void 0x0:D[W(0x1b9)](JSON[W(0x19c)]({'type':W(0x1c8)}),()=>a());}),process[R(0x1c3)]();}),l=new Promise((a,D)=>{const n=r;var f,L,E;try{this[n(0x1a6)]=(0x0,ws_1['createWebSocketStream'])(H),process['on']('SIGINT',j);}catch(C){D(new Error('Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20'+C[n(0x19d)]));}(f=this[n(0x1a6)])===null||f===void 0x0?void 0x0:f['on'](n(0x1a9),v=>{const s=n;var O;const Q=JSON['parse'](v[s(0x1c9)]());switch(Q===null||Q===void 0x0?void 0x0:Q['type']){case s(0x1b7):{const {loginPage:U}=Q;if(U===undefined){this[s(0x1aa)]('Unexpected\x20response',D);return;}this[s(0x1a2)]&&(0x0,open_1[s(0x1cd)])(U)[s(0x1c0)](G=>{const S=s,x=S(0x1c5)+G[S(0x19d)];this[S(0x1aa)](x,D);});this[s(0x1ab)](s(0x1af),{'url':U});break;}case'login-success':{const {apiToken:G,contextName:x}=Q;if(G===undefined){this[s(0x1aa)](s(0x1bb),D);return;}(O=this['duplex'])===null||O===void 0x0?void 0x0:O[s(0x1b9)](),a({'token':G,'contextName':x}),this[s(0x1a4)]=s(0x1ad);break;}case s(0x1c6):{const b='Failure\x20during\x20login:\x20'+(Q===null||Q===void 0x0?void 0x0:Q['message']);this[s(0x1aa)](b,D);break;}default:{const w=s(0x1a5)+JSON[s(0x19c)](Q);this[s(0x1aa)](w,D);}}}),(L=this[n(0x1a6)])===null||L===void 0x0?void 0x0:L['on'](n(0x1a1),v=>{const T=n;this['handleError'](T(0x1bc)+v[T(0x19d)],D);}),(E=this[n(0x1a6)])===null||E===void 0x0?void 0x0:E['on']('end',()=>{const V=n;if(this[V(0x1a4)]===V(0x1ad)){}else this[V(0x1aa)](V(0x1a0),D);});});return(i=this[r(0x1a6)])===null||i===void 0x0?void 0x0:i[r(0x196)](this[r(0x1b3)]()),this['status']=r(0x194),l['finally'](()=>{const I=r;process[I(0x193)](I(0x1b8),j);});}[a8K(0x1aa)](i,p){const o=a8K;var B,H;p?(B=this[o(0x1a6)])===null||B===void 0x0?void 0x0:B[o(0x1b9)](()=>p(new Error(i))):(H=this['duplex'])===null||H===void 0x0?void 0x0:H[o(0x1b9)](),this['status']=o(0x1a1);}}function a8i(){const y=['http:','__createBinding','1349605vNhiMS','removeListener','init','36796FypKUn','write','9333577TnELOb','throw','12LYiFqE','writable','__awaiter','stringify','message','wss:','prototype','Login\x20process\x20stopped\x20before\x20completed','error','openBrowser','apply','status','unable\x20to\x20parse\x20message:\x20','duplex','hasOwnProperty','done','data','handleError','emit','open','success','events','browser-opened','baseUrl','getOwnPropertyDescriptor','startLogin','initPackage','220HusamR','44CtKzsZ','__esModule','init-ack','SIGINT','end','/v1/cli-login','Unexpected\x20response,\x20api\x20token\x20missing','error\x20happened\x20during\x20browser\x20login:\x20','__setModuleDefault','6aJnock','defineProperty','catch','https:','__importDefault','exit','value','Unable\x20to\x20open\x20browser:\x20','login-failure','3476179vBuycx','aborted','toString','5806176SXLqSM','1330136tWDMFZ','next','default','249651oMuhVy','configurable','replace','18kSVjFD'];a8i=function(){return y;};return a8i();}exports['NorthflankApiBrowserLogin']=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 a9x=a9p;(function(i,p){const v=a9p,B=i();while(!![]){try{const H=-parseInt(v(0x9f))/0x1+parseInt(v(0x7f))/0x2*(parseInt(v(0x9b))/0x3)+parseInt(v(0x79))/0x4+parseInt(v(0x84))/0x5+parseInt(v(0x7a))/0x6*(-parseInt(v(0x99))/0x7)+parseInt(v(0xa0))/0x8+parseInt(v(0x87))/0x9*(-parseInt(v(0x88))/0xa);if(H===p)break;else B['push'](B['shift']());}catch(j){B['push'](B['shift']());}}}(a9i,0x22cdb));function a9p(i,p){const B=a9i();return a9p=function(H,j){H=H-0x78;let l=B[H];return l;},a9p(i,p);}var __awaiter=this&&this['__awaiter']||function(i,p,B,H){function j(l){return l instanceof B?l:new B(function(a){a(l);});}return new(B||(B=Promise))(function(l,a){const e=a9p;function D(E){const O=a9p;try{L(H[O(0x86)](E));}catch(C){a(C);}}function f(E){const Q=a9p;try{L(H[Q(0x8c)](E));}catch(C){a(C);}}function L(E){const U=a9p;E[U(0x96)]?l(E['value']):j(E[U(0x82)])['then'](D,f);}L((H=H[e(0x91)](i,p||[]))['next']());});},__importDefault=this&&this['__importDefault']||function(i){const G=a9p;return i&&i[G(0x7b)]?i:{'default':i};};Object['defineProperty'](exports,a9x(0x7b),{'value':!![]}),exports[a9x(0x7d)]=void 0x0;function a9i(){const J=['length','dir\x20must\x20be\x20up\x20or\x20down','2121pbuuJY','selected','422535jYnSBI','catch','italic','down','214573rsslgb','644056PYCokl','pagOpt','1015388ieaMJC','708xsoLsw','__esModule','nextPageCursor','DynamicReloadPaginationPrompt','name','2EFEufZ','reloadText','loading','value','\x20Loading\x20more\x20options','625370vocotf','push','next','9iSESVU','2073910jldIYp','opt','loop','inquirer/lib/objects/choice','throw','choices','default','splice','loadMore','apply','render','onUpKey','inquirer/lib/prompts/list','handleDynamicPageLoad','done'];a9i=function(){return J;};return a9i();}const list_1=__importDefault(require(a9x(0x94))),choice_1=__importDefault(require(a9x(0x8b))),chalk_1=__importDefault(require('chalk'));function incrementListIndex(i,p,B){const b=a9x,H=B[b(0x8d)]['realLength'],j=b(0x8a)in B?Boolean(B[b(0x8a)]):!![];if(p==='up'){if(i>0x0)return i-0x1;return j?H-0x1:i;}if(p===b(0x9e)){if(i<H-0x1)return i+0x1;return j?0x0:i;}throw new Error(b(0x98));}class DynamicReloadPaginationPrompt extends list_1[a9x(0x8e)]{constructor(i,p,B){const w=a9x;super(i,p,B),this[w(0x80)]=chalk_1[w(0x8e)][w(0x9d)]('..\x20Load\x20more\x20options\x20..'),this[w(0x81)]=![],this[w(0x78)]=this['opt'],this['nextPageCursor']=this[w(0x78)][w(0x7c)],this[w(0x7c)]!==undefined&&this['opt']['choices']['push'](new choice_1['default'](this['reloadText'],this[w(0x80)]));}[a9x(0x93)](){const X=a9x;if(this[X(0x81)])return;this[X(0x9a)]=incrementListIndex(this[X(0x9a)],'up',this[X(0x89)]),this[X(0x92)]();}['onDownKey'](){return __awaiter(this,void 0x0,void 0x0,function*(){const K=a9p;if(this[K(0x81)])return;this[K(0x9a)]=incrementListIndex(this[K(0x9a)],K(0x9e),this[K(0x89)]),yield this[K(0x95)](),this[K(0x92)]();});}['handleDynamicPageLoad'](){return __awaiter(this,void 0x0,void 0x0,function*(){const N=a9p;if(this[N(0x9a)]>=this[N(0x89)][N(0x8d)][N(0x97)]-0x1){if(this[N(0x7c)]===undefined)return;this[N(0x81)]=!![];let p=0x0;const B=setInterval(()=>{const m=N,a=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],D=chalk_1['default'][m(0x9d)](a[p%a[m(0x97)]]+m(0x83));this['opt'][m(0x8d)]['choices'][this[m(0x9a)]][m(0x7e)]=''+D,p+=0x1,this[m(0x92)]();},0x50),{elements:H,nextPageCursor:j}=yield this[N(0x78)][N(0x90)]({'nextPageCursor':this[N(0x7c)]})[N(0x9c)](()=>({'elements':[],'nextPageCursor':undefined}));this[N(0x7c)]=j;const l=H['map'](a=>new choice_1[(N(0x8e))](a,a));this['opt'][N(0x8d)][N(0x8d)][N(0x8f)](this[N(0x9a)],0x1),this[N(0x89)]['choices'][N(0x85)](...l),j!==undefined&&this[N(0x89)]['choices'][N(0x85)](new choice_1[(N(0x8e))](this[N(0x80)],this['reloadText'])),clearInterval(B),this['loading']=![];}});}}exports[a9x(0x7d)]=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';function a10p(i,p){const B=a10i();return a10p=function(H,j){H=H-0x6d;let l=B[H];return l;},a10p(i,p);}const a10U=a10p;function a10i(){const g=['../utils','\x27:\x20\x22','next','green','option','address','greenBright','value','getCurrentServiceName','askForAddon','bold','20562xdvKXl','getCommand','forwardAddon','project\x20for\x20forwarding','SIGINT','forwarding','@northflank/js-client','InquirerHelper','protocol','ApiClient','then',')\x20with\x20these\x20hostnames:','askForProject','exit','forwardProject','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','port','870cNdQvh','\x20on\x20','service','Service\x20to\x20forward','\x20and\x20','throw','warning','customUserAgent','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','Port-forwarding\x20for\x20the\x20specified\x20addon','--noDefaults','description','\x20in\x20project\x20','assertContextExisting','313014BXNNpT','forEach','action','http://','20850880yCyxqW','alias','881163yLHjaQ','56sHzmEL','../inquirer-helper','noDefaultsText','apiClient','1393mbaUND','done','Failed:\x20','__awaiter','type','portFwdCmd','defineProperty','Forwarding\x20','__esModule','addon','success','getProxyForwarder','message','1276eANraw','name','Stop\x20forwarding\x20traffic\x20from\x20','default','637388FObuiA','\x20for\x20these\x20hostnames:','stop','2167380fscOzv','--project\x20--projectId\x20[NAME]','error','apply','getCurrentProjectName','HTTP','Forwarding\x20addon\x20','\x20to\x20','log','askForService','Project\x20for\x20forwarding','length','chalk','addCommand','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','fwd','\x20service\x20ports','tunnel-open','\x20addon\x20ports','Addon\x20to\x20forward','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project'];a10i=function(){return g;};return a10i();}(function(i,p){const Q=a10p,B=i();while(!![]){try{const H=parseInt(Q(0x8b))/0x1+parseInt(Q(0x6f))/0x2+parseInt(Q(0xbf))/0x3*(-parseInt(Q(0x87))/0x4)+parseInt(Q(0x8e))/0x5+-parseInt(Q(0xae))/0x6*(-parseInt(Q(0x7a))/0x7)+-parseInt(Q(0x76))/0x8*(-parseInt(Q(0x75))/0x9)+-parseInt(Q(0x73))/0xa;if(H===p)break;else B['push'](B['shift']());}catch(j){B['push'](B['shift']());}}}(a10i,0x65d47));var __awaiter=this&&this[a10U(0x7d)]||function(i,p,B,H){function j(l){return l instanceof B?l:new B(function(a){a(l);});}return new(B||(B=Promise))(function(l,a){const b=a10p;function D(E){const e=a10p;try{L(H[e(0xa5)](E));}catch(C){a(C);}}function f(E){const G=a10p;try{L(H[G(0xc4)](E));}catch(C){a(C);}}function L(E){const x=a10p;E[x(0x7b)]?l(E[x(0xaa)]):j(E['value'])[x(0xb8)](D,f);}L((H=H[b(0x91)](i,p||[]))[b(0xa5)]());});},__importDefault=this&&this['__importDefault']||function(i){const w=a10U;return i&&i[w(0x82)]?i:{'default':i};};Object[a10U(0x80)](exports,a10U(0x82),{'value':!![]}),exports['CliPortForward']=void 0x0;const js_client_1=require(a10U(0xb4)),chalk_1=__importDefault(require(a10U(0x9a))),utils_1=require(a10U(0xa3)),inquirer_helper_1=require(a10U(0x77));class CliPortForward{constructor(i){const X=a10U;this[X(0x78)]=X(0xbd),this[X(0x79)]=new js_client_1[(X(0xb7))](i,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[X(0xc6)]});const p=new inquirer_helper_1[(X(0xb5))](this[X(0x79)]);this[X(0x7f)]=(0x0,utils_1[X(0xaf)])()[X(0x88)]('forward')[X(0x74)](X(0x9d))[X(0xca)]('Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.');const B=(0x0,utils_1[X(0xaf)])(!![])[X(0x88)]('all')[X(0xca)](X(0xa2))[X(0xa7)](X(0x8f),X(0xb1))['option'](X(0xc9),this['noDefaultsText'],![])['action'](({noDefaults:l,projectId:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const K=X;(0x0,utils_1[K(0x6e)])(this[K(0x79)]);const D=this[K(0x85)](),f=l?undefined:i[K(0x92)](),L=a||f||(yield p[K(0xba)]());try{const {services:E,addons:C}=yield D[K(0xbc)]({'projectId':L},![]);E[K(0x99)]+C[K(0x99)]<=0x0?(0x0,utils_1[K(0xc5)])(K(0x9c)+chalk_1[K(0x8a)]['bold'](L)):(console['log'](K(0x81)+chalk_1[K(0x8a)][K(0xa6)][K(0xad)](E[K(0x99)]+K(0x9e))+K(0xc3)+chalk_1['default'][K(0xa6)][K(0xad)](C['length']+K(0xa0))+'\x20in\x20project\x20'+chalk_1['default']['bold'](L)),yield Promise['all']([...E,...C]));}catch(v){(0x0,utils_1[K(0x90)])(K(0x7c)+v[K(0x86)]);}})),H=(0x0,utils_1[X(0xaf)])(!![])[X(0x88)](X(0xc1))[X(0xca)]('Port-forwarding\x20for\x20the\x20specified\x20service')[X(0xa7)](X(0x8f),X(0x98))[X(0xa7)]('--service\x20--serviceId\x20[NAME]',X(0xc2))[X(0xa7)]('--noDefaults',this[X(0x78)],![])[X(0x71)](({noDefaults:l,projectId:a,serviceId:D})=>__awaiter(this,void 0x0,void 0x0,function*(){const N=X;(0x0,utils_1['assertContextExisting'])(this[N(0x79)]);const f=this[N(0x85)](),L=l?undefined:i[N(0x92)](),E=a||L||(yield p[N(0xba)]()),C=l?undefined:i[N(0xab)](),v=D||C||(yield p[N(0x97)](E)());console[N(0x96)]('Forwarding\x20service\x20'+chalk_1['default']['bold'](v)+N(0x6d)+chalk_1[N(0x8a)][N(0xad)](E));try{yield f['forwardService']({'projectId':E,'serviceId':v},![]);}catch(O){(0x0,utils_1['error'])(N(0x7c)+O[N(0x86)]);}})),j=(0x0,utils_1[X(0xaf)])(!![])['name'](X(0x83))[X(0xca)](X(0xc8))[X(0xa7)](X(0x8f),X(0x98))[X(0xa7)]('--addon\x20--addonId\x20[NAME]',X(0xa1))[X(0xa7)](X(0xc9),this[X(0x78)],![])[X(0x71)](({projectId:l,addonId:a,noDefaults:D})=>__awaiter(this,void 0x0,void 0x0,function*(){const m=X;(0x0,utils_1[m(0x6e)])(this[m(0x79)]);const f=D?undefined:i['getCurrentProjectName'](),L=l||f||(yield p[m(0xba)]()),E=a||(yield p[m(0xac)](L)());console[m(0x96)](m(0x94)+chalk_1[m(0x8a)][m(0xad)](E)+m(0x6d)+chalk_1[m(0x8a)][m(0xad)](L));const C=this[m(0x85)]();try{yield C[m(0xb0)]({'projectId':L,'addonId':E},![]);}catch(v){(0x0,utils_1['error'])(m(0x7c)+v[m(0x86)]);}}));this[X(0x7f)][X(0x9b)](B),this[X(0x7f)]['addCommand'](H),this[X(0x7f)][X(0x9b)](j);}[a10U(0x85)](){const J=a10U,i=this[J(0x79)][J(0xb3)],p=i['canExecuteWithHostnames']();if(p['error'])throw new Error(p[J(0x86)]);return i['on'](J(0x9f),(B,H)=>{const Y=J,j=chalk_1[Y(0x8a)]['greenBright'][Y(0xad)](H[Y(0x7e)]+'\x20\x27'+H['id']+'\x27'),l=H[Y(0xb6)]===Y(0x93)?Y(0x72):'';(0x0,utils_1['success'])('Exposing\x20'+j+Y(0xc0)+H['address']+':'+H[Y(0xbe)]+'\x20('+H[Y(0xb6)]+Y(0xb9)),H['hostnames'][Y(0x70)](a=>{const k=Y;(0x0,utils_1[k(0x84)])('\x20\x20'+l+a+':'+H[k(0xbe)]);}),(0x0,utils_1['success'])('');}),i['on']('tunnel-close',(B,H)=>{const M=J,j=chalk_1[M(0x8a)][M(0xa9)][M(0xad)](H[M(0x7e)]+'\x20\x27'+H['id']+'\x27');(0x0,utils_1['warning'])(M(0x89)+H['address']+':'+H[M(0xbe)]+M(0x95)+j+M(0x8c)),H['hostnames'][M(0x70)](l=>{(0x0,utils_1['warning'])('\x20\x20'+l+':'+H['port']);}),(0x0,utils_1[M(0xc5)])('');}),i['on']('connection-error',(B,H,j)=>{const F=J;(0x0,utils_1['warning'])(F(0xc7)+H[F(0xa8)]+':'+H[F(0xbe)]+F(0xa4)+(j===null||j===void 0x0?void 0x0:j[F(0x86)])+'\x22');}),process['on'](J(0xb2),()=>__awaiter(this,void 0x0,void 0x0,function*(){const q=J;try{yield i[q(0x8d)]();}catch(B){(0x0,utils_1[q(0x90)])('Cleaning\x20up\x20open\x20connections\x20failed:\x20'+B[q(0x86)]);}finally{process[q(0xbb)]();}})),i;}}exports['CliPortForward']=CliPortForward;
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 a11O=a11p;(function(i,p){const v=a11p,B=i();while(!![]){try{const H=parseInt(v(0x14c))/0x1+-parseInt(v(0x154))/0x2+parseInt(v(0x11c))/0x3+parseInt(v(0x122))/0x4+-parseInt(v(0x14d))/0x5+parseInt(v(0x14b))/0x6*(parseInt(v(0x150))/0x7)+parseInt(v(0x141))/0x8;if(H===p)break;else B['push'](B['shift']());}catch(j){B['push'](B['shift']());}}}(a11i,0x9cca6));var __awaiter=this&&this[a11O(0x155)]||function(i,p,B,H){function j(l){return l instanceof B?l:new B(function(a){a(l);});}return new(B||(B=Promise))(function(l,a){const e=a11p;function D(E){try{L(H['next'](E));}catch(C){a(C);}}function f(E){const Q=a11p;try{L(H[Q(0x130)](E));}catch(C){a(C);}}function L(E){const U=a11p;E[U(0x14e)]?l(E[U(0x140)]):j(E[U(0x140)])['then'](D,f);}L((H=H[e(0x125)](i,p||[]))[e(0x128)]());});},__importDefault=this&&this['__importDefault']||function(i){const G=a11O;return i&&i[G(0x129)]?i:{'default':i};};Object[a11O(0x12e)](exports,a11O(0x129),{'value':!![]}),exports[a11O(0x158)]=exports[a11O(0x156)]=exports[a11O(0x15b)]=exports[a11O(0x11b)]=exports[a11O(0x147)]=exports[a11O(0x136)]=exports[a11O(0x157)]=exports[a11O(0x132)]=exports['checkUpdate']=exports[a11O(0x11e)]=void 0x0;const node_fetch_1=__importDefault(require('node-fetch')),chalk_1=__importDefault(require(a11O(0x13b))),commander_1=require(a11O(0x135)),pgk=require(a11O(0x142));exports[a11O(0x11e)]=a11O(0x15c)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a11O(0x148)]);function checkUpdate(i){return __awaiter(this,void 0x0,void 0x0,function*(){const b=a11p;function p(B,H){const x=a11p,j=new Date(Number(B));return j['setDate'](j[x(0x153)]()+H),j;}try{if(p(i['getLastUpdateCheck'](),0x1)>new Date())return;const B=pgk['version'],{name:H}=pgk;if(!B)return;const j='https://registry.npmjs.org/'+H+'/latest',l=yield(0x0,node_fetch_1[b(0x146)])(j,{'method':b(0x13c),'timeout':0x1388}),a=(yield l[b(0x127)]())[b(0x148)];needsUpdate(B,a)&&warning('**\x20You\x27re\x20running\x20on\x20version\x20'+B+b(0x121)+a+'.'+(b(0x13e)+H+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+H+'\x27\x20**')),yield i[b(0x149)](new Date());}catch(D){}});}exports[a11O(0x124)]=checkUpdate;function needsUpdate(p,B){const w=a11O,H=/(\.0+)+$/,j=p[w(0x144)](H,'')['split']('.'),l=B[w(0x144)](H,'')[w(0x13f)]('.');for(let a=0x0;a<Math['min'](j['length'],l[w(0x126)]);a+=0x1){const D=parseInt(l[a],0xa)-parseInt(j[a],0xa);if(D>0x0)return!![];if(D<0x0)return![];}return l[w(0x126)]>j[w(0x126)];}function error(i){const X=a11O;console['error'](chalk_1[X(0x146)][X(0x15a)](X(0x12f)+i));}exports[a11O(0x132)]=error;function warning(i){const K=a11O;console[K(0x132)](chalk_1['default'][K(0x13a)](''+i));}exports[a11O(0x157)]=warning;function success(i){const N=a11O;console[N(0x143)](chalk_1[N(0x146)][N(0x11f)](''+i));}exports[a11O(0x136)]=success;function getCommand(i=![]){const m=a11O,p=new commander_1[(m(0x13d))]();return p[m(0x138)](![]),p[m(0x123)](![]),p[m(0x12b)](![]),p[m(0x139)](!![]),i&&(p[m(0x11d)](m(0x152),m(0x134),![]),p[m(0x11d)](m(0x12a),m(0x120),![])),p;}exports[a11O(0x147)]=getCommand;function a11p(i,p){const B=a11i();return a11p=function(H,j){H=H-0x11b;let l=B[H];return l;},a11p(i,p);}const retry=(i,p=0x32)=>B=>{let H=i;const j=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield B();}catch(l){if(H<=0x0)throw l;return H-=0x1,yield new Promise(a=>setTimeout(()=>a(),p)),j();}});return j();};exports['retry']=retry;const asyncSequential=(i,p)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const J=a11O,B=Promise[J(0x14a)]([]);return i[J(0x159)]((H,j)=>H[J(0x133)](l=>p(j)[J(0x133)](a=>{const Y=J;return l[Y(0x131)](a),l;})),B);});function a11i(){const F=['warning','assertContextExisting','reduce','redBright','asyncSequential','northflank-cli/','retry','2026200lkufRp','option','customUserAgent','green','No\x20console\x20output',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','1869732fjZOfd','allowUnknownOption','checkUpdate','apply','length','json','next','__esModule','--quiet','allowExcessArguments','getCurrentToken','parse','defineProperty','Failed:\x20','throw','push','error','then','Verbose\x20output','commander','success','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','storeOptionsAsProperties','enablePositionalOptions','yellow','chalk','GET','Command','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','split','value','4717784apLwtG','../package.json','log','replace','getCurrentBaseUrl','default','getCommand','version','setLastUpdateCheck','resolve','73776AFvRTt','391504ObMlTz','4436245GEFWUG','done','getCurrentContext','77hNNGDn','contextProvider','--verbose','getDate','1459706VievYq','__awaiter','isValidJSON'];a11i=function(){return F;};return a11i();}exports[a11O(0x15b)]=asyncSequential;function isValidJSON(i){const k=a11O;try{return JSON[k(0x12d)](i);}catch(p){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(i){const M=a11O;if(i[M(0x151)][M(0x14f)]()===undefined)throw new Error('No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27');if(i['contextProvider'][M(0x145)]()===undefined)throw new Error(M(0x137));if(i[M(0x151)][M(0x12c)]()===undefined)throw new Error('No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27');}exports[a11O(0x158)]=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.2",
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": {