@northflank/cli 0.9.3 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use strict';const a6b=a6C;(function(n,C){const N=a6C,k=n();while(!![]){try{const H=parseInt(N(0x184))/0x1+parseInt(N(0x1ad))/0x2+parseInt(N(0x1bc))/0x3*(-parseInt(N(0x1c3))/0x4)+parseInt(N(0x1a6))/0x5+parseInt(N(0x1d7))/0x6+parseInt(N(0x194))/0x7+parseInt(N(0x1d4))/0x8*(-parseInt(N(0x1c9))/0x9);if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a6n,0x4c75c));var __awaiter=this&&this['__awaiter']||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const c=a6C;function t(y){const X=a6C;try{M(H[X(0x1b2)](y));}catch(T){i(T);}}function r(y){const E=a6C;try{M(H[E(0x1d8)](y));}catch(T){i(T);}}function M(y){const g=a6C;y[g(0x1c0)]?W(y['value']):R(y[g(0x18a)])[g(0x1a7)](t,r);}M((H=H[c(0x1cc)](n,C||[]))[c(0x1b2)]());});},__importDefault=this&&this[a6b(0x1cf)]||function(n){const L=a6b;return n&&n[L(0x1b7)]?n:{'default':n};};Object[a6b(0x1b5)](exports,a6b(0x1b7),{'value':!![]}),exports[a6b(0x1b4)]=void 0x0;function a6n(){const Y=['--cmd\x20--command\x20[COMMAND]','job','exit','success','execStartLog','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','with\x20user:','log','exec','action','addCommand','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','rows','with\x20shell\x20session','stdErr','message','440155Imwxhw','then','../utils','execJobSession','handleShellSession','getCurrentProjectName','Run\x20command\x20with\x20this\x20user','1019538DOsAkq','askForService','../inquirer-helper','stderr','customUserAgent','next','warning','CliExec','defineProperty','Command\x20exec\x20for\x20the\x20specified\x20','__esModule','Run\x20command\x20with\x20shell\x20(e.g.\x20bash,sh).\x20If\x20not\x20set\x20and\x20no\x20command\x20is\x20provided,\x20several\x20standard\x20shells\x20will\x20be\x20attempted.\x20If\x20not\x20set\x20and\x20a\x20command\x20is\x20provided,\x20the\x20command\x20will\x20run\x20without\x20shell','Id\x20[NAME]','default','service','1532577OaeKvJ','description','assertContextExisting','without\x20shell','done','Error\x20occured\x20during\x20','greenBright','4lGNHyh','execServiceSession','--container\x20--containerId\x20[NAME]','bold','askForJob',',\x20details:\x20','369ZxtclM','stdOut','waitForCommandResult','apply','toUpperCase','alias','__importDefault','name','chalk','Unknown',',\x20exit\x20code:\x20','146136TyVAZQ','getStandardExecCommand','charAt','1708662AgNWgB','throw','isTTY','--user\x20[USER]','error','option','Success','none','setRawMode','Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise','askForProject','Command\x20completed\x20successfully,\x20exit\x20code:\x20','pipe','status','Run\x20command\x20with\x20this\x20group','334780kLiqes','(exit\x20with\x20\x27Ctrl+D\x27)','stdout','columns','apiClient','\x20in\x20project\x20','value','stdin','ApiClient','resizeTerminal','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','@northflank/js-client','slice','execCmd','getTerminalSize','Project\x20for\x20exec','2489403FgyABd','\x20to\x20exec\x20into'];a6n=function(){return Y;};return a6n();}const js_client_1=require(a6b(0x18f)),chalk_1=__importDefault(require(a6b(0x1d1))),utils_1=require(a6b(0x1a8)),inquirer_helper_1=require(a6b(0x1af));class CliExec{constructor(n){const G=a6b;this[G(0x1d5)]=R=>(0x0,utils_1['getCommand'])(!![])[G(0x1d0)](R)[G(0x1bd)](G(0x1b6)+R)[G(0x1dc)]('--project\x20--projectId\x20[NAME]',G(0x193))['option']('--'+R+'\x20--'+R+G(0x1b9),R[G(0x1d6)](0x0)[G(0x1cd)]()+R[G(0x190)](0x1)+G(0x195))[G(0x1dc)](G(0x1c5),G(0x19b))[G(0x1dc)]('--shell-cmd\x20[SHELL-CMD]',G(0x1b8))[G(0x1dc)](G(0x1da),G(0x1ac))[G(0x1dc)]('--group\x20[GROUP]',G(0x183))[G(0x1dc)]('--noDefaults',G(0x18e),![])[G(0x1dc)](G(0x196),G(0x17e)),this[G(0x192)]=()=>({'columns':process[G(0x186)]['columns'],'rows':process[G(0x186)][G(0x1a2)]}),this[G(0x19a)]=(R,W,i,t,r,M,y,T)=>{const Z=G;if(T===!![])return;const V=t==='none',j=V?Z(0x1bf):t===undefined?Z(0x1a3):'shell\x20command\x20'+chalk_1[Z(0x1ba)][Z(0x1c2)](t),U=r!==undefined?Z(0x19c)+r:'',h=M!==undefined?'with\x20group:'+M:'',o=y!==undefined?'with\x20command\x20\x27'+chalk_1[Z(0x1ba)]['greenBright'](y)+'\x27':'',A=[o,j,U,h]['filter'](Q=>Q!=='')['join']('\x20'),d=Z(0x185);console[Z(0x19d)]('Exec\x20'+R+'\x20'+chalk_1[Z(0x1ba)]['bold'](W)+Z(0x189)+chalk_1[Z(0x1ba)][Z(0x1c6)](i)+'\x20'+A+'\x20'+d);},this[G(0x1aa)]=(R,W,i=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const q=G;var t,r;try{process['stdin']['isTTY']&&(process[q(0x18b)][q(0x17d)](!![]),process['stdout']['on']('resize',()=>{const w=q;R[w(0x18d)](this[w(0x192)]());}));process[q(0x18b)]['pipe'](R['stdIn']),R[q(0x1a4)]['pipe'](process[q(0x1b0)]),R[q(0x1ca)][q(0x181)](process[q(0x186)]),R['on'](q(0x1db),y=>{const O=q;var T;(0x0,utils_1[O(0x1db)])(O(0x1c1)+W+'\x20command\x20exec:\x20'+((T=y[O(0x1a5)])!==null&&T!==void 0x0?T:y)),process[O(0x18b)][O(0x1d9)]&&process[O(0x18b)][O(0x17d)](![]),process[O(0x198)](-0x1);});const M=yield R[q(0x1cb)]();if(i!==!![]){const y=(t=M===null||M===void 0x0?void 0x0:M[q(0x182)])!==null&&t!==void 0x0?t:q(0x1d2),T=(r=M===null||M===void 0x0?void 0x0:M['exitCode'])!==null&&r!==void 0x0?r:-0x1,V=(M===null||M===void 0x0?void 0x0:M[q(0x1a5)])?q(0x1c8)+M[q(0x1a5)]:'';y===q(0x1dd)?(0x0,utils_1[q(0x199)])(q(0x180)+T):(0x0,utils_1[q(0x1b3)])('Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20'+y+q(0x1d3)+T+V);}return M;}finally{process[q(0x18b)][q(0x1d9)]&&process[q(0x18b)]['setRawMode'](![]);}}),this['apiClient']=new js_client_1[(G(0x18c))](n,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[G(0x1b1)]});const C=new inquirer_helper_1['InquirerHelper'](this[G(0x188)]);this['execCmd']=(0x0,utils_1['getCommand'])()[G(0x1d0)]('command-exec')[G(0x1ce)](G(0x19e))['description'](G(0x1a1));const k=this['getStandardExecCommand']('service')[G(0x19f)](R=>__awaiter(this,void 0x0,void 0x0,function*(){const F=G,{noDefaults:W,projectId:i,serviceId:t,containerId:r,shellCmd:M,user:y,group:T,command:V,quiet:j}=R;(0x0,utils_1[F(0x1be)])(this[F(0x188)]);try{const U=W?undefined:n[F(0x1ab)](),h=i||U||(yield C[F(0x17f)]()),o=W?undefined:n['getCurrentServiceName'](),A=t||o||(yield C[F(0x1ae)](h)()),d=M!==null&&M!==void 0x0?M:V!==undefined?F(0x1de):undefined;this[F(0x19a)]('service',A,h,d,y,T,V,j);const Q=process['stdout'][F(0x187)],l=process['stdout'][F(0x1a2)],K={'projectId':h,'serviceId':A},m=yield this[F(0x188)][F(0x19e)][F(0x1c4)](K,{'containerName':r,'command':V,'shell':d,'user':y,'group':T,'ttyColumns':Q,'ttyRows':l});yield this[F(0x1aa)](m,F(0x1bb),j);}catch(a){(0x0,utils_1['error'])(''+a[F(0x1a5)]);}finally{process[F(0x198)]();}})),H=this[G(0x1d5)](G(0x197))['action'](R=>__awaiter(this,void 0x0,void 0x0,function*(){const D=G,{projectId:W,jobId:i,containerId:t,noDefaults:r,shellCmd:M,user:y,group:T,command:V,quiet:j}=R;(0x0,utils_1[D(0x1be)])(this[D(0x188)]);try{const U=r?undefined:n[D(0x1ab)](),h=W||U||(yield C[D(0x17f)]()),o=i||(yield C[D(0x1c7)](h)());this[D(0x19a)](D(0x197),o,h,M,j);const {rows:A,columns:d}=this[D(0x192)](),Q={'projectId':h,'jobId':o},l=yield this[D(0x188)][D(0x19e)][D(0x1a9)](Q,{'containerName':t,'command':V,'shell':M,'user':y,'group':T,'ttyColumns':d,'ttyRows':A});yield this[D(0x1aa)](l,'job',j);}catch(K){(0x0,utils_1[D(0x1db)])(''+K[D(0x1a5)]);}finally{process[D(0x198)]();}}));this[G(0x191)][G(0x1a0)](k),this['execCmd'][G(0x1a0)](H);}}function a6C(n,C){const k=a6n();return a6C=function(H,R){H=H-0x17d;let W=k[H];return W;},a6C(n,C);}exports[a6b(0x1b4)]=CliExec;
1
+ 'use strict';const a6k=a6f;(function(H,f){const e=a6f,l=H();while(!![]){try{const t=-parseInt(e(0xb4))/0x1+parseInt(e(0x94))/0x2+parseInt(e(0xcc))/0x3*(parseInt(e(0xa5))/0x4)+-parseInt(e(0x93))/0x5+-parseInt(e(0xa7))/0x6*(-parseInt(e(0x9b))/0x7)+-parseInt(e(0xa3))/0x8*(-parseInt(e(0x8a))/0x9)+parseInt(e(0xa1))/0xa*(-parseInt(e(0x9f))/0xb);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a6H,0xa83fe));var __awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const A=a6f;function r(Y){const O=a6f;try{w(t[O(0xb8)](Y));}catch(x){n(x);}}function q(Y){const E=a6f;try{w(t[E(0xd6)](Y));}catch(x){n(x);}}function w(Y){const S=a6f;Y[S(0xbd)]?i(Y[S(0xb6)]):b(Y[S(0xb6)])[S(0xb2)](r,q);}w((t=t['apply'](H,f||[]))[A(0xb8)]());});},__importDefault=this&&this[a6k(0xb7)]||function(H){const h=a6k;return H&&H[h(0xab)]?H:{'default':H};};Object[a6k(0xe7)](exports,a6k(0xab),{'value':!![]}),exports['CliExec']=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a6k(0xdf))),utils_1=require('../utils'),inquirer_helper_1=require(a6k(0xd1));class CliExec{constructor(H){const K=a6k;this[K(0xae)]=b=>(0x0,utils_1['getCommand'])(!![])['name'](b)[K(0xaf)]('Command\x20exec\x20for\x20the\x20specified\x20'+b)[K(0xe3)](K(0xdd),'Project\x20for\x20exec')[K(0xe3)]('--'+b+K(0xa0)+b+K(0xca),b[K(0x9c)](0x0)[K(0xc8)]()+b[K(0x98)](0x1)+K(0xd4))['option'](K(0xb1),K(0x9a))[K(0xe3)](K(0xbe),'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')['option'](K(0x97),'Run\x20command\x20with\x20this\x20user')[K(0xe3)](K(0xe5),'Run\x20command\x20with\x20this\x20group')[K(0xe3)]('--noDefaults','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])[K(0xe3)]('--cmd\x20--command\x20[COMMAND]',K(0xd5)),this['getTerminalSize']=()=>({'columns':process['stdout'][K(0xcb)],'rows':process[K(0xb3)][K(0xa4)]}),this[K(0xb9)]=(b,i,n,r,q,w,Y,x)=>{const I=K;if(x===!![])return;const U=r==='none',m=U?'without\x20shell':r===undefined?'with\x20shell\x20session':I(0xdc)+chalk_1[I(0xe2)][I(0xda)](r),Q=q!==undefined?'with\x20user:'+q:'',L=w!==undefined?I(0xba)+w:'',B=Y!==undefined?I(0x9e)+chalk_1[I(0xe2)][I(0xda)](Y)+'\x27':'',T=[B,m,Q,L][I(0xc1)](C=>C!=='')[I(0x96)]('\x20'),X='(exit\x20with\x20two\x20quick\x20'+chalk_1['default']['bold'](I(0xa9))+')';console[I(0xe6)](I(0xac)+b+'\x20'+chalk_1[I(0xe2)][I(0xbf)](i)+I(0x8c)+chalk_1[I(0xe2)]['bold'](n)+'\x20'+T+'\x20'+X);},this[K(0xb0)]=(b,i,n=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const P=K;var r,q;let w=![];try{if(process[P(0xde)][P(0xe0)]){const x=require(P(0xcd));x[P(0xd9)](process['stdin']),process['stdin'][P(0xea)](!![]),process[P(0xb3)]['on'](P(0xc2),()=>{const Z=P;b[Z(0xe8)](this[Z(0xce)]());}),process[P(0xde)]['on'](P(0x8f),(U,m)=>{const W=P;m['sequence']==='\x04'&&(w?(process[W(0xde)]['setRawMode'](![]),(0x0,utils_1[W(0xd2)])('Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.'),process[W(0x91)]()):(w=!![],setTimeout(()=>w=![],0x190)));});}process[P(0xde)][P(0xcf)](b[P(0x99)]),b['stdErr'][P(0xcf)](process[P(0xbc)]),b[P(0xe9)][P(0xcf)](process[P(0xb3)]),b['on'](P(0x95),U=>{const u=P;var m;(0x0,utils_1['error'])(u(0xc4)+i+u(0xb5)+((m=U[u(0x89)])!==null&&m!==void 0x0?m:U)),process[u(0xde)][u(0xe0)]&&process[u(0xde)][u(0xea)](![]),process[u(0x91)](-0x1);});const Y=yield b['waitForCommandResult']();if(n!==!![]){const U=(r=Y===null||Y===void 0x0?void 0x0:Y['status'])!==null&&r!==void 0x0?r:P(0xa6),m=(q=Y===null||Y===void 0x0?void 0x0:Y[P(0xc7)])!==null&&q!==void 0x0?q:-0x1,Q=(Y===null||Y===void 0x0?void 0x0:Y[P(0x89)])?P(0xc3)+Y[P(0x89)]:'';U===P(0xd7)?(0x0,utils_1[P(0xdb)])(P(0x90)+m):(0x0,utils_1[P(0xd2)])(P(0x8e)+U+',\x20exit\x20code:\x20'+m+Q);}return Y;}finally{process[P(0xde)][P(0xe0)]&&process[P(0xde)][P(0xea)](![]);}}),this['apiClient']=new js_client_1[(K(0xa2))](H,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[K(0xc0)]});const f=new inquirer_helper_1['InquirerHelper'](this[K(0xd8)]);this[K(0xa8)]=(0x0,utils_1[K(0xc6)])()[K(0xad)](K(0x9d))['alias'](K(0xc5))[K(0xaf)]('Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.');const l=this[K(0xae)](K(0xbb))['action'](b=>__awaiter(this,void 0x0,void 0x0,function*(){const g=K,{noDefaults:i,projectId:n,serviceId:r,containerId:q,shellCmd:w,user:Y,group:x,command:U,quiet:m}=b;(0x0,utils_1[g(0x8d)])(this[g(0xd8)]);try{const Q=i?undefined:H[g(0x92)](),L=n||Q||(yield f[g(0xd0)]()),B=i?undefined:H[g(0xc9)](),T=r||B||(yield f[g(0xe4)](L)()),X=w!==null&&w!==void 0x0?w:U!==undefined?'none':undefined;this[g(0xb9)](g(0xbb),T,L,X,Y,x,U,m);const C=process[g(0xb3)][g(0xcb)],j=process[g(0xb3)][g(0xa4)],c={'projectId':L,'serviceId':T},D=yield this[g(0xd8)][g(0xc5)][g(0xe1)](c,{'containerName':q,'command':U,'shell':X,'user':Y,'group':x,'ttyColumns':C,'ttyRows':j});yield this[g(0xb0)](D,g(0xbb),m);}catch(V){(0x0,utils_1[g(0x95)])(''+V[g(0x89)]);}finally{process[g(0x91)]();}})),t=this[K(0xae)](K(0xd3))[K(0xaa)](b=>__awaiter(this,void 0x0,void 0x0,function*(){const d=K,{projectId:i,jobId:n,containerId:r,noDefaults:q,shellCmd:w,user:Y,group:x,command:U,quiet:m}=b;(0x0,utils_1[d(0x8d)])(this[d(0xd8)]);try{const Q=q?undefined:H[d(0x92)](),L=i||Q||(yield f[d(0xd0)]()),B=n||(yield f['askForJob'](L)());this['execStartLog'](d(0xd3),B,L,w,m);const {rows:T,columns:X}=this['getTerminalSize'](),C={'projectId':L,'jobId':B},j=yield this[d(0xd8)][d(0xc5)][d(0x8b)](C,{'containerName':r,'command':U,'shell':w,'user':Y,'group':x,'ttyColumns':X,'ttyRows':T});yield this[d(0xb0)](j,d(0xd3),m);}catch(c){(0x0,utils_1[d(0x95)])(''+c[d(0x89)]);}finally{process[d(0x91)]();}}));this[K(0xa8)]['addCommand'](l),this[K(0xa8)]['addCommand'](t);}}exports[a6k(0xeb)]=CliExec;function a6f(H,f){const l=a6H();return a6f=function(t,b){t=t-0x89;let i=l[t];return i;},a6f(H,f);}function a6H(){const F=['chalk','isTTY','execServiceSession','default','option','askForService','--group\x20[GROUP]','log','defineProperty','resizeTerminal','stdOut','setRawMode','CliExec','message','7263QuqMKI','execJobSession','\x20in\x20project\x20','assertContextExisting','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','keypress','Command\x20completed\x20successfully,\x20exit\x20code:\x20','exit','getCurrentProjectName','5398935fdltYg','1496902IGVfFr','error','join','--user\x20[USER]','slice','stdIn','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','81977hddDgp','charAt','command-exec','with\x20command\x20\x27','335786qPDveP','\x20--','20tXTiph','ApiClient','13336lCImfN','rows','2124628xUwcMW','Unknown','210KkrTlg','execCmd','\x27Ctrl+D\x27','action','__esModule','Exec\x20','name','getStandardExecCommand','description','handleShellSession','--container\x20--containerId\x20[NAME]','then','stdout','1204773eHzYVY','\x20command\x20exec:\x20','value','__importDefault','next','execStartLog','with\x20group:','service','stderr','done','--shell-cmd\x20[SHELL-CMD]','bold','customUserAgent','filter','resize',',\x20details:\x20','Error\x20occured\x20during\x20','exec','getCommand','exitCode','toUpperCase','getCurrentServiceName','Id\x20[NAME]','columns','3TAPGEb','readline','getTerminalSize','pipe','askForProject','../inquirer-helper','warning','job','\x20to\x20exec\x20into','Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise','throw','Success','apiClient','emitKeypressEvents','greenBright','success','shell\x20command\x20','--project\x20--projectId\x20[NAME]','stdin'];a6H=function(){return F;};return a6H();}
@@ -1 +1 @@
1
- 'use strict';const a7U=a7C;(function(n,C){const j=a7C,k=n();while(!![]){try{const H=parseInt(j(0x1f3))/0x1+parseInt(j(0x1fa))/0x2+-parseInt(j(0x274))/0x3*(parseInt(j(0x22e))/0x4)+-parseInt(j(0x212))/0x5*(parseInt(j(0x24e))/0x6)+-parseInt(j(0x20f))/0x7+parseInt(j(0x272))/0x8+parseInt(j(0x202))/0x9*(parseInt(j(0x197))/0xa);if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a7n,0xf0dfe));var __createBinding=this&&this['__createBinding']||(Object[a7U(0x23c)]?function(n,C,H,R){const h=a7U;if(R===undefined)R=H;var W=Object['getOwnPropertyDescriptor'](C,H);(!W||(h(0x23f)in W?!C[h(0x18d)]:W[h(0x1a2)]||W[h(0x20b)]))&&(W={'enumerable':!![],'get':function(){return C[H];}}),Object[h(0x1ba)](n,R,W);}:function(n,C,H,R){if(R===undefined)R=H;n[R]=C[H];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(n,C){const o=a7U;Object[o(0x1ba)](n,o(0x1ec),{'enumerable':!![],'value':C});}:function(n,C){const A=a7U;n[A(0x1ec)]=C;}),__importStar=this&&this[a7U(0x247)]||function(n){const d=a7U;if(n&&n[d(0x18d)])return n;var C={};if(n!=null){for(var H in n)if(H!==d(0x1ec)&&Object[d(0x269)][d(0x203)][d(0x23b)](n,H))__createBinding(C,n,H);}return __setModuleDefault(C,n),C;},__awaiter=this&&this[a7U(0x240)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const m=a7C;function t(y){const Q=a7C;try{M(H[Q(0x20e)](y));}catch(T){i(T);}}function r(y){const l=a7C;try{M(H[l(0x195)](y));}catch(T){i(T);}}function M(y){const K=a7C;y[K(0x243)]?W(y['value']):R(y[K(0x280)])[K(0x234)](t,r);}M((H=H[m(0x261)](n,C||[]))['next']());});},__importDefault=this&&this[a7U(0x1ea)]||function(n){const a=a7U;return n&&n[a(0x18d)]?n:{'default':n};};function a7n(){const nl=['getType','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','description','editor','Choose\x20the\x20','editPayload','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','join','values','chalk','pagination-prompt','askForBuild','this\x20option\x20is\x20required,\x20please\x20answer','for\x20this\x20','askForTemplateRun','subdomains','blue','askGeneric','REPEAT','whiteBright','5260708MgfhpI','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','askForJobRun','slice','Aborted.','\x20type?','then','yml','length','integer','templateRuns','isNaN','keys','call','create','repeat','ABORT','get','__awaiter','includes','confirmation','done','askForLogSink','example','enum','__importStar','filter','lodash','domain','defaultPaginationPageSize','askForSecret','prompt','2898sOOTCR','propToType','credentials','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','askForResourcePaginated','Should\x20it\x20be','pathVars','Choose\x20the\x20login\x20token:','retry','project:\x20\x27','set','safeDump','No\x20','template\x20run','Please\x20confirm\x20following\x20configuration:\x0a','password','\x20characters,\x20is\x20','underline','message','apply','No,\x20abort','getPathString','isArray','job\x20builds','max','isBoolean','trim','prototype','What\x20do\x20you\x20want\x20to\x20use\x20as','job\x20build','validate','toUpperCase','retrievePayloadViaInteractiveCli','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','askForResource','json','8415408WGhisC','.*\x5c.(json|yaml|yml)$','3iHeyBw','job:\x20\x27','./api-helpers','addons','\x20and\x20it\x20','backups','./utils','EDIT','cmdPath','getInnerType','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','value','stringify','No,\x20edit','project','map','__esModule','confirmationPrompt','grey','push','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','contextProvider','domain\x20(','assign','throw','items','10XWtcjd','list','logSinks','unset','maximum','properties','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','test','getCurrentProjectName','askForDomain','maxLength','writable','createdAt','nextPageCursor','search-list','addEntry','service:\x20\x27','volume','askForProjectScopedResource','askForVolume','service','inquirer','Yes,\x20send','tmpCmdPath','Do\x20you\x20want\x20to\x20add','fullName','YES','askForService','runs','Template\x20id\x20not\x20provided.','name','string','writeFileSync','data','startedAt','defineProperty','subdomain','apiClient','nextCursor','askArrayEntry','volumes','getQuestionString','bold','builds','deleteWarningPrompt','split','\x20(startedAt:\x20','opt','override','SAVE','success','isUndefined','tokenPrompt','Something\x20unexpected\x20happened.','don\x27t\x20change','services','minimum','bgGrey','yaml','completedAt','minLength','saveFile','registerPrompt','log\x20sink','\x20(full\x20domain:\x20','rawObject','greenBright','job','inquirer-search-list','a\x20Northflank\x20resource','askForProject','Enter\x20the\x20','Configuration\x20file\x20written\x20to\x20','ask','secret','cursor','templates','warning','to\x20use:','\x20characters','registries','isValidJSON','pop','__importDefault','No,\x20but\x20save\x20as\x20file','default','found','Context\x20name\x20already\x20exists.',',\x20supported\x20types:\x20[json|yaml|yml]','askForAddon','askForJob','domains','1460477dARfoA','main-context','secrets','\x20Example:\x20','isEmpty','pagination','Writing\x20configuration\x20failed:\x20','1061920DpuzDI','type','No,\x20repeat','doesn\x27t\x20match\x20pattern\x20\x27','yellowBright','js-yaml','has','resultCache','11061009IzwkRT','hasOwnProperty','fetchResourceList','template','not\x20completed','jobs','editedResult','safeLoad','oneOf','configurable','green','askForProjectScopedResourcePaginated','next','11423874wCpcJa','toString','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','3505sKsKOD','confirm','boolean','elements','token','input','\x20in\x20','\x20to\x20use:'];a7n=function(){return nl;};return a7n();}Object[a7U(0x1ba)](exports,a7U(0x18d),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a7U(0x249))),chalk_1=__importDefault(require(a7U(0x223))),fs=__importStar(require('fs')),utils_1=require(a7U(0x27a)),api_helpers_1=require(a7U(0x276)),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require(a7U(0x1ac)),inquirerSearchList=require(a7U(0x1db)),yaml=require(a7U(0x1ff));var ConfirmChoices;(function(n){const N=a7U;n['YES']=N(0x1ad),n[N(0x22c)]=N(0x1fc),n[N(0x27b)]=N(0x282),n[N(0x1c8)]=N(0x1eb),n[N(0x23e)]=N(0x262);}(ConfirmChoices||(ConfirmChoices={})));function a7C(n,C){const k=a7n();return a7C=function(H,R){H=H-0x18b;let W=k[H];return W;},a7C(n,C);}class InquirerHelper{constructor(n){const X=a7U;this[X(0x1bc)]=n,this['defaultPaginationPageSize']=0x32,this['editPayload']=C=>__awaiter(this,void 0x0,void 0x0,function*(){const E=X,{editedResult:k}=yield inquirer[E(0x24d)]([{'type':E(0x21d),'name':E(0x208),'message':'Go\x20to\x20editor','default':yaml[E(0x259)](C)}]);return yaml[E(0x209)](k);}),this['saveFile']=C=>__awaiter(this,void 0x0,void 0x0,function*(){const g=X,k=i=>'Unexpected\x20file\x20type:\x20'+i+g(0x1ef);function H(){return __awaiter(this,void 0x0,void 0x0,function*(){const b=a7C;return inquirer[b(0x24d)]([{'type':b(0x217),'name':'fileName','message':b(0x27f),'validate':i=>new RegExp(b(0x273))[b(0x19e)](i)?!![]:k(i)}]);});}const {fileName:R}=yield H(),W=R[g(0x210)]()['split']('.')[g(0x1e9)]();try{switch(W){case g(0x271):(0x0,utils_1[g(0x1c9)])(g(0x1df)+R);return fs['writeFileSync'](R,JSON['stringify'](C,null,'\x20\x20'));case g(0x1d1):case g(0x235):(0x0,utils_1[g(0x1c9)])(g(0x1df)+R);return fs[g(0x1b7)](R,yaml[g(0x259)](C));default:(0x0,utils_1[g(0x1e4)])(k(W));}}catch(i){(0x0,utils_1[g(0x1e4)])(g(0x1f9)+i[g(0x260)]);}return undefined;}),this['filter']=(C,k)=>H=>{const L=X,R=typeof H===L(0x1b6)?H[L(0x268)]():H;return k===![]&&R==='don\x27t\x20change'?'':R;},this['validate']=(C,k,H)=>R=>{const G=X,W=[];if(R===''||R===G(0x1cd)){if(k!==![])W[G(0x190)](G(0x226));else return!![];}C[G(0x1fb)]==='string'&&!_[G(0x1ca)](C['pattern'])&&W['push'](new RegExp(C['pattern'])[G(0x19e)](R)?!![]:G(0x1fd)+C['pattern']+'\x27');C['type']===G(0x1b6)&&!_['isUndefined'](C[G(0x1d3)])&&W[G(0x190)](R[G(0x236)]>=C['minLength']?!![]:G(0x26f)+C[G(0x1d3)]+G(0x25e)+R['length']+G(0x1e6));C['type']===G(0x1b6)&&!_[G(0x1ca)](C[G(0x1a1)])&&W[G(0x190)](R['length']<=C[G(0x1a1)]?!![]:G(0x22f)+C[G(0x1a1)]+G(0x25e)+R[G(0x236)]+G(0x1e6));H&&Number[G(0x239)](parseInt(R,0xa))&&W[G(0x190)]('must\x20be\x20a\x20number,\x20is\x20'+R);C[G(0x1fb)]===G(0x237)&&!_[G(0x1ca)](C[G(0x1cf)])&&W[G(0x190)](R>=C[G(0x1cf)]?!![]:'must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20'+C[G(0x1cf)]);C['type']===G(0x237)&&!_[G(0x1ca)](C[G(0x19b)])&&W[G(0x190)](R<=C[G(0x19b)]?!![]:G(0x211)+C[G(0x19b)]);if(C[G(0x1fb)]==='rawObject'){const r=(0x0,utils_1[G(0x1e8)])(R);W[G(0x190)](r===![]||_[G(0x1f7)](r)?G(0x19d):!![]);}const i=W[G(0x248)](M=>M!==!![]),t=(C===null||C===void 0x0?void 0x0:C[G(0x245)])?'\x0a'+chalk_1['default']['red']('>>')+G(0x1f6)+chalk_1[G(0x1ec)][G(0x22d)](JSON[G(0x281)](C[G(0x245)])):'';return i['length']>0x0?i['join'](chalk_1[G(0x1ec)][G(0x25f)](G(0x278)))+t:!![];},this[X(0x263)]=(C,k,H)=>{const q=X,R=C[C['length']-0x1];function W(){const Z=a7C;return C[Z(0x231)](0x0,-0x1)['map'](r=>r['charAt'](0x0)[Z(0x26d)]()+r[Z(0x231)](0x1))['join']('>');}const i=C[q(0x236)]>0x1?chalk_1[q(0x1ec)][q(0x1d0)][q(0x22d)](W())+':\x20':'',t=H?'\x20('+chalk_1[q(0x1ec)][q(0x22a)](H)+')':'';return chalk_1[q(0x1ec)]['reset'](''+i+k+'\x20'+chalk_1['default'][q(0x1c1)][q(0x1d9)](R)+t+'?');},this[X(0x270)]=(C,k,H)=>__awaiter(this,void 0x0,void 0x0,function*(){const w=X;if(k[w(0x236)]<0x1){const i=H?'for\x20this\x20'+H:w(0x1ed);throw new Error(w(0x25a)+C+'\x20'+i+'.');}const R=w(0x21e)+C+w(0x219),W=k[w(0x236)]>0x4?w(0x1a5):w(0x198);return(yield inquirer[w(0x24d)]([{'type':W,'name':'name','message':R,'choices':k}]))[w(0x1b5)];}),this[X(0x252)]=(C,k,H)=>__awaiter(this,void 0x0,void 0x0,function*(){const O=X,{elements:R,nextCursor:W}=yield k();if(R[O(0x236)]<0x1){const r=H?O(0x227)+H:O(0x1ed);throw new Error(O(0x25a)+C+'\x20'+r+'.');}const i=O(0x21e)+C+O(0x219);if(W!==undefined){const M=({nextPageCursor:y})=>__awaiter(this,void 0x0,void 0x0,function*(){const F=O,T=yield k(y);return{'elements':T[F(0x215)],'nextPageCursor':T[F(0x1bd)]};});return(yield inquirer[O(0x24d)]([{'type':'pagination-prompt','name':O(0x1b5),'message':i,'choices':R,'nextPageCursor':W,'loadMore':M}]))['name'];}const t=R[O(0x236)]>0x4?O(0x1a5):O(0x198);return(yield inquirer['prompt']([{'type':t,'name':'name','message':i,'choices':R}]))['name'];}),this[X(0x22b)]=(C,k)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=X,H=''+(k?'('+chalk_1[D(0x1ec)][D(0x22a)](k)+')\x20':''),R=D(0x1de)+chalk_1['default'][D(0x20c)](C)+'\x20'+H+D(0x1e5),W=this[D(0x26c)]({'type':'string','required':!![]});return(yield inquirer[D(0x24d)]([{'type':'input','name':'name','message':R,'validate':W}]))[D(0x1b5)];}),this['askConfirm']=C=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=X;return(yield inquirer[Y(0x24d)]([{'type':Y(0x213),'name':Y(0x1b5),'message':C,'default':!![]}]))[Y(0x1b5)];}),this[X(0x1b2)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const x=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const S=a7C;var W;const i=yield this['apiClient'][S(0x198)][S(0x1ce)]({'parameters':{'projectId':H},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':R}}),t=i[S(0x1b8)][S(0x1ce)][S(0x18c)](r=>r['id']);return{'elements':t,'nextCursor':(W=i[S(0x1f8)])===null||W===void 0x0?void 0x0:W[S(0x1e2)]};});return this[x(0x20d)](x(0x1ab),k,C);}),this['askForTemplate']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const z=X,C=k=>__awaiter(this,void 0x0,void 0x0,function*(){const J=a7C;var H;const R=yield this[J(0x1bc)][J(0x198)][J(0x1e3)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':k}}),W=R['data'][J(0x1e3)][J(0x18c)](i=>i['id']);return{'elements':W,'nextCursor':(H=R[J(0x1f8)])===null||H===void 0x0?void 0x0:H[J(0x1e2)]};});return this['askForResourcePaginated'](z(0x205),C);}),this[X(0x228)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=X;if(_[u(0x1ca)](C))throw new Error(u(0x1b4));const k=H=>__awaiter(this,void 0x0,void 0x0,function*(){const f=u;var R;let W=this[f(0x24b)];const i=yield this[f(0x1bc)][f(0x198)][f(0x238)]({'parameters':{'templateId':C},'options':{'per_page':W,'cursor':H}}),t=i[f(0x1b8)][f(0x238)][f(0x18c)](r=>r['id']+f(0x1c5)+r[f(0x1a3)]+')');return{'elements':t,'nextCursor':(R=i[f(0x1f8)])===null||R===void 0x0?void 0x0:R[f(0x1e2)]};});return this[u(0x252)](u(0x25b),k)[u(0x234)](H=>H[u(0x1c4)]('\x20')[0x0]);}),this[X(0x244)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const e=X,C=k=>__awaiter(this,void 0x0,void 0x0,function*(){const B=a7C;var H;let R=this[B(0x24b)];const W=yield this['apiClient'][B(0x198)][B(0x199)]({'options':{'per_page':R,'cursor':k}}),i=W[B(0x1b8)]['logSinks']['map'](t=>t['id']);return{'elements':i,'nextCursor':(H=W[B(0x1f8)])===null||H===void 0x0?void 0x0:H['cursor']};});return this['askForResourcePaginated'](e(0x1d6),C);}),this[X(0x1f1)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const v=a7C;var W;const i=yield this['apiClient'][v(0x198)][v(0x207)]({'parameters':{'projectId':H},'options':{'per_page':this[v(0x24b)],'cursor':R}}),t=i[v(0x1b8)]['jobs'][v(0x18c)](r=>r['id']);return{'elements':t,'nextCursor':(W=i[v(0x1f8)])===null||W===void 0x0?void 0x0:W[v(0x1e2)]};});return this['askForProjectScopedResourcePaginated'](P(0x1da),k,C);}),this[X(0x230)]=(C,k)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const s=X,H=R=>W=>__awaiter(this,void 0x0,void 0x0,function*(){const I=a7C;var i;const t=yield this[I(0x1bc)]['get'][I(0x1da)][I(0x1b3)]({'parameters':{'projectId':R,'jobId':C},'options':{'per_page':this[I(0x24b)],'cursor':W}}),r=t['data']['runs'][I(0x18c)](M=>M['id']+I(0x1c5)+M[I(0x1b9)]+')');return{'elements':r,'nextCursor':(i=t[I(0x1f8)])===null||i===void 0x0?void 0x0:i[I(0x1e2)]};});return this['askForProjectScopedResourcePaginated']('job\x20runs',H,k,s(0x275)+C+'\x27')[s(0x234)](R=>R[s(0x1c4)]('\x20')[0x0]);}),this[X(0x225)]=(C,k,H)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n0=X;if(H!==undefined){const R=W=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const p=a7C;var t;const r=yield this[p(0x1bc)][p(0x23f)][p(0x1da)][p(0x1c2)]({'parameters':{'projectId':W,'jobId':H},'options':{'per_page':this[p(0x24b)],'cursor':i}});return{'elements':r['data']['builds'][p(0x18c)](M=>M['id']+p(0x1c5)+M['createdAt']+')'),'nextCursor':(t=r[p(0x1f8)])===null||t===void 0x0?void 0x0:t[p(0x1e2)]};});return this['askForProjectScopedResourcePaginated'](n0(0x265),R,C,n0(0x275)+H+'\x27')['then'](W=>W['split']('\x20')[0x0]);}if(k!==undefined){const W=i=>t=>__awaiter(this,void 0x0,void 0x0,function*(){const n1=n0;var r;const M=yield this[n1(0x1bc)][n1(0x23f)][n1(0x1ab)]['builds']({'parameters':{'projectId':i,'serviceId':k},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':t}});return{'elements':M['data']['builds'][n1(0x18c)](y=>y['id']+n1(0x1c5)+y['createdAt']+')'),'nextCursor':(r=M[n1(0x1f8)])===null||r===void 0x0?void 0x0:r[n1(0x1e2)]};});return this[n0(0x20d)](n0(0x26b),W,C,n0(0x1a7)+H+'\x27')[n0(0x234)](i=>i[n0(0x1c4)]('\x20')[0x0]);}throw new Error('No\x20builds\x20found');}),this[X(0x1f0)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n3=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const n2=a7C;var W;const i=yield this[n2(0x1bc)][n2(0x198)]['addons']({'parameters':{'projectId':H},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':R}});return{'elements':i['data'][n2(0x277)][n2(0x18c)](t=>t['id']),'nextCursor':(W=i[n2(0x1f8)])===null||W===void 0x0?void 0x0:W['cursor']};});return this[n3(0x20d)]('addon',k,C);}),this['askForAddonBackup']=(C,k)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n5=X,H=R=>W=>__awaiter(this,void 0x0,void 0x0,function*(){const n4=a7C;var i;const t=yield this['apiClient']['get']['addon'][n4(0x279)]({'parameters':{'projectId':R,'addonId':k},'options':{'per_page':this[n4(0x24b)],'cursor':W}});return{'elements':t['data'][n4(0x279)][n4(0x18c)](r=>r['id']+'\x20(completedAt:\x20'+(r[n4(0x1d2)]||n4(0x206))+')'),'nextCursor':(i=t[n4(0x1f8)])===null||i===void 0x0?void 0x0:i[n4(0x1e2)]};});return this[n5(0x20d)](n5(0x279),H,C,'addon:\x20\x27'+k+'\x27')[n5(0x234)](R=>R[n5(0x1c4)]('\x20')[0x0]);}),this[X(0x1aa)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n7=X,k=H=>__awaiter(this,void 0x0,void 0x0,function*(){const n6=a7C;return(yield this[n6(0x1bc)][n6(0x198)][n6(0x1bf)]({'parameters':{'projectId':H}}))[n6(0x1b8)][n6(0x18c)](R=>R['id']);});return this[n7(0x1a9)](n7(0x1a8),k,C);}),this[X(0x24c)]=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n9=X,k=H=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const n8=a7C;var W;const i=yield this[n8(0x1bc)][n8(0x198)]['secrets']({'parameters':{'projectId':H},'options':{'per_page':this[n8(0x24b)],'cursor':R}});return{'elements':i[n8(0x1b8)][n8(0x1f5)][n8(0x18c)](t=>t['id']),'nextCursor':(W=i[n8(0x1f8)])===null||W===void 0x0?void 0x0:W['cursor']};});return this[n9(0x20d)](n9(0x1e1),k,C);}),this['askForSubdomain']=C=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const nn=X,k=yield this[nn(0x1bc)]['get'][nn(0x24a)]({'parameters':{'domain':C}}),H=k[nn(0x1b8)][nn(0x229)][nn(0x18c)](W=>W[nn(0x1b5)]+nn(0x1d7)+W[nn(0x1b0)]+')'),R=nn(0x193)+C+')';return this['askForResource'](nn(0x1bb),H,R)['then'](W=>W['split']('\x20')[0x0]);}),this[X(0x1c3)]=C=>__awaiter(this,void 0x0,void 0x0,function*(){const nC=X;return(yield inquirer['prompt']([{'type':nC(0x213),'name':nC(0x242),'message':chalk_1[nC(0x1ec)][nC(0x1fe)](nC(0x251)+(C||nC(0x1dc))+nC(0x27e)),'default':![]}]))[nC(0x242)];}),this['loginPrompt']=(C,k)=>__awaiter(this,void 0x0,void 0x0,function*(){const nk=X;_[nk(0x1ca)](C['name'])&&(k['length']<=0x0?_[nk(0x258)](C,nk(0x1b5),nk(0x1ec)):yield(0x0,utils_1[nk(0x256)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const nH=nk,{name:H}=yield inquirer['prompt']([{'type':nH(0x217),'name':nH(0x1b5),'message':nH(0x21b),'default':nH(0x1f4)}]);if(!C[nH(0x1c7)]&&k['find'](R=>R[nH(0x1b5)]===H)){const {c:R}=yield inquirer[nH(0x24d)]([{'type':nH(0x213),'name':'c','message':'Context\x20with\x20name\x20\x27'+H+nH(0x220),'default':![]}]);if(R===![])throw new Error(nH(0x1ee));_[nH(0x258)](C,'override',!![]);}_[nH(0x258)](C,nH(0x1b5),H);})));if(_[nk(0x1ca)](C['token'])){const H=yield this[nk(0x1cb)]();_[nk(0x258)](C,nk(0x216),H);}return C;}),this[X(0x1cb)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const nR=X,{token:C}=yield inquirer['prompt']([{'type':nR(0x25d),'name':nR(0x216),'mask':'*','message':nR(0x255)}]);return C;}),inquirer[X(0x1d5)]('search-list',inquirerSearchList),inquirer['registerPrompt'](X(0x224),inquirer_pagination_prompt_1['DynamicReloadPaginationPrompt']);}['confirmationPrompt'](n,C){return __awaiter(this,void 0x0,void 0x0,function*(){const nW=a7C,k=yaml[nW(0x259)](n),H=_[nW(0x266)](k[nW(0x1c4)]('\x0a')[nW(0x18c)](i=>i[nW(0x236)])),R=chalk_1[nW(0x1ec)][nW(0x18f)]('-'[nW(0x23d)](H)+'\x0a'),{confirm:W}=yield inquirer['prompt']([{'type':'list','name':nW(0x213),'message':''+chalk_1[nW(0x1ec)][nW(0x1c1)][nW(0x20c)](nW(0x25c))+R+chalk_1[nW(0x1ec)]['blueBright'](k)+R,'choices':Object[nW(0x222)](ConfirmChoices)}]);switch(W){case ConfirmChoices[nW(0x1b1)]:return n;case ConfirmChoices[nW(0x23e)]:throw new Error(nW(0x232));case ConfirmChoices[nW(0x22c)]:return this[nW(0x26e)](C);case ConfirmChoices[nW(0x27b)]:return this[nW(0x18e)](yield this[nW(0x21f)](n),C);case ConfirmChoices[nW(0x1c8)]:yield this[nW(0x1d4)](n);return this[nW(0x18e)](n,C);default:throw new Error(nW(0x1cc));}});}[a7U(0x26e)](n,C){return __awaiter(this,void 0x0,void 0x0,function*(){const ni=a7C;if((C===null||C===void 0x0?void 0x0:C[ni(0x201)])!==undefined)this['resultCache']=C===null||C===void 0x0?void 0x0:C['resultCache'];this[ni(0x1ae)]=C===null||C===void 0x0?void 0x0:C[ni(0x27c)];const k={};return yield this[ni(0x24f)]([],n[ni(0x1c6)]['body'],k),this[ni(0x201)]=k,yield this[ni(0x18e)](k,n);});}[a7U(0x24f)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const nt=a7C;let R;if(C[nt(0x20a)]&&!_[nt(0x200)](C,nt(0x19c))){if(C['oneOf']['length']>0x1){const {choice:W}=yield inquirer[nt(0x24d)]([{'type':nt(0x198),'name':'choice','message':'What\x27s\x20the\x20'+(n[n[nt(0x236)]-0x1]||'')+nt(0x233),'choices':C['oneOf'][nt(0x18c)](i=>{var t;return(t=i['description'])!==null&&t!==void 0x0?t:'??';})}]);R=yield this[nt(0x21a)](n,C[nt(0x20a)]['find'](i=>i[nt(0x21c)]===W),k,H);}else{const i=C[nt(0x20a)][0x0];_['set'](i,'description',C[nt(0x21c)]),R=yield this[nt(0x21a)](n,i,k,H);}R={};}else R=yield this['getType'](n,C,k,H);return R;});}[a7U(0x27d)](n,C,k,H){var R;return __awaiter(this,void 0x0,void 0x0,function*(){const nr=a7C;if(H===![]){const {addEntry:t}=yield inquirer['prompt']([{'type':nr(0x213),'name':nr(0x1a6),'message':this[nr(0x263)](C,nr(0x1af),n===null||n===void 0x0?void 0x0:n['description']),'default':![]}]);if(!t)return k;}const W=Object[nr(0x23a)]((R=n===null||n===void 0x0?void 0x0:n[nr(0x19c)])!==null&&R!==void 0x0?R:[]),i=n['required']||[];if(W['length']>0x0)for(const r of W){const M=C['concat'](r);if(C['length']>0x0&&!_['has'](k,C[nr(0x221)]('.')))_[nr(0x258)](k,C['join']('.'),{});yield this[nr(0x24f)](M,n[nr(0x19c)][r],k,i[nr(0x241)](r));}else yield this['getType'](C,Object[nr(0x194)](Object[nr(0x194)]({},n),{'type':'rawObject'}),k,H);return k;});}[a7U(0x1be)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const nM=a7C;if(C&&k)return!![];const R=C?nM(0x1af):'Do\x20you\x20want\x20to\x20add\x20more',{addEntry:W}=yield inquirer[nM(0x24d)]([{'type':nM(0x213),'name':'addEntry','message':this[nM(0x263)](n,R,C?H:undefined),'default':![]}]);return W;});}['getType'](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const ny=a7C;let R;const W=n['join']('.');switch(C===null||C===void 0x0?void 0x0:C[ny(0x1fb)]){case'array':{let i=!![];while(yield this[ny(0x1be)](n,i,H,C===null||C===void 0x0?void 0x0:C[ny(0x21c)])){const t=_['get'](k,W);_[ny(0x19a)](k,W),yield this['getType'](n,C[ny(0x196)],k);const r=_[ny(0x23f)](k,W);!_[ny(0x264)](t)?_['set'](k,W,[r]):(t[ny(0x190)](r),_[ny(0x258)](k,W,t)),i=![];}return R||[];}case'object':{return R=yield this[ny(0x27d)](C,n,k,H),R;}case ny(0x1d8):R=(0x0,utils_1[ny(0x1e8)])(yield this['ask'](n,C,H))||undefined;break;case ny(0x1b6):case ny(0x214):case'integer':default:R=yield this['ask'](n,C,H,k);break;}return!_[ny(0x1ca)](R)&&_[ny(0x258)](k,W,R),R;});}[a7U(0x1e0)](n,C,k,H){var R;return __awaiter(this,void 0x0,void 0x0,function*(){const nT=a7C,W=n[n[nT(0x236)]-0x1],{defaultValue:defaultValue=(R=C===null||C===void 0x0?void 0x0:C[nT(0x245)])!==null&&R!==void 0x0?R:C===null||C===void 0x0?void 0x0:C[nT(0x1ec)],choices:choices=C===null||C===void 0x0?void 0x0:C[nT(0x246)],pagination:i}=yield(0x0,api_helpers_1[nT(0x204)])(W,this['apiClient'],this[nT(0x1ae)],H,this['pathVars'],n);let t=nT(0x217);if(!_[nT(0x1ca)](choices)&&choices['length']>0x0){if(i!==undefined&&i[nT(0x1a4)]!==undefined)t=nT(0x224);else choices[nT(0x236)]>0x4&&typeof choices[0x0]===nT(0x1b6)?t=nT(0x1a5):t=nT(0x198);}else{if((C===null||C===void 0x0?void 0x0:C[nT(0x1fb)])===nT(0x214))t=nT(0x213);else{if((C===null||C===void 0x0?void 0x0:C[nT(0x1fb)])==='integer')t=nT(0x217);else(C===null||C===void 0x0?void 0x0:C[nT(0x1fb)])===nT(0x1d8)&&(t=nT(0x21d));}}let r=k!==![]?!_['isObject'](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[nT(0x267)](defaultValue)?defaultValue:nT(0x1cd);if(choices)r=r['toString']();_[nT(0x200)](this['resultCache'],n['join']('.'))&&(r=this[nT(0x201)][n[nT(0x221)]('.')]);const M=choices&&k===![]?[nT(0x1cd),...choices]:choices,y=(C===null||C===void 0x0?void 0x0:C['type'])==='integer',T=Object['assign']({'type':t,'name':'id','message':this[nT(0x1c0)](n,C),'choices':M,'default':r,'filter':this[nT(0x248)](t,k),'validate':this['validate'](C,k,y)},i),V=(yield inquirer[nT(0x24d)]([T]))['id'];if(V===nT(0x1cd)||V==='')return undefined;if(y)return parseInt(V,0xa);return V;});}[a7U(0x1c0)](n,C){const nV=a7U,k=(C===null||C===void 0x0?void 0x0:C[nV(0x1fb)])!==nV(0x214)?nV(0x26a):nV(0x253);return this[nV(0x263)](n,k,C===null||C===void 0x0?void 0x0:C[nV(0x21c)]);}[a7U(0x1dd)](){return __awaiter(this,void 0x0,void 0x0,function*(){const nU=a7C,n=C=>__awaiter(this,void 0x0,void 0x0,function*(){const nj=a7C;var k;const H=yield this[nj(0x1bc)][nj(0x198)]['projects']({'options':{'per_page':this[nj(0x24b)],'cursor':C}}),R=H['data']['projects'][nj(0x18c)](W=>W['id']);return{'elements':R,'nextCursor':(k=H[nj(0x1f8)])===null||k===void 0x0?void 0x0:k[nj(0x1e2)]};});return yield this[nU(0x252)](nU(0x18b),n);});}[a7U(0x1a9)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const nh=a7C,R=k||this[nh(0x1bc)][nh(0x192)][nh(0x19f)]();if(_['isUndefined'](R))throw new Error(nh(0x191));const W=yield C(R);return yield this[nh(0x270)](n,W,(H?H+nh(0x218):'')+nh(0x257)+R+'\x27');});}[a7U(0x20d)](n,C,k,H){return __awaiter(this,void 0x0,void 0x0,function*(){const no=a7C,R=k||this[no(0x1bc)]['contextProvider'][no(0x19f)]();if(_[no(0x1ca)](R))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const W=yield C(R);return yield this[no(0x252)](n,W,(H?H+'\x20in\x20':'')+'project:\x20\x27'+R+'\x27');});}[a7U(0x1a0)](){return __awaiter(this,void 0x0,void 0x0,function*(){const nA=a7C,n=yield this[nA(0x1bc)][nA(0x198)][nA(0x1f2)]({}),C=n[nA(0x1b8)][nA(0x1f2)][nA(0x18c)](k=>k[nA(0x1b5)]);return this[nA(0x270)](nA(0x24a),C);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const nd=a7C,n=yield this[nd(0x1bc)][nd(0x198)][nd(0x1e7)]({}),C=n['data'][nd(0x250)][nd(0x18c)](k=>k['id']);return this[nd(0x270)](nd(0x250),C);});}['setPathVars'](n){const nQ=a7U;this[nQ(0x254)]=n;}}exports['InquirerHelper']=InquirerHelper;
1
+ 'use strict';const a7Q=a7f;function a7f(H,f){const l=a7H();return a7f=function(t,b){t=t-0xed;let i=l[t];return i;},a7f(H,f);}(function(H,f){const m=a7f,l=H();while(!![]){try{const t=-parseInt(m(0x150))/0x1+parseInt(m(0x132))/0x2*(-parseInt(m(0x12e))/0x3)+parseInt(m(0x12a))/0x4+-parseInt(m(0x192))/0x5*(-parseInt(m(0x112))/0x6)+parseInt(m(0x194))/0x7+-parseInt(m(0x1b9))/0x8*(-parseInt(m(0xed))/0x9)+-parseInt(m(0x16e))/0xa;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a7H,0xaf586));var __createBinding=this&&this[a7Q(0x16c)]||(Object[a7Q(0x1d7)]?function(H,f,l,t){const L=a7Q;if(t===undefined)t=l;var b=Object[L(0x19d)](f,l);(!b||('get'in b?!f['__esModule']:b[L(0x127)]||b[L(0x12b)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[L(0x189)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a7Q(0x140)]||(Object['create']?function(H,f){const B=a7Q;Object[B(0x189)](H,B(0x182),{'enumerable':!![],'value':f});}:function(H,f){const T=a7Q;H[T(0x182)]=f;}),__importStar=this&&this[a7Q(0x1eb)]||function(H){const X=a7Q;if(H&&H[X(0x1ae)])return H;var f={};if(H!=null){for(var l in H)if(l!==X(0x182)&&Object['prototype']['hasOwnProperty'][X(0x181)](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this[a7Q(0x168)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const V=a7f;function r(Y){const C=a7f;try{w(t[C(0x146)](Y));}catch(x){n(x);}}function q(Y){const j=a7f;try{w(t[j(0x1da)](Y));}catch(x){n(x);}}function w(Y){const D=a7f;Y[D(0x179)]?i(Y[D(0x176)]):b(Y[D(0x176)])[D(0x169)](r,q);}w((t=t['apply'](H,f||[]))[V(0x146)]());});},__importDefault=this&&this[a7Q(0x1e3)]||function(H){return H&&H['__esModule']?H:{'default':H};};Object[a7Q(0x189)](exports,a7Q(0x1ae),{'value':!![]}),exports[a7Q(0x15a)]=void 0x0;const _=__importStar(require(a7Q(0x102))),chalk_1=__importDefault(require(a7Q(0x10e))),fs=__importStar(require('fs')),utils_1=require(a7Q(0x1d8)),api_helpers_1=require(a7Q(0x1d9)),inquirer_pagination_prompt_1=require(a7Q(0x162)),inquirer=require(a7Q(0xf0)),inquirerSearchList=require(a7Q(0x1cb)),yaml=require(a7Q(0x193));var ConfirmChoices;function a7H(){const HD=['askForBuild','max','addon:\x20\x27','bgGrey','lodash','askForAddonBackup','safeLoad','completedAt','unset','toString','Do\x20you\x20want\x20to\x20add','charAt','pattern','\x20type?','isEmpty','Do\x20you\x20want\x20to\x20add\x20more','chalk','askForTemplate','project','resultCache','6283206HzuhdW','body','blueBright','startedAt','secrets','domain','split','\x20to\x20use:','registerPrompt','No\x20builds\x20found','volume','properties','service:\x20\x27','nextCursor','DynamicReloadPaginationPrompt','addon','must\x20be\x20a\x20number,\x20is\x20','get','askConfirm','Something\x20unexpected\x20happened.','askForJob','writable','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','project:\x20\x27','5302104PKKmcF','configurable','getQuestionString','don\x27t\x20change','1053OOLhIg','yellowBright','EDIT','Configuration\x20file\x20written\x20to\x20','2246aKIhZS','boolean','main-context','list','name','pagination','stringify','maximum','join','override','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','askForLogSink','Writing\x20configuration\x20failed:\x20','green','__setModuleDefault','Context\x20with\x20name\x20\x27','Please\x20confirm\x20following\x20configuration:\x0a','example','push','What\x27s\x20the\x20','next','\x20in\x20','pathVars','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','backups','REPEAT','apiClient','doesn\x27t\x20match\x20pattern\x20\x27','askArrayEntry','log\x20sink','409813RiqdHW','blue','editedResult','input','json','confirm','pop','isNaN','job:\x20\x27','\x20Example:\x20','InquirerHelper','length','grey','isUndefined','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','password','token','No\x20','./pagination/inquirer-pagination-prompt','found','trim','required','has','reset','__awaiter','then','YES','isObject','__createBinding','pipelines','33917590IUYoXv','defaultPaginationPageSize','fullName','loginPrompt','pipeline','builds','tokenPrompt','integer','value','bold','What\x20do\x20you\x20want\x20to\x20use\x20as','done','ask','No,\x20but\x20save\x20as\x20file','setPathVars','cmdPath','deleteWarningPrompt','template\x20run','nextPageCursor','call','default','\x20and\x20it\x20',',\x20supported\x20types:\x20[json|yaml|yml]','askForProjectScopedResource','Aborted.','retrievePayloadViaInteractiveCli','search-list','defineProperty','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','getType','services','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','subdomains','job\x20build','fileName','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','5JdrcCX','js-yaml','8236102dAJKFu','askForProjectScopedResourcePaginated','this\x20option\x20is\x20required,\x20please\x20answer','\x20(startedAt:\x20','askForAddon','yaml','.*\x5c.(json|yaml|yml)$','validate','jobs','getOwnPropertyDescriptor','No,\x20edit','set','Enter\x20the\x20','whiteBright','askForSecret','data','domains','No,\x20abort','createdAt','writeFileSync','opt','fetchResourceList','find','type','values','enum','__esModule','Go\x20to\x20editor','ABORT','repeat','Context\x20name\x20already\x20exists.','askForPipeline','confirmationPrompt','askForSubdomain','propToType','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','success','138192FrmChP','slice','getInnerType','keys','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','items','oneOf','logSinks','addons','secret','rawObject','red','template','service','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','prompt','askForResourcePaginated','string','inquirer-search-list','array','askForResource','map','greenBright','credentials','runs','confirmation','retry','cursor','askForDomain','\x20characters,\x20is\x20','create','./utils','./api-helpers','throw','test','description','askGeneric','pagination-prompt','includes','\x20(completedAt:\x20','templateRuns','Unexpected\x20file\x20type:\x20','__importDefault','job','assign','templates','saveFile','safeDump','addEntry','askForService','__importStar','maxLength','filter','domain\x20(','711AEixPh','warning','contextProvider','inquirer','isBoolean','choice','isValidJSON','\x20characters','SAVE','Choose\x20the\x20','minimum','minLength','editor','askForCredentials','getCurrentProjectName','underline','volumes'];a7H=function(){return HD;};return a7H();}(function(H){const e=a7Q;H[e(0x16a)]='Yes,\x20send',H[e(0x14b)]='No,\x20repeat',H[e(0x130)]=e(0x19e),H['SAVE']=e(0x17b),H['ABORT']=e(0x1a5);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(H){const O=a7Q;this[O(0x14c)]=H,this[O(0x16f)]=0x32,this['editPayload']=f=>__awaiter(this,void 0x0,void 0x0,function*(){const E=O,{editedResult:l}=yield inquirer[E(0x1c8)]([{'type':E(0xf9),'name':E(0x152),'message':E(0x1af),'default':yaml[E(0x1e8)](f)}]);return yaml[E(0x104)](l);}),this[O(0x1e7)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const S=O,l=n=>S(0x1e2)+n+S(0x184);function t(){return __awaiter(this,void 0x0,void 0x0,function*(){const A=a7f;return inquirer[A(0x1c8)]([{'type':'input','name':A(0x190),'message':A(0x13c),'validate':n=>new RegExp(A(0x19a))[A(0x1db)](n)?!![]:l(n)}]);});}const {fileName:b}=yield t(),i=b[S(0x107)]()[S(0x118)]('.')[S(0x156)]();try{switch(i){case S(0x154):(0x0,utils_1[S(0x1b8)])(S(0x131)+b);return fs[S(0x1a7)](b,JSON[S(0x138)](f,null,'\x20\x20'));case S(0x199):case'yml':(0x0,utils_1['success'])(S(0x131)+b);return fs[S(0x1a7)](b,yaml[S(0x1e8)](f));default:(0x0,utils_1[S(0xee)])(l(i));}}catch(n){(0x0,utils_1[S(0xee)])(S(0x13e)+n['message']);}return undefined;}),this[O(0x1ed)]=(f,l)=>t=>{const k=O,b=typeof t===k(0x1ca)?t[k(0x164)]():t;return l===![]&&b==='don\x27t\x20change'?'':b;},this[O(0x19b)]=(f,l,t)=>b=>{const h=O,i=[];if(b===''||b===h(0x12d)){if(l!==![])i[h(0x144)](h(0x196));else return!![];}f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0x10a)])&&i[h(0x144)](new RegExp(f['pattern'])[h(0x1db)](b)?!![]:h(0x14d)+f[h(0x10a)]+'\x27');f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0xf8)])&&i['push'](b['length']>=f['minLength']?!![]:h(0x18a)+f['minLength']+'\x20characters,\x20is\x20'+b[h(0x15b)]+h(0xf4));f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0x1ec)])&&i['push'](b[h(0x15b)]<=f[h(0x1ec)]?!![]:h(0x128)+f[h(0x1ec)]+h(0x1d6)+b[h(0x15b)]+h(0xf4));t&&Number[h(0x157)](parseInt(b,0xa))&&i[h(0x144)](h(0x122)+b);f[h(0x1ab)]===h(0x175)&&!_[h(0x15d)](f[h(0xf7)])&&i[h(0x144)](b>=f['minimum']?!![]:h(0x149)+f[h(0xf7)]);f[h(0x1ab)]==='integer'&&!_[h(0x15d)](f[h(0x139)])&&i['push'](b<=f[h(0x139)]?!![]:h(0x15e)+f[h(0x139)]);if(f['type']==='rawObject'){const q=(0x0,utils_1[h(0xf3)])(b);i[h(0x144)](q===![]||_[h(0x10c)](q)?h(0x1bd):!![]);}const n=i[h(0x1ed)](w=>w!==!![]),r=(f===null||f===void 0x0?void 0x0:f[h(0x143)])?'\x0a'+chalk_1[h(0x182)][h(0x1c4)]('>>')+h(0x159)+chalk_1['default'][h(0x1a1)](JSON[h(0x138)](f['example'])):'';return n[h(0x15b)]>0x0?n[h(0x13a)](chalk_1['default'][h(0xfc)](h(0x183)))+r:!![];},this['getPathString']=(f,l,t)=>{const K=O,b=f[f[K(0x15b)]-0x1];function i(){const I=K;return f[I(0x1ba)](0x0,-0x1)[I(0x1ce)](q=>q[I(0x109)](0x0)['toUpperCase']()+q['slice'](0x1))[I(0x13a)]('>');}const n=f[K(0x15b)]>0x1?chalk_1['default'][K(0x101)][K(0x1a1)](i())+':\x20':'',r=t?'\x20('+chalk_1[K(0x182)][K(0x151)](t)+')':'';return chalk_1[K(0x182)][K(0x167)](''+n+l+'\x20'+chalk_1[K(0x182)][K(0x177)][K(0x1cf)](b)+r+'?');},this['askForResource']=(f,l,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const P=O;if(l[P(0x15b)]<0x1){const n=t?'for\x20this\x20'+t:P(0x163);throw new Error(P(0x161)+f+'\x20'+n+'.');}const b=P(0xf6)+f+P(0x119),i=l[P(0x15b)]>0x4?P(0x188):P(0x135);return(yield inquirer[P(0x1c8)]([{'type':i,'name':P(0x136),'message':b,'choices':l}]))[P(0x136)];}),this[O(0x1c9)]=(f,l,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=O,{elements:b,nextCursor:i}=yield l();if(b[Z(0x15b)]<0x1){const q=t?'for\x20this\x20'+t:Z(0x163);throw new Error(Z(0x161)+f+'\x20'+q+'.');}const n='Choose\x20the\x20'+f+Z(0x119);if(i!==undefined){const w=({nextPageCursor:Y})=>__awaiter(this,void 0x0,void 0x0,function*(){const W=Z,x=yield l(Y);return{'elements':x['elements'],'nextPageCursor':x[W(0x11f)]};});return(yield inquirer[Z(0x1c8)]([{'type':Z(0x1de),'name':Z(0x136),'message':n,'choices':b,'nextPageCursor':i,'loadMore':w}]))[Z(0x136)];}const r=b[Z(0x15b)]>0x4?Z(0x188):Z(0x135);return(yield inquirer['prompt']([{'type':r,'name':Z(0x136),'message':n,'choices':b}]))['name'];}),this[O(0x1dd)]=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=O,t=''+(l?'('+chalk_1[u(0x182)]['blue'](l)+')\x20':''),b=u(0x1a0)+chalk_1['default'][u(0x13f)](f)+'\x20'+t+'to\x20use:',i=this[u(0x19b)]({'type':u(0x1ca),'required':!![]});return(yield inquirer['prompt']([{'type':u(0x153),'name':u(0x136),'message':b,'validate':i}]))[u(0x136)];}),this[O(0x124)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const g=O;return(yield inquirer[g(0x1c8)]([{'type':g(0x155),'name':'name','message':f,'default':!![]}]))['name'];}),this[O(0x1ea)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const d=a7f;var i;const n=yield this[d(0x14c)]['list'][d(0x18c)]({'parameters':{'projectId':t},'options':{'per_page':this[d(0x16f)],'cursor':b}}),r=n[d(0x1a3)]['services'][d(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[d(0x137)])===null||i===void 0x0?void 0x0:i[d(0x1d4)]};});return this[F(0x195)](F(0x1c6),l,f);}),this[O(0x10f)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const a=O,f=l=>__awaiter(this,void 0x0,void 0x0,function*(){const p=a7f;var t;const b=yield this[p(0x14c)][p(0x135)][p(0x1e6)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':l}}),i=b['data']['templates'][p(0x1ce)](n=>n['id']);return{'elements':i,'nextCursor':(t=b[p(0x137)])===null||t===void 0x0?void 0x0:t['cursor']};});return this[a(0x1c9)](a(0x1c5),f);}),this['askForTemplateRun']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=O;if(_[J(0x15d)](f))throw new Error('Template\x20id\x20not\x20provided.');const l=t=>__awaiter(this,void 0x0,void 0x0,function*(){const o=J;var b;let i=this[o(0x16f)];const n=yield this[o(0x14c)][o(0x135)]['templateRuns']({'parameters':{'templateId':f},'options':{'per_page':i,'cursor':t}}),r=n[o(0x1a3)][o(0x1e1)][o(0x1ce)](q=>q['id']+o(0x197)+q[o(0x1a6)]+')');return{'elements':r,'nextCursor':(b=n[o(0x137)])===null||b===void 0x0?void 0x0:b[o(0x1d4)]};});return this[J(0x1c9)](J(0x17f),l)[J(0x169)](t=>t['split']('\x20')[0x0]);}),this[O(0x13d)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=O,f=l=>__awaiter(this,void 0x0,void 0x0,function*(){const M=a7f;var t;let b=this['defaultPaginationPageSize'];const i=yield this[M(0x14c)][M(0x135)][M(0x1c0)]({'options':{'per_page':b,'cursor':l}}),n=i[M(0x1a3)][M(0x1c0)][M(0x1ce)](r=>r['id']);return{'elements':n,'nextCursor':(t=i[M(0x137)])===null||t===void 0x0?void 0x0:t['cursor']};});return this[G(0x1c9)](G(0x14f),f);}),this[O(0x1b3)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const z=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const N=a7f;var i;const n=yield this[N(0x14c)][N(0x135)]['pipelines']({'parameters':{'projectId':t},'options':{'per_page':this[N(0x16f)],'cursor':b}}),r=n[N(0x1a3)][N(0x16d)][N(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[N(0x137)])===null||i===void 0x0?void 0x0:i['cursor']};});return this[z(0x195)](z(0x172),l,f);}),this[O(0x126)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const R=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const v=a7f;var i;const n=yield this['apiClient']['list']['jobs']({'parameters':{'projectId':t},'options':{'per_page':this[v(0x16f)],'cursor':b}}),r=n['data'][v(0x19c)][v(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[v(0x137)])===null||i===void 0x0?void 0x0:i['cursor']};});return this[R(0x195)]('job',l,f);}),this['askForJobRun']=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=O,t=b=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const s=a7f;var n;const r=yield this[s(0x14c)][s(0x123)][s(0x1e4)][s(0x1d1)]({'parameters':{'projectId':b,'jobId':f},'options':{'per_page':this[s(0x16f)],'cursor':i}}),q=r[s(0x1a3)][s(0x1d1)]['map'](w=>w['id']+s(0x197)+w[s(0x115)]+')');return{'elements':q,'nextCursor':(n=r[s(0x137)])===null||n===void 0x0?void 0x0:n[s(0x1d4)]};});return this[y(0x195)]('job\x20runs',t,l,y(0x158)+f+'\x27')['then'](b=>b[y(0x118)]('\x20')[0x0]);}),this[O(0xfe)]=(f,l,t)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H1=O;if(t!==undefined){const b=i=>n=>__awaiter(this,void 0x0,void 0x0,function*(){const H0=a7f;var r;const q=yield this[H0(0x14c)]['get'][H0(0x1e4)][H0(0x173)]({'parameters':{'projectId':i,'jobId':t},'options':{'per_page':this[H0(0x16f)],'cursor':n}});return{'elements':q[H0(0x1a3)][H0(0x173)][H0(0x1ce)](w=>w['id']+H0(0x197)+w[H0(0x1a6)]+')'),'nextCursor':(r=q[H0(0x137)])===null||r===void 0x0?void 0x0:r[H0(0x1d4)]};});return this['askForProjectScopedResourcePaginated']('job\x20builds',b,f,H1(0x158)+t+'\x27')[H1(0x169)](i=>i[H1(0x118)]('\x20')[0x0]);}if(l!==undefined){const i=n=>r=>__awaiter(this,void 0x0,void 0x0,function*(){const H2=H1;var q;const w=yield this[H2(0x14c)][H2(0x123)][H2(0x1c6)]['builds']({'parameters':{'projectId':n,'serviceId':l},'options':{'per_page':this[H2(0x16f)],'cursor':r}});return{'elements':w[H2(0x1a3)][H2(0x173)]['map'](Y=>Y['id']+H2(0x197)+Y[H2(0x1a6)]+')'),'nextCursor':(q=w['pagination'])===null||q===void 0x0?void 0x0:q[H2(0x1d4)]};});return this['askForProjectScopedResourcePaginated'](H1(0x18f),i,f,H1(0x11e)+t+'\x27')[H1(0x169)](n=>n['split']('\x20')[0x0]);}throw new Error(H1(0x11b));}),this[O(0x198)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H4=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const H3=a7f;var i;const n=yield this[H3(0x14c)][H3(0x135)][H3(0x1c1)]({'parameters':{'projectId':t},'options':{'per_page':this[H3(0x16f)],'cursor':b}});return{'elements':n['data'][H3(0x1c1)][H3(0x1ce)](r=>r['id']),'nextCursor':(i=n[H3(0x137)])===null||i===void 0x0?void 0x0:i[H3(0x1d4)]};});return this[H4(0x195)](H4(0x121),l,f);}),this[O(0x103)]=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H6=O,t=b=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const H5=a7f;var n;const r=yield this[H5(0x14c)]['get'][H5(0x121)][H5(0x14a)]({'parameters':{'projectId':b,'addonId':l},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':i}});return{'elements':r['data'][H5(0x14a)]['map'](q=>q['id']+H5(0x1e0)+(q[H5(0x105)]||'not\x20completed')+')'),'nextCursor':(n=r[H5(0x137)])===null||n===void 0x0?void 0x0:n[H5(0x1d4)]};});return this[H6(0x195)](H6(0x14a),t,f,H6(0x100)+l+'\x27')[H6(0x169)](b=>b[H6(0x118)]('\x20')[0x0]);}),this['askForVolume']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H8=O,l=t=>__awaiter(this,void 0x0,void 0x0,function*(){const H7=a7f;return(yield this[H7(0x14c)][H7(0x135)][H7(0xfd)]({'parameters':{'projectId':t}}))[H7(0x1a3)]['map'](b=>b['id']);});return this[H8(0x185)](H8(0x11c),l,f);}),this[O(0x1a2)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const HH=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const H9=a7f;var i;const n=yield this[H9(0x14c)]['list'][H9(0x116)]({'parameters':{'projectId':t},'options':{'per_page':this[H9(0x16f)],'cursor':b}});return{'elements':n['data'][H9(0x116)][H9(0x1ce)](r=>r['id']),'nextCursor':(i=n['pagination'])===null||i===void 0x0?void 0x0:i[H9(0x1d4)]};});return this[HH(0x195)](HH(0x1c2),l,f);}),this[O(0x1b5)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hf=O,l=yield this[Hf(0x14c)]['get']['domain']({'parameters':{'domain':f}}),t=l[Hf(0x1a3)][Hf(0x18e)][Hf(0x1ce)](i=>i[Hf(0x136)]+'\x20(full\x20domain:\x20'+i[Hf(0x170)]+')'),b=Hf(0x1ee)+f+')';return this[Hf(0x1cd)]('subdomain',t,b)[Hf(0x169)](i=>i[Hf(0x118)]('\x20')[0x0]);}),this[O(0x17e)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const Hl=O;return(yield inquirer['prompt']([{'type':Hl(0x155),'name':Hl(0x1d2),'message':chalk_1['default'][Hl(0x12f)](Hl(0x191)+(f||'a\x20Northflank\x20resource')+Hl(0x1b7)),'default':![]}]))[Hl(0x1d2)];}),this[O(0x171)]=(f,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const Ht=O;_[Ht(0x15d)](f[Ht(0x136)])&&(l['length']<=0x0?_[Ht(0x19f)](f,'name',Ht(0x182)):yield(0x0,utils_1[Ht(0x1d3)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hb=Ht,{name:t}=yield inquirer[Hb(0x1c8)]([{'type':Hb(0x153),'name':Hb(0x136),'message':Hb(0x1c7),'default':Hb(0x134)}]);if(!f[Hb(0x13b)]&&l['find'](b=>b[Hb(0x136)]===t)){const {c:b}=yield inquirer[Hb(0x1c8)]([{'type':Hb(0x155),'name':'c','message':Hb(0x141)+t+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(b===![])throw new Error(Hb(0x1b2));_['set'](f,'override',!![]);}_[Hb(0x19f)](f,Hb(0x136),t);})));if(_['isUndefined'](f['token'])){const t=yield this[Ht(0x174)]();_[Ht(0x19f)](f,Ht(0x160),t);}return f;}),this['tokenPrompt']=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hi=O,{token:f}=yield inquirer['prompt']([{'type':Hi(0x15f),'name':Hi(0x160),'mask':'*','message':'Choose\x20the\x20login\x20token:'}]);return f;}),inquirer[O(0x11a)](O(0x188),inquirerSearchList),inquirer[O(0x11a)](O(0x1de),inquirer_pagination_prompt_1[O(0x120)]);}[a7Q(0x1b4)](H,f){return __awaiter(this,void 0x0,void 0x0,function*(){const Hn=a7f,l=yaml[Hn(0x1e8)](H),t=_[Hn(0xff)](l[Hn(0x118)]('\x0a')['map'](n=>n[Hn(0x15b)])),b=chalk_1[Hn(0x182)][Hn(0x15c)]('-'[Hn(0x1b1)](t)+'\x0a'),{confirm:i}=yield inquirer[Hn(0x1c8)]([{'type':Hn(0x135),'name':Hn(0x155),'message':''+chalk_1['default'][Hn(0x177)]['green'](Hn(0x142))+b+chalk_1[Hn(0x182)][Hn(0x114)](l)+b,'choices':Object[Hn(0x1ac)](ConfirmChoices)}]);switch(i){case ConfirmChoices[Hn(0x16a)]:return H;case ConfirmChoices[Hn(0x1b0)]:throw new Error(Hn(0x186));case ConfirmChoices[Hn(0x14b)]:return this[Hn(0x187)](f);case ConfirmChoices['EDIT']:return this['confirmationPrompt'](yield this['editPayload'](H),f);case ConfirmChoices[Hn(0xf5)]:yield this['saveFile'](H);return this['confirmationPrompt'](H,f);default:throw new Error(Hn(0x125));}});}[a7Q(0x187)](H,f){return __awaiter(this,void 0x0,void 0x0,function*(){const Hr=a7f;if((f===null||f===void 0x0?void 0x0:f[Hr(0x111)])!==undefined)this[Hr(0x111)]=f===null||f===void 0x0?void 0x0:f[Hr(0x111)];this['tmpCmdPath']=f===null||f===void 0x0?void 0x0:f[Hr(0x17d)];const l={};return yield this[Hr(0x1b6)]([],H[Hr(0x1a8)][Hr(0x113)],l),this[Hr(0x111)]=l,yield this['confirmationPrompt'](l,H);});}['propToType'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const Hq=a7f;let b;if(f[Hq(0x1bf)]&&!_[Hq(0x166)](f,'properties')){if(f['oneOf'][Hq(0x15b)]>0x1){const {choice:i}=yield inquirer[Hq(0x1c8)]([{'type':Hq(0x135),'name':Hq(0xf2),'message':Hq(0x145)+(H[H[Hq(0x15b)]-0x1]||'')+Hq(0x10b),'choices':f[Hq(0x1bf)][Hq(0x1ce)](n=>{const Hw=Hq;var r;return(r=n[Hw(0x1dc)])!==null&&r!==void 0x0?r:'??';})}]);b=yield this[Hq(0x18b)](H,f[Hq(0x1bf)][Hq(0x1aa)](n=>n[Hq(0x1dc)]===i),l,t);}else{const n=f[Hq(0x1bf)][0x0];_['set'](n,'description',f[Hq(0x1dc)]),b=yield this[Hq(0x18b)](H,n,l,t);}b={};}else b=yield this[Hq(0x18b)](H,f,l,t);return b;});}[a7Q(0x1bb)](H,f,l,t){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const HY=a7f;if(t===![]){const {addEntry:r}=yield inquirer[HY(0x1c8)]([{'type':HY(0x155),'name':HY(0x1e9),'message':this['getPathString'](f,HY(0x108),H===null||H===void 0x0?void 0x0:H[HY(0x1dc)]),'default':![]}]);if(!r)return l;}const i=Object[HY(0x1bc)]((b=H===null||H===void 0x0?void 0x0:H[HY(0x11d)])!==null&&b!==void 0x0?b:[]),n=H[HY(0x165)]||[];if(i['length']>0x0)for(const q of i){const w=f['concat'](q);if(f['length']>0x0&&!_['has'](l,f[HY(0x13a)]('.')))_[HY(0x19f)](l,f[HY(0x13a)]('.'),{});yield this[HY(0x1b6)](w,H[HY(0x11d)][q],l,n[HY(0x1df)](q));}else yield this['getType'](f,Object[HY(0x1e5)](Object[HY(0x1e5)]({},H),{'type':'rawObject'}),l,t);return l;});}[a7Q(0x14e)](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const Hx=a7f;if(f&&l)return!![];const b=f?'Do\x20you\x20want\x20to\x20add':Hx(0x10d),{addEntry:i}=yield inquirer['prompt']([{'type':'confirm','name':'addEntry','message':this['getPathString'](H,b,f?t:undefined),'default':![]}]);return i;});}[a7Q(0x18b)](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HU=a7f;let b;const i=H[HU(0x13a)]('.');switch(f===null||f===void 0x0?void 0x0:f['type']){case HU(0x1cc):{let n=!![];while(yield this[HU(0x14e)](H,n,t,f===null||f===void 0x0?void 0x0:f[HU(0x1dc)])){const r=_[HU(0x123)](l,i);_[HU(0x106)](l,i),yield this[HU(0x18b)](H,f[HU(0x1be)],l);const q=_[HU(0x123)](l,i);!_['isArray'](r)?_[HU(0x19f)](l,i,[q]):(r[HU(0x144)](q),_[HU(0x19f)](l,i,r)),n=![];}return b||[];}case'object':{return b=yield this[HU(0x1bb)](f,H,l,t),b;}case'rawObject':b=(0x0,utils_1[HU(0xf3)])(yield this[HU(0x17a)](H,f,t))||undefined;break;case HU(0x1ca):case HU(0x133):case HU(0x175):default:b=yield this[HU(0x17a)](H,f,t,l);break;}return!_[HU(0x15d)](b)&&_['set'](l,i,b),b;});}['ask'](H,f,l,t){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const Hm=a7f,i=H[H[Hm(0x15b)]-0x1],{defaultValue:defaultValue=(b=f===null||f===void 0x0?void 0x0:f['example'])!==null&&b!==void 0x0?b:f===null||f===void 0x0?void 0x0:f[Hm(0x182)],choices:choices=f===null||f===void 0x0?void 0x0:f[Hm(0x1ad)],pagination:n}=yield(0x0,api_helpers_1[Hm(0x1a9)])(i,this[Hm(0x14c)],this['tmpCmdPath'],t,this[Hm(0x148)],H);let r='input';if(!_[Hm(0x15d)](choices)&&choices[Hm(0x15b)]>0x0){if(n!==undefined&&n[Hm(0x180)]!==undefined)r='pagination-prompt';else choices[Hm(0x15b)]>0x4&&typeof choices[0x0]==='string'?r=Hm(0x188):r=Hm(0x135);}else{if((f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])===Hm(0x133))r=Hm(0x155);else{if((f===null||f===void 0x0?void 0x0:f['type'])===Hm(0x175))r=Hm(0x153);else(f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])===Hm(0x1c3)&&(r=Hm(0xf9));}}let q=l!==![]?!_[Hm(0x16b)](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[Hm(0xf1)](defaultValue)?defaultValue:Hm(0x12d);if(choices)q=q[Hm(0x107)]();_['has'](this[Hm(0x111)],H[Hm(0x13a)]('.'))&&(q=this[Hm(0x111)][H['join']('.')]);const w=choices&&l===![]?[Hm(0x12d),...choices]:choices,Y=(f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])==='integer',x=Object[Hm(0x1e5)]({'type':r,'name':'id','message':this['getQuestionString'](H,f),'choices':w,'default':q,'filter':this[Hm(0x1ed)](r,l),'validate':this[Hm(0x19b)](f,l,Y)},n),U=(yield inquirer['prompt']([x]))['id'];if(U==='don\x27t\x20change'||U==='')return undefined;if(Y)return parseInt(U,0xa);return U;});}[a7Q(0x12c)](H,f){const HQ=a7Q,l=(f===null||f===void 0x0?void 0x0:f[HQ(0x1ab)])!==HQ(0x133)?HQ(0x178):'Should\x20it\x20be';return this['getPathString'](H,l,f===null||f===void 0x0?void 0x0:f[HQ(0x1dc)]);}['askForProject'](){return __awaiter(this,void 0x0,void 0x0,function*(){const HB=a7f,H=f=>__awaiter(this,void 0x0,void 0x0,function*(){const HL=a7f;var l;const t=yield this[HL(0x14c)]['list']['projects']({'options':{'per_page':this[HL(0x16f)],'cursor':f}}),b=t[HL(0x1a3)]['projects'][HL(0x1ce)](i=>i['id']);return{'elements':b,'nextCursor':(l=t[HL(0x137)])===null||l===void 0x0?void 0x0:l[HL(0x1d4)]};});return yield this[HB(0x1c9)](HB(0x110),H);});}['askForProjectScopedResource'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HT=a7f,b=l||this['apiClient']['contextProvider'][HT(0xfb)]();if(_['isUndefined'](b))throw new Error(HT(0x18d));const i=yield f(b);return yield this[HT(0x1cd)](H,i,(t?t+HT(0x147):'')+'project:\x20\x27'+b+'\x27');});}['askForProjectScopedResourcePaginated'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HX=a7f,b=l||this[HX(0x14c)][HX(0xef)][HX(0xfb)]();if(_[HX(0x15d)](b))throw new Error(HX(0x18d));const i=yield f(b);return yield this[HX(0x1c9)](H,i,(t?t+'\x20in\x20':'')+HX(0x129)+b+'\x27');});}[a7Q(0x1d5)](){return __awaiter(this,void 0x0,void 0x0,function*(){const HC=a7f,H=yield this[HC(0x14c)]['list'][HC(0x1a4)]({}),f=H['data']['domains']['map'](l=>l[HC(0x136)]);return this['askForResource'](HC(0x117),f);});}[a7Q(0xfa)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Hj=a7f,H=yield this[Hj(0x14c)]['list']['registries']({}),f=H[Hj(0x1a3)][Hj(0x1d0)][Hj(0x1ce)](l=>l['id']);return this['askForResource'](Hj(0x1d0),f);});}[a7Q(0x17c)](H){const Hc=a7Q;this[Hc(0x148)]=H;}}exports['InquirerHelper']=InquirerHelper;
@@ -1 +1 @@
1
- 'use strict';const a8K=a8C;function a8C(n,C){const k=a8n();return a8C=function(H,R){H=H-0x117;let W=k[H];return W;},a8C(n,C);}(function(n,C){const l=a8C,k=n();while(!![]){try{const H=parseInt(l(0x13c))/0x1+-parseInt(l(0x149))/0x2+parseInt(l(0x11d))/0x3+-parseInt(l(0x14c))/0x4+parseInt(l(0x13e))/0x5*(-parseInt(l(0x14d))/0x6)+-parseInt(l(0x14e))/0x7*(parseInt(l(0x118))/0x8)+parseInt(l(0x152))/0x9;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a8n,0x9da44));var __createBinding=this&&this[a8K(0x156)]||(Object[a8K(0x157)]?function(n,C,H,R){const m=a8K;if(R===undefined)R=H;var W=Object[m(0x155)](C,H);(!W||('get'in W?!C[m(0x150)]:W[m(0x11b)]||W[m(0x13a)]))&&(W={'enumerable':!![],'get':function(){return C[H];}}),Object[m(0x123)](n,R,W);}:function(n,C,H,R){if(R===undefined)R=H;n[R]=C[H];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(n,C){const a=a8K;Object[a(0x123)](n,a(0x148),{'enumerable':!![],'value':C});}:function(n,C){const N=a8K;n[N(0x148)]=C;}),__importStar=this&&this[a8K(0x12b)]||function(n){const X=a8K;if(n&&n[X(0x150)])return n;var C={};if(n!=null){for(var H in n)if(H!==X(0x148)&&Object[X(0x124)]['hasOwnProperty'][X(0x12d)](n,H))__createBinding(C,n,H);}return __setModuleDefault(C,n),C;},__awaiter=this&&this[a8K(0x143)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const c=a8C;function t(y){const E=a8C;try{M(H[E(0x128)](y));}catch(T){i(T);}}function r(y){try{M(H['throw'](y));}catch(T){i(T);}}function M(y){const g=a8C;y[g(0x153)]?W(y[g(0x154)]):R(y[g(0x154)])['then'](t,r);}M((H=H[c(0x138)](n,C||[]))['next']());});},__importDefault=this&&this[a8K(0x139)]||function(n){return n&&n['__esModule']?n:{'default':n};};function a8n(){const S=['Failure\x20during\x20login:\x20','init','apply','__importDefault','configurable','finally','94487nmzRYe','unable\x20to\x20parse\x20message:\x20','820sQEUtl','open','data','end','stringify','__awaiter','login-success','catch','initPackage','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','default','290458yaqKBt','message','wss:','580420DxYNAL','27942mQlOHo','35xXKWue','SIGINT','__esModule','EventEmitter','18091989daukHk','done','value','getOwnPropertyDescriptor','__createBinding','create','init-ack','1978696UjpTPb','baseUrl','status','writable','aborted','2495277uAsIse','replace','Unable\x20to\x20open\x20browser:\x20','http:','NorthflankApiBrowserLogin','handleError','defineProperty','prototype','success','error','openBrowser','next','/v1/cli-login','idle','__importStar','type','call','Unexpected\x20response','startLogin','duplex','emit','removeListener','createWebSocketStream','error\x20happened\x20during\x20browser\x20login:\x20','ws:'];a8n=function(){return S;};return a8n();}Object[a8K(0x123)](exports,'__esModule',{'value':!![]}),exports[a8K(0x121)]=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a8K(0x13f))),events_1=require('events');class NorthflankApiBrowserLogin extends events_1[a8K(0x151)]{constructor(n,C=!![]){const b=a8K;super(),this[b(0x119)]=n,this[b(0x127)]=C,this[b(0x11a)]=b(0x12a),this[b(0x146)]=()=>JSON[b(0x142)]({'type':b(0x137)});}[a8K(0x12f)](){const L=a8K;var n;const C=this[L(0x119)][L(0x11e)]('https:',L(0x14b))[L(0x11e)](L(0x120),L(0x135)),k=C+L(0x129),H=new ws_1['default'](k),R=()=>__awaiter(this,void 0x0,void 0x0,function*(){yield new Promise(i=>{const G=a8C;var t;(t=this[G(0x130)])===null||t===void 0x0?void 0x0:t[G(0x141)](JSON[G(0x142)]({'type':G(0x11c)}),()=>i());}),process['exit']();}),W=new Promise((i,t)=>{const Z=L;var r,M,y;try{this[Z(0x130)]=(0x0,ws_1[Z(0x133)])(H),process['on'](Z(0x14f),R);}catch(T){t(new Error(Z(0x147)+T[Z(0x14a)]));}(r=this[Z(0x130)])===null||r===void 0x0?void 0x0:r['on'](Z(0x140),V=>{const q=Z;var j;const U=JSON['parse'](V['toString']());switch(U===null||U===void 0x0?void 0x0:U[q(0x12c)]){case q(0x117):{const {loginPage:h}=U;if(h===undefined){this['handleError'](q(0x12e),t);return;}this[q(0x127)]&&(0x0,open_1[q(0x148)])(h)[q(0x145)](o=>{const w=q,A=w(0x11f)+o['message'];this[w(0x122)](A,t);});this[q(0x131)]('browser-opened',{'url':h});break;}case q(0x144):{const {apiToken:o,contextName:A}=U;if(o===undefined){this[q(0x122)]('Unexpected\x20response,\x20api\x20token\x20missing',t);return;}(j=this['duplex'])===null||j===void 0x0?void 0x0:j[q(0x141)](),i({'token':o,'contextName':A}),this[q(0x11a)]='success';break;}case'login-failure':{const d=q(0x136)+(U===null||U===void 0x0?void 0x0:U['message']);this[q(0x122)](d,t);break;}default:{const Q=q(0x13d)+JSON['stringify'](U);this[q(0x122)](Q,t);}}}),(M=this[Z(0x130)])===null||M===void 0x0?void 0x0:M['on']('error',V=>{const O=Z;this[O(0x122)](O(0x134)+V[O(0x14a)],t);}),(y=this['duplex'])===null||y===void 0x0?void 0x0:y['on'](Z(0x141),()=>{const F=Z;if(this[F(0x11a)]===F(0x125)){}else this[F(0x122)]('Login\x20process\x20stopped\x20before\x20completed',t);});});return(n=this[L(0x130)])===null||n===void 0x0?void 0x0:n['write'](this['initPackage']()),this[L(0x11a)]=L(0x137),W[L(0x13b)](()=>{const D=L;process[D(0x132)](D(0x14f),R);});}[a8K(0x122)](n,C){const Y=a8K;var k,H;C?(k=this['duplex'])===null||k===void 0x0?void 0x0:k['end'](()=>C(new Error(n))):(H=this[Y(0x130)])===null||H===void 0x0?void 0x0:H[Y(0x141)](),this[Y(0x11a)]=Y(0x126);}}exports[a8K(0x121)]=NorthflankApiBrowserLogin;
1
+ 'use strict';const a8c=a8f;(function(H,f){const j=a8f,l=H();while(!![]){try{const t=parseInt(j(0x210))/0x1*(-parseInt(j(0x1e1))/0x2)+-parseInt(j(0x1e5))/0x3*(-parseInt(j(0x1fb))/0x4)+parseInt(j(0x1e2))/0x5+-parseInt(j(0x20b))/0x6+-parseInt(j(0x214))/0x7+parseInt(j(0x1df))/0x8+parseInt(j(0x1dc))/0x9;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a8H,0xe9cf9));function a8H(){const a=['login-success','http:','/v1/cli-login','SIGINT','__importDefault','emit','duplex','parse','1476200mwyKud','init-ack','message','__esModule','end','value','then','https:','login-failure','init','Unable\x20to\x20open\x20browser:\x20','Login\x20process\x20stopped\x20before\x20completed','openBrowser','configurable','catch','__importStar','4595784OzWXIW','idle','defineProperty','toString','EventEmitter','55126wQpLrR','unable\x20to\x20parse\x20message:\x20','create','write','12107487cnpDRB','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','open','getOwnPropertyDescriptor','wss:','Unexpected\x20response','exit','10797912qtxDkH','default','finally','5649288umpJrL','NorthflankApiBrowserLogin','16ekEHvA','8096615CTfXHw','startLogin','stringify','3MhYkPo','writable','baseUrl','status','__createBinding','browser-opened','initPackage','replace','events','handleError','apply','data','next','error'];a8H=function(){return a;};return a8H();}var __createBinding=this&&this[a8c(0x1e9)]||(Object[a8c(0x212)]?function(H,f,l,t){const D=a8c;if(t===undefined)t=l;var b=Object[D(0x217)](f,l);(!b||('get'in b?!f[D(0x1fe)]:b[D(0x1e6)]||b[D(0x208)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[D(0x20d)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a8c(0x212)]?function(H,f){const V=a8c;Object[V(0x20d)](H,V(0x1dd),{'enumerable':!![],'value':f});}:function(H,f){const e=a8c;H[e(0x1dd)]=f;}),__importStar=this&&this[a8c(0x20a)]||function(H){const O=a8c;if(H&&H[O(0x1fe)])return H;var f={};if(H!=null){for(var l in H)if(l!==O(0x1dd)&&Object['prototype']['hasOwnProperty']['call'](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const A=a8f;function r(Y){const E=a8f;try{w(t[E(0x1f1)](Y));}catch(x){n(x);}}function q(Y){try{w(t['throw'](Y));}catch(x){n(x);}}function w(Y){const S=a8f;Y['done']?i(Y[S(0x200)]):b(Y['value'])[S(0x201)](r,q);}w((t=t[A(0x1ef)](H,f||[]))['next']());});},__importDefault=this&&this[a8c(0x1f7)]||function(H){const k=a8c;return H&&H[k(0x1fe)]?H:{'default':H};};Object[a8c(0x20d)](exports,a8c(0x1fe),{'value':!![]}),exports[a8c(0x1e0)]=void 0x0;function a8f(H,f){const l=a8H();return a8f=function(t,b){t=t-0x1db;let i=l[t];return i;},a8f(H,f);}const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a8c(0x216))),events_1=require(a8c(0x1ed));class NorthflankApiBrowserLogin extends events_1[a8c(0x20f)]{constructor(H,f=!![]){const h=a8c;super(),this['baseUrl']=H,this[h(0x207)]=f,this[h(0x1e8)]=h(0x20c),this[h(0x1eb)]=()=>JSON['stringify']({'type':h(0x204)});}[a8c(0x1e3)](){const K=a8c;var H;const f=this[K(0x1e7)][K(0x1ec)](K(0x202),K(0x218))['replace'](K(0x1f4),'ws:'),l=f+K(0x1f5),t=new ws_1['default'](l),b=()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=K;yield new Promise(n=>{const I=a8f;var r;(r=this['duplex'])===null||r===void 0x0?void 0x0:r[I(0x1ff)](JSON['stringify']({'type':'aborted'}),()=>n());}),process[P(0x1db)]();}),i=new Promise((n,r)=>{const Z=K;var q,w,Y;try{this[Z(0x1f9)]=(0x0,ws_1['createWebSocketStream'])(t),process['on'](Z(0x1f6),b);}catch(x){r(new Error(Z(0x215)+x[Z(0x1fd)]));}(q=this['duplex'])===null||q===void 0x0?void 0x0:q['on'](Z(0x1f0),U=>{const W=Z;var m;const Q=JSON[W(0x1fa)](U[W(0x20e)]());switch(Q===null||Q===void 0x0?void 0x0:Q['type']){case W(0x1fc):{const {loginPage:L}=Q;if(L===undefined){this[W(0x1ee)](W(0x219),r);return;}this[W(0x207)]&&(0x0,open_1[W(0x1dd)])(L)[W(0x209)](B=>{const u=W,T=u(0x205)+B[u(0x1fd)];this[u(0x1ee)](T,r);});this[W(0x1f8)](W(0x1ea),{'url':L});break;}case W(0x1f3):{const {apiToken:B,contextName:T}=Q;if(B===undefined){this[W(0x1ee)]('Unexpected\x20response,\x20api\x20token\x20missing',r);return;}(m=this[W(0x1f9)])===null||m===void 0x0?void 0x0:m[W(0x1ff)](),n({'token':B,'contextName':T}),this[W(0x1e8)]='success';break;}case W(0x203):{const X='Failure\x20during\x20login:\x20'+(Q===null||Q===void 0x0?void 0x0:Q['message']);this[W(0x1ee)](X,r);break;}default:{const C=W(0x211)+JSON[W(0x1e4)](Q);this[W(0x1ee)](C,r);}}}),(w=this[Z(0x1f9)])===null||w===void 0x0?void 0x0:w['on'](Z(0x1f2),U=>{const g=Z;this['handleError']('error\x20happened\x20during\x20browser\x20login:\x20'+U[g(0x1fd)],r);}),(Y=this[Z(0x1f9)])===null||Y===void 0x0?void 0x0:Y['on'](Z(0x1ff),()=>{const d=Z;if(this[d(0x1e8)]==='success'){}else this[d(0x1ee)](d(0x206),r);});});return(H=this[K(0x1f9)])===null||H===void 0x0?void 0x0:H[K(0x213)](this[K(0x1eb)]()),this[K(0x1e8)]='init',i[K(0x1de)](()=>{const F=K;process['removeListener'](F(0x1f6),b);});}[a8c(0x1ee)](H,f){const p=a8c;var l,t;f?(l=this[p(0x1f9)])===null||l===void 0x0?void 0x0:l[p(0x1ff)](()=>f(new Error(H))):(t=this[p(0x1f9)])===null||t===void 0x0?void 0x0:t[p(0x1ff)](),this[p(0x1e8)]=p(0x1f2);}}exports[a8c(0x1e0)]=NorthflankApiBrowserLogin;
@@ -1 +1 @@
1
- 'use strict';const a9A=a9C;function a9n(){const N=['loadMore','down','359964oXxKAp','1918788pXzJwK','640872Ldqtti','__esModule','reloadText','realLength','opt','5mxczqy','handleDynamicPageLoad','inquirer/lib/objects/choice','italic','default','..\x20Load\x20more\x20options\x20..','2578542fRhBVK','selected','19774250uXgYBU','inquirer/lib/prompts/list','DynamicReloadPaginationPrompt','then','done','8jMqxqr','__importDefault','nextPageCursor','render','choices','splice','1205328NGCdBw','8696793NXWHsh','push','length','map','pagOpt','catch','apply','loading','chalk','throw','defineProperty','next','loop','9xDojcP'];a9n=function(){return N;};return a9n();}(function(n,C){const V=a9C,k=n();while(!![]){try{const H=parseInt(V(0xb3))/0x1+-parseInt(V(0xa2))/0x2+-parseInt(V(0xb0))/0x3*(-parseInt(V(0xb4))/0x4)+parseInt(V(0xba))/0x5*(parseInt(V(0x95))/0x6)+-parseInt(V(0xa3))/0x7*(-parseInt(V(0x9c))/0x8)+-parseInt(V(0xb5))/0x9+-parseInt(V(0x97))/0xa;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a9n,0xc82ca));function a9C(n,C){const k=a9n();return a9C=function(H,R){H=H-0x92;let W=k[H];return W;},a9C(n,C);}var __awaiter=this&&this['__awaiter']||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const o=a9C;function t(y){const j=a9C;try{M(H[j(0xae)](y));}catch(T){i(T);}}function r(y){const U=a9C;try{M(H[U(0xac)](y));}catch(T){i(T);}}function M(y){const h=a9C;y[h(0x9b)]?W(y['value']):R(y['value'])[h(0x9a)](t,r);}M((H=H[o(0xa9)](n,C||[]))['next']());});},__importDefault=this&&this[a9A(0x9d)]||function(n){return n&&n['__esModule']?n:{'default':n};};Object[a9A(0xad)](exports,a9A(0xb6),{'value':!![]}),exports[a9A(0x99)]=void 0x0;const list_1=__importDefault(require(a9A(0x98))),choice_1=__importDefault(require(a9A(0xbc))),chalk_1=__importDefault(require(a9A(0xab)));function incrementListIndex(n,C,k){const d=a9A,H=k['choices'][d(0xb8)],R=d(0xaf)in k?Boolean(k[d(0xaf)]):!![];if(C==='up'){if(n>0x0)return n-0x1;return R?H-0x1:n;}if(C==='down'){if(n<H-0x1)return n+0x1;return R?0x0:n;}throw new Error('dir\x20must\x20be\x20up\x20or\x20down');}class DynamicReloadPaginationPrompt extends list_1[a9A(0x93)]{constructor(n,C,k){const Q=a9A;super(n,C,k),this[Q(0xb7)]=chalk_1[Q(0x93)][Q(0x92)](Q(0x94)),this[Q(0xaa)]=![],this[Q(0xa7)]=this['opt'],this['nextPageCursor']=this['pagOpt']['nextPageCursor'],this[Q(0x9e)]!==undefined&&this[Q(0xb9)][Q(0xa0)][Q(0xa4)](new choice_1[(Q(0x93))](this[Q(0xb7)],this[Q(0xb7)]));}['onUpKey'](){const l=a9A;if(this[l(0xaa)])return;this['selected']=incrementListIndex(this[l(0x96)],'up',this['opt']),this[l(0x9f)]();}['onDownKey'](){return __awaiter(this,void 0x0,void 0x0,function*(){const K=a9C;if(this[K(0xaa)])return;this[K(0x96)]=incrementListIndex(this[K(0x96)],K(0xb2),this['opt']),yield this[K(0xbb)](),this[K(0x9f)]();});}[a9A(0xbb)](){return __awaiter(this,void 0x0,void 0x0,function*(){const m=a9C;if(this[m(0x96)]>=this['opt']['choices'][m(0xa5)]-0x1){if(this[m(0x9e)]===undefined)return;this[m(0xaa)]=!![];let n=0x0;const C=setInterval(()=>{const a=m,W=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],t=chalk_1[a(0x93)][a(0x92)](W[n%W['length']]+'\x20Loading\x20more\x20options');this[a(0xb9)][a(0xa0)][a(0xa0)][this['selected']]['name']=''+t,n+=0x1,this['render']();},0x50),{elements:k,nextPageCursor:H}=yield this[m(0xa7)][m(0xb1)]({'nextPageCursor':this[m(0x9e)]})[m(0xa8)](()=>({'elements':[],'nextPageCursor':undefined}));this[m(0x9e)]=H;const R=k[m(0xa6)](W=>new choice_1[(m(0x93))](W,W));this[m(0xb9)][m(0xa0)][m(0xa0)][m(0xa1)](this['selected'],0x1),this[m(0xb9)]['choices']['push'](...R),H!==undefined&&this[m(0xb9)]['choices'][m(0xa4)](new choice_1[(m(0x93))](this[m(0xb7)],this[m(0xb7)])),clearInterval(C),this['loading']=![];}});}}exports['DynamicReloadPaginationPrompt']=DynamicReloadPaginationPrompt;
1
+ 'use strict';const a9B=a9f;(function(H,f){const U=a9f,l=H();while(!![]){try{const t=-parseInt(U(0x95))/0x1+parseInt(U(0x8c))/0x2*(-parseInt(U(0x96))/0x3)+parseInt(U(0x79))/0x4*(parseInt(U(0x88))/0x5)+parseInt(U(0x8b))/0x6+-parseInt(U(0x99))/0x7+parseInt(U(0x9c))/0x8+parseInt(U(0x84))/0x9*(parseInt(U(0x9e))/0xa);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a9H,0xc414f));function a9f(H,f){const l=a9H();return a9f=function(t,b){t=t-0x75;let i=l[t];return i;},a9f(H,f);}var __awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const L=a9f;function r(Y){const m=a9f;try{w(t[m(0x90)](Y));}catch(x){n(x);}}function q(Y){try{w(t['throw'](Y));}catch(x){n(x);}}function w(Y){const Q=a9f;Y[Q(0x93)]?i(Y['value']):b(Y[Q(0x9f)])[Q(0x9d)](r,q);}w((t=t[L(0x75)](H,f||[]))['next']());});},__importDefault=this&&this[a9B(0x7f)]||function(H){const T=a9B;return H&&H[T(0x7a)]?H:{'default':H};};Object[a9B(0x91)](exports,'__esModule',{'value':!![]}),exports[a9B(0x77)]=void 0x0;function a9H(){const e=['opt','map','next','defineProperty','realLength','done','choices','1096487OzzSol','54DYaTxk','selected','default','5665758OysARd','inquirer/lib/objects/choice','loadMore','1082848XYWoDp','then','28538590LdwZxU','value','apply','onUpKey','DynamicReloadPaginationPrompt','handleDynamicPageLoad','28828pDMWSX','__esModule','dir\x20must\x20be\x20up\x20or\x20down','loop','pagOpt','reloadText','__importDefault','down','..\x20Load\x20more\x20options\x20..','push','splice','9BDSxsY','render','onDownKey','length','415tMqieJ','loading','nextPageCursor','2026188BSwBUv','135118eaSGif','\x20Loading\x20more\x20options'];a9H=function(){return e;};return a9H();}const list_1=__importDefault(require('inquirer/lib/prompts/list')),choice_1=__importDefault(require(a9B(0x9a))),chalk_1=__importDefault(require('chalk'));function incrementListIndex(H,f,l){const X=a9B,t=l[X(0x94)][X(0x92)],b=X(0x7c)in l?Boolean(l[X(0x7c)]):!![];if(f==='up'){if(H>0x0)return H-0x1;return b?t-0x1:H;}if(f===X(0x80)){if(H<t-0x1)return H+0x1;return b?0x0:H;}throw new Error(X(0x7b));}class DynamicReloadPaginationPrompt extends list_1[a9B(0x98)]{constructor(H,f,l){const C=a9B;super(H,f,l),this[C(0x7e)]=chalk_1['default']['italic'](C(0x81)),this[C(0x89)]=![],this[C(0x7d)]=this[C(0x8e)],this['nextPageCursor']=this[C(0x7d)]['nextPageCursor'],this[C(0x8a)]!==undefined&&this[C(0x8e)][C(0x94)][C(0x82)](new choice_1[(C(0x98))](this[C(0x7e)],this[C(0x7e)]));}[a9B(0x76)](){const j=a9B;if(this[j(0x89)])return;this[j(0x97)]=incrementListIndex(this[j(0x97)],'up',this[j(0x8e)]),this[j(0x85)]();}[a9B(0x86)](){return __awaiter(this,void 0x0,void 0x0,function*(){const c=a9f;if(this[c(0x89)])return;this[c(0x97)]=incrementListIndex(this['selected'],c(0x80),this['opt']),yield this[c(0x78)](),this[c(0x85)]();});}['handleDynamicPageLoad'](){return __awaiter(this,void 0x0,void 0x0,function*(){const D=a9f;if(this[D(0x97)]>=this['opt'][D(0x94)]['length']-0x1){if(this['nextPageCursor']===undefined)return;this['loading']=!![];let H=0x0;const f=setInterval(()=>{const V=D,n=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],r=chalk_1[V(0x98)]['italic'](n[H%n[V(0x87)]]+V(0x8d));this[V(0x8e)]['choices'][V(0x94)][this[V(0x97)]]['name']=''+r,H+=0x1,this[V(0x85)]();},0x50),{elements:l,nextPageCursor:t}=yield this[D(0x7d)][D(0x9b)]({'nextPageCursor':this[D(0x8a)]})['catch'](()=>({'elements':[],'nextPageCursor':undefined}));this['nextPageCursor']=t;const b=l[D(0x8f)](n=>new choice_1[(D(0x98))](n,n));this[D(0x8e)][D(0x94)][D(0x94)][D(0x83)](this['selected'],0x1),this[D(0x8e)][D(0x94)][D(0x82)](...b),t!==undefined&&this[D(0x8e)][D(0x94)][D(0x82)](new choice_1[(D(0x98))](this[D(0x7e)],this[D(0x7e)])),clearInterval(f),this[D(0x89)]=![];}});}}exports['DynamicReloadPaginationPrompt']=DynamicReloadPaginationPrompt;
@@ -1 +1 @@
1
- 'use strict';function a10C(n,C){const k=a10n();return a10C=function(H,R){H=H-0xb8;let W=k[H];return W;},a10C(n,C);}const a10h=a10C;(function(n,C){const U=a10C,k=n();while(!![]){try{const H=parseInt(U(0xb9))/0x1+-parseInt(U(0xdf))/0x2+parseInt(U(0xbf))/0x3*(parseInt(U(0xdd))/0x4)+-parseInt(U(0xec))/0x5*(-parseInt(U(0xe3))/0x6)+parseInt(U(0xd4))/0x7+parseInt(U(0xe9))/0x8*(parseInt(U(0xfe))/0x9)+-parseInt(U(0xfc))/0xa;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a10n,0x4204e));function a10n(){const Z=['198lygOjD','fwd','addon','value','Forwarding\x20addon\x20','apiClient','Service\x20to\x20forward','type','\x20on\x20','then','length','message','apply','success','protocol','--noDefaults','\x20addon\x20ports','63539kZTLMj','\x20to\x20','option','\x20and\x20','name','addCommand','15VnUWGP','askForAddon','forEach','throw','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','forwarding','defineProperty','__esModule','greenBright','connection-error','green','address','port','portFwdCmd','getCommand','done','Port-forwarding\x20for\x20the\x20specified\x20addon','askForProject','getCurrentProjectName','CliPortForward','service','878626ecacck','canExecuteWithHostnames','noDefaultsText','@northflank/js-client','SIGINT','Failed:\x20','all','hostnames','action','386024wbgxTZ','tunnel-open','833520knmHqu','\x20for\x20these\x20hostnames:','alias','\x20in\x20project\x20','6CfGJPj','../inquirer-helper','getProxyForwarder','bold','__awaiter','InquirerHelper','25048SuGEHl','forward','Project\x20for\x20forwarding','1329980Fvydvq','Exposing\x20','error','assertContextExisting','getCurrentServiceName','description','log','customUserAgent','ApiClient','next','forwardProject','warning','--addon\x20--addonId\x20[NAME]','default','\x20service\x20ports','--project\x20--projectId\x20[NAME]','3192910ULbLEl','\x27:\x20\x22'];a10n=function(){return Z;};return a10n();}var __awaiter=this&&this[a10h(0xe7)]||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const Q=a10C;function t(y){const o=a10C;try{M(H[o(0xf5)](y));}catch(T){i(T);}}function r(y){const A=a10C;try{M(H[A(0xc2)](y));}catch(T){i(T);}}function M(y){const d=a10C;y[d(0xce)]?W(y[d(0x101)]):R(y[d(0x101)])[d(0x107)](t,r);}M((H=H[Q(0x10a)](n,C||[]))[Q(0xf5)]());});},__importDefault=this&&this['__importDefault']||function(n){const l=a10h;return n&&n[l(0xc6)]?n:{'default':n};};Object[a10h(0xc5)](exports,a10h(0xc6),{'value':!![]}),exports[a10h(0xd2)]=void 0x0;const js_client_1=require(a10h(0xd7)),chalk_1=__importDefault(require('chalk')),utils_1=require('../utils'),inquirer_helper_1=require(a10h(0xe4));class CliPortForward{constructor(n){const K=a10h;this[K(0xd6)]='Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',this[K(0x103)]=new js_client_1[(K(0xf4))](n,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[K(0xf3)]});const C=new inquirer_helper_1[(K(0xe8))](this[K(0x103)]);this[K(0xcc)]=(0x0,utils_1['getCommand'])()[K(0xbd)](K(0xea))[K(0xe1)](K(0xff))[K(0xf1)](K(0xc3));const k=(0x0,utils_1[K(0xcd)])(!![])[K(0xbd)](K(0xda))[K(0xf1)]('Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project')['option'](K(0xfb),'project\x20for\x20forwarding')['option'](K(0x10d),this[K(0xd6)],![])['action'](({noDefaults:W,projectId:i})=>__awaiter(this,void 0x0,void 0x0,function*(){const m=K;(0x0,utils_1['assertContextExisting'])(this[m(0x103)]);const t=this[m(0xe5)](),r=W?undefined:n[m(0xd1)](),M=i||r||(yield C['askForProject']());try{const {services:y,addons:T}=yield t[m(0xf6)]({'projectId':M},![]);y['length']+T['length']<=0x0?(0x0,utils_1['warning'])('No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20'+chalk_1[m(0xf9)][m(0xe6)](M)):(console[m(0xf2)]('Forwarding\x20'+chalk_1[m(0xf9)][m(0xc9)]['bold'](y[m(0x108)]+m(0xfa))+m(0xbc)+chalk_1[m(0xf9)][m(0xc9)]['bold'](T[m(0x108)]+m(0xb8))+m(0xe2)+chalk_1[m(0xf9)][m(0xe6)](M)),yield Promise['all']([...y,...T]));}catch(V){(0x0,utils_1[m(0xee)])(m(0xd9)+V[m(0x109)]);}})),H=(0x0,utils_1[K(0xcd)])(!![])['name'](K(0xd3))[K(0xf1)]('Port-forwarding\x20for\x20the\x20specified\x20service')[K(0xbb)](K(0xfb),'Project\x20for\x20forwarding')[K(0xbb)]('--service\x20--serviceId\x20[NAME]',K(0x104))[K(0xbb)](K(0x10d),this['noDefaultsText'],![])[K(0xdc)](({noDefaults:W,projectId:i,serviceId:t})=>__awaiter(this,void 0x0,void 0x0,function*(){const a=K;(0x0,utils_1[a(0xef)])(this[a(0x103)]);const r=this[a(0xe5)](),M=W?undefined:n['getCurrentProjectName'](),y=i||M||(yield C[a(0xd0)]()),T=W?undefined:n[a(0xf0)](),V=t||T||(yield C['askForService'](y)());console[a(0xf2)]('Forwarding\x20service\x20'+chalk_1[a(0xf9)][a(0xe6)](V)+'\x20in\x20project\x20'+chalk_1[a(0xf9)]['bold'](y));try{yield r['forwardService']({'projectId':y,'serviceId':V},![]);}catch(j){(0x0,utils_1['error'])('Failed:\x20'+j[a(0x109)]);}})),R=(0x0,utils_1[K(0xcd)])(!![])[K(0xbd)](K(0x100))[K(0xf1)](K(0xcf))[K(0xbb)](K(0xfb),K(0xeb))[K(0xbb)](K(0xf8),'Addon\x20to\x20forward')[K(0xbb)](K(0x10d),this[K(0xd6)],![])['action'](({projectId:W,addonId:i,noDefaults:t})=>__awaiter(this,void 0x0,void 0x0,function*(){const N=K;(0x0,utils_1[N(0xef)])(this['apiClient']);const r=t?undefined:n['getCurrentProjectName'](),M=W||r||(yield C[N(0xd0)]()),y=i||(yield C[N(0xc0)](M)());console[N(0xf2)](N(0x102)+chalk_1[N(0xf9)][N(0xe6)](y)+N(0xe2)+chalk_1[N(0xf9)][N(0xe6)](M));const T=this[N(0xe5)]();try{yield T['forwardAddon']({'projectId':M,'addonId':y},![]);}catch(V){(0x0,utils_1[N(0xee)])(N(0xd9)+V['message']);}}));this[K(0xcc)][K(0xbe)](k),this['portFwdCmd']['addCommand'](H),this['portFwdCmd'][K(0xbe)](R);}[a10h(0xe5)](){const X=a10h,n=this['apiClient'][X(0xc4)],C=n[X(0xd5)]();if(C[X(0xee)])throw new Error(C[X(0x109)]);return n['on'](X(0xde),(k,H)=>{const E=X,R=chalk_1[E(0xf9)][E(0xc7)][E(0xe6)](H[E(0x105)]+'\x20\x27'+H['id']+'\x27'),W=H[E(0x10c)]==='HTTP'?'http://':'';(0x0,utils_1[E(0x10b)])(E(0xed)+R+E(0x106)+H[E(0xca)]+':'+H[E(0xcb)]+'\x20('+H[E(0x10c)]+')\x20with\x20these\x20hostnames:'),H[E(0xdb)][E(0xc1)](i=>{const g=E;(0x0,utils_1['success'])('\x20\x20'+W+i+':'+H[g(0xcb)]);}),(0x0,utils_1[E(0x10b)])('');}),n['on']('tunnel-close',(k,H)=>{const c=X,R=chalk_1[c(0xf9)][c(0xc7)]['bold'](H['type']+'\x20\x27'+H['id']+'\x27');(0x0,utils_1[c(0xf7)])('Stop\x20forwarding\x20traffic\x20from\x20'+H['address']+':'+H[c(0xcb)]+c(0xba)+R+c(0xe0)),H['hostnames']['forEach'](W=>{const b=c;(0x0,utils_1['warning'])('\x20\x20'+W+':'+H[b(0xcb)]);}),(0x0,utils_1[c(0xf7)])('');}),n['on'](X(0xc8),(k,H,R)=>{const L=X;(0x0,utils_1['warning'])('Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27'+H[L(0xca)]+':'+H[L(0xcb)]+L(0xfd)+(R===null||R===void 0x0?void 0x0:R['message'])+'\x22');}),process['on'](X(0xd8),()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=X;try{yield n['stop']();}catch(k){(0x0,utils_1[G(0xee)])('Cleaning\x20up\x20open\x20connections\x20failed:\x20'+k[G(0x109)]);}finally{process['exit']();}})),n;}}exports[a10h(0xd2)]=CliPortForward;
1
+ 'use strict';function a10f(H,f){const l=a10H();return a10f=function(t,b){t=t-0x6b;let i=l[t];return i;},a10f(H,f);}const a10O=a10f;(function(H,f){const e=a10f,l=H();while(!![]){try{const t=-parseInt(e(0xcb))/0x1+parseInt(e(0xa5))/0x2*(-parseInt(e(0xa6))/0x3)+-parseInt(e(0xed))/0x4+-parseInt(e(0x83))/0x5*(-parseInt(e(0x6f))/0x6)+parseInt(e(0x7f))/0x7+parseInt(e(0xdd))/0x8+parseInt(e(0x98))/0x9;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a10H,0x326f9));var __createBinding=this&&this['__createBinding']||(Object[a10O(0x7e)]?function(H,f,l,t){const E=a10O;if(t===undefined)t=l;var b=Object[E(0xb9)](f,l);(!b||(E(0x87)in b?!f[E(0x84)]:b['writable']||b[E(0xaf)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[E(0x6c)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a10O(0xa9)]||(Object[a10O(0x7e)]?function(H,f){const S=a10O;Object['defineProperty'](H,S(0x78),{'enumerable':!![],'value':f});}:function(H,f){H['default']=f;}),__importStar=this&&this[a10O(0xb2)]||function(H){const A=a10O;if(H&&H[A(0x84)])return H;var f={};if(H!=null){for(var l in H)if(l!==A(0x78)&&Object[A(0xcd)][A(0xdc)][A(0xc9)](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const I=a10f;function r(Y){const k=a10f;try{w(t[k(0xd6)](Y));}catch(x){n(x);}}function q(Y){const h=a10f;try{w(t[h(0x70)](Y));}catch(x){n(x);}}function w(Y){const K=a10f;Y[K(0x91)]?i(Y[K(0xe8)]):b(Y[K(0xe8)])['then'](r,q);}w((t=t[I(0xc4)](H,f||[]))[I(0xd6)]());});},__importDefault=this&&this['__importDefault']||function(H){const P=a10O;return H&&H[P(0x84)]?H:{'default':H};};function a10H(){const H0=['entries','port','portName','data.id','\x27:\x20\x22','6244704WZHHEs','option','message','forwardProject','noDefaultsText','Forwarding\x20','Port-forwarding\x20for\x20the\x20specified\x20service','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','CliPortForward','Cleaning\x20up\x20open\x20connections\x20failed:\x20','join','printHostsFileHint','connection-error','2UNQqnu','938325fWDcSD','SIGINT','printForwardingInfo','__setModuleDefault','Forwarding\x20addon\x20','win32','\x20with\x20multiple\x20ports:','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','Forwarding\x20service\x20','configurable','\x20is\x20running\x20and\x20reachable.','--noDefaults','__importStar','flatMap','customUserAgent','repeat','service','\x20-\x20','--skipHostnames','getOwnPropertyDescriptor','\x20in\x20project\x20','Addon\x20to\x20forward','Failed:\x20','error','flat','\x20is\x20exposed\x20with\x20multiple\x20','capitalize','protocol','apiClient','/etc/hosts','apply','uniqBy','greenBright','stop','forwardAddon','call','assertContextExisting','396061PPFuXP','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','prototype','name','portFwdCmd','lodash','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','uniq','green','log','skipHostnamesText','next','type','hostnames','addon','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','success','hasOwnProperty','2840xMtwFG','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','C:/Windows/System32/drivers/etc/hosts','getCurrentProjectName','\x20addon\x20ports','askForProject','../utils','description','\x20is\x20exposed\x20on\x20','fwd','value','\x20\x20-\x20Address:\x20','warning','askForAddon','Running\x20in\x20','1097248UIOWTx','Services:','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','black','defineProperty','alias','\x20\x20-\x20port\x20','1458usPtFh','throw','action','askForService','addCommand','getProxyForwarder','http://','--project\x20--projectId\x20[NAME]','getCommand','default','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','Running\x20on\x20macOS\x20in\x20','data','Project\x20for\x20forwarding','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','create','2825676XIjyEt','forEach','../inquirer-helper','\x20to\x20','1890USsFJL','__esModule','\x20and\x20','filter','get','--service\x20--serviceId\x20[NAME]','bold','--addon\x20--addonId\x20[NAME]','map','\x20with\x20these\x20hostnames:','Stop\x20forwarding\x20traffic\x20from\x20','forwardService','length','platform','done','address'];a10H=function(){return H0;};return a10H();}Object[a10O(0x6c)](exports,a10O(0x84),{'value':!![]}),exports[a10O(0xa0)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require('chalk')),utils_1=require(a10O(0xe4)),inquirer_helper_1=require(a10O(0x81)),os=__importStar(require('os')),lodash_1=require(a10O(0xd0)),{EOL}=require('os');class CliPortForward{constructor(H){const Z=a10O;this['noDefaultsText']=Z(0xdf),this['skipHostnamesText']=Z(0x9f),this[Z(0xc2)]=new js_client_1['ApiClient'](H,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Z(0xb4)]});const f=new inquirer_helper_1['InquirerHelper'](this[Z(0xc2)]);this[Z(0xcf)]=(0x0,utils_1[Z(0x77)])()[Z(0xce)]('forward')[Z(0x6d)](Z(0xe7))[Z(0xe5)](Z(0x7d));const l=(0x0,utils_1['getCommand'])(!![])[Z(0xce)]('all')[Z(0xe5)](Z(0xd1))['option'](Z(0x76),'project\x20for\x20forwarding')[Z(0x99)](Z(0xb1),this[Z(0x9c)],![])[Z(0x99)]('--skipHostnames',this[Z(0xd5)],![])[Z(0x71)](({noDefaults:i,projectId:n,skipHostnames:r})=>__awaiter(this,void 0x0,void 0x0,function*(){const W=Z;(0x0,utils_1[W(0xca)])(this[W(0xc2)]);const q=this[W(0x74)](r),w=i?undefined:H[W(0xe1)](),Y=n||w||(yield f['askForProject']());try{const {services:x,addons:U}=yield q[W(0x9b)]({'projectId':Y},r);if(x[W(0x8f)]+U[W(0x8f)]<=0x0)(0x0,utils_1[W(0xea)])(W(0xad)+chalk_1['default']['bold'](Y));else{const m=x[W(0x86)](B=>B[W(0x8f)]>0x0)[W(0x8f)],Q=U['filter'](B=>B[W(0x8f)]>0x0)[W(0x8f)],L=W(0xba)+chalk_1[W(0x78)][W(0x89)](Y);console['log'](W(0x9d)+chalk_1[W(0x78)][W(0xd3)][W(0x89)](m+'\x20service\x20ports')+W(0x85)+chalk_1[W(0x78)][W(0xd3)][W(0x89)](Q+W(0xe2))+L),console[W(0xd4)](),console[W(0xd4)](chalk_1[W(0x78)]['bold'](W(0xee))),x[W(0x80)](B=>{const u=W;if(B[u(0x8f)]>=0x1&&!B[0x0][u(0xbd)])this[u(0xa8)](B,{'type':u(0xb6),'name':B[0x0]['data']['id']},r);}),console[W(0xd4)](chalk_1[W(0x78)][W(0x89)]('Addons:')),U[W(0x80)](B=>{const g=W;if(B['length']>=0x1&&!B[0x0][g(0xbd)])this[g(0xa8)](B,{'type':g(0xd9),'name':B[0x0][g(0x7b)]['id']},r);}),this['printHostsFileHint']([...x[W(0xbe)](),...U[W(0xbe)]()],r);}}catch(B){(0x0,utils_1[W(0xbd)])(W(0xbc)+B[W(0x9a)]);}})),t=(0x0,utils_1[Z(0x77)])(!![])['name'](Z(0xb6))['description'](Z(0x9e))[Z(0x99)](Z(0x76),Z(0x7c))['option'](Z(0x88),'Service\x20to\x20forward')[Z(0x99)]('--noDefaults',this[Z(0x9c)],![])[Z(0x99)](Z(0xb8),this['skipHostnamesText'],![])[Z(0x71)](({noDefaults:i,projectId:n,serviceId:r,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const d=Z;(0x0,utils_1[d(0xca)])(this[d(0xc2)]);const w=this[d(0x74)](q),Y=i?undefined:H['getCurrentProjectName'](),x=n||Y||(yield f[d(0xe3)]()),U=i?undefined:H['getCurrentServiceName'](),m=r||U||(yield f[d(0x72)](x)());console['log'](d(0xae)+chalk_1[d(0x78)][d(0x89)](m)+d(0xba)+chalk_1[d(0x78)][d(0x89)](x));try{const Q=yield w[d(0x8e)]({'projectId':x,'serviceId':m},q);this['printForwardingInfo'](Q,{'name':m,'type':d(0xb6)},q),this[d(0xa3)](Q,q);}catch(L){(0x0,utils_1[d(0xbd)])(d(0xbc)+L[d(0x9a)]);}})),b=(0x0,utils_1[Z(0x77)])(!![])['name'](Z(0xd9))[Z(0xe5)]('Port-forwarding\x20for\x20the\x20specified\x20addon')[Z(0x99)](Z(0x76),Z(0x7c))[Z(0x99)](Z(0x8a),Z(0xbb))['option'](Z(0xb8),this[Z(0xd5)],![])[Z(0x71)](({noDefaults:i,projectId:n,addonId:r,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const F=Z;(0x0,utils_1[F(0xca)])(this[F(0xc2)]);const w=this[F(0x74)](q),Y=i?undefined:H[F(0xe1)](),x=n||Y||(yield f['askForProject']()),U=r||(yield f[F(0xeb)](x)());console[F(0xd4)](F(0xaa)+chalk_1[F(0x78)][F(0x89)](U)+F(0xba)+chalk_1[F(0x78)]['bold'](x));try{const m={'projectId':x,'addonId':U},Q=yield w[F(0xc8)](m,q);this[F(0xa8)](Q,{'name':U,'type':F(0xd9)},q),this['printHostsFileHint'](Q,q);}catch(L){(0x0,utils_1[F(0xbd)])(F(0xbc)+L[F(0x9a)]);}}));this[Z(0xcf)][Z(0x73)](l),this['portFwdCmd']['addCommand'](t),this[Z(0xcf)][Z(0x73)](b);}['getProxyForwarder'](H=![]){const p=a10O,f=this[p(0xc2)]['forwarding'];if(!H){const l=f['canExecuteWithHostnames']();if(l[p(0xbd)])throw new Error(l[p(0x9a)]);}return f['on']('tunnel-close',(t,b)=>{const a=p,i=chalk_1[a(0x78)]['bold'](b['type']+'\x20\x27'+b['id']+'\x27'),n=b[a(0xd8)]['length']>0x0;(0x0,utils_1[a(0xea)])(a(0x8d)+b[a(0x92)]+':'+b[a(0x94)]+a(0x82)+i),H&&n&&(0x0,utils_1[a(0xea)])(a(0x79));}),f['on'](p(0xa4),(t,b,i)=>{const J=p;(0x0,utils_1[J(0xea)])('Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27'+b[J(0x92)]+':'+b['port']+J(0x97)+(i===null||i===void 0x0?void 0x0:i[J(0x9a)])+'\x22');}),process['on'](p(0xa7),()=>__awaiter(this,void 0x0,void 0x0,function*(){const o=p;try{yield f[o(0xc7)]();}catch(t){(0x0,utils_1[o(0xbd)])(o(0xa1)+t[o(0x9a)]);}finally{process['exit']();}})),f;}[a10O(0xa8)](H,f,l=![]){const M=a10O,{type:t,name:b}=f;if(H[M(0x8f)]<=0x0){const q='Please\x20ensure\x20the\x20'+f[M(0xd7)]+M(0xb0);(0x0,utils_1['warning'])(M(0xef)+t+'\x20'+chalk_1[M(0x78)][M(0x89)](b)+'.\x20'+q);return;}const i=(0x0,lodash_1['groupBy'])(H,M(0x96)),n=w=>'\x20('+(w[M(0x95)]?w[M(0x95)]+M(0xb7):'')+w[M(0xc1)]+')';function r(w,Y=0x2){const G=M;if(!l){const x=w[G(0xc1)]==='HTTP'?G(0x75):'';w[G(0xd8)]['forEach'](U=>{const N=G;console['log']((0x0,lodash_1[N(0xb5)])('\x20',Y)+'-\x20'+x+U+':'+w[N(0x94)]);});}}Object[M(0x93)](i)[M(0x80)](([w,Y])=>{const z=M;var x,U;const m='>\x20'+(0x0,lodash_1[z(0xc0)])(t)+'\x20\x27'+chalk_1[z(0x78)][z(0xc6)][z(0x89)](w)+'\x27';if(t===z(0xd9)){if(Y[z(0x8f)]===0x1){const Q=Y[0x0];if(Q[z(0xbd)]){(0x0,utils_1[z(0xbd)])(z(0xcc)+w+':\x20'+Q[z(0xbd)][z(0x9a)]);return;}const L=Q['data'],B=!l?chalk_1['default'][z(0x6b)]('\x20with\x20hostname:\x20'+L[z(0xd8)][z(0xa2)](',')):'';(0x0,utils_1[z(0xdb)])(m+'\x20is\x20exposed\x20on\x20'+L['address']+':'+L[z(0x94)]+n(L)+B);}else{const T=(0x0,lodash_1[z(0xc5)])(Y,X=>{const v=z;var C,j;return(j=(C=X===null||X===void 0x0?void 0x0:X['data'])===null||C===void 0x0?void 0x0:C[v(0xd8)])===null||j===void 0x0?void 0x0:j[v(0xa2)](',');})[z(0x8f)]>0x1;(0x0,utils_1[z(0xdb)])(m+z(0xbf)+(T?'hosts':'ports')+':'),Y['forEach'](X=>{const R=z;if(X[R(0xbd)]){(0x0,utils_1[R(0xbd)])(R(0xcc)+w+':\x20'+X[R(0xbd)][R(0x9a)]);return;}const C=X[R(0x7b)],j=!l?',\x20hostname:\x20'+C[R(0xd8)][R(0xa2)](','):'';console[R(0xd4)](R(0xe9)+C[R(0x92)]+':'+C['port']+n(C)+j);});}}if(t===z(0xb6)){if(Y[z(0x8f)]===0x1){const X=Y[0x0];if(X['error']){(0x0,utils_1['error'])(z(0xcc)+w+':\x20'+X[z(0xbd)][z(0x9a)]);return;}const C=X[z(0x7b)],j=!l?z(0x8c):':',c=C[z(0x92)]+':'+C[z(0x94)]+n(C);(0x0,utils_1[z(0xdb)])(m+z(0xe6)+c+j),r(C);}else(0x0,utils_1['success'])(m+z(0xe6)+((U=(x=Y[0x0])===null||x===void 0x0?void 0x0:x['data'])===null||U===void 0x0?void 0x0:U[z(0x92)])+z(0xac)),Y[z(0x80)](D=>{const s=z;if(D[s(0xbd)]){(0x0,utils_1[s(0xbd)])(s(0xcc)+w+':\x20'+D[s(0xbd)][s(0x9a)]);return;}const V=D[s(0x7b)];(0x0,utils_1['success'])(s(0x6e)+V[s(0x94)]+n(V)),r(V,0x4);});}});}[a10O(0xa3)](H,f=![]){const y=a10O;if(f){const l=H[y(0xb3)](Y=>Y[y(0x7b)])[y(0x86)](Y=>Y!==undefined),t=(process===null||process===void 0x0?void 0x0:process[y(0x90)])===y(0xab),b=os[y(0x90)]()==='darwin',i=t?y(0xe0):y(0xc3),n=chalk_1[y(0x78)][y(0x89)]('skipHostnames'),r=b?EOL+y(0x7a)+n+y(0xde):undefined;let q=y(0xec)+n+y(0xda)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+i+'):';r!==undefined&&(0x0,utils_1[y(0xea)])(r!==null&&r!==void 0x0?r:'');(0x0,utils_1[y(0xea)])(q);const w=l[y(0x8b)](Y=>Y['address']+'\x20\x20\x20\x20\x20\x20\x20\x20\x20'+Y['hostnames'][y(0xa2)]('\x20'));console['log']((0x0,lodash_1[y(0xd2)])(w)[y(0xa2)](EOL)),console[y(0xd4)]();}}}exports[a10O(0xa0)]=CliPortForward;
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- 'use strict';const a11A=a11C;(function(n,C){const V=a11C,k=n();while(!![]){try{const H=parseInt(V(0x1a2))/0x1*(parseInt(V(0x1ae))/0x2)+-parseInt(V(0x1a5))/0x3+parseInt(V(0x1a7))/0x4*(parseInt(V(0x18d))/0x5)+parseInt(V(0x1c4))/0x6+-parseInt(V(0x1b3))/0x7+parseInt(V(0x18b))/0x8+-parseInt(V(0x1bf))/0x9;if(H===C)break;else k['push'](k['shift']());}catch(R){k['push'](k['shift']());}}}(a11n,0x242e7));var __awaiter=this&&this['__awaiter']||function(n,C,k,H){function R(W){return W instanceof k?W:new k(function(i){i(W);});}return new(k||(k=Promise))(function(W,i){const o=a11C;function t(y){const j=a11C;try{M(H[j(0x1a6)](y));}catch(T){i(T);}}function r(y){const U=a11C;try{M(H[U(0x19d)](y));}catch(T){i(T);}}function M(y){const h=a11C;y[h(0x18c)]?W(y[h(0x190)]):R(y[h(0x190)])[h(0x18e)](t,r);}M((H=H['apply'](n,C||[]))[o(0x1a6)]());});},__importDefault=this&&this[a11A(0x1a4)]||function(n){return n&&n['__esModule']?n:{'default':n};};Object[a11A(0x1c3)](exports,a11A(0x1a8),{'value':!![]}),exports[a11A(0x1c5)]=exports[a11A(0x1b6)]=exports[a11A(0x1b7)]=exports[a11A(0x197)]=exports[a11A(0x1ac)]=exports['success']=exports['warning']=exports[a11A(0x192)]=exports[a11A(0x1b0)]=exports[a11A(0x1af)]=void 0x0;const node_fetch_1=__importDefault(require('node-fetch')),chalk_1=__importDefault(require(a11A(0x19a))),commander_1=require(a11A(0x199)),pgk=require(a11A(0x19c));function a11C(n,C){const k=a11n();return a11C=function(H,R){H=H-0x18a;let W=k[H];return W;},a11C(n,C);}exports[a11A(0x1af)]=a11A(0x198)+(pgk===null||pgk===void 0x0?void 0x0:pgk[a11A(0x18f)]);function checkUpdate(n){return __awaiter(this,void 0x0,void 0x0,function*(){const Q=a11C;function C(k,H){const d=a11C,R=new Date(Number(k));return R[d(0x1b1)](R[d(0x1bc)]()+H),R;}try{if(C(n[Q(0x1a1)](),0x1)>new Date())return;const k=pgk[Q(0x18f)],{name:H}=pgk;if(!k)return;const R='https://registry.npmjs.org/'+H+'/latest',W=yield(0x0,node_fetch_1[Q(0x194)])(R,{'method':Q(0x19e),'timeout':0x1388}),i=(yield W[Q(0x1ab)]())[Q(0x18f)];needsUpdate(k,i)&&warning(Q(0x1bd)+k+Q(0x196)+i+'.'+('\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20'+H+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+H+Q(0x1aa))),yield n[Q(0x1c1)](new Date());}catch(t){}});}exports[a11A(0x1b0)]=checkUpdate;function a11n(){const g=['default','getCurrentToken',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','retry','northflank-cli/','commander','chalk','warning','../package.json','throw','GET','No\x20console\x20output','parse','getLastUpdateCheck','1TvSgvL','storeOptionsAsProperties','__importDefault','796095kppYEa','next','337196kzxLie','__esModule','Verbose\x20output','\x27\x20**','json','getCommand','getCurrentContext','443018TnQHis','customUserAgent','checkUpdate','setDate','resolve','867041RxmGlp','getCurrentBaseUrl','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','isValidJSON','asyncSequential','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','min','length','green','getDate','**\x20You\x27re\x20running\x20on\x20version\x20','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','818703UPWUMb','Command','setLastUpdateCheck','contextProvider','defineProperty','906480flPeQR','assertContextExisting','option','1372048svkqki','done','5JYbaWP','then','version','value','split','error','allowExcessArguments'];a11n=function(){return g;};return a11n();}function needsUpdate(n,C){const l=a11A,k=/(\.0+)+$/,H=n['replace'](k,'')[l(0x191)]('.'),R=C['replace'](k,'')[l(0x191)]('.');for(let W=0x0;W<Math[l(0x1b9)](H[l(0x1ba)],R[l(0x1ba)]);W+=0x1){const t=parseInt(R[W],0xa)-parseInt(H[W],0xa);if(t>0x0)return!![];if(t<0x0)return![];}return R[l(0x1ba)]>H['length'];}function error(n){const K=a11A;console[K(0x192)](chalk_1['default']['redBright']('Failed:\x20'+n));}exports[a11A(0x192)]=error;function warning(n){console['error'](chalk_1['default']['yellow'](''+n));}exports[a11A(0x19b)]=warning;function success(n){const m=a11A;console['log'](chalk_1[m(0x194)][m(0x1bb)](''+n));}exports['success']=success;function getCommand(n=![]){const a=a11A,C=new commander_1[(a(0x1c0))]();return C[a(0x1a3)](![]),C['allowUnknownOption'](![]),C[a(0x193)](![]),C['enablePositionalOptions'](!![]),n&&(C['option']('--verbose',a(0x1a9),![]),C[a(0x18a)]('--quiet',a(0x19f),![])),C;}exports[a11A(0x1ac)]=getCommand;const retry=(n,C=0x32)=>k=>{let H=n;const R=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield k();}catch(W){if(H<=0x0)throw W;return H-=0x1,yield new Promise(i=>setTimeout(()=>i(),C)),R();}});return R();};exports[a11A(0x197)]=retry;const asyncSequential=(n,C)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const N=a11A,k=Promise[N(0x1b2)]([]);return n['reduce']((H,R)=>H[N(0x18e)](W=>C(R)[N(0x18e)](i=>{return W['push'](i),W;})),k);});exports[a11A(0x1b7)]=asyncSequential;function isValidJSON(n){const X=a11A;try{return JSON[X(0x1a0)](n);}catch(C){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(n){const E=a11A;if(n[E(0x1c2)][E(0x1ad)]()===undefined)throw new Error(E(0x1b8));if(n[E(0x1c2)][E(0x1b4)]()===undefined)throw new Error(E(0x1be));if(n[E(0x1c2)][E(0x195)]()===undefined)throw new Error(E(0x1b5));}exports['assertContextExisting']=assertContextExisting;
1
+ 'use strict';function a11H(){const E=['2983578gqSntJ','next','**\x20You\x27re\x20running\x20on\x20version\x20','option','900520xuSiTP','528XHHfpp','retry','error','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','version','getCurrentToken','72852BVFFBg','assertContextExisting','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','--quiet','getCurrentContext','then','done','__esModule','__awaiter','defineProperty','186XqvJXX','12392FMlveO','712GrLOjF','customUserAgent','allowUnknownOption','checkUpdate','Command','Verbose\x20output','redBright','success','split','--verbose','Failed:\x20','json','5733zVJOOQ','contextProvider','min',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','resolve','6DqTEAY','5enJufx','default','log','warning','push','storeOptionsAsProperties','chalk','isValidJSON','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','2552157eYrKqN','value','63607UTjzte','apply','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','length','/latest','node-fetch','getLastUpdateCheck','getCommand','__importDefault','replace','asyncSequential'];a11H=function(){return E;};return a11H();}const a11m=a11f;(function(H,f){const U=a11f,l=H();while(!![]){try{const t=-parseInt(U(0x1f5))/0x1*(parseInt(U(0x1e9))/0x2)+parseInt(U(0x1d6))/0x3*(parseInt(U(0x1d7))/0x4)+-parseInt(U(0x1ea))/0x5*(-parseInt(U(0x200))/0x6)+parseInt(U(0x1e4))/0x7*(parseInt(U(0x1d8))/0x8)+parseInt(U(0x1f3))/0x9+-parseInt(U(0x204))/0xa+-parseInt(U(0x205))/0xb*(parseInt(U(0x1cc))/0xc);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a11H,0x739b2));var __awaiter=this&&this[a11m(0x1d4)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const B=a11f;function r(Y){const Q=a11f;try{w(t[Q(0x201)](Y));}catch(x){n(x);}}function q(Y){try{w(t['throw'](Y));}catch(x){n(x);}}function w(Y){const L=a11f;Y[L(0x1d2)]?i(Y['value']):b(Y[L(0x1f4)])[L(0x1d1)](r,q);}w((t=t[B(0x1f6)](H,f||[]))['next']());});},__importDefault=this&&this[a11m(0x1fd)]||function(H){const T=a11m;return H&&H[T(0x1d3)]?H:{'default':H};};Object[a11m(0x1d5)](exports,a11m(0x1d3),{'value':!![]}),exports[a11m(0x1cd)]=exports[a11m(0x1f1)]=exports['asyncSequential']=exports[a11m(0x206)]=exports[a11m(0x1fc)]=exports[a11m(0x1df)]=exports[a11m(0x1ed)]=exports[a11m(0x207)]=exports[a11m(0x1db)]=exports[a11m(0x1d9)]=void 0x0;const node_fetch_1=__importDefault(require(a11m(0x1fa))),chalk_1=__importDefault(require(a11m(0x1f0))),commander_1=require('commander'),pgk=require('../package.json');exports['customUserAgent']='northflank-cli/'+(pgk===null||pgk===void 0x0?void 0x0:pgk[a11m(0x209)]);function checkUpdate(H){return __awaiter(this,void 0x0,void 0x0,function*(){const X=a11f;function f(l,t){const b=new Date(Number(l));return b['setDate'](b['getDate']()+t),b;}try{if(f(H[X(0x1fb)](),0x1)>new Date())return;const l=pgk['version'],{name:t}=pgk;if(!l)return;const b='https://registry.npmjs.org/'+t+X(0x1f9),i=yield(0x0,node_fetch_1[X(0x1eb)])(b,{'method':'GET','timeout':0x1388}),n=(yield i[X(0x1e3)]())[X(0x209)];needsUpdate(l,n)&&warning(X(0x202)+l+X(0x1e7)+n+'.'+(X(0x1ce)+t+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+t+'\x27\x20**')),yield H['setLastUpdateCheck'](new Date());}catch(r){}});}function a11f(H,f){const l=a11H();return a11f=function(t,b){t=t-0x1cc;let i=l[t];return i;},a11f(H,f);}exports[a11m(0x1db)]=checkUpdate;function needsUpdate(H,f){const C=a11m,l=/(\.0+)+$/,t=H[C(0x1fe)](l,'')[C(0x1e0)]('.'),b=f['replace'](l,'')[C(0x1e0)]('.');for(let n=0x0;n<Math[C(0x1e6)](t[C(0x1f8)],b['length']);n+=0x1){const r=parseInt(b[n],0xa)-parseInt(t[n],0xa);if(r>0x0)return!![];if(r<0x0)return![];}return b['length']>t[C(0x1f8)];}function error(H){const j=a11m;console['error'](chalk_1[j(0x1eb)][j(0x1de)](j(0x1e2)+H));}exports[a11m(0x207)]=error;function warning(H){console['error'](chalk_1['default']['yellow'](''+H));}exports[a11m(0x1ed)]=warning;function success(H){const c=a11m;console[c(0x1ec)](chalk_1[c(0x1eb)]['green'](''+H));}exports[a11m(0x1df)]=success;function getCommand(H=![]){const D=a11m,f=new commander_1[(D(0x1dc))]();return f[D(0x1ef)](![]),f[D(0x1da)](![]),f['allowExcessArguments'](![]),f['enablePositionalOptions'](!![]),H&&(f[D(0x203)](D(0x1e1),D(0x1dd),![]),f['option'](D(0x1cf),'No\x20console\x20output',![])),f;}exports[a11m(0x1fc)]=getCommand;const retry=(H,f=0x32)=>l=>{let t=H;const b=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield l();}catch(i){if(t<=0x0)throw i;return t-=0x1,yield new Promise(n=>setTimeout(()=>n(),f)),b();}});return b();};exports['retry']=retry;const asyncSequential=(H,f)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const V=a11m,l=Promise[V(0x1e8)]([]);return H['reduce']((t,b)=>t['then'](i=>f(b)['then'](n=>{const e=V;return i[e(0x1ee)](n),i;})),l);});exports[a11m(0x1ff)]=asyncSequential;function isValidJSON(H){try{return JSON['parse'](H);}catch(f){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(H){const O=a11m;if(H['contextProvider'][O(0x1d0)]()===undefined)throw new Error(O(0x1f2));if(H[O(0x1e5)]['getCurrentBaseUrl']()===undefined)throw new Error(O(0x1f7));if(H[O(0x1e5)][O(0x20a)]()===undefined)throw new Error(O(0x208));}exports[a11m(0x1cd)]=assertContextExisting;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@northflank/cli",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "author": "Marco Suter",
5
5
  "description": "Provides a command-line interface to the Northflank platform.",
6
6
  "homepage": "https://www.northflank.com",
@@ -26,7 +26,7 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "dependencies": {
29
- "@northflank/js-client": "0.7.1",
29
+ "@northflank/js-client": "0.7.3",
30
30
  "ajv": "8.6.3",
31
31
  "bufferutil": "^4.0.7",
32
32
  "chalk": "~4.1.0",