@northflank/cli 0.9.2 → 0.9.4

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 a6E=a6G;(function(l,G){const r=a6G,s=l();while(!![]){try{const I=-parseInt(r(0x1aa))/0x1+parseInt(r(0x155))/0x2*(-parseInt(r(0x194))/0x3)+-parseInt(r(0x15e))/0x4+-parseInt(r(0x19b))/0x5+parseInt(r(0x18b))/0x6*(parseInt(r(0x1a7))/0x7)+parseInt(r(0x162))/0x8*(parseInt(r(0x187))/0x9)+-parseInt(r(0x16d))/0xa*(-parseInt(r(0x18a))/0xb);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a6l,0xa4d1a));var __awaiter=this&&this[a6E(0x164)]||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const e=a6G;function A(p){try{n(I['next'](p));}catch(m){N(m);}}function a(p){const V=a6G;try{n(I[V(0x178)](p));}catch(m){N(m);}}function n(p){const M=a6G;p[M(0x18d)]?X(p[M(0x14e)]):z(p[M(0x14e)])[M(0x190)](A,a);}n((I=I[e(0x18f)](l,G||[]))['next']());});},__importDefault=this&&this[a6E(0x1a9)]||function(l){const w=a6E;return l&&l[w(0x1b1)]?l:{'default':l};};Object[a6E(0x19e)](exports,a6E(0x1b1),{'value':!![]}),exports[a6E(0x161)]=void 0x0;const js_client_1=require(a6E(0x188)),chalk_1=__importDefault(require(a6E(0x17f))),utils_1=require(a6E(0x1a1)),inquirer_helper_1=require(a6E(0x158));function a6G(l,G){const s=a6l();return a6G=function(I,z){I=I-0x14c;let X=s[I];return X;},a6G(l,G);}class CliExec{constructor(l){const q=a6E;this['getStandardExecCommand']=z=>(0x0,utils_1['getCommand'])(!![])[q(0x15a)](z)[q(0x159)](q(0x1a0)+z)[q(0x1a8)]('--project\x20--projectId\x20[NAME]',q(0x184))[q(0x1a8)]('--'+z+q(0x199)+z+'Id\x20[NAME]',z['charAt'](0x0)[q(0x177)]()+z[q(0x15c)](0x1)+q(0x163))[q(0x1a8)]('--container\x20--containerId\x20[NAME]',q(0x152))[q(0x1a8)]('--shell-cmd\x20[SHELL-CMD]',q(0x18c))[q(0x1a8)](q(0x1a6),'Run\x20command\x20with\x20this\x20user')['option'](q(0x19c),q(0x14c))[q(0x1a8)](q(0x17d),q(0x185),![])[q(0x1a8)](q(0x183),q(0x153)),this[q(0x19d)]=()=>({'columns':process['stdout']['columns'],'rows':process[q(0x170)][q(0x166)]}),this[q(0x1ac)]=(z,X,N,A,a,n,p,m)=>{const O=q;if(m===!![])return;const D=A===O(0x182),o=D?O(0x15b):A===undefined?O(0x1b0):'shell\x20command\x20'+chalk_1[O(0x14d)][O(0x16a)](A),T=a!==undefined?O(0x16b)+a:'',d=n!==undefined?'with\x20group:'+n:'',W=p!==undefined?O(0x160)+chalk_1[O(0x14d)]['greenBright'](p)+'\x27':'',B=[W,o,T,d][O(0x17e)](y=>y!=='')['join']('\x20'),R=O(0x198);console[O(0x173)](O(0x19a)+z+'\x20'+chalk_1[O(0x14d)][O(0x17c)](X)+'\x20in\x20project\x20'+chalk_1[O(0x14d)][O(0x17c)](N)+'\x20'+B+'\x20'+R);},this[q(0x169)]=(z,X,N=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const U=q;var A,a;try{process[U(0x186)][U(0x165)]&&(process[U(0x186)][U(0x181)](!![]),process[U(0x170)]['on'](U(0x180),()=>{const Z=U;z[Z(0x172)](this[Z(0x19d)]());}));process[U(0x186)][U(0x176)](z[U(0x16f)]),z[U(0x191)]['pipe'](process[U(0x1af)]),z[U(0x174)][U(0x176)](process[U(0x170)]),z['on'](U(0x154),p=>{const v=U;var m;(0x0,utils_1[v(0x154)])(v(0x1a5)+X+v(0x175)+((m=p[v(0x15d)])!==null&&m!==void 0x0?m:p)),process[v(0x186)]['isTTY']&&process['stdin'][v(0x181)](![]),process[v(0x167)](-0x1);});const n=yield z['waitForCommandResult']();if(N!==!![]){const p=(A=n===null||n===void 0x0?void 0x0:n['status'])!==null&&A!==void 0x0?A:'Unknown',m=(a=n===null||n===void 0x0?void 0x0:n[U(0x150)])!==null&&a!==void 0x0?a:-0x1,D=(n===null||n===void 0x0?void 0x0:n[U(0x15d)])?U(0x157)+n[U(0x15d)]:'';p===U(0x196)?(0x0,utils_1[U(0x19f)])(U(0x16e)+m):(0x0,utils_1[U(0x14f)])(U(0x179)+p+U(0x189)+m+D);}return n;}finally{process[U(0x186)]['isTTY']&&process[U(0x186)][U(0x181)](![]);}}),this[q(0x18e)]=new js_client_1['ApiClient'](l,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']});const G=new inquirer_helper_1[(q(0x1a2))](this[q(0x18e)]);this['execCmd']=(0x0,utils_1['getCommand'])()['name'](q(0x15f))['alias'](q(0x171))[q(0x159)](q(0x192));const s=this[q(0x17b)](q(0x151))[q(0x195)](z=>__awaiter(this,void 0x0,void 0x0,function*(){const S=q,{noDefaults:X,projectId:N,serviceId:A,containerId:a,shellCmd:n,user:p,group:m,command:D,quiet:o}=z;(0x0,utils_1[S(0x17a)])(this[S(0x18e)]);try{const T=X?undefined:l['getCurrentProjectName'](),d=N||T||(yield G[S(0x168)]()),W=X?undefined:l[S(0x1a3)](),B=A||W||(yield G[S(0x197)](d)()),R=n!==null&&n!==void 0x0?n:D!==undefined?S(0x182):undefined;this[S(0x1ac)](S(0x151),B,d,R,p,m,D,o);const y=process[S(0x170)][S(0x193)],K=process[S(0x170)][S(0x166)],i={'projectId':d,'serviceId':B},J=yield this[S(0x18e)][S(0x171)][S(0x16c)](i,{'containerName':a,'command':D,'shell':R,'user':p,'group':m,'ttyColumns':y,'ttyRows':K});yield this[S(0x169)](J,S(0x151),o);}catch(Q){(0x0,utils_1[S(0x154)])(''+Q[S(0x15d)]);}finally{process[S(0x167)]();}})),I=this['getStandardExecCommand']('job')['action'](z=>__awaiter(this,void 0x0,void 0x0,function*(){const g=q,{projectId:X,jobId:N,containerId:A,noDefaults:a,shellCmd:n,user:p,group:m,command:D,quiet:o}=z;(0x0,utils_1[g(0x17a)])(this[g(0x18e)]);try{const T=a?undefined:l[g(0x156)](),d=X||T||(yield G[g(0x168)]()),W=N||(yield G['askForJob'](d)());this['execStartLog']('job',W,d,n,o);const {rows:B,columns:R}=this['getTerminalSize'](),y={'projectId':d,'jobId':W},K=yield this['apiClient'][g(0x171)][g(0x1ae)](y,{'containerName':A,'command':D,'shell':n,'user':p,'group':m,'ttyColumns':R,'ttyRows':B});yield this[g(0x169)](K,g(0x1ab),o);}catch(i){(0x0,utils_1[g(0x154)])(''+i[g(0x15d)]);}finally{process['exit']();}}));this[q(0x1a4)]['addCommand'](s),this[q(0x1a4)][q(0x1ad)](I);}}exports[a6E(0x161)]=CliExec;function a6l(){const j=['Project\x20for\x20exec','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','stdin','18wVbQPt','@northflank/js-client',',\x20exit\x20code:\x20','55HdBBQn','12htNXsk','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','done','apiClient','apply','then','stdErr','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','columns','367899ngmrmX','action','Success','askForService','(exit\x20with\x20\x27Ctrl+D\x27)','\x20--','Exec\x20','477590msVZxZ','--group\x20[GROUP]','getTerminalSize','defineProperty','success','Command\x20exec\x20for\x20the\x20specified\x20','../utils','InquirerHelper','getCurrentServiceName','execCmd','Error\x20occured\x20during\x20','--user\x20[USER]','4226285UqFbDT','option','__importDefault','315689XRmfeD','job','execStartLog','addCommand','execJobSession','stderr','with\x20shell\x20session','__esModule','Run\x20command\x20with\x20this\x20group','default','value','warning','exitCode','service','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise','error','4DPTYzD','getCurrentProjectName',',\x20details:\x20','../inquirer-helper','description','name','without\x20shell','slice','message','4180008dzUuEC','command-exec','with\x20command\x20\x27','CliExec','3038032vOoABQ','\x20to\x20exec\x20into','__awaiter','isTTY','rows','exit','askForProject','handleShellSession','greenBright','with\x20user:','execServiceSession','819110TBJzCz','Command\x20completed\x20successfully,\x20exit\x20code:\x20','stdIn','stdout','exec','resizeTerminal','log','stdOut','\x20command\x20exec:\x20','pipe','toUpperCase','throw','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','assertContextExisting','getStandardExecCommand','bold','--noDefaults','filter','chalk','resize','setRawMode','none','--cmd\x20--command\x20[COMMAND]'];a6l=function(){return j;};return a6l();}
@@ -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 a7T=a7G;(function(l,G){const o=a7G,s=l();while(!![]){try{const I=parseInt(o(0x1df))/0x1+parseInt(o(0x1c8))/0x2+-parseInt(o(0x247))/0x3*(-parseInt(o(0x1f9))/0x4)+-parseInt(o(0x26e))/0x5+-parseInt(o(0x1d7))/0x6+-parseInt(o(0x258))/0x7*(-parseInt(o(0x1b6))/0x8)+-parseInt(o(0x1c5))/0x9*(parseInt(o(0x1a3))/0xa);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a7l,0xb51c4));var __createBinding=this&&this[a7T(0x238)]||(Object['create']?function(l,G,s,I){const d=a7T;if(I===undefined)I=s;var z=Object[d(0x1b4)](G,s);(!z||('get'in z?!G['__esModule']:z['writable']||z[d(0x216)]))&&(z={'enumerable':!![],'get':function(){return G[s];}}),Object[d(0x215)](l,I,z);}:function(l,G,s,I){if(I===undefined)I=s;l[I]=G[s];}),__setModuleDefault=this&&this[a7T(0x20e)]||(Object[a7T(0x19e)]?function(l,G){const W=a7T;Object[W(0x215)](l,W(0x212),{'enumerable':!![],'value':G});}:function(l,G){const B=a7T;l[B(0x212)]=G;}),__importStar=this&&this[a7T(0x219)]||function(l){const R=a7T;if(l&&l[R(0x1b3)])return l;var G={};if(l!=null){for(var s in l)if(s!==R(0x212)&&Object[R(0x26d)][R(0x277)][R(0x285)](l,s))__createBinding(G,l,s);}return __setModuleDefault(G,l),G;},__awaiter=this&&this[a7T(0x1d1)]||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const J=a7G;function A(p){const y=a7G;try{n(I[y(0x250)](p));}catch(m){N(m);}}function a(p){const K=a7G;try{n(I[K(0x23e)](p));}catch(m){N(m);}}function n(p){const i=a7G;p[i(0x18d)]?X(p[i(0x1d6)]):z(p[i(0x1d6)])['then'](A,a);}n((I=I[J(0x1d8)](l,G||[]))[J(0x250)]());});},__importDefault=this&&this[a7T(0x23f)]||function(l){const Q=a7T;return l&&l[Q(0x1b3)]?l:{'default':l};};Object[a7T(0x215)](exports,a7T(0x1b3),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a7T(0x1f3))),chalk_1=__importDefault(require(a7T(0x23b))),fs=__importStar(require('fs')),utils_1=require(a7T(0x1f4)),api_helpers_1=require(a7T(0x209)),inquirer_pagination_prompt_1=require(a7T(0x1ce)),inquirer=require(a7T(0x24f)),inquirerSearchList=require('inquirer-search-list'),yaml=require('js-yaml');function a7l(){const lR=['default','askForResource','ask','defineProperty','configurable','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','No\x20builds\x20found','__importStar','Unexpected\x20file\x20type:\x20','whiteBright','type','toUpperCase','saveFile','No,\x20but\x20save\x20as\x20file','Writing\x20configuration\x20failed:\x20','Something\x20unexpected\x20happened.','nextPageCursor','bgGrey','secret','domains','volume','backups','message','job\x20runs','What\x27s\x20the\x20','askForProjectScopedResource','addon:\x20\x27','Please\x20confirm\x20following\x20configuration:\x0a','must\x20be\x20a\x20number,\x20is\x20','split','\x20and\x20it\x20','builds','max','service','has','required','job','logSinks','__createBinding','project','askForJobRun','chalk','askArrayEntry','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','throw','__importDefault','.*\x5c.(json|yaml|yml)$','concat','\x20characters,\x20is\x20','Go\x20to\x20editor','array','confirmation','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','3309087bQMXxr','askForProjectScopedResourcePaginated','Aborted.','writeFileSync','charAt','No,\x20repeat','then','json','inquirer','next','\x20characters','warning','credentials','Choose\x20the\x20login\x20token:','to\x20use:','EDIT','isObject','3045875GrvlqU','get','DynamicReloadPaginationPrompt','domain\x20(','loginPrompt','success','length','addons','jobs','\x20type?','SAVE','pagination','What\x20do\x20you\x20want\x20to\x20use\x20as','project:\x20\x27','askForSubdomain','isEmpty','don\x27t\x20change','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','description','boolean','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','prototype','2344130JglYXz','askForDomain','askForBuild','Configuration\x20file\x20written\x20to\x20','retry','object','bold',',\x20supported\x20types:\x20[json|yaml|yml]','blue','hasOwnProperty','createdAt','unset','resultCache','items','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','greenBright','getPathString','cmdPath','filter','editPayload','editedResult','reset','yellowBright','call','for\x20this\x20','data','this\x20option\x20is\x20required,\x20please\x20answer','done','assign','template\x20run','pop','values','isValidJSON','yaml','toString','body','No\x20','nextCursor','subdomains','projects','\x20to\x20use:','askForLogSink','pathVars','\x20(startedAt:\x20','create','\x20in\x20','No,\x20edit','rawObject','askForJob','70PpgnLc','cursor','list','slice','getInnerType','addEntry','askForResourcePaginated','minimum','Choose\x20the\x20','find','askGeneric','templates','isBoolean','fetchResourceList','templateRuns','red','__esModule','getOwnPropertyDescriptor','YES','16CmZJrw','Yes,\x20send','maxLength','repeat','defaultPaginationPageSize','domain','tmpCmdPath','safeLoad','getCurrentProjectName','runs','confirmationPrompt','askForProject','tokenPrompt','job\x20builds','\x20(completedAt:\x20','2272383QgocMs','doesn\x27t\x20match\x20pattern\x20\x27','getType','1085966HOmlLD','isUndefined','main-context','string','Context\x20name\x20already\x20exists.','name','./pagination/inquirer-pagination-prompt','setPathVars','isNaN','__awaiter','example','password','askConfirm','addon','value','1529046KDPmhW','apply','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','pattern','trim','propToType','getQuestionString','integer','716642iRqHRS','test','deleteWarningPrompt','set','keys','join','job:\x20\x27','\x20(full\x20domain:\x20','minLength','askForVolume','token','search-list','override','grey','services','askForAddon','completedAt','isArray','prompt','askForTemplateRun','lodash','./utils','REPEAT','ABORT','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','4AsbfRj','No,\x20abort','green','Template\x20id\x20not\x20provided.','opt','Context\x20with\x20name\x20\x27','push','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','volumes','retrievePayloadViaInteractiveCli','validate','pagination-prompt','map','askForTemplate','editor','askForAddonBackup','./api-helpers','apiClient','properties','confirm','input','__setModuleDefault','oneOf','maximum','\x20Example:\x20'];a7l=function(){return lR;};return a7l();}var ConfirmChoices;(function(l){const r=a7T;l[r(0x1b5)]=r(0x1b7),l[r(0x1f5)]=r(0x24c),l[r(0x256)]=r(0x1a0),l[r(0x262)]=r(0x21f),l[r(0x1f6)]=r(0x1fa);}(ConfirmChoices||(ConfirmChoices={})));function a7G(l,G){const s=a7l();return a7G=function(I,z){I=I-0x18d;let X=s[I];return X;},a7G(l,G);}class InquirerHelper{constructor(l){const E=a7T;this['apiClient']=l,this[E(0x1ba)]=0x32,this['editPayload']=G=>__awaiter(this,void 0x0,void 0x0,function*(){const V=E,{editedResult:s}=yield inquirer[V(0x1f1)]([{'type':V(0x207),'name':V(0x282),'message':V(0x243),'default':yaml['safeDump'](G)}]);return yaml[V(0x1bd)](s);}),this[E(0x21e)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const M=E,s=N=>M(0x21a)+N+M(0x275);function I(){return __awaiter(this,void 0x0,void 0x0,function*(){const e=a7G;return inquirer['prompt']([{'type':e(0x20d),'name':'fileName','message':e(0x1f8),'validate':N=>new RegExp(e(0x240))[e(0x1e0)](N)?!![]:s(N)}]);});}const {fileName:z}=yield I(),X=z[M(0x194)]()[M(0x22f)]('.')[M(0x190)]();try{switch(X){case M(0x24e):(0x0,utils_1['success'])(M(0x271)+z);return fs[M(0x24a)](z,JSON['stringify'](G,null,'\x20\x20'));case M(0x193):case'yml':(0x0,utils_1[M(0x25d)])(M(0x271)+z);return fs[M(0x24a)](z,yaml['safeDump'](G));default:(0x0,utils_1['warning'])(s(X));}}catch(N){(0x0,utils_1[M(0x252)])(M(0x220)+N[M(0x228)]);}return undefined;}),this[E(0x280)]=(G,s)=>I=>{const w=E,z=typeof I==='string'?I[w(0x1db)]():I;return s===![]&&z===w(0x268)?'':z;},this['validate']=(G,s,I)=>z=>{const q=E,X=[];if(z===''||z===q(0x268)){if(s!==![])X[q(0x1ff)](q(0x288));else return!![];}G[q(0x21c)]===q(0x1cb)&&!_[q(0x1c9)](G[q(0x1da)])&&X[q(0x1ff)](new RegExp(G[q(0x1da)])['test'](z)?!![]:q(0x1c6)+G[q(0x1da)]+'\x27');G[q(0x21c)]===q(0x1cb)&&!_[q(0x1c9)](G[q(0x1e7)])&&X[q(0x1ff)](z[q(0x25e)]>=G[q(0x1e7)]?!![]:'must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20'+G['minLength']+q(0x242)+z['length']+q(0x251));G[q(0x21c)]==='string'&&!_[q(0x1c9)](G[q(0x1b8)])&&X[q(0x1ff)](z[q(0x25e)]<=G['maxLength']?!![]:q(0x269)+G['maxLength']+q(0x242)+z[q(0x25e)]+'\x20characters');I&&Number[q(0x1d0)](parseInt(z,0xa))&&X[q(0x1ff)](q(0x22e)+z);G[q(0x21c)]===q(0x1de)&&!_[q(0x1c9)](G[q(0x1aa)])&&X[q(0x1ff)](z>=G['minimum']?!![]:q(0x217)+G[q(0x1aa)]);G[q(0x21c)]===q(0x1de)&&!_[q(0x1c9)](G[q(0x210)])&&X['push'](z<=G[q(0x210)]?!![]:q(0x23d)+G['maximum']);if(G[q(0x21c)]===q(0x1a1)){const a=(0x0,utils_1[q(0x192)])(z);X[q(0x1ff)](a===![]||_[q(0x267)](a)?q(0x26c):!![]);}const N=X['filter'](n=>n!==!![]),A=(G===null||G===void 0x0?void 0x0:G[q(0x1d2)])?'\x0a'+chalk_1[q(0x212)][q(0x1b2)]('>>')+q(0x211)+chalk_1['default'][q(0x21b)](JSON['stringify'](G['example'])):'';return N['length']>0x0?N['join'](chalk_1[q(0x212)]['underline'](q(0x230)))+A:!![];},this[E(0x27e)]=(G,s,I)=>{const O=E,z=G[G[O(0x25e)]-0x1];function X(){const U=O;return G['slice'](0x0,-0x1)[U(0x205)](a=>a[U(0x24b)](0x0)[U(0x21d)]()+a[U(0x1a6)](0x1))[U(0x1e4)]('>');}const N=G['length']>0x1?chalk_1[O(0x212)][O(0x223)][O(0x21b)](X())+':\x20':'',A=I?'\x20('+chalk_1[O(0x212)][O(0x276)](I)+')':'';return chalk_1[O(0x212)][O(0x283)](''+N+s+'\x20'+chalk_1[O(0x212)][O(0x274)][O(0x27d)](z)+A+'?');},this[E(0x213)]=(G,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=E;if(s['length']<0x1){const N=I?Z(0x286)+I:'found';throw new Error('No\x20'+G+'\x20'+N+'.');}const z=Z(0x1ab)+G+Z(0x19a),X=s[Z(0x25e)]>0x4?Z(0x1ea):Z(0x1a5);return(yield inquirer['prompt']([{'type':X,'name':Z(0x1cd),'message':z,'choices':s}]))['name'];}),this[E(0x1a9)]=(G,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const v=E,{elements:z,nextCursor:X}=yield s();if(z[v(0x25e)]<0x1){const a=I?v(0x286)+I:'found';throw new Error(v(0x196)+G+'\x20'+a+'.');}const N=v(0x1ab)+G+v(0x19a);if(X!==undefined){const n=({nextPageCursor:p})=>__awaiter(this,void 0x0,void 0x0,function*(){const S=v,m=yield s(p);return{'elements':m['elements'],'nextPageCursor':m[S(0x197)]};});return(yield inquirer[v(0x1f1)]([{'type':v(0x204),'name':v(0x1cd),'message':N,'choices':z,'nextPageCursor':X,'loadMore':n}]))['name'];}const A=z['length']>0x4?v(0x1ea):v(0x1a5);return(yield inquirer[v(0x1f1)]([{'type':A,'name':v(0x1cd),'message':N,'choices':z}]))[v(0x1cd)];}),this[E(0x1ad)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const g=E,I=''+(s?'('+chalk_1[g(0x212)]['blue'](s)+')\x20':''),z='Enter\x20the\x20'+chalk_1['default'][g(0x1fb)](G)+'\x20'+I+g(0x255),X=this[g(0x203)]({'type':'string','required':!![]});return(yield inquirer[g(0x1f1)]([{'type':g(0x20d),'name':g(0x1cd),'message':z,'validate':X}]))['name'];}),this[E(0x1d4)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const j=E;return(yield inquirer['prompt']([{'type':j(0x20c),'name':j(0x1cd),'message':G,'default':!![]}]))[j(0x1cd)];}),this['askForService']=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const f=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const C=a7G;var X;const N=yield this['apiClient'][C(0x1a5)][C(0x1ed)]({'parameters':{'projectId':I},'options':{'per_page':this[C(0x1ba)],'cursor':z}}),A=N[C(0x287)]['services'][C(0x205)](a=>a['id']);return{'elements':A,'nextCursor':(X=N[C(0x263)])===null||X===void 0x0?void 0x0:X[C(0x1a4)]};});return this[f(0x248)](f(0x233),s,G);}),this[E(0x206)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=s=>__awaiter(this,void 0x0,void 0x0,function*(){const h=a7G;var I;const z=yield this[h(0x20a)][h(0x1a5)][h(0x1ae)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':s}}),X=z[h(0x287)]['templates'][h(0x205)](N=>N['id']);return{'elements':X,'nextCursor':(I=z[h(0x263)])===null||I===void 0x0?void 0x0:I[h(0x1a4)]};});return this['askForResourcePaginated']('template',G);}),this[E(0x1f2)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=E;if(_[F(0x1c9)](G))throw new Error(F(0x1fc));const s=I=>__awaiter(this,void 0x0,void 0x0,function*(){const P=F;var z;let X=this[P(0x1ba)];const N=yield this['apiClient'][P(0x1a5)][P(0x1b1)]({'parameters':{'templateId':G},'options':{'per_page':X,'cursor':I}}),A=N[P(0x287)][P(0x1b1)]['map'](a=>a['id']+'\x20(startedAt:\x20'+a['createdAt']+')');return{'elements':A,'nextCursor':(z=N['pagination'])===null||z===void 0x0?void 0x0:z[P(0x1a4)]};});return this[F(0x1a9)](F(0x18f),s)[F(0x24d)](I=>I[F(0x22f)]('\x20')[0x0]);}),this[E(0x19b)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=s=>__awaiter(this,void 0x0,void 0x0,function*(){const L=a7G;var I;let z=this['defaultPaginationPageSize'];const X=yield this['apiClient']['list'][L(0x237)]({'options':{'per_page':z,'cursor':s}}),N=X[L(0x287)]['logSinks'][L(0x205)](A=>A['id']);return{'elements':N,'nextCursor':(I=X[L(0x263)])===null||I===void 0x0?void 0x0:I[L(0x1a4)]};});return this['askForResourcePaginated']('log\x20sink',G);}),this[E(0x1a2)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const k=a7G;var X;const N=yield this['apiClient'][k(0x1a5)][k(0x260)]({'parameters':{'projectId':I},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':z}}),A=N[k(0x287)][k(0x260)][k(0x205)](a=>a['id']);return{'elements':A,'nextCursor':(X=N[k(0x263)])===null||X===void 0x0?void 0x0:X[k(0x1a4)]};});return this['askForProjectScopedResourcePaginated'](Y(0x236),s,G);}),this[E(0x23a)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=E,I=z=>X=>__awaiter(this,void 0x0,void 0x0,function*(){const x=a7G;var N;const A=yield this['apiClient'][x(0x259)][x(0x236)][x(0x1bf)]({'parameters':{'projectId':z,'jobId':G},'options':{'per_page':this[x(0x1ba)],'cursor':X}}),a=A[x(0x287)][x(0x1bf)][x(0x205)](n=>n['id']+x(0x19d)+n['startedAt']+')');return{'elements':a,'nextCursor':(N=A[x(0x263)])===null||N===void 0x0?void 0x0:N[x(0x1a4)]};});return this[u(0x248)](u(0x229),I,s,u(0x1e5)+G+'\x27')['then'](z=>z[u(0x22f)]('\x20')[0x0]);}),this[E(0x270)]=(G,s,I)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const t=E;if(I!==undefined){const z=X=>N=>__awaiter(this,void 0x0,void 0x0,function*(){const b=a7G;var A;const a=yield this[b(0x20a)]['get'][b(0x236)][b(0x231)]({'parameters':{'projectId':X,'jobId':I},'options':{'per_page':this[b(0x1ba)],'cursor':N}});return{'elements':a[b(0x287)][b(0x231)][b(0x205)](n=>n['id']+b(0x19d)+n[b(0x278)]+')'),'nextCursor':(A=a[b(0x263)])===null||A===void 0x0?void 0x0:A['cursor']};});return this[t(0x248)](t(0x1c3),z,G,t(0x1e5)+I+'\x27')['then'](X=>X['split']('\x20')[0x0]);}if(s!==undefined){const X=N=>A=>__awaiter(this,void 0x0,void 0x0,function*(){const H=t;var a;const n=yield this['apiClient'][H(0x259)]['service']['builds']({'parameters':{'projectId':N,'serviceId':s},'options':{'per_page':this[H(0x1ba)],'cursor':A}});return{'elements':n[H(0x287)][H(0x231)][H(0x205)](p=>p['id']+H(0x19d)+p[H(0x278)]+')'),'nextCursor':(a=n[H(0x263)])===null||a===void 0x0?void 0x0:a[H(0x1a4)]};});return this[t(0x248)]('job\x20build',X,G,'service:\x20\x27'+I+'\x27')[t(0x24d)](N=>N['split']('\x20')[0x0]);}throw new Error(t(0x218));}),this[E(0x1ee)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l1=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const l0=a7G;var X;const N=yield this['apiClient'][l0(0x1a5)][l0(0x25f)]({'parameters':{'projectId':I},'options':{'per_page':this[l0(0x1ba)],'cursor':z}});return{'elements':N[l0(0x287)][l0(0x25f)]['map'](A=>A['id']),'nextCursor':(X=N[l0(0x263)])===null||X===void 0x0?void 0x0:X['cursor']};});return this[l1(0x248)](l1(0x1d5),s,G);}),this[E(0x208)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l3=E,I=z=>X=>__awaiter(this,void 0x0,void 0x0,function*(){const l2=a7G;var N;const A=yield this[l2(0x20a)][l2(0x259)][l2(0x1d5)]['backups']({'parameters':{'projectId':z,'addonId':s},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':X}});return{'elements':A['data'][l2(0x227)][l2(0x205)](a=>a['id']+l2(0x1c4)+(a[l2(0x1ef)]||'not\x20completed')+')'),'nextCursor':(N=A[l2(0x263)])===null||N===void 0x0?void 0x0:N['cursor']};});return this[l3(0x248)]('backups',I,G,l3(0x22c)+s+'\x27')['then'](z=>z['split']('\x20')[0x0]);}),this[E(0x1e8)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l5=E,s=I=>__awaiter(this,void 0x0,void 0x0,function*(){const l4=a7G;return(yield this['apiClient'][l4(0x1a5)][l4(0x201)]({'parameters':{'projectId':I}}))[l4(0x287)][l4(0x205)](z=>z['id']);});return this[l5(0x22b)](l5(0x226),s,G);}),this['askForSecret']=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l7=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const l6=a7G;var X;const N=yield this[l6(0x20a)][l6(0x1a5)]['secrets']({'parameters':{'projectId':I},'options':{'per_page':this[l6(0x1ba)],'cursor':z}});return{'elements':N[l6(0x287)]['secrets'][l6(0x205)](A=>A['id']),'nextCursor':(X=N[l6(0x263)])===null||X===void 0x0?void 0x0:X[l6(0x1a4)]};});return this[l7(0x248)](l7(0x224),s,G);}),this[E(0x266)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l8=E,s=yield this[l8(0x20a)][l8(0x259)][l8(0x1bb)]({'parameters':{'domain':G}}),I=s[l8(0x287)][l8(0x198)][l8(0x205)](X=>X['name']+l8(0x1e6)+X['fullName']+')'),z=l8(0x25b)+G+')';return this['askForResource']('subdomain',I,z)['then'](X=>X[l8(0x22f)]('\x20')[0x0]);}),this[E(0x1e1)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const l9=E;return(yield inquirer['prompt']([{'type':'confirm','name':l9(0x245),'message':chalk_1[l9(0x212)][l9(0x284)](l9(0x27c)+(G||'a\x20Northflank\x20resource')+l9(0x1d9)),'default':![]}]))[l9(0x245)];}),this[E(0x25c)]=(G,s)=>__awaiter(this,void 0x0,void 0x0,function*(){const ll=E;_[ll(0x1c9)](G[ll(0x1cd)])&&(s[ll(0x25e)]<=0x0?_[ll(0x1e2)](G,ll(0x1cd),ll(0x212)):yield(0x0,utils_1[ll(0x272)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const lG=ll,{name:I}=yield inquirer[lG(0x1f1)]([{'type':lG(0x20d),'name':lG(0x1cd),'message':lG(0x246),'default':lG(0x1ca)}]);if(!G[lG(0x1eb)]&&s[lG(0x1ac)](z=>z[lG(0x1cd)]===I)){const {c:z}=yield inquirer[lG(0x1f1)]([{'type':lG(0x20c),'name':'c','message':lG(0x1fe)+I+lG(0x200),'default':![]}]);if(z===![])throw new Error(lG(0x1cc));_[lG(0x1e2)](G,lG(0x1eb),!![]);}_['set'](G,lG(0x1cd),I);})));if(_[ll(0x1c9)](G[ll(0x1e9)])){const I=yield this[ll(0x1c2)]();_['set'](G,'token',I);}return G;}),this[E(0x1c2)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const ls=E,{token:G}=yield inquirer[ls(0x1f1)]([{'type':ls(0x1d3),'name':ls(0x1e9),'mask':'*','message':ls(0x254)}]);return G;}),inquirer['registerPrompt'](E(0x1ea),inquirerSearchList),inquirer['registerPrompt'](E(0x204),inquirer_pagination_prompt_1[E(0x25a)]);}[a7T(0x1c0)](l,G){return __awaiter(this,void 0x0,void 0x0,function*(){const lI=a7G,s=yaml['safeDump'](l),I=_[lI(0x232)](s[lI(0x22f)]('\x0a')['map'](N=>N[lI(0x25e)])),z=chalk_1['default'][lI(0x1ec)]('-'[lI(0x1b9)](I)+'\x0a'),{confirm:X}=yield inquirer[lI(0x1f1)]([{'type':lI(0x1a5),'name':'confirm','message':''+chalk_1['default'][lI(0x274)][lI(0x1fb)](lI(0x22d))+z+chalk_1[lI(0x212)]['blueBright'](s)+z,'choices':Object[lI(0x191)](ConfirmChoices)}]);switch(X){case ConfirmChoices['YES']:return l;case ConfirmChoices['ABORT']:throw new Error(lI(0x249));case ConfirmChoices[lI(0x1f5)]:return this['retrievePayloadViaInteractiveCli'](G);case ConfirmChoices[lI(0x256)]:return this[lI(0x1c0)](yield this[lI(0x281)](l),G);case ConfirmChoices[lI(0x262)]:yield this['saveFile'](l);return this[lI(0x1c0)](l,G);default:throw new Error(lI(0x221));}});}[a7T(0x202)](l,G){return __awaiter(this,void 0x0,void 0x0,function*(){const lz=a7G;if((G===null||G===void 0x0?void 0x0:G[lz(0x27a)])!==undefined)this[lz(0x27a)]=G===null||G===void 0x0?void 0x0:G[lz(0x27a)];this['tmpCmdPath']=G===null||G===void 0x0?void 0x0:G[lz(0x27f)];const s={};return yield this['propToType']([],l[lz(0x1fd)][lz(0x195)],s),this[lz(0x27a)]=s,yield this['confirmationPrompt'](s,l);});}[a7T(0x1dc)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lX=a7G;let z;if(G[lX(0x20f)]&&!_[lX(0x234)](G,'properties')){if(G[lX(0x20f)][lX(0x25e)]>0x1){const {choice:X}=yield inquirer[lX(0x1f1)]([{'type':lX(0x1a5),'name':'choice','message':lX(0x22a)+(l[l[lX(0x25e)]-0x1]||'')+lX(0x261),'choices':G[lX(0x20f)][lX(0x205)](N=>{var A;return(A=N['description'])!==null&&A!==void 0x0?A:'??';})}]);z=yield this[lX(0x1c7)](l,G['oneOf'][lX(0x1ac)](N=>N[lX(0x26a)]===X),s,I);}else{const N=G['oneOf'][0x0];_[lX(0x1e2)](N,'description',G[lX(0x26a)]),z=yield this[lX(0x1c7)](l,N,s,I);}z={};}else z=yield this[lX(0x1c7)](l,G,s,I);return z;});}[a7T(0x1a7)](l,G,s,I){var z;return __awaiter(this,void 0x0,void 0x0,function*(){const lN=a7G;if(I===![]){const {addEntry:A}=yield inquirer['prompt']([{'type':lN(0x20c),'name':lN(0x1a8),'message':this[lN(0x27e)](G,'Do\x20you\x20want\x20to\x20add',l===null||l===void 0x0?void 0x0:l[lN(0x26a)]),'default':![]}]);if(!A)return s;}const X=Object[lN(0x1e3)]((z=l===null||l===void 0x0?void 0x0:l[lN(0x20b)])!==null&&z!==void 0x0?z:[]),N=l[lN(0x235)]||[];if(X[lN(0x25e)]>0x0)for(const a of X){const n=G[lN(0x241)](a);if(G[lN(0x25e)]>0x0&&!_['has'](s,G['join']('.')))_[lN(0x1e2)](s,G[lN(0x1e4)]('.'),{});yield this['propToType'](n,l[lN(0x20b)][a],s,N['includes'](a));}else yield this['getType'](G,Object['assign'](Object[lN(0x18e)]({},l),{'type':lN(0x1a1)}),s,I);return s;});}[a7T(0x23c)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lA=a7G;if(G&&s)return!![];const z=G?'Do\x20you\x20want\x20to\x20add':'Do\x20you\x20want\x20to\x20add\x20more',{addEntry:X}=yield inquirer[lA(0x1f1)]([{'type':'confirm','name':lA(0x1a8),'message':this['getPathString'](l,z,G?I:undefined),'default':![]}]);return X;});}['getType'](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const la=a7G;let z;const X=l['join']('.');switch(G===null||G===void 0x0?void 0x0:G['type']){case la(0x244):{let N=!![];while(yield this[la(0x23c)](l,N,I,G===null||G===void 0x0?void 0x0:G['description'])){const A=_[la(0x259)](s,X);_[la(0x279)](s,X),yield this['getType'](l,G[la(0x27b)],s);const a=_[la(0x259)](s,X);!_[la(0x1f0)](A)?_[la(0x1e2)](s,X,[a]):(A[la(0x1ff)](a),_['set'](s,X,A)),N=![];}return z||[];}case la(0x273):{return z=yield this['getInnerType'](G,l,s,I),z;}case'rawObject':z=(0x0,utils_1[la(0x192)])(yield this[la(0x214)](l,G,I))||undefined;break;case la(0x1cb):case'boolean':case la(0x1de):default:z=yield this[la(0x214)](l,G,I,s);break;}return!_[la(0x1c9)](z)&&_['set'](s,X,z),z;});}['ask'](l,G,s,I){var z;return __awaiter(this,void 0x0,void 0x0,function*(){const ln=a7G,X=l[l[ln(0x25e)]-0x1],{defaultValue:defaultValue=(z=G===null||G===void 0x0?void 0x0:G[ln(0x1d2)])!==null&&z!==void 0x0?z:G===null||G===void 0x0?void 0x0:G['default'],choices:choices=G===null||G===void 0x0?void 0x0:G['enum'],pagination:N}=yield(0x0,api_helpers_1[ln(0x1b0)])(X,this[ln(0x20a)],this[ln(0x1bc)],I,this[ln(0x19c)],l);let A=ln(0x20d);if(!_[ln(0x1c9)](choices)&&choices['length']>0x0){if(N!==undefined&&N[ln(0x222)]!==undefined)A=ln(0x204);else choices['length']>0x4&&typeof choices[0x0]===ln(0x1cb)?A=ln(0x1ea):A=ln(0x1a5);}else{if((G===null||G===void 0x0?void 0x0:G[ln(0x21c)])===ln(0x26b))A=ln(0x20c);else{if((G===null||G===void 0x0?void 0x0:G[ln(0x21c)])===ln(0x1de))A=ln(0x20d);else(G===null||G===void 0x0?void 0x0:G['type'])==='rawObject'&&(A=ln(0x207));}}let a=s!==![]?!_[ln(0x257)](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[ln(0x1af)](defaultValue)?defaultValue:ln(0x268);if(choices)a=a['toString']();_[ln(0x234)](this[ln(0x27a)],l[ln(0x1e4)]('.'))&&(a=this[ln(0x27a)][l[ln(0x1e4)]('.')]);const n=choices&&s===![]?['don\x27t\x20change',...choices]:choices,p=(G===null||G===void 0x0?void 0x0:G[ln(0x21c)])==='integer',m=Object[ln(0x18e)]({'type':A,'name':'id','message':this[ln(0x1dd)](l,G),'choices':n,'default':a,'filter':this[ln(0x280)](A,s),'validate':this[ln(0x203)](G,s,p)},N),D=(yield inquirer[ln(0x1f1)]([m]))['id'];if(D===ln(0x268)||D==='')return undefined;if(p)return parseInt(D,0xa);return D;});}[a7T(0x1dd)](l,G){const lp=a7T,s=(G===null||G===void 0x0?void 0x0:G[lp(0x21c)])!=='boolean'?lp(0x264):'Should\x20it\x20be';return this[lp(0x27e)](l,s,G===null||G===void 0x0?void 0x0:G[lp(0x26a)]);}[a7T(0x1c1)](){return __awaiter(this,void 0x0,void 0x0,function*(){const lD=a7G,l=G=>__awaiter(this,void 0x0,void 0x0,function*(){const lm=a7G;var s;const I=yield this['apiClient'][lm(0x1a5)][lm(0x199)]({'options':{'per_page':this[lm(0x1ba)],'cursor':G}}),z=I[lm(0x287)][lm(0x199)]['map'](X=>X['id']);return{'elements':z,'nextCursor':(s=I[lm(0x263)])===null||s===void 0x0?void 0x0:s[lm(0x1a4)]};});return yield this[lD(0x1a9)](lD(0x239),l);});}[a7T(0x22b)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lo=a7G,z=s||this[lo(0x20a)]['contextProvider'][lo(0x1be)]();if(_['isUndefined'](z))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const X=yield G(z);return yield this[lo(0x213)](l,X,(I?I+lo(0x19f):'')+lo(0x265)+z+'\x27');});}['askForProjectScopedResourcePaginated'](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lT=a7G,z=s||this['apiClient']['contextProvider']['getCurrentProjectName']();if(_[lT(0x1c9)](z))throw new Error(lT(0x1f7));const X=yield G(z);return yield this['askForResourcePaginated'](l,X,(I?I+lT(0x19f):'')+lT(0x265)+z+'\x27');});}[a7T(0x26f)](){return __awaiter(this,void 0x0,void 0x0,function*(){const ld=a7G,l=yield this[ld(0x20a)]['list'][ld(0x225)]({}),G=l['data']['domains'][ld(0x205)](s=>s[ld(0x1cd)]);return this['askForResource'](ld(0x1bb),G);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const lW=a7G,l=yield this[lW(0x20a)][lW(0x1a5)]['registries']({}),G=l[lW(0x287)][lW(0x253)][lW(0x205)](s=>s['id']);return this[lW(0x213)](lW(0x253),G);});}[a7T(0x1cf)](l){const lB=a7T;this[lB(0x19c)]=l;}}exports['InquirerHelper']=InquirerHelper;
@@ -1 +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 a8i=a8G;function a8l(){const P=['SIGINT','call','20XEPfmo','__importDefault','createWebSocketStream','Unexpected\x20response','aborted','6879645LQodAX','4474360pdVkoj','getOwnPropertyDescriptor','removeListener','stringify','then','NorthflankApiBrowserLogin','events','success','hasOwnProperty','6831544FjslGv','throw','parse','http:','Unable\x20to\x20open\x20browser:\x20','96qLHDaP','unable\x20to\x20parse\x20message:\x20','startLogin','create','value','init','configurable','emit','idle','wss:','75jKYWdu','4884fVorVH','EventEmitter','initPackage','handleError','Failure\x20during\x20login:\x20','error','__createBinding','baseUrl','message','write','login-success','type','end','6458023ukWMZg','apply','https:','prototype','get','openBrowser','6906ItIUpE','exit','1563fDeBlf','next','replace','data','default','finally','/v1/cli-login','__esModule','17164sVtKYi','defineProperty','status','__awaiter','duplex','login-failure'];a8l=function(){return P;};return a8l();}(function(l,G){const K=a8G,s=l();while(!![]){try{const I=parseInt(K(0x1cb))/0x1*(parseInt(K(0x1df))/0x2)+parseInt(K(0x1e1))/0x3*(parseInt(K(0x1cc))/0x4)+parseInt(K(0x1b3))/0x5+-parseInt(K(0x1c1))/0x6*(parseInt(K(0x1e9))/0x7)+-parseInt(K(0x1bc))/0x8+parseInt(K(0x1f6))/0x9+-parseInt(K(0x1f1))/0xa*(parseInt(K(0x1d9))/0xb);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a8l,0x76e78));function a8G(l,G){const s=a8l();return a8G=function(I,z){I=I-0x1b3;let X=s[I];return X;},a8G(l,G);}var __createBinding=this&&this[a8i(0x1d2)]||(Object[a8i(0x1c4)]?function(l,G,s,I){const J=a8i;if(I===undefined)I=s;var z=Object[J(0x1b4)](G,s);(!z||(J(0x1dd)in z?!G['__esModule']:z['writable']||z[J(0x1c7)]))&&(z={'enumerable':!![],'get':function(){return G[s];}}),Object['defineProperty'](l,I,z);}:function(l,G,s,I){if(I===undefined)I=s;l[I]=G[s];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a8i(0x1c4)]?function(l,G){const Q=a8i;Object[Q(0x1ea)](l,Q(0x1e5),{'enumerable':!![],'value':G});}:function(l,G){const r=a8i;l[r(0x1e5)]=G;}),__importStar=this&&this['__importStar']||function(l){const E=a8i;if(l&&l['__esModule'])return l;var G={};if(l!=null){for(var s in l)if(s!==E(0x1e5)&&Object[E(0x1dc)][E(0x1bb)][E(0x1f0)](l,s))__createBinding(G,l,s);}return __setModuleDefault(G,l),G;},__awaiter=this&&this[a8i(0x1ec)]||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const w=a8G;function A(p){const V=a8G;try{n(I[V(0x1e2)](p));}catch(m){N(m);}}function a(p){const M=a8G;try{n(I[M(0x1bd)](p));}catch(m){N(m);}}function n(p){const e=a8G;p['done']?X(p[e(0x1c5)]):z(p[e(0x1c5)])[e(0x1b7)](A,a);}n((I=I[w(0x1da)](l,G||[]))[w(0x1e2)]());});},__importDefault=this&&this[a8i(0x1f2)]||function(l){const q=a8i;return l&&l[q(0x1e8)]?l:{'default':l};};Object[a8i(0x1ea)](exports,a8i(0x1e8),{'value':!![]}),exports[a8i(0x1b8)]=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require('open')),events_1=require(a8i(0x1b9));class NorthflankApiBrowserLogin extends events_1[a8i(0x1cd)]{constructor(l,G=!![]){const O=a8i;super(),this[O(0x1d3)]=l,this['openBrowser']=G,this[O(0x1eb)]=O(0x1c9),this[O(0x1ce)]=()=>JSON[O(0x1b6)]({'type':'init'});}[a8i(0x1c3)](){const U=a8i;var l;const G=this[U(0x1d3)][U(0x1e3)](U(0x1db),U(0x1ca))['replace'](U(0x1bf),'ws:'),s=G+U(0x1e7),I=new ws_1[(U(0x1e5))](s),z=()=>__awaiter(this,void 0x0,void 0x0,function*(){const v=U;yield new Promise(N=>{const Z=a8G;var A;(A=this[Z(0x1ed)])===null||A===void 0x0?void 0x0:A[Z(0x1d8)](JSON[Z(0x1b6)]({'type':Z(0x1f5)}),()=>N());}),process[v(0x1e0)]();}),X=new Promise((N,A)=>{const S=U;var a,n,p;try{this[S(0x1ed)]=(0x0,ws_1[S(0x1f3)])(I),process['on']('SIGINT',z);}catch(m){A(new Error('Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20'+m[S(0x1d4)]));}(a=this[S(0x1ed)])===null||a===void 0x0?void 0x0:a['on'](S(0x1e4),D=>{const g=S;var o;const T=JSON[g(0x1be)](D['toString']());switch(T===null||T===void 0x0?void 0x0:T[g(0x1d7)]){case'init-ack':{const {loginPage:d}=T;if(d===undefined){this[g(0x1cf)](g(0x1f4),A);return;}this[g(0x1de)]&&(0x0,open_1[g(0x1e5)])(d)['catch'](W=>{const j=g,B=j(0x1c0)+W[j(0x1d4)];this[j(0x1cf)](B,A);});this[g(0x1c8)]('browser-opened',{'url':d});break;}case g(0x1d6):{const {apiToken:W,contextName:B}=T;if(W===undefined){this[g(0x1cf)]('Unexpected\x20response,\x20api\x20token\x20missing',A);return;}(o=this[g(0x1ed)])===null||o===void 0x0?void 0x0:o[g(0x1d8)](),N({'token':W,'contextName':B}),this[g(0x1eb)]='success';break;}case g(0x1ee):{const R=g(0x1d0)+(T===null||T===void 0x0?void 0x0:T[g(0x1d4)]);this[g(0x1cf)](R,A);break;}default:{const y=g(0x1c2)+JSON[g(0x1b6)](T);this[g(0x1cf)](y,A);}}}),(n=this[S(0x1ed)])===null||n===void 0x0?void 0x0:n['on'](S(0x1d1),D=>{const C=S;this['handleError']('error\x20happened\x20during\x20browser\x20login:\x20'+D[C(0x1d4)],A);}),(p=this[S(0x1ed)])===null||p===void 0x0?void 0x0:p['on'](S(0x1d8),()=>{const f=S;if(this[f(0x1eb)]===f(0x1ba)){}else this[f(0x1cf)]('Login\x20process\x20stopped\x20before\x20completed',A);});});return(l=this['duplex'])===null||l===void 0x0?void 0x0:l[U(0x1d5)](this[U(0x1ce)]()),this[U(0x1eb)]=U(0x1c6),X[U(0x1e6)](()=>{const h=U;process[h(0x1b5)](h(0x1ef),z);});}[a8i(0x1cf)](l,G){const F=a8i;var s,I;G?(s=this[F(0x1ed)])===null||s===void 0x0?void 0x0:s[F(0x1d8)](()=>G(new Error(l))):(I=this['duplex'])===null||I===void 0x0?void 0x0:I['end'](),this[F(0x1eb)]=F(0x1d1);}}exports[a8i(0x1b8)]=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 a9o=a9G;(function(l,G){const D=a9G,s=l();while(!![]){try{const I=-parseInt(D(0x12d))/0x1*(-parseInt(D(0x131))/0x2)+-parseInt(D(0x135))/0x3+-parseInt(D(0x117))/0x4+parseInt(D(0x11c))/0x5*(-parseInt(D(0x126))/0x6)+parseInt(D(0x129))/0x7+parseInt(D(0x123))/0x8+parseInt(D(0x13b))/0x9;if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a9l,0x1e462));var __awaiter=this&&this[a9o(0x130)]||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const W=a9G;function A(p){try{n(I['next'](p));}catch(m){N(m);}}function a(p){const T=a9G;try{n(I[T(0x133)](p));}catch(m){N(m);}}function n(p){const d=a9G;p['done']?X(p['value']):z(p[d(0x12b)])['then'](A,a);}n((I=I[W(0x128)](l,G||[]))[W(0x125)]());});},__importDefault=this&&this['__importDefault']||function(l){const B=a9o;return l&&l[B(0x11f)]?l:{'default':l};};Object[a9o(0x137)](exports,'__esModule',{'value':!![]}),exports[a9o(0x134)]=void 0x0;const list_1=__importDefault(require('inquirer/lib/prompts/list')),choice_1=__importDefault(require('inquirer/lib/objects/choice')),chalk_1=__importDefault(require(a9o(0x13c)));function incrementListIndex(l,G,s){const R=a9o,I=s[R(0x13a)][R(0x138)],z='loop'in s?Boolean(s[R(0x11b)]):!![];if(G==='up'){if(l>0x0)return l-0x1;return z?I-0x1:l;}if(G===R(0x139)){if(l<I-0x1)return l+0x1;return z?0x0:l;}throw new Error(R(0x121));}function a9l(){const r=['__esModule','italic','dir\x20must\x20be\x20up\x20or\x20down','\x20Loading\x20more\x20options','1979592ZiMNCT','splice','next','6MHXfXK','onUpKey','apply','372120CTIyKQ','loading','value','default','65129qZrFhr','length','reloadText','__awaiter','4skJuoX','selected','throw','DynamicReloadPaginationPrompt','288390HtUJgx','pagOpt','defineProperty','realLength','down','choices','1446633cvHyBj','chalk','push','catch','677820DlEDfN','opt','..\x20Load\x20more\x20options\x20..','render','loop','1010085FPrdSw','map','nextPageCursor'];a9l=function(){return r;};return a9l();}function a9G(l,G){const s=a9l();return a9G=function(I,z){I=I-0x117;let X=s[I];return X;},a9G(l,G);}class DynamicReloadPaginationPrompt extends list_1[a9o(0x12c)]{constructor(l,G,s){const y=a9o;super(l,G,s),this[y(0x12f)]=chalk_1[y(0x12c)][y(0x120)](y(0x119)),this[y(0x12a)]=![],this['pagOpt']=this[y(0x118)],this[y(0x11e)]=this[y(0x136)][y(0x11e)],this[y(0x11e)]!==undefined&&this[y(0x118)]['choices'][y(0x13d)](new choice_1['default'](this[y(0x12f)],this[y(0x12f)]));}[a9o(0x127)](){const K=a9o;if(this[K(0x12a)])return;this[K(0x132)]=incrementListIndex(this[K(0x132)],'up',this[K(0x118)]),this[K(0x11a)]();}['onDownKey'](){return __awaiter(this,void 0x0,void 0x0,function*(){const i=a9G;if(this[i(0x12a)])return;this[i(0x132)]=incrementListIndex(this[i(0x132)],i(0x139),this[i(0x118)]),yield this['handleDynamicPageLoad'](),this[i(0x11a)]();});}['handleDynamicPageLoad'](){return __awaiter(this,void 0x0,void 0x0,function*(){const J=a9G;if(this[J(0x132)]>=this[J(0x118)][J(0x13a)][J(0x12e)]-0x1){if(this[J(0x11e)]===undefined)return;this[J(0x12a)]=!![];let l=0x0;const G=setInterval(()=>{const Q=J,X=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],N=chalk_1[Q(0x12c)][Q(0x120)](X[l%X[Q(0x12e)]]+Q(0x122));this[Q(0x118)][Q(0x13a)][Q(0x13a)][this[Q(0x132)]]['name']=''+N,l+=0x1,this[Q(0x11a)]();},0x50),{elements:s,nextPageCursor:I}=yield this[J(0x136)]['loadMore']({'nextPageCursor':this[J(0x11e)]})[J(0x13e)](()=>({'elements':[],'nextPageCursor':undefined}));this[J(0x11e)]=I;const z=s[J(0x11d)](X=>new choice_1[(J(0x12c))](X,X));this[J(0x118)]['choices']['choices'][J(0x124)](this[J(0x132)],0x1),this['opt'][J(0x13a)][J(0x13d)](...z),I!==undefined&&this[J(0x118)][J(0x13a)][J(0x13d)](new choice_1[(J(0x12c))](this['reloadText'],this['reloadText'])),clearInterval(G),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';const a10W=a10G;(function(l,G){const d=a10G,s=l();while(!![]){try{const I=parseInt(d(0xe2))/0x1+parseInt(d(0x10f))/0x2+parseInt(d(0x119))/0x3*(parseInt(d(0xf6))/0x4)+-parseInt(d(0xcf))/0x5*(parseInt(d(0xbb))/0x6)+parseInt(d(0x11f))/0x7*(parseInt(d(0xdb))/0x8)+parseInt(d(0xd3))/0x9*(parseInt(d(0x108))/0xa)+parseInt(d(0x122))/0xb*(-parseInt(d(0x111))/0xc);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a10l,0xaa0ab));var __createBinding=this&&this[a10W(0xd2)]||(Object[a10W(0x11c)]?function(l,G,s,I){const B=a10W;if(I===undefined)I=s;var z=Object[B(0xb8)](G,s);(!z||('get'in z?!G[B(0xf4)]:z[B(0xd4)]||z[B(0xc9)]))&&(z={'enumerable':!![],'get':function(){return G[s];}}),Object[B(0xc5)](l,I,z);}:function(l,G,s,I){if(I===undefined)I=s;l[I]=G[s];}),__setModuleDefault=this&&this[a10W(0xf7)]||(Object[a10W(0x11c)]?function(l,G){Object['defineProperty'](l,'default',{'enumerable':!![],'value':G});}:function(l,G){const R=a10W;l[R(0xfb)]=G;}),__importStar=this&&this[a10W(0x113)]||function(l){const y=a10W;if(l&&l[y(0xf4)])return l;var G={};if(l!=null){for(var s in l)if(s!==y(0xfb)&&Object[y(0xfd)][y(0x12b)][y(0xc2)](l,s))__createBinding(G,l,s);}return __setModuleDefault(G,l),G;},__awaiter=this&&this['__awaiter']||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const Q=a10G;function A(p){const K=a10G;try{n(I[K(0xec)](p));}catch(m){N(m);}}function a(p){const i=a10G;try{n(I[i(0x128)](p));}catch(m){N(m);}}function n(p){const J=a10G;p['done']?X(p[J(0x10a)]):z(p['value'])[J(0x12d)](A,a);}n((I=I[Q(0x109)](l,G||[]))[Q(0xec)]());});},__importDefault=this&&this['__importDefault']||function(l){const r=a10W;return l&&l[r(0xf4)]?l:{'default':l};};function a10G(l,G){const s=a10l();return a10G=function(I,z){I=I-0xb5;let X=s[I];return X;},a10G(l,G);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a10W(0xcd)]=void 0x0;function a10l(){const g=['Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','__importStar','description','forwardAddon','message','project\x20for\x20forwarding','\x20with\x20these\x20hostnames:','6471ecPxOg','protocol','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','create','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','port','8713873fqyvlB','http://','all','286gAnffs','assertContextExisting','hostnames','addCommand','fwd','Port-forwarding\x20for\x20the\x20specified\x20addon','throw','getCurrentServiceName','canExecuteWithHostnames','hasOwnProperty','--skipHostnames','then','\x20\x20Running\x20on\x20macOS\x20in\x20','green','chalk','../inquirer-helper','getOwnPropertyDescriptor','forwardProject','noDefaultsText','5882454gWzVNf','Service\x20to\x20forward','platform','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20your\x20','getCommand','warning','apiClient','call','customUserAgent','@northflank/js-client','defineProperty','getCurrentProjectName','stop','name','configurable','\x20for\x20these\x20hostnames:','ApiClient','Forwarding\x20service\x20','CliPortForward','type','5PrcNTV','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','Port-forwarding\x20for\x20the\x20specified\x20service','__createBinding','414qLICoK','writable','forward','bold','Project\x20for\x20forwarding','win32','--noDefaults','\x20in\x20project\x20','8YjpsYY','askForProject','alias','darwin','addon','askForAddon','address','1293721lTgveT','--service\x20--serviceId\x20[NAME]','tunnel-close','\x20to\x20','\x20on\x20','getProxyForwarder','SIGINT','option','C:/Windows/System32/drivers/etc/hosts','--project\x20--projectId\x20[NAME]','next','length','join','\x20addon\x20ports','skipHostnamesText','Failed:\x20','log','InquirerHelper','__esModule','action','1700EdCftq','__setModuleDefault','Stop\x20forwarding\x20traffic\x20from\x20','error','\x20and\x20','default','tunnel-open','prototype','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','service','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','\x20service\x20ports','Forwarding\x20','forEach','HTTP','--addon\x20--addonId\x20[NAME]','Forwarding\x20addon\x20','251450yQkUac','apply','value','success','askForService','portFwdCmd','/etc/hosts','1679926PNgmWu','\x20\x20\x20\x20\x20\x20\x20\x20\x20','1742316BpyMQP'];a10l=function(){return g;};return a10l();}const js_client_1=require(a10W(0xc4)),chalk_1=__importDefault(require(a10W(0xb6))),utils_1=require('../utils'),inquirer_helper_1=require(a10W(0xb7)),os=__importStar(require('os'));class CliPortForward{constructor(l){const E=a10W;this['noDefaultsText']=E(0x11d),this[E(0xf0)]=E(0xd0),this[E(0xc1)]=new js_client_1[(E(0xcb))](l,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[E(0xc3)]});const G=new inquirer_helper_1[(E(0xf3))](this[E(0xc1)]);this[E(0x10d)]=(0x0,utils_1[E(0xbf)])()[E(0xc8)](E(0xd5))[E(0xdd)](E(0x126))[E(0x114)](E(0x112));const s=(0x0,utils_1[E(0xbf)])(!![])['name']('all')[E(0x114)]('Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project')[E(0xe9)](E(0xeb),E(0x117))[E(0xe9)](E(0xd9),this[E(0xba)],![])[E(0xe9)](E(0x12c),this[E(0xf0)],![])['action'](({noDefaults:X,projectId:N,skipHostnames:A})=>__awaiter(this,void 0x0,void 0x0,function*(){const V=E;(0x0,utils_1[V(0x123)])(this[V(0xc1)]);const a=this[V(0xe7)](A),n=X?undefined:l[V(0xc6)](),p=N||n||(yield G[V(0xdc)]());try{const {services:m,addons:D}=yield a[V(0xb9)]({'projectId':p},A);m['length']+D[V(0xed)]<=0x0?(0x0,utils_1[V(0xc0)])(V(0x11b)+chalk_1['default'][V(0xd6)](p)):(console[V(0xf2)](V(0x103)+chalk_1[V(0xfb)]['green'][V(0xd6)](m['length']+V(0x102))+V(0xfa)+chalk_1['default'][V(0xb5)][V(0xd6)](D[V(0xed)]+V(0xef))+'\x20in\x20project\x20'+chalk_1[V(0xfb)][V(0xd6)](p)),yield Promise[V(0x121)]([...m,...D]));}catch(o){(0x0,utils_1[V(0xf9)])(V(0xf1)+o[V(0x116)]);}})),I=(0x0,utils_1[E(0xbf)])(!![])[E(0xc8)](E(0x100))[E(0x114)](E(0xd1))[E(0xe9)](E(0xeb),E(0xd7))[E(0xe9)](E(0xe3),E(0xbc))[E(0xe9)]('--noDefaults',this[E(0xba)],![])['option'](E(0x12c),this[E(0xf0)],![])[E(0xf5)](({noDefaults:X,projectId:N,serviceId:A,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const M=E;(0x0,utils_1[M(0x123)])(this['apiClient']);const n=this[M(0xe7)](a),p=X?undefined:l[M(0xc6)](),m=N||p||(yield G[M(0xdc)]()),D=X?undefined:l[M(0x129)](),o=A||D||(yield G[M(0x10c)](m)());console[M(0xf2)](M(0xcc)+chalk_1['default'][M(0xd6)](o)+M(0xda)+chalk_1['default'][M(0xd6)](m));try{yield n['forwardService']({'projectId':m,'serviceId':o},a);}catch(T){(0x0,utils_1[M(0xf9)])('Failed:\x20'+T[M(0x116)]);}})),z=(0x0,utils_1['getCommand'])(!![])['name'](E(0xdf))['description'](E(0x127))[E(0xe9)](E(0xeb),E(0xd7))['option'](E(0x106),'Addon\x20to\x20forward')[E(0xe9)]('--skipHostnames',this[E(0xf0)],![])[E(0xf5)](({noDefaults:X,projectId:N,addonId:A,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const e=E;(0x0,utils_1[e(0x123)])(this[e(0xc1)]);const n=this[e(0xe7)](a),p=X?undefined:l[e(0xc6)](),m=N||p||(yield G[e(0xdc)]()),D=A||(yield G[e(0xe0)](m)());console[e(0xf2)](e(0x107)+chalk_1['default'][e(0xd6)](D)+e(0xda)+chalk_1[e(0xfb)][e(0xd6)](m));try{yield n[e(0x115)]({'projectId':m,'addonId':D},a);}catch(o){(0x0,utils_1[e(0xf9)])(e(0xf1)+o[e(0x116)]);}}));this['portFwdCmd'][E(0x125)](s),this[E(0x10d)][E(0x125)](I),this[E(0x10d)]['addCommand'](z);}['getProxyForwarder'](l=![]){const w=a10W,G=this['apiClient']['forwarding'];if(!l){const s=G[w(0x12a)]();if(s[w(0xf9)])throw new Error(s[w(0x116)]);}return G['on'](w(0xfc),(I,z)=>{const q=w,X=chalk_1[q(0xfb)]['greenBright'][q(0xd6)](z[q(0xce)]+'\x20\x27'+z['id']+'\x27'),N=z[q(0x124)]['length']>0x0,A=''+(!l?q(0x118):'.'),a=z['protocol']===q(0x105)?q(0x120):'';(0x0,utils_1['success'])('Exposing\x20'+X+q(0xe6)+z[q(0xe1)]+':'+z[q(0x11e)]+'\x20('+z[q(0x11a)]+')'+A);if(!l)z[q(0x124)][q(0x104)](n=>{const O=q;(0x0,utils_1[O(0x10b)])('\x20\x20'+a+n+':'+z[O(0x11e)]);});else{if(N){const n=process[q(0xbd)]===q(0xd8),p=os[q(0xbd)]()===q(0xde),m=n?q(0xea):q(0x10e),D=chalk_1[q(0xfb)]['bold']('skipHostnames'),o=p?q(0x12e)+D+q(0xbe)+z['type']+'.':undefined;let T='\x20\x20Running\x20in\x20'+D+q(0xff)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+m+'):';if(o!==undefined)(0x0,utils_1[q(0xc0)])(o);(0x0,utils_1['warning'])(T),console[q(0xf2)](z['address']+q(0x110)+z[q(0x124)][q(0xee)]('\x20'));}}(0x0,utils_1[q(0x10b)])('');}),G['on'](w(0xe4),(I,z)=>{const U=w,X=chalk_1['default']['greenBright'][U(0xd6)](z[U(0xce)]+'\x20\x27'+z['id']+'\x27'),N=z[U(0x124)][U(0xed)]>0x0,A=''+(!l?U(0xca):'.');(0x0,utils_1[U(0xc0)])(U(0xf8)+z['address']+':'+z[U(0x11e)]+U(0xe5)+X+A);if(!l)z['hostnames'][U(0x104)](a=>{const Z=U;(0x0,utils_1[Z(0xc0)])('\x20\x20'+a+':'+z['port']);});else N&&(0x0,utils_1['warning'])(U(0xfe));(0x0,utils_1['warning'])('');}),G['on']('connection-error',(I,z,X)=>{const v=w;(0x0,utils_1[v(0xc0)])(v(0x101)+z[v(0xe1)]+':'+z['port']+'\x27:\x20\x22'+(X===null||X===void 0x0?void 0x0:X[v(0x116)])+'\x22');}),process['on'](w(0xe8),()=>__awaiter(this,void 0x0,void 0x0,function*(){const S=w;try{yield G[S(0xc7)]();}catch(I){(0x0,utils_1[S(0xf9)])('Cleaning\x20up\x20open\x20connections\x20failed:\x20'+I['message']);}finally{process['exit']();}})),G;}}exports['CliPortForward']=CliPortForward;
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 a11o=a11G;(function(l,G){const D=a11G,s=l();while(!![]){try{const I=parseInt(D(0xdb))/0x1*(-parseInt(D(0xf7))/0x2)+-parseInt(D(0xe5))/0x3+-parseInt(D(0xd0))/0x4+-parseInt(D(0xed))/0x5+-parseInt(D(0xdf))/0x6+-parseInt(D(0xef))/0x7*(-parseInt(D(0x102))/0x8)+parseInt(D(0xc8))/0x9*(parseInt(D(0xdd))/0xa);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a11l,0x70c62));var __awaiter=this&&this[a11o(0xcf)]||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const B=a11G;function A(p){const T=a11G;try{n(I[T(0x104)](p));}catch(m){N(m);}}function a(p){const d=a11G;try{n(I[d(0x100)](p));}catch(m){N(m);}}function n(p){const W=a11G;p[W(0x103)]?X(p['value']):z(p['value'])[W(0x107)](A,a);}n((I=I[B(0xd3)](l,G||[]))['next']());});},__importDefault=this&&this[a11o(0xe8)]||function(l){const R=a11o;return l&&l[R(0x101)]?l:{'default':l};};Object[a11o(0xee)](exports,'__esModule',{'value':!![]}),exports[a11o(0xeb)]=exports[a11o(0xce)]=exports[a11o(0xe9)]=exports['retry']=exports[a11o(0xcd)]=exports['success']=exports['warning']=exports[a11o(0xcb)]=exports['checkUpdate']=exports['customUserAgent']=void 0x0;const node_fetch_1=__importDefault(require('node-fetch')),chalk_1=__importDefault(require(a11o(0xca))),commander_1=require(a11o(0xf8)),pgk=require(a11o(0xf5));exports[a11o(0xfd)]=a11o(0xea)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a11o(0xe6)]);function checkUpdate(l){return __awaiter(this,void 0x0,void 0x0,function*(){const K=a11G;function G(s,I){const y=a11G,z=new Date(Number(s));return z['setDate'](z[y(0xfa)]()+I),z;}try{if(G(l[K(0xcc)](),0x1)>new Date())return;const s=pgk[K(0xe6)],{name:I}=pgk;if(!s)return;const z=K(0xfb)+I+K(0xc6),X=yield(0x0,node_fetch_1[K(0xe0)])(z,{'method':K(0xde),'timeout':0x1388}),N=(yield X['json']())[K(0xe6)];needsUpdate(s,N)&&warning(K(0xec)+s+K(0xff)+N+'.'+(K(0xfc)+I+K(0xf4)+I+K(0xf6))),yield l[K(0xc4)](new Date());}catch(A){}});}exports[a11o(0xe2)]=checkUpdate;function needsUpdate(l,G){const i=a11o,s=/(\.0+)+$/,I=l[i(0xe3)](s,'')[i(0x108)]('.'),z=G[i(0xe3)](s,'')[i(0x108)]('.');for(let X=0x0;X<Math[i(0xc3)](I[i(0x106)],z[i(0x106)]);X+=0x1){const N=parseInt(z[X],0xa)-parseInt(I[X],0xa);if(N>0x0)return!![];if(N<0x0)return![];}return z[i(0x106)]>I[i(0x106)];}function error(l){const J=a11o;console[J(0xcb)](chalk_1[J(0xe0)][J(0xdc)](J(0xe7)+l));}exports['error']=error;function a11l(){const w=['retry','checkUpdate','replace','option','577230mNtRKf','version','Failed:\x20','__importDefault','asyncSequential','northflank-cli/','assertContextExisting','**\x20You\x27re\x20running\x20on\x20version\x20','1028840oMymNe','defineProperty','238eQqhLQ','allowExcessArguments','Command','enablePositionalOptions','getCurrentBaseUrl','\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20','../package.json','\x27\x20**','1038822mspliO','commander','warning','getDate','https://registry.npmjs.org/','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','customUserAgent','--verbose',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','throw','__esModule','197480uSdwCq','done','next','storeOptionsAsProperties','length','then','split','min','setLastUpdateCheck','reduce','/latest','contextProvider','579996VQZdNi','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','chalk','error','getLastUpdateCheck','getCommand','isValidJSON','__awaiter','2154724LfbWgO','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','log','apply','parse','No\x20console\x20output','green','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','getCurrentToken','yellow','success','1JRwoSA','redBright','210zvTXpn','GET','1646532roqxUD','default'];a11l=function(){return w;};return a11l();}function warning(l){const Q=a11o;console[Q(0xcb)](chalk_1[Q(0xe0)][Q(0xd9)](''+l));}exports[a11o(0xf9)]=warning;function success(l){const r=a11o;console[r(0xd2)](chalk_1['default'][r(0xd6)](''+l));}exports[a11o(0xda)]=success;function getCommand(l=![]){const E=a11o,G=new commander_1[(E(0xf1))]();return G[E(0x105)](![]),G['allowUnknownOption'](![]),G[E(0xf0)](![]),G[E(0xf2)](!![]),l&&(G[E(0xe4)](E(0xfe),'Verbose\x20output',![]),G[E(0xe4)]('--quiet',E(0xd5),![])),G;}exports[a11o(0xcd)]=getCommand;const retry=(l,G=0x32)=>s=>{let I=l;const z=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield s();}catch(X){if(I<=0x0)throw X;return I-=0x1,yield new Promise(N=>setTimeout(()=>N(),G)),z();}});return z();};exports[a11o(0xe1)]=retry;const asyncSequential=(l,G)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const V=a11o,s=Promise['resolve']([]);return l[V(0xc5)]((I,z)=>I[V(0x107)](X=>G(z)[V(0x107)](N=>{return X['push'](N),X;})),s);});exports[a11o(0xe9)]=asyncSequential;function isValidJSON(l){const M=a11o;try{return JSON[M(0xd4)](l);}catch(G){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(l){const e=a11o;if(l[e(0xc7)]['getCurrentContext']()===undefined)throw new Error(e(0xd1));if(l['contextProvider'][e(0xf3)]()===undefined)throw new Error(e(0xc9));if(l[e(0xc7)][e(0xd8)]()===undefined)throw new Error(e(0xd7));}function a11G(l,G){const s=a11l();return a11G=function(I,z){I=I-0xc3;let X=s[I];return X;},a11G(l,G);}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.4",
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.2",
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": {