@northflank/cli 0.9.16 → 0.9.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-helpers.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/contextCommands.js +1 -1
- package/dist/defaults.js +1 -1
- package/dist/exec/index.js +1 -1
- package/dist/formatting/command-overview.js +1 -1
- package/dist/formatting/console-format-helpers.js +1 -1
- package/dist/formatting/terminal-chart.js +1 -1
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/logs/index.js +1 -1
- package/dist/logs/log-formatter.js +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/pagination/inquirer-pagination-prompt.js +1 -1
- package/dist/pagination/pagination-helper.js +1 -0
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a4D
|
|
1
|
+
'use strict';const a4M=a4D;(function(C,D){const t=a4D,V=C();while(!![]){try{const Y=-parseInt(t(0x1b1))/0x1+parseInt(t(0x1f2))/0x2*(-parseInt(t(0x1df))/0x3)+parseInt(t(0x1e9))/0x4+-parseInt(t(0x1c9))/0x5*(-parseInt(t(0x1bc))/0x6)+-parseInt(t(0x1db))/0x7+parseInt(t(0x211))/0x8+-parseInt(t(0x1fb))/0x9*(-parseInt(t(0x1bb))/0xa);if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a4C,0xdb27e));function a4D(C,D){const V=a4C();return a4D=function(Y,e){Y=Y-0x1a8;let T=V[Y];return T;},a4D(C,D);}function a4C(){const w=['stderr','Run\x20command\x20with\x20this\x20group','chalk','stdOut','columns','service','warning','execJobSession','../inquirer-helper','1346485QzeEMh','with\x20user:','filter','charAt','\x20in\x20project\x20','ApiClient',',\x20details:\x20','success','../utils','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','alias','stdout','resizeTerminal','getStandardExecCommand','Success',',\x20exit\x20code:\x20','--noDefaults','Unknown','1374345TyThPR','log','assertContextExisting','--cmd\x20--command\x20[COMMAND]','3QzUtpH','value','isTTY','none','error','name','execServiceSession','getTerminalSize','askForProject','pipe','1315468DSllxo','\x20--','Command\x20exec\x20for\x20the\x20specified\x20','exit','rows','Command\x20completed\x20successfully,\x20exit\x20code:\x20','apiClient','execCmd','exitCode','786442QNIsib','stdIn','--shell-cmd\x20[SHELL-CMD]','exec','action','slice','\x0a\x20\x20Single\x20command,\x20no\x20shell:\x20\x20\x20\x20\x20northflank\x20exec\x20','Command\x20to\x20execute.\x0aIf\x20--shell-cmd\x20option\x20such\x20as\x20\x27bash\x20-c\x27\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell.\x20Otherwise\x20the\x20command\x20will\x20run\x20without\x20a\x20shell.\x20If\x20no\x20command\x20is\x20provided,\x20an\x20interactive\x20session\x20with\x20stdin\x20and\x20tty\x20is\x20opened.','option','198FSGZnt','\x20--shell-cmd\x20\x27sh\x27','job','__esModule','join','description','askForJob','keypress','stdErr','command-exec','Id\x20[NAME]','--group\x20[GROUP]','greenBright','addCommand','Run\x20command\x20with\x20this\x20user','with\x20shell\x20session','bold','message','Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.','sequence','with\x20command\x20\x27','.\x0aExamples:\x0a\x20\x20Shell\x20session:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20northflank\x20exec\x20','11983728ohnJjl','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','@northflank/js-client','setRawMode','with\x20group:','next','InquirerHelper','handleShellSession','then','--user\x20[USER]','--container\x20--containerId\x20[NAME]','1676418LpDqwZ','getCurrentProjectName','Run\x20command\x20with\x20shell\x20(e.g.\x20\x27bash\x27,\x27sh\x27).\x0aIf\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.','default','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','Error\x20occured\x20during\x20','getCommand','stdin','CliExec','done','485230hgSQwo','6IamXEm','without\x20shell','customUserAgent','execStartLog'];a4C=function(){return w;};return a4C();}var __awaiter=this&&this['__awaiter']||function(C,D,V,Y){function e(T){return T instanceof V?T:new V(function(W){W(T);});}return new(V||(V=Promise))(function(T,W){const X=a4D;function f(i){const y=a4D;try{G(Y[y(0x1ab)](i));}catch(I){W(I);}}function q(i){try{G(Y['throw'](i));}catch(I){W(I);}}function G(i){const Z=a4D;i[Z(0x1ba)]?T(i[Z(0x1e0)]):e(i[Z(0x1e0)])[Z(0x1ae)](f,q);}G((Y=Y['apply'](C,D||[]))[X(0x1ab)]());});},__importDefault=this&&this['__importDefault']||function(C){const p=a4D;return C&&C[p(0x1fe)]?C:{'default':C};};Object['defineProperty'](exports,a4M(0x1fe),{'value':!![]}),exports['CliExec']=void 0x0;const js_client_1=require(a4M(0x1a8)),chalk_1=__importDefault(require(a4M(0x1c2))),utils_1=require(a4M(0x1d1)),inquirer_helper_1=require(a4M(0x1c8));class CliExec{constructor(C){const n=a4M;this[n(0x1d6)]=e=>(0x0,utils_1[n(0x1b7)])(!![])[n(0x1e4)](e)[n(0x200)](n(0x1eb)+e+n(0x210)+e+n(0x1f8)+e+'\x20--cmd\x20\x27date\x27\x0a\x20\x20Single\x20command,\x20custom\x20shell:\x20northflank\x20exec\x20'+e+'\x20--cmd\x20\x27\x22ls\x20-l\x20/usr\x22\x27\x20--shell-cmd\x20\x27bash\x20-c\x27\x0a\x20\x20Shell\x20session,\x20custom\x20shell:\x20\x20northflank\x20exec\x20'+e+n(0x1fc))[n(0x1fa)]('--project\x20--projectId\x20[NAME]','Project\x20for\x20exec')[n(0x1fa)]('--'+e+n(0x1ea)+e+n(0x205),e[n(0x1cc)](0x0)['toUpperCase']()+e[n(0x1f7)](0x1)+'\x20to\x20exec\x20into')[n(0x1fa)](n(0x1b0),n(0x212))[n(0x1fa)](n(0x1f4),n(0x1b3))[n(0x1fa)](n(0x1af),n(0x209))[n(0x1fa)](n(0x206),n(0x1c1))[n(0x1fa)](n(0x1d9),'Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])[n(0x1fa)](n(0x1de),n(0x1f9)),this['getTerminalSize']=()=>({'columns':process[n(0x1d4)]['columns'],'rows':process[n(0x1d4)][n(0x1ed)]}),this[n(0x1bf)]=(e,T,W,f,q,G,i,I)=>{const r=n;if(I===!![])return;const m=f===r(0x1e2),Q=m?r(0x1bd):f===undefined?r(0x20a):'shell\x20command\x20'+chalk_1[r(0x1b4)][r(0x207)](f),J=q!==undefined?r(0x1ca)+q:'',z=G!==undefined?r(0x1aa)+G:'',u=i!==undefined?r(0x20f)+chalk_1[r(0x1b4)]['greenBright'](i)+'\x27':'',L=[u,Q,J,z][r(0x1cb)](k=>k!=='')[r(0x1ff)]('\x20'),v='(exit\x20with\x20two\x20quick\x20'+chalk_1['default']['bold']('\x27Ctrl+D\x27')+')';console[r(0x1dc)]('Exec\x20'+e+'\x20'+chalk_1[r(0x1b4)][r(0x20b)](T)+r(0x1cd)+chalk_1['default'][r(0x20b)](W)+'\x20'+L+'\x20'+v);},this['handleShellSession']=(e,T,W=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const l=n;var f,q;let G=![];try{if(process[l(0x1b8)][l(0x1e1)]){const I=require('readline');I['emitKeypressEvents'](process[l(0x1b8)]),process[l(0x1b8)][l(0x1a9)](!![]),process[l(0x1d4)]['on']('resize',()=>{const b=l;e[b(0x1d5)](this[b(0x1e6)]());}),process['stdin']['on'](l(0x202),(m,Q)=>{const P=l;Q[P(0x20e)]==='\x04'&&(G?(process[P(0x1b8)][P(0x1a9)](![]),(0x0,utils_1[P(0x1c6)])(P(0x20d)),process[P(0x1ec)]()):(G=!![],setTimeout(()=>G=![],0x190)));});}process[l(0x1b8)][l(0x1e8)](e[l(0x1f3)]),e[l(0x203)][l(0x1e8)](process[l(0x1c0)]),e[l(0x1c3)][l(0x1e8)](process['stdout']),e['on'](l(0x1e3),m=>{const g=l;var Q;(0x0,utils_1[g(0x1e3)])(g(0x1b6)+T+'\x20command\x20exec:\x20'+((Q=m[g(0x20c)])!==null&&Q!==void 0x0?Q:m)),process['stdin'][g(0x1e1)]&&process[g(0x1b8)][g(0x1a9)](![]),process[g(0x1ec)](-0x1);});const i=yield e['waitForCommandResult']();if(W!==!![]){const m=(f=i===null||i===void 0x0?void 0x0:i['status'])!==null&&f!==void 0x0?f:l(0x1da),Q=(q=i===null||i===void 0x0?void 0x0:i[l(0x1f1)])!==null&&q!==void 0x0?q:-0x1,J=(i===null||i===void 0x0?void 0x0:i[l(0x20c)])?l(0x1cf)+i['message']:'';m===l(0x1d7)?(0x0,utils_1[l(0x1d0)])(l(0x1ee)+Q):(0x0,utils_1[l(0x1c6)])(l(0x1b5)+m+l(0x1d8)+Q+J);}return i;}finally{process[l(0x1b8)][l(0x1e1)]&&process[l(0x1b8)]['setRawMode'](![]);}}),this[n(0x1ef)]=new js_client_1[(n(0x1ce))](C,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[n(0x1be)]});const D=new inquirer_helper_1[(n(0x1ac))](this['apiClient']);this[n(0x1f0)]=(0x0,utils_1[n(0x1b7)])()[n(0x1e4)](n(0x204))[n(0x1d3)](n(0x1f5))['description'](n(0x1d2));const V=this[n(0x1d6)](n(0x1c5))[n(0x1f6)](e=>__awaiter(this,void 0x0,void 0x0,function*(){const E=n,{noDefaults:T,projectId:W,serviceId:f,containerId:q,shellCmd:G,user:i,group:I,command:m,quiet:Q}=e;(0x0,utils_1[E(0x1dd)])(this[E(0x1ef)]);try{const J=T?undefined:C[E(0x1b2)](),z=W||J||(yield D[E(0x1e7)]()),u=T?undefined:C['getCurrentServiceName'](),L=f||u||(yield D['askForService'](z)()),v=G!==null&&G!==void 0x0?G:m!==undefined?'none':undefined;this[E(0x1bf)](E(0x1c5),L,z,v,i,I,m,Q);const k=process[E(0x1d4)][E(0x1c4)],s=process[E(0x1d4)]['rows'],h={'projectId':z,'serviceId':L},j=yield this[E(0x1ef)][E(0x1f5)][E(0x1e5)](h,{'containerName':q,'command':m,'shell':v,'user':i,'group':I,'ttyColumns':k,'ttyRows':s});yield this[E(0x1ad)](j,E(0x1c5),Q);}catch(U){(0x0,utils_1['error'])(''+U[E(0x20c)]);}finally{process[E(0x1ec)]();}})),Y=this['getStandardExecCommand'](n(0x1fd))['action'](e=>__awaiter(this,void 0x0,void 0x0,function*(){const o=n,{projectId:T,jobId:W,containerId:f,noDefaults:q,shellCmd:G,user:i,group:I,command:m,quiet:Q}=e;(0x0,utils_1[o(0x1dd)])(this[o(0x1ef)]);try{const J=q?undefined:C[o(0x1b2)](),z=T||J||(yield D[o(0x1e7)]()),u=W||(yield D[o(0x201)](z)());this[o(0x1bf)](o(0x1fd),u,z,G,Q);const {rows:L,columns:v}=this[o(0x1e6)](),k={'projectId':z,'jobId':u},s=yield this['apiClient'][o(0x1f5)][o(0x1c7)](k,{'containerName':f,'command':m,'shell':G,'user':i,'group':I,'ttyColumns':v,'ttyRows':L});yield this[o(0x1ad)](s,o(0x1fd),Q);}catch(h){(0x0,utils_1[o(0x1e3)])(''+h[o(0x20c)]);}finally{process[o(0x1ec)]();}}));this[n(0x1f0)]['addCommand'](V),this['execCmd'][n(0x208)](Y);}}exports[a4M(0x1b9)]=CliExec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a5j=a5D;(function(C,D){const h=a5D,V=C();while(!![]){try{const Y=-parseInt(h(0x1e8))/0x1*(-parseInt(h(0x1fe))/0x2)+-parseInt(h(0x1df))/0x3+parseInt(h(0x1fb))/0x4+parseInt(h(0x1e2))/0x5*(parseInt(h(0x1e4))/0x6)+-parseInt(h(0x1ff))/0x7*(parseInt(h(0x1eb))/0x8)+-parseInt(h(0x1f6))/0x9+-parseInt(h(0x1e7))/0xa*(parseInt(h(0x1f7))/0xb);if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a5C,0xa5afa));var __awaiter=this&&this[a5j(0x1f0)]||function(C,D,V,Y){function e(T){return T instanceof V?T:new V(function(W){W(T);});}return new(V||(V=Promise))(function(T,W){const Z=a5D;function f(i){const U=a5D;try{G(Y[U(0x1e9)](i));}catch(I){W(I);}}function q(i){const t=a5D;try{G(Y[t(0x1f9)](i));}catch(I){W(I);}}function G(i){const y=a5D;i[y(0x1f4)]?T(i['value']):e(i[y(0x202)])[y(0x1f3)](f,q);}G((Y=Y[Z(0x1f2)](C,D||[]))[Z(0x1e9)]());});},__importDefault=this&&this[a5j(0x1de)]||function(C){const X=a5j;return C&&C[X(0x200)]?C:{'default':C};};function a5C(){const r=['3450170hjQmXH','67GuaiUy','next','description','920GvIgMp','action','join','forEach','getCommand','__awaiter','../utils','apply','then','done','option','10603098lhugdg','11LPEfrR','log','throw','chalk','4159600zyJgRx','slice','defineProperty','40162OHhLex','46018aKRDZf','__esModule','commands','value','bold','getCommandOverview','Print\x20command\x20descriptions','Prints\x20a\x20tree\x20view\x20of\x20all\x20available\x20commands','__importDefault','215205mywdmO','every','command-overview','87055mJRxAa','opts','222JYRJGO','name','length'];a5C=function(){return r;};return a5C();}Object[a5j(0x1fd)](exports,a5j(0x200),{'value':!![]}),exports['getCommandOverview']=void 0x0;const chalk_1=__importDefault(require(a5j(0x1fa))),utils_1=require(a5j(0x1f1));function a5D(C,D){const V=a5C();return a5D=function(Y,e){Y=Y-0x1db;let T=V[Y];return T;},a5D(C,D);}function getCommandOverview(C){const p=a5j;return(0x0,utils_1[p(0x1ef)])()[p(0x1e5)](p(0x1e1))[p(0x1ea)](p(0x1dd))[p(0x1f5)]('--verbose',p(0x1dc))[p(0x1ec)](D=>__awaiter(this,void 0x0,void 0x0,function*(){const {verbose:V}=D;function Y(e,T){const M=a5D;var W;const f=(v,k=!![])=>k?chalk_1['default'][M(0x203)]['green'](v['name']()):v[M(0x1e5)](),q=T[M(0x1e6)]===0x0,G=e[M(0x201)];let i='';const I=G['length']===0x0,m=I||((W=Object['keys'](e===null||e===void 0x0?void 0x0:e[M(0x1e3)]()))===null||W===void 0x0?void 0x0:W[M(0x1e6)])>0x0;!q&&(i=G&&!I?'┬\x20':'─\x20');const Q=V&&m&&e[M(0x1ea)]()?':\x20'+e[M(0x1ea)]():'';console[M(0x1f8)](''+T+i+f(e,m)+Q);let J=T;if(!q){const v=T[M(0x1fc)](-0x2)==='└─';J=T[M(0x1fc)](0x0,-0x2)+(v?'\x20\x20':'│\x20');}const z=J+'├─',u=J+'└─',L=G[M(0x1e0)](k=>k['commands'][M(0x1e6)]===0x0);L&&!I&&!V?console['log'](u+'\x20'+G['map'](k=>f(k))[M(0x1ed)](',\x20')):G[M(0x1ee)]((k,s)=>{const n=M;Y(k,G[n(0x1e6)]-0x1===s?u:z);});}Y(C,'');}));}exports[a5j(0x1db)]=getCommandOverview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a6z=a6D;(function(C,D){const J=a6D,V=C();while(!![]){try{const Y=parseInt(J(0x11c))/0x1*(parseInt(J(0xfa))/0x2)+-parseInt(J(0x138))/0x3*(-parseInt(J(0x10d))/0x4)+parseInt(J(0x10a))/0x5*(parseInt(J(0x11d))/0x6)+-parseInt(J(0x108))/0x7*(parseInt(J(0x10c))/0x8)+parseInt(J(0x136))/0x9*(-parseInt(J(0x103))/0xa)+-parseInt(J(0x124))/0xb*(parseInt(J(0x100))/0xc)+parseInt(J(0x106))/0xd;if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a6C,0xb29af));function a6D(C,D){const V=a6C();return a6D=function(Y,e){Y=Y-0xfa;let T=V[Y];return T;},a6D(C,D);}var __createBinding=this&&this[a6z(0x12e)]||(Object[a6z(0x11f)]?function(C,D,V,Y){const u=a6z;if(Y===undefined)Y=V;var e=Object['getOwnPropertyDescriptor'](D,V);(!e||('get'in e?!D[u(0x104)]:e[u(0x113)]||e['configurable']))&&(e={'enumerable':!![],'get':function(){return D[V];}}),Object[u(0x101)](C,Y,e);}:function(C,D,V,Y){if(Y===undefined)Y=V;C[Y]=D[V];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a6z(0x11f)]?function(C,D){const L=a6z;Object[L(0x101)](C,L(0x12f),{'enumerable':!![],'value':D});}:function(C,D){const v=a6z;C[v(0x12f)]=D;}),__importStar=this&&this[a6z(0x11a)]||function(C){const k=a6z;if(C&&C[k(0x104)])return C;var D={};if(C!=null){for(var V in C)if(V!=='default'&&Object[k(0xff)][k(0x12a)][k(0x125)](C,V))__createBinding(D,C,V);}return __setModuleDefault(D,C),D;},__importDefault=this&&this[a6z(0x10b)]||function(C){const s=a6z;return C&&C[s(0x104)]?C:{'default':C};};Object[a6z(0x101)](exports,a6z(0x104),{'value':!![]}),exports[a6z(0x126)]=exports['handleFormattedOutput']=exports[a6z(0x13d)]=exports['handleJsonOutput']=exports[a6z(0x119)]=exports[a6z(0x123)]=void 0x0;const chalk_1=__importDefault(require(a6z(0x117))),_=__importStar(require(a6z(0x13b))),util=__importStar(require('util')),yaml=require('js-yaml'),columnify=require(a6z(0x132));function printAsTable(C,D,V,Y=![],e=0x0){const h=a6z;!Y&&console[h(0x130)](''+chalk_1[h(0x12f)][h(0x109)](D));function T(f){const j=h;return f==='disabled'?f:f[j(0x12b)]('disabled','');}function W(f,q){const t=h;function G(I){const U=a6D,m=new Date(I);return m[U(0x135)]()+'/'+m['getMonth']()+'/'+m[U(0x122)]()+'\x0a'+m[U(0x137)]()+':'+m[U(0x131)]()+':'+m[U(0x112)]();}const i=[t(0xfd),'updatedat'];if(i['includes'](q[t(0x128)]())&&_[t(0x105)](f)&&f[t(0x10f)]()[t(0x12d)]===0xd)return G(Number(f));if(_['isBoolean'](f)){if(q!=='disabled'&&q[t(0x102)](t(0x115)))return f?'x':'✔';return f?'✔':'x';}if(_[t(0x127)](f))return util['inspect'](f,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});return f;}if(_['isArrayLike'](C)){C['length']===0x0&&console[h(0x130)](h(0x118)+D['toLowerCase']()+h(0x120));const f=C['map']((i,I)=>{const y=h,m={'i':I+e};return Object[y(0x114)](i)['forEach'](Q=>{const Z=y;(_[Z(0x12c)](V)||V[Z(0x102)](Q[Z(0x128)]()))&&_[Z(0xfc)](m,T(Q),W(i[Q],Q));}),m;}),q=_[h(0x129)](Object[h(0x114)]((f===null||f===void 0x0?void 0x0:f[0x0])||[]))[h(0x121)]((i,I)=>{const X=h,m=Q=>Q!=='i'?Q!==X(0xfb)?0x0:0x1:0x2;return m(I)-m(i);}),G={'maxWidth':0x1e,'preserveNewLines':!![],'showHeaders':!Y,'config':{'_id':{'maxWidth':0x5,'truncate':!![]},'i':{'showHeaders':![]}},'columns':q};console[h(0x130)](columnify(f,G));}else console[h(0x130)](C);}exports[a6z(0x123)]=printAsTable;function consoleFormat(C,D){const p=a6z;if(_[p(0x13c)](C)){const V=D?p(0xfe)+D+')':'';return chalk_1['default'][p(0x139)](p(0x13a))+V;}if(!_[p(0x127)](C))return C===null||C===void 0x0?void 0x0:C[p(0x10f)]();return util[p(0x110)](C,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});}exports[a6z(0x119)]=consoleFormat;const handleJsonOutput=(C,D)=>{const M=a6z,V=C===M(0x11b);if(V)console[M(0x130)](JSON[M(0x11e)](D,null,'\x20'));};exports[a6z(0x10e)]=handleJsonOutput;const handleYamlOutput=(C,D)=>{const n=a6z,V=C===n(0x134)||C===n(0x107);if(V)console[n(0x130)](yaml[n(0x116)](D));};exports[a6z(0x13d)]=handleYamlOutput;const handleFormattedOutput=(C,D)=>{const r=a6z,V=C===r(0x133);if(V)console[r(0x130)](consoleFormat(D));};exports[a6z(0x111)]=handleFormattedOutput;const printResponse=(C,D)=>{const l=a6z;(0x0,exports['handleJsonOutput'])(C,D),(0x0,exports['handleYamlOutput'])(C,D),(0x0,exports[l(0x111)])(C,D);};function a6C(){const b=['31430eOtDiK','__esModule','isFinite','14835795aafSdW','yml','4803974LyucpW','bold','1575125YfOLGN','__importDefault','8MpkeLw','4uuEFyr','handleJsonOutput','toString','inspect','handleFormattedOutput','getSeconds','writable','keys','disabled','safeDump','chalk','No\x20','consoleFormat','__importStar','json','49177PYgrHJ','6VGiysz','stringify','create','\x20found','sort','getFullYear','printAsTable','99JUGnjL','call','printResponse','isObjectLike','toLowerCase','clone','hasOwnProperty','replace','isUndefined','length','__createBinding','default','log','getMinutes','columnify','format','yaml','getDate','1809ZmPFXS','getHours','3543123XpfCQH','green','The\x20request\x20was\x20completed\x20successfully','lodash','isEmpty','handleYamlOutput','22zfWLfa','internalId','set','createdat','\x20(HTTP\x20status:\x20','prototype','1504848SIEOkL','defineProperty','includes'];a6C=function(){return b;};return a6C();}exports[a6z(0x126)]=printResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a7a=a7D;function a7D(C,D){const V=a7C();return a7D=function(Y,e){Y=Y-0x14f;let T=V[Y];return T;},a7D(C,D);}(function(C,D){const F=a7D,V=C();while(!![]){try{const Y=-parseInt(F(0x163))/0x1*(-parseInt(F(0x14f))/0x2)+-parseInt(F(0x16f))/0x3*(parseInt(F(0x15a))/0x4)+-parseInt(F(0x158))/0x5*(parseInt(F(0x159))/0x6)+-parseInt(F(0x15e))/0x7+parseInt(F(0x16e))/0x8+-parseInt(F(0x16a))/0x9*(-parseInt(F(0x160))/0xa)+parseInt(F(0x166))/0xb;if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a7C,0xce735));var __importDefault=this&&this['__importDefault']||function(C){return C&&C['__esModule']?C:{'default':C};};Object[a7a(0x178)](exports,a7a(0x157),{'value':!![]}),exports[a7a(0x164)]=exports[a7a(0x15c)]=void 0x0;const chalk_1=__importDefault(require(a7a(0x15f))),colored=(C,D)=>{return D===undefined?C:chalk_1['default'][D](C);},getAsciiChart=(C,D={})=>{const R=a7a,V=Array[R(0x154)](C[0x0])?C:[C];let Y=typeof D[R(0x16c)]!==R(0x153)?D[R(0x16c)]:V[0x0][0x0],e=typeof D[R(0x151)]!==R(0x153)?D['max']:V[0x0][0x0];for(let U=0x0;U<V[R(0x167)];U++){for(let t=0x0;t<V[U]['length'];t++){Y=Math[R(0x16c)](Y,V[U][t]),e=Math[R(0x151)](e,V[U][t]);}}let T=['┼','┤','╶','╴','─','╰','╭','╮','╯','│'],W=Math[R(0x152)](e-Y),f=typeof D[R(0x156)]!=='undefined'?D[R(0x156)]:0x3,q=typeof D[R(0x17b)]!==R(0x153)?D[R(0x17b)]:R(0x16b),G=typeof D[R(0x174)]!==R(0x153)?D[R(0x174)]:W,I=typeof D['colors']!==R(0x153)?D[R(0x162)]:[R(0x16d),R(0x168),R(0x172),R(0x170),R(0x15d)],m=W!==0x0?G/W:0x1,Q=Math['round'](Y*m),J=Math[R(0x161)](e*m),z=Math['abs'](J-Q),u=0x0;for(let Z=0x0;Z<V['length'];Z++){u=Math[R(0x151)](u,V[Z][R(0x167)]);}u=u+f;let L=typeof D[R(0x173)]!==R(0x153)?D['symbols']:T,v=D[R(0x15b)]!==undefined?D['format']:function(X){const x=R;return(q+X[x(0x165)](0x2)+D[x(0x176)])[x(0x155)](-q['length']);},k=new Array(z+0x1);for(let X=0x0;X<=z;X++){k[X]=new Array(u);for(let p=0x0;p<u;p++){k[X][p]='\x20';}}for(let M=Q;M<=J;++M){const n=v(z>0x0?e-(M-Q)*W/z:M,M-Q);k[M-Q][Math[R(0x151)](f-n[R(0x167)],0x0)]=n,k[M-Q][f-0x1]=M==0x0?L[0x0]:L[0x1];}for(let r=0x0;r<V['length'];r++){let l=I[r%I['length']],b=Math[R(0x161)](V[r][0x0]*m)-Q;k[z-b][f-0x1]=colored(L[0x0],l);for(let P=0x0;P<V[r]['length']-0x1;P++){let g=Math['round'](V[r][P+0x0]*m)-Q,E=Math[R(0x161)](V[r][P+0x1]*m)-Q;if(g==E)k[z-g][P+f]=colored(L[0x4],l);else{k[z-E][P+f]=colored(g>E?L[0x5]:L[0x6],l),k[z-g][P+f]=colored(g>E?L[0x7]:L[0x8],l);let o=Math[R(0x16c)](g,E),w=Math[R(0x151)](g,E);for(let A=o+0x1;A<w;A++){k[z-A][P+f]=colored(L[0x9],l);}}}}const {startTs:s,endTs:h}=D;if(s||h){const N=c=>{const C0=R;if(!c)return C0(0x150);const d=c[C0(0x169)](undefined,{'day':C0(0x179),'month':'2-digit','year':C0(0x179)}),O=c[C0(0x17a)](undefined,{'hourCycle':'h24'});return d+'\x20'+O;},S=N(h),B=N(s),H=q['slice'](0x0,Math[R(0x151)](0x2,q[R(0x167)]-B[R(0x167)]/0x2+0x1)),K='\x20'['repeat'](Math[R(0x151)](u-(q[R(0x167)]+S[R(0x167)]/0x2),0x1));k['push']([''+H+B+K+S]),k[R(0x175)]([]);}return k['map'](c=>c[R(0x171)](''))[R(0x171)]('\x0a');};exports[a7a(0x15c)]=getAsciiChart;const downSampleData=(C,D)=>{const C1=a7a,V=C[C1(0x167)];if(D>=V||D===0x0)return C;const Y=[];let e=0x0;const T=(V-0x2)/(D-0x2);let W=0x0,f,q,G,I;Y[e++]=C[W];for(var m=0x0;m<D-0x2;m++){let v=0x0,k=0x0,s=Math[C1(0x177)]((m+0x1)*T)+0x1,h=Math[C1(0x177)]((m+0x2)*T)+0x1;h=h<V?h:V;var Q=h-s;for(;s<h;s++){v+=C[s][0x0],k+=C[s][0x1];}v/=Q,k/=Q;var J=Math[C1(0x177)](m*T)+0x1,z=Math[C1(0x177)]((m+0x1)*T)+0x1,u=C[W][0x0],L=C[W][0x1];q=G=-0x1;for(;J<z;J++){G=Math[C1(0x152)]((u-v)*(C[J][0x1]-L)-(u-C[J][0x0])*(k-L))*0.5,G>q&&(q=G,f=C[J],I=J);}Y[e++]=f,W=I;}return Y[e++]=C[V-0x1],Y;};function a7C(){const C2=['green','symbols','height','push','unit','floor','defineProperty','2-digit','toLocaleTimeString','padding','2VLabJC','\x20\x20\x20','max','abs','undefined','isArray','slice','offset','__esModule','3780525mHLUPE','12FYEtDd','12yodyaJ','format','getAsciiChart','black','10304056KlGAeb','chalk','5950wgIQsj','round','colors','739279VBeHjH','downSampleData','toFixed','24633191ozcASR','length','red','toLocaleDateString','23661EAOQys','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','min','blue','5719944gLfipb','1428069HZEUTA','grey','join'];a7C=function(){return C2;};return a7C();}exports[a7a(0x164)]=downSampleData;
|
package/dist/inquirer-helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a8w(){const wb=['builds','askForSubdomain','__esModule','askForTag','main-context','data','\x20(startedAt:\x20','red','tokenPrompt','propToType','editPayload','Template\x20id\x20not\x20provided.','throw','array','askForJobRun','getOwnPropertyDescriptor','integer','credentials','494918ZspSek','join','__awaiter','writable','length','default','\x20characters,\x20is\x20','chalk','fileName','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','inquirer-search-list','Yes,\x20send','Configuration\x20file\x20written\x20to\x20','retrievePayloadViaInteractiveCli','job\x20builds','assign','retry','pathVars','toUpperCase','toString','confirmationPrompt','inquirer','1233117IfgsZA','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','defaultPaginationPageSize','YES','subdomains','Writing\x20configuration\x20failed:\x20','No,\x20repeat','bold','js-yaml','askForTemplateRun','warning','./pagination/inquirer-pagination-prompt','apiClient','choice','name','templates','includes','pipelines','askForCredentials','askConfirm','restore','slice','concat','getCurrentProjectName','askForAddonBackup','askForDomain','values','yaml','backups','__importStar','cmdPath','boolean','1227666CFGusc','set','keys','defineProperty','askGeneric','askForResource','done','pagination-prompt','reset','Choose\x20the\x20login\x20token:','askForProjectScopedResourcePaginated','1071628ufrhor','all-job-runs','editedResult','InquirerHelper','split','pattern','greenBright','job:\x20\x27','askForLogSink','get','type','rawObject','askForSubdomainPath','tag','service\x20containers','volumes','filter','hasOwnProperty','token','string','project:\x20\x27','max','volume','No,\x20edit','minimum','find','addon:\x20\x27','jobs','override','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','\x20(completedAt:\x20','getQuestionString','domain\x20(','job\x20containers','Enter\x20the\x20','registerPrompt','anyOf','maximum','services','map','\x20(full\x20domain:\x20','askForProjectScopedResource','askForBuild','don\x27t\x20change','domains','addons','description','domain','minLength','green','doesn\x27t\x20match\x20pattern\x20\x27','confirm','fetchResourceList','properties','7pbosbf','Do\x20you\x20want\x20to\x20add\x20more','\x20in\x20','configurable','What\x27s\x20the\x20','charAt','REPEAT','1306484BWiQHs','getInnerType','isValidJSON','secrets','input','ask','__createBinding','pop','isUndefined','blue','body','oneOf','whiteBright','yml','apply','stringify','repeat','example','logSinks','pagination','push','isBoolean','containers','saveFile','json','safeDump','\x20and\x20it\x20','addon','message','lodash','contextProvider','templateRuns','tmpCmdPath','2057820zDAQCV','call','trim','askForResourcePaginated','What\x20do\x20you\x20want\x20to\x20use\x20as','password','prompt','Please\x20confirm\x20following\x20configuration:\x0a','ABORT','DynamicReloadPaginationPrompt','service:\x20\x27','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','SAVE','service','askForSecret','__importDefault','for\x20this\x20','EDIT','Choose\x20the\x20','subdomain','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','value','\x20to\x20use:','askForContainer','prototype','No,\x20abort','projects','runs',',\x20supported\x20types:\x20[json|yaml|yml]','resultCache','uri','isEmpty','\x20characters','confirmation','yellowBright','template\x20run','object','getPathString','tags','to\x20use:','unshift','path','validate','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','has','list','addEntry','836880OiGaKX','skipValidation','No\x20','blueBright','all-containers','64moxiRT','writeFileSync','cursor','No,\x20but\x20save\x20as\x20file','nextCursor','job\x20runs','Aborted.','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','Go\x20to\x20editor','Context\x20with\x20name\x20\x27','No\x20builds\x20found','underline','success','maxLength','getType','template','Should\x20it\x20be','Do\x20you\x20want\x20to\x20add','isArray','Context\x20name\x20already\x20exists.','restores','__setModuleDefault','editor','project','askForProject','test','not\x20completed','job','search-list','found','then','askArrayEntry','./api-helpers','createdAt','\x20type?'];a8w=function(){return wb;};return a8w();}const a8k=a8o;(function(w,o){const m=a8o,C=w();while(!![]){try{const R=-parseInt(m(0xc9))/0x1+-parseInt(m(0x147))/0x2+parseInt(m(0xff))/0x3+-parseInt(m(0x10a))/0x4+parseInt(m(0x168))/0x5+parseInt(m(0x197))/0x6*(-parseInt(m(0x140))/0x7)+parseInt(m(0x19c))/0x8*(parseInt(m(0xdf))/0x9);if(R===o)break;else C['push'](C['shift']());}catch(M){C['push'](C['shift']());}}}(a8w,0x5837f));var __createBinding=this&&this[a8k(0x14d)]||(Object['create']?function(w,C,R,M){const K=a8k;if(M===undefined)M=R;var I=Object[K(0xc6)](C,R);(!I||('get'in I?!C[K(0xb9)]:I[K(0xcc)]||I[K(0x143)]))&&(I={'enumerable':!![],'get':function(){return C[R];}}),Object[K(0x102)](w,M,I);}:function(w,C,R,M){if(M===undefined)M=R;w[M]=C[R];}),__setModuleDefault=this&&this[a8k(0xa9)]||(Object['create']?function(w,C){const n=a8k;Object[n(0x102)](w,'default',{'enumerable':!![],'value':C});}:function(w,C){const W=a8k;w[W(0xce)]=C;}),__importStar=this&&this[a8k(0xfc)]||function(w){const O=a8k;if(w&&w[O(0xb9)])return w;var o={};if(w!=null){for(var C in w)if(C!=='default'&&Object[O(0x180)][O(0x11b)][O(0x169)](w,C))__createBinding(o,w,C);}return __setModuleDefault(o,w),o;},__awaiter=this&&this[a8k(0xcb)]||function(w,o,C,R){function M(I){return I instanceof C?I:new C(function(l){l(I);});}return new(C||(C=Promise))(function(I,l){const x=a8o;function a(F){try{e(R['next'](F));}catch(Q){l(Q);}}function H(F){const r=a8o;try{e(R[r(0xc3)](F));}catch(Q){l(Q);}}function e(F){const A=a8o;F[A(0x105)]?I(F[A(0x17d)]):M(F[A(0x17d)])[A(0xb2)](a,H);}e((R=R[x(0x155)](w,o||[]))['next']());});},__importDefault=this&&this[a8k(0x177)]||function(w){const D=a8k;return w&&w[D(0xb9)]?w:{'default':w};};Object[a8k(0x102)](exports,'__esModule',{'value':!![]}),exports[a8k(0x10d)]=void 0x0;const _=__importStar(require(a8k(0x164))),chalk_1=__importDefault(require(a8k(0xd0))),fs=__importStar(require('fs')),utils_1=require('./utils'),api_helpers_1=require(a8k(0xb4)),inquirer_pagination_prompt_1=require(a8k(0xea)),inquirer=require(a8k(0xde)),inquirerSearchList=require(a8k(0xd3)),yaml=require(a8k(0xe7));function a8o(w,o){const C=a8w();return a8o=function(R,M){R=R-0x9a;let I=C[R];return I;},a8o(w,o);}var ConfirmChoices;(function(w){const t=a8k;w['YES']=t(0xd4),w[t(0x146)]=t(0xe5),w[t(0x179)]=t(0x121),w[t(0x174)]=t(0x19f),w['ABORT']=t(0x181);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(w){const g=a8k;this[g(0xeb)]=w,this[g(0xe1)]=0x32,this['editPayload']=o=>__awaiter(this,void 0x0,void 0x0,function*(){const h=g,{editedResult:C}=yield inquirer['prompt']([{'type':h(0xaa),'name':h(0x10c),'message':h(0x9c),'default':yaml[h(0x160)](o)}]);return yaml['safeLoad'](C);}),this['saveFile']=o=>__awaiter(this,void 0x0,void 0x0,function*(){const N=g,C=l=>'Unexpected\x20file\x20type:\x20'+l+N(0x184);function R(){return __awaiter(this,void 0x0,void 0x0,function*(){const T=a8o;return inquirer[T(0x16e)]([{'type':'input','name':T(0xd1),'message':T(0x127),'validate':l=>new RegExp('.*\x5c.(json|yaml|yml)$')[T(0xad)](l)?!![]:C(l)}]);});}const {fileName:M}=yield R(),I=M[N(0xdc)]()[N(0x10e)]('.')[N(0x14e)]();try{switch(I){case N(0x15f):(0x0,utils_1[N(0xa0)])(N(0xd5)+M);return fs[N(0x19d)](M,JSON['stringify'](o,null,'\x20\x20'));case N(0xfa):case N(0x154):(0x0,utils_1['success'])(N(0xd5)+M);return fs[N(0x19d)](M,yaml['safeDump'](o));default:(0x0,utils_1['warning'])(C(I));}}catch(l){(0x0,utils_1[N(0xe9)])(N(0xe4)+l[N(0x163)]);}return undefined;}),this[g(0x11a)]=(o,C)=>R=>{const s=g,M=typeof R===s(0x11d)?R[s(0x16a)]():R;return C===![]&&M==='don\x27t\x20change'?'':M;},this['validate']=(o,C,R)=>M=>{const d=g;if(this[d(0x198)]===!![])return!![];const I=[];if(M===''||M===d(0x135)){if(C!==![])I[d(0x15b)]('this\x20option\x20is\x20required,\x20please\x20answer');else return!![];}o[d(0x114)]===d(0x11d)&&!_[d(0x14f)](o[d(0x10f)])&&I[d(0x15b)](new RegExp(o[d(0x10f)])[d(0xad)](M)?!![]:d(0x13c)+o[d(0x10f)]+'\x27');o[d(0x114)]===d(0x11d)&&!_[d(0x14f)](o[d(0x13a)])&&I[d(0x15b)](M[d(0xcd)]>=o[d(0x13a)]?!![]:d(0x9b)+o['minLength']+'\x20characters,\x20is\x20'+M[d(0xcd)]+d(0x188));o[d(0x114)]===d(0x11d)&&!_[d(0x14f)](o['maxLength'])&&I['push'](M[d(0xcd)]<=o[d(0xa1)]?!![]:d(0xd2)+o['maxLength']+d(0xcf)+M[d(0xcd)]+'\x20characters');R&&Number['isNaN'](parseInt(M,0xa))&&I['push']('must\x20be\x20a\x20number,\x20is\x20'+M);o[d(0x114)]==='integer'&&!_[d(0x14f)](o[d(0x122)])&&I['push'](M>=o[d(0x122)]?!![]:'must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20'+o[d(0x122)]);o['type']==='integer'&&!_[d(0x14f)](o[d(0x12f)])&&I[d(0x15b)](M<=o['maximum']?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+o[d(0x12f)]);if(o[d(0x114)]===d(0x115)){const H=(0x0,utils_1[d(0x149)])(M);I[d(0x15b)](H===![]||_[d(0x187)](H)?d(0x173):!![]);}const l=I[d(0x11a)](F=>F!==!![]),a=(o===null||o===void 0x0?void 0x0:o[d(0x158)])?'\x0a'+chalk_1['default'][d(0xbe)]('>>')+'\x20Example:\x20'+chalk_1[d(0xce)][d(0x153)](JSON[d(0x156)](o['example'])):'';return l[d(0xcd)]>0x0?l[d(0xca)](chalk_1[d(0xce)][d(0x9f)](d(0x161)))+a:!![];},this[g(0x18d)]=(o,C,R)=>{const p=g,M=o[o[p(0xcd)]-0x1];function I(){const E=p;return o[E(0xf4)](0x0,-0x1)[E(0x131)](H=>H[E(0x145)](0x0)[E(0xdb)]()+H['slice'](0x1))[E(0xca)]('>');}const l=o['length']>0x1?chalk_1[p(0xce)]['bgGrey'][p(0x153)](I())+':\x20':'',a=R?'\x20('+chalk_1[p(0xce)][p(0x150)](R)+')':'';return chalk_1['default'][p(0x107)](''+l+C+'\x20'+chalk_1['default'][p(0xe6)][p(0x110)](M)+a+'?');},this['askForResource']=(o,C,R)=>__awaiter(this,void 0x0,void 0x0,function*(){const j=g;if(C['length']<0x1){const l=R?j(0x178)+R:j(0xb1);throw new Error(j(0x199)+o+'\x20'+l+'.');}const M=j(0x17a)+o+'\x20to\x20use:',I=C[j(0xcd)]>0x4?j(0xb0):j(0x195);return(yield inquirer[j(0x16e)]([{'type':I,'name':j(0xed),'message':M,'choices':C}]))['name'];}),this[g(0x16b)]=(o,C,R)=>__awaiter(this,void 0x0,void 0x0,function*(){const X=g,{elements:M,nextCursor:I}=yield C();if(M[X(0xcd)]<0x1){const H=R?'for\x20this\x20'+R:X(0xb1);throw new Error(X(0x199)+o+'\x20'+H+'.');}const l='Choose\x20the\x20'+o+X(0x17e);if(I!==undefined){const e=({nextPageCursor:F})=>__awaiter(this,void 0x0,void 0x0,function*(){const b=X,Q=yield C(F);return{'elements':Q['elements'],'nextPageCursor':Q[b(0x1a0)]};});return(yield inquirer[X(0x16e)]([{'type':'pagination-prompt','name':X(0xed),'message':l,'choices':M,'nextPageCursor':I,'loadMore':e}]))[X(0xed)];}const a=M[X(0xcd)]>0x4?'search-list':X(0x195);return(yield inquirer[X(0x16e)]([{'type':a,'name':'name','message':l,'choices':M}]))['name'];}),this[g(0x103)]=(o,C)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=g,R=''+(C?'('+chalk_1[u(0xce)][u(0x150)](C)+')\x20':''),M=u(0x12c)+chalk_1[u(0xce)][u(0x13b)](o)+'\x20'+R+u(0x18f),I=this[u(0x192)]({'type':u(0x11d),'required':!![]});return(yield inquirer['prompt']([{'type':u(0x14b),'name':u(0xed),'message':M,'validate':I}]))[u(0xed)];}),this[g(0xf2)]=o=>__awaiter(this,void 0x0,void 0x0,function*(){const S=g;return(yield inquirer[S(0x16e)]([{'type':S(0x13d),'name':S(0xed),'message':o,'default':!![]}]))[S(0xed)];}),this['askForService']=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const f=g,C=R=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const V=a8o;var I;const l=yield this[V(0xeb)][V(0x195)][V(0x130)]({'parameters':{'projectId':R},'options':{'per_page':this[V(0xe1)],'cursor':M}}),a=l[V(0xbc)][V(0x130)][V(0x131)](H=>H['id']);return{'elements':a,'nextCursor':(I=l[V(0x15a)])===null||I===void 0x0?void 0x0:I[V(0x19e)]};});return this[f(0x109)](f(0x175),C,o);}),this['askForTemplate']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=g,o=C=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=a8o;var R;const M=yield this[Z(0xeb)][Z(0x195)]['templates']({'options':{'per_page':this[Z(0xe1)],'cursor':C}}),I=M[Z(0xbc)][Z(0xee)][Z(0x131)](l=>l['id']);return{'elements':I,'nextCursor':(R=M[Z(0x15a)])===null||R===void 0x0?void 0x0:R[Z(0x19e)]};});return this['askForResourcePaginated'](G(0xa3),o);}),this[g(0xba)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const v=g,o=C=>__awaiter(this,void 0x0,void 0x0,function*(){const U=a8o;var R,M,I;const l=yield this[U(0xeb)][U(0x195)][U(0x18e)]({'options':{'per_page':this[U(0xe1)],'cursor':C}}),a=(M=(R=l[U(0xbc)][U(0x18e)])===null||R===void 0x0?void 0x0:R[U(0x131)](H=>H['id']))!==null&&M!==void 0x0?M:[];return{'elements':a,'nextCursor':(I=l[U(0x15a)])===null||I===void 0x0?void 0x0:I[U(0x19e)]};});return this[v(0x16b)](v(0x117),o);}),this[g(0xe8)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=g;if(_[y(0x14f)](o))throw new Error(y(0xc2));const C=R=>__awaiter(this,void 0x0,void 0x0,function*(){const P=y;var M;let I=this[P(0xe1)];const l=yield this['apiClient']['list']['templateRuns']({'parameters':{'templateId':o},'options':{'per_page':I,'cursor':R}}),a=l[P(0xbc)][P(0x166)][P(0x131)](H=>H['id']+'\x20(startedAt:\x20'+H[P(0xb5)]+')');return{'elements':a,'nextCursor':(M=l['pagination'])===null||M===void 0x0?void 0x0:M[P(0x19e)]};});return this[y(0x16b)](y(0x18b),C)[y(0xb2)](R=>R[y(0x10e)]('\x20')[0x0]);}),this[g(0x112)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=g,o=C=>__awaiter(this,void 0x0,void 0x0,function*(){const B=a8o;var R;let M=this[B(0xe1)];const I=yield this[B(0xeb)]['list'][B(0x159)]({'options':{'per_page':M,'cursor':C}}),l=I[B(0xbc)][B(0x159)]['map'](a=>a['id']);return{'elements':l,'nextCursor':(R=I['pagination'])===null||R===void 0x0?void 0x0:R[B(0x19e)]};});return this[J(0x16b)]('log\x20sink',o);}),this['askForPipeline']=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const w0=g,C=R=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a8o;var I;const l=yield this[Y(0xeb)][Y(0x195)][Y(0xf0)]({'parameters':{'projectId':R},'options':{'per_page':this[Y(0xe1)],'cursor':M}}),a=l[Y(0xbc)]['pipelines'][Y(0x131)](H=>H['id']);return{'elements':a,'nextCursor':(I=l[Y(0x15a)])===null||I===void 0x0?void 0x0:I['cursor']};});return this[w0(0x109)]('pipeline',C,o);}),this['askForJob']=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const w2=g,C=R=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const w1=a8o;var I;const l=yield this[w1(0xeb)][w1(0x195)][w1(0x125)]({'parameters':{'projectId':R},'options':{'per_page':this[w1(0xe1)],'cursor':M}}),a=l[w1(0xbc)][w1(0x125)]['map'](H=>H['id']);return{'elements':a,'nextCursor':(I=l[w1(0x15a)])===null||I===void 0x0?void 0x0:I['cursor']};});return this['askForProjectScopedResourcePaginated'](w2(0xaf),C,o);}),this[g(0xc5)]=(o,C,R=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const w3=g,M=w3(0x10b),I=l=>a=>__awaiter(this,void 0x0,void 0x0,function*(){const w4=w3;var H;const e=yield this[w4(0xeb)]['get'][w4(0xaf)][w4(0x183)]({'parameters':{'projectId':l,'jobId':o},'options':{'per_page':this[w4(0xe1)],'cursor':a}}),F=e['data'][w4(0x183)][w4(0x131)](Q=>Q['id']+w4(0xbd)+Q['startedAt']+')');return R&&F[w4(0x190)](M),{'elements':F,'nextCursor':(H=e[w4(0x15a)])===null||H===void 0x0?void 0x0:H[w4(0x19e)]};});return this[w3(0x109)](w3(0x1a1),I,C,w3(0x111)+o+'\x27')[w3(0xb2)](l=>{const w5=w3,a=l[w5(0x10e)]('\x20')[0x0];if(a===M)return undefined;return a;});}),this[g(0x134)]=(o,C,R,M=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const w7=g,I='all-builds';if(R!==undefined){const l=a=>H=>__awaiter(this,void 0x0,void 0x0,function*(){const w6=a8o;var e;const F=yield this['apiClient'][w6(0x113)][w6(0xaf)][w6(0xb7)]({'parameters':{'projectId':a,'jobId':R},'options':{'per_page':this[w6(0xe1)],'cursor':H}}),Q=F[w6(0xbc)][w6(0xb7)][w6(0x131)](L=>L['id']+w6(0xbd)+L['createdAt']+')');return M&&Q[w6(0x190)](I),{'elements':Q,'nextCursor':(e=F[w6(0x15a)])===null||e===void 0x0?void 0x0:e[w6(0x19e)]};});return this[w7(0x109)](w7(0xd7),l,o,'job:\x20\x27'+R+'\x27')['then'](a=>{const w8=w7,H=a[w8(0x10e)]('\x20')[0x0];if(H===I)return undefined;return H;});}if(C!==undefined){const a=H=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const w9=w7;var F;const Q=yield this[w9(0xeb)][w9(0x113)]['service'][w9(0xb7)]({'parameters':{'projectId':H,'serviceId':C},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':e}}),L=Q[w9(0xbc)][w9(0xb7)][w9(0x131)](z=>z['id']+w9(0xbd)+z['createdAt']+')');if(M)L[w9(0x190)](I);return{'elements':L,'nextCursor':(F=Q[w9(0x15a)])===null||F===void 0x0?void 0x0:F['cursor']};});return this['askForProjectScopedResourcePaginated']('service\x20build',a,o,w7(0x172)+R+'\x27')[w7(0xb2)](H=>{const e=H['split']('\x20')[0x0];if(e===I)return undefined;return e;});}throw new Error(w7(0x9e));}),this[g(0x17f)]=(o,C,R,M=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const ww=g,I=ww(0x19b);if(R!==undefined){const l=a=>H=>__awaiter(this,void 0x0,void 0x0,function*(){const wo=ww;var e,F;const Q=yield this['apiClient'][wo(0x113)]['job'][wo(0x15d)]({'parameters':{'projectId':a,'jobId':R},'options':{'per_page':this[wo(0xe1)],'cursor':H}}),L=(e=Q[wo(0xbc)][wo(0x15d)])!==null&&e!==void 0x0?e:[],z=L===null||L===void 0x0?void 0x0:L[wo(0x131)](i=>i[wo(0xed)]+wo(0xbd)+i[wo(0xb5)]+')');return M&&z['unshift'](I),{'elements':z,'nextCursor':(F=Q[wo(0x15a)])===null||F===void 0x0?void 0x0:F['cursor']};});return this['askForProjectScopedResourcePaginated'](ww(0x12b),l,o,ww(0x111)+R+'\x27')[ww(0xb2)](a=>{const wC=ww,H=a[wC(0x10e)]('\x20')[0x0];if(H===I)return undefined;return H;});}if(C!==undefined){const a=H=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const wR=ww;var F,Q;const L=yield this['apiClient'][wR(0x113)][wR(0x175)]['containers']({'parameters':{'projectId':H,'serviceId':C},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':e}}),z=(F=L[wR(0xbc)]['containers'])!==null&&F!==void 0x0?F:[],i=z['map'](q=>q[wR(0xed)]+wR(0xbd)+q[wR(0xb5)]+')');if(M)i===null||i===void 0x0?void 0x0:i['unshift'](I);return{'elements':i,'nextCursor':(Q=L['pagination'])===null||Q===void 0x0?void 0x0:Q[wR(0x19e)]};});return this['askForProjectScopedResourcePaginated'](ww(0x118),a,o,ww(0x172)+R+'\x27')[ww(0xb2)](H=>{const wM=ww,e=H[wM(0x10e)]('\x20')[0x0];if(e===I)return undefined;return e;});}throw new Error('No\x20containers\x20found');}),this['askForAddon']=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const wl=g,C=R=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const wI=a8o;var I;const l=yield this[wI(0xeb)][wI(0x195)][wI(0x137)]({'parameters':{'projectId':R},'options':{'per_page':this[wI(0xe1)],'cursor':M}});return{'elements':l[wI(0xbc)][wI(0x137)]['map'](a=>a['id']),'nextCursor':(I=l[wI(0x15a)])===null||I===void 0x0?void 0x0:I['cursor']};});return this[wl(0x109)]('addon',C,o);}),this[g(0xf7)]=(o,C)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const wH=g,R=M=>I=>__awaiter(this,void 0x0,void 0x0,function*(){const wa=a8o;var l;const a=yield this[wa(0xeb)][wa(0x113)]['addon']['backups']({'parameters':{'projectId':M,'addonId':C},'options':{'per_page':this[wa(0xe1)],'cursor':I}});return{'elements':a[wa(0xbc)][wa(0xfb)]['map'](H=>H['id']+'\x20(completedAt:\x20'+(H['completedAt']||wa(0xae))+')'),'nextCursor':(l=a[wa(0x15a)])===null||l===void 0x0?void 0x0:l[wa(0x19e)]};});return this[wH(0x109)]('backups',R,o,wH(0x124)+C+'\x27')[wH(0xb2)](M=>M[wH(0x10e)]('\x20')[0x0]);}),this['askForAddonRestore']=(o,C,R)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const wF=g,M=I=>l=>__awaiter(this,void 0x0,void 0x0,function*(){const we=a8o;var a;const H=yield this['apiClient'][we(0x113)][we(0x162)][we(0xa8)]({'parameters':{'projectId':I,'addonId':C,'backupId':R},'options':{'per_page':this[we(0xe1)],'cursor':l}});return{'elements':H[we(0xbc)][we(0xa8)][we(0x131)](e=>e['id']+we(0x128)+(e['completedAt']||we(0xae))+')'),'nextCursor':(a=H[we(0x15a)])===null||a===void 0x0?void 0x0:a[we(0x19e)]};});return this[wF(0x109)](wF(0xf3),M,o,'addon:\x20\x27'+C+'\x27')[wF(0xb2)](I=>I['split']('\x20')[0x0]);}),this['askForVolume']=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const wL=g,C=R=>__awaiter(this,void 0x0,void 0x0,function*(){const wQ=a8o;return(yield this['apiClient'][wQ(0x195)][wQ(0x119)]({'parameters':{'projectId':R}}))[wQ(0xbc)][wQ(0x131)](M=>M['id']);});return this[wL(0x133)](wL(0x120),C,o);}),this[g(0x176)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const C=R=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const wz=a8o;var I;const l=yield this[wz(0xeb)][wz(0x195)][wz(0x14a)]({'parameters':{'projectId':R},'options':{'per_page':this[wz(0xe1)],'cursor':M}});return{'elements':l['data'][wz(0x14a)][wz(0x131)](a=>a['id']),'nextCursor':(I=l['pagination'])===null||I===void 0x0?void 0x0:I[wz(0x19e)]};});return this['askForProjectScopedResourcePaginated']('secret',C,o);}),this[g(0xb8)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const wi=g,C=yield this[wi(0xeb)][wi(0x113)][wi(0x139)]({'parameters':{'domain':o}}),R=C[wi(0xbc)][wi(0xe3)][wi(0x131)](I=>I[wi(0xed)]+wi(0x132)+I['fullName']+')'),M='domain\x20('+o+')';return this['askForResource']('subdomain',R,M)[wi(0xb2)](I=>I[wi(0x10e)]('\x20')[0x0]);}),this[g(0x116)]=(o,C)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const wq=g,R=yield this['apiClient'][wq(0x195)][wq(0x17b)][wq(0x191)]({'parameters':{'domain':o,'subdomain':C}}),M=R[wq(0xbc)]['paths']['map'](l=>''+l[wq(0x186)]),I=wq(0x12a)+o+'),\x20subdomain\x20('+C+')';return this[wq(0x104)]('subdomainPath',M,I);}),this['deleteWarningPrompt']=o=>__awaiter(this,void 0x0,void 0x0,function*(){const wm=g;return(yield inquirer['prompt']([{'type':'confirm','name':'confirmation','message':chalk_1[wm(0xce)][wm(0x18a)](wm(0xe0)+(o||'a\x20Northflank\x20resource')+'.\x20This\x20is\x20irreversible.\x20Please\x20confirm!'),'default':![]}]))[wm(0x189)];}),this['loginPrompt']=(o,C)=>__awaiter(this,void 0x0,void 0x0,function*(){const wk=g;_['isUndefined'](o[wk(0xed)])&&(C[wk(0xcd)]<=0x0?_[wk(0x100)](o,wk(0xed),'default'):yield(0x0,utils_1[wk(0xd9)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const wK=wk,{name:R}=yield inquirer[wK(0x16e)]([{'type':wK(0x14b),'name':wK(0xed),'message':wK(0x193),'default':wK(0xbb)}]);if(!o[wK(0x126)]&&C[wK(0x123)](M=>M['name']===R)){const {c:M}=yield inquirer[wK(0x16e)]([{'type':wK(0x13d),'name':'c','message':wK(0x9d)+R+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(M===![])throw new Error(wK(0xa7));_[wK(0x100)](o,wK(0x126),!![]);}_[wK(0x100)](o,wK(0xed),R);})));if(_[wk(0x14f)](o[wk(0x11c)])){const R=yield this[wk(0xbf)]();_[wk(0x100)](o,'token',R);}return o;}),this['tokenPrompt']=()=>__awaiter(this,void 0x0,void 0x0,function*(){const wn=g,{token:o}=yield inquirer['prompt']([{'type':wn(0x16d),'name':wn(0x11c),'mask':'*','message':wn(0x108)}]);return o;}),inquirer[g(0x12d)]('search-list',inquirerSearchList),inquirer[g(0x12d)](g(0x106),inquirer_pagination_prompt_1[g(0x171)]);}[a8k(0xdd)](w,o){return __awaiter(this,void 0x0,void 0x0,function*(){const wW=a8o,C=yaml[wW(0x160)](w),R=_[wW(0x11f)](C['split']('\x0a')['map'](a=>a[wW(0xcd)])),M=chalk_1['default']['grey']('-'[wW(0x157)](R)+'\x0a'),{confirm:I}=yield inquirer[wW(0x16e)]([{'type':wW(0x195),'name':wW(0x13d),'message':''+chalk_1[wW(0xce)]['bold'][wW(0x13b)](wW(0x16f))+M+chalk_1[wW(0xce)][wW(0x19a)](C)+M,'choices':Object[wW(0xf9)](ConfirmChoices)}]);switch(I){case ConfirmChoices[wW(0xe2)]:return w;case ConfirmChoices[wW(0x170)]:throw new Error(wW(0x9a));case ConfirmChoices['REPEAT']:return this['retrievePayloadViaInteractiveCli'](o);case ConfirmChoices[wW(0x179)]:return this['confirmationPrompt'](yield this[wW(0xc1)](w),o);case ConfirmChoices['SAVE']:yield this[wW(0x15e)](w);return this[wW(0xdd)](w,o);default:throw new Error('Something\x20unexpected\x20happened.');}});}[a8k(0xd6)](w,o){return __awaiter(this,void 0x0,void 0x0,function*(){const wO=a8o;if((o===null||o===void 0x0?void 0x0:o[wO(0x185)])!==undefined)this[wO(0x185)]=o===null||o===void 0x0?void 0x0:o[wO(0x185)];this[wO(0x167)]=o===null||o===void 0x0?void 0x0:o[wO(0xfd)],this[wO(0x198)]=o===null||o===void 0x0?void 0x0:o[wO(0x198)];const C={};return yield this[wO(0xc0)]([],w['opt'][wO(0x151)],C),this[wO(0x185)]=C,yield this[wO(0xdd)](C,w);});}[a8k(0xc0)](w,o,C,R){return __awaiter(this,void 0x0,void 0x0,function*(){const wr=a8o;let M;if(o[wr(0x152)]&&!_[wr(0x194)](o,wr(0x13f))){if(o[wr(0x152)][wr(0xcd)]>0x1){const {choice:I}=yield inquirer['prompt']([{'type':wr(0x195),'name':wr(0xec),'message':wr(0x144)+(w[w[wr(0xcd)]-0x1]||'')+wr(0xb6),'choices':o[wr(0x152)]['map'](l=>{const wc=wr;var a;return(a=l[wc(0x138)])!==null&&a!==void 0x0?a:'??';})}]);M=yield this['getType'](w,o[wr(0x152)][wr(0x123)](l=>l[wr(0x138)]===I),C,R);}else{const l=o[wr(0x152)][0x0];_[wr(0x100)](l,wr(0x138),o[wr(0x138)]),M=yield this[wr(0xa2)](w,l,C,R);}M={};}else{if(o[wr(0x12e)]&&!_['has'](o,'properties')){if(o[wr(0x12e)][wr(0xcd)]>0x1){const {choice:a}=yield inquirer[wr(0x16e)]([{'type':wr(0x195),'name':wr(0xec),'message':wr(0x144)+(w[w['length']-0x1]||'')+wr(0xb6),'choices':[...o['anyOf'][wr(0x131)](H=>{const wA=wr;var e;return(e=H[wA(0x138)])!==null&&e!==void 0x0?e:'??';}),'don\x27t\x20change']}]);a!=='don\x27t\x20change'&&(M=yield this[wr(0xa2)](w,o[wr(0x12e)]['find'](H=>H[wr(0x138)]===a),C,R));}else{const H=o[wr(0x12e)][0x0];_['set'](H,'description',o['description']),M=yield this[wr(0xa2)](w,H,C,R);}M={};}else M=yield this[wr(0xa2)](w,o,C,R);}return M;});}[a8k(0x148)](w,o,C,R){var M;return __awaiter(this,void 0x0,void 0x0,function*(){const wx=a8o;if(R===![]){const {addEntry:a}=yield inquirer[wx(0x16e)]([{'type':wx(0x13d),'name':wx(0x196),'message':this[wx(0x18d)](o,wx(0xa5),w===null||w===void 0x0?void 0x0:w[wx(0x138)]),'default':![]}]);if(!a)return C;}const I=Object[wx(0x101)]((M=w===null||w===void 0x0?void 0x0:w[wx(0x13f)])!==null&&M!==void 0x0?M:[]),l=w['required']||[];if(I['length']>0x0)for(const H of I){const e=o[wx(0xf5)](H);if(o[wx(0xcd)]>0x0&&!_[wx(0x194)](C,o[wx(0xca)]('.')))_[wx(0x100)](C,o[wx(0xca)]('.'),{});yield this[wx(0xc0)](e,w[wx(0x13f)][H],C,l[wx(0xef)](H));}else yield this[wx(0xa2)](o,Object[wx(0xd8)](Object['assign']({},w),{'type':wx(0x115)}),C,R);return C;});}[a8k(0xb3)](w,o,C,R){return __awaiter(this,void 0x0,void 0x0,function*(){const wD=a8o;if(o&&C)return!![];const M=o?'Do\x20you\x20want\x20to\x20add':wD(0x141),{addEntry:I}=yield inquirer[wD(0x16e)]([{'type':wD(0x13d),'name':wD(0x196),'message':this[wD(0x18d)](w,M,o?R:undefined),'default':![]}]);return I;});}[a8k(0xa2)](w,o,C,R){return __awaiter(this,void 0x0,void 0x0,function*(){const wt=a8o;let M;const I=w[wt(0xca)]('.');switch(o===null||o===void 0x0?void 0x0:o[wt(0x114)]){case wt(0xc4):{let l=!![];while(yield this['askArrayEntry'](w,l,R,o===null||o===void 0x0?void 0x0:o[wt(0x138)])){const a=_[wt(0x113)](C,I);_['unset'](C,I),yield this[wt(0xa2)](w,o['items'],C);const H=_[wt(0x113)](C,I);!_[wt(0xa6)](a)?_[wt(0x100)](C,I,[H]):(a[wt(0x15b)](H),_[wt(0x100)](C,I,a)),l=![];}return M||[];}case wt(0x18c):{return M=yield this['getInnerType'](o,w,C,R),M;}case'rawObject':M=(0x0,utils_1[wt(0x149)])(yield this['ask'](w,o,R))||undefined;break;case wt(0x11d):case wt(0xfe):case wt(0xc7):default:M=yield this[wt(0x14c)](w,o,R,C);break;}return!_['isUndefined'](M)&&_[wt(0x100)](C,I,M),M;});}[a8k(0x14c)](w,o,C,R){var M;return __awaiter(this,void 0x0,void 0x0,function*(){const wg=a8o,I=w[w['length']-0x1],{defaultValue:defaultValue=(M=o===null||o===void 0x0?void 0x0:o['example'])!==null&&M!==void 0x0?M:o===null||o===void 0x0?void 0x0:o[wg(0xce)],choices:choices=o===null||o===void 0x0?void 0x0:o['enum'],pagination:l}=yield(0x0,api_helpers_1[wg(0x13e)])(I,this['apiClient'],this[wg(0x167)],R,this[wg(0xda)],w);let a=wg(0x14b);if(!_[wg(0x14f)](choices)&&choices[wg(0xcd)]>0x0){if(l!==undefined&&l['nextPageCursor']!==undefined)a='pagination-prompt';else choices[wg(0xcd)]>0x4&&typeof choices[0x0]==='string'?a=wg(0xb0):a=wg(0x195);}else{if((o===null||o===void 0x0?void 0x0:o[wg(0x114)])===wg(0xfe))a=wg(0x13d);else{if((o===null||o===void 0x0?void 0x0:o[wg(0x114)])===wg(0xc7))a=wg(0x14b);else(o===null||o===void 0x0?void 0x0:o['type'])===wg(0x115)&&(a=wg(0xaa));}}let H=C!==![]?!_['isObject'](defaultValue)?defaultValue:JSON[wg(0x156)](defaultValue):_[wg(0x15c)](defaultValue)?defaultValue:wg(0x135);if(choices)H=H[wg(0xdc)]();_['has'](this[wg(0x185)],w[wg(0xca)]('.'))&&(H=this['resultCache'][w[wg(0xca)]('.')]);const e=choices&&C===![]?[wg(0x135),...choices]:choices,F=(o===null||o===void 0x0?void 0x0:o['type'])===wg(0xc7),Q=Object[wg(0xd8)]({'type':a,'name':'id','message':this['getQuestionString'](w,o),'choices':e,'default':H,'filter':this[wg(0x11a)](a,C),'validate':this[wg(0x192)](o,C,F)},l),L=(yield inquirer[wg(0x16e)]([Q]))['id'];if(L===wg(0x135)||L==='')return undefined;if(F)return parseInt(L,0xa);return L;});}[a8k(0x129)](w,o){const wh=a8k,C=(o===null||o===void 0x0?void 0x0:o[wh(0x114)])!==wh(0xfe)?wh(0x16c):wh(0xa4);return this['getPathString'](w,C,o===null||o===void 0x0?void 0x0:o[wh(0x138)]);}[a8k(0xac)](){return __awaiter(this,void 0x0,void 0x0,function*(){const wT=a8o,w=o=>__awaiter(this,void 0x0,void 0x0,function*(){const wN=a8o;var C;const R=yield this[wN(0xeb)][wN(0x195)][wN(0x182)]({'options':{'per_page':this[wN(0xe1)],'cursor':o}}),M=R[wN(0xbc)]['projects']['map'](I=>I['id']);return{'elements':M,'nextCursor':(C=R[wN(0x15a)])===null||C===void 0x0?void 0x0:C[wN(0x19e)]};});return yield this[wT(0x16b)](wT(0xab),w);});}['askForProjectScopedResource'](w,o,C,R){return __awaiter(this,void 0x0,void 0x0,function*(){const ws=a8o,M=C||this['apiClient'][ws(0x165)]['getCurrentProjectName']();if(_[ws(0x14f)](M))throw new Error(ws(0x17c));const I=yield o(M);return yield this[ws(0x104)](w,I,(R?R+ws(0x142):'')+ws(0x11e)+M+'\x27');});}[a8k(0x109)](w,o,C,R){return __awaiter(this,void 0x0,void 0x0,function*(){const wd=a8o,M=C||this['apiClient']['contextProvider'][wd(0xf6)]();if(_[wd(0x14f)](M))throw new Error(wd(0x17c));const I=yield o(M);return yield this[wd(0x16b)](w,I,(R?R+wd(0x142):'')+wd(0x11e)+M+'\x27');});}[a8k(0xf8)](){return __awaiter(this,void 0x0,void 0x0,function*(){const wE=a8o,w=o=>__awaiter(this,void 0x0,void 0x0,function*(){const wp=a8o;var C;const R=yield this[wp(0xeb)][wp(0x195)]['domains']({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':o}});return{'elements':R[wp(0xbc)][wp(0x136)][wp(0x131)](M=>M[wp(0xed)]),'nextCursor':(C=R[wp(0x15a)])===null||C===void 0x0?void 0x0:C['cursor']};});return this[wE(0x16b)](wE(0x139),w);});}[a8k(0xf1)](){return __awaiter(this,void 0x0,void 0x0,function*(){const wX=a8o,w=o=>__awaiter(this,void 0x0,void 0x0,function*(){const wj=a8o;var C;const R=yield this['apiClient'][wj(0x195)]['registryCredentials']({'options':{'per_page':this[wj(0xe1)],'cursor':o}});return{'elements':R[wj(0xbc)][wj(0xc8)][wj(0x131)](M=>M['id']),'nextCursor':(C=R['pagination'])===null||C===void 0x0?void 0x0:C[wj(0x19e)]};});return this[wX(0x16b)](wX(0xc8),w);});}['setPathVars'](w){this['pathVars']=w;}}exports[a8k(0x10d)]=InquirerHelper;
|
|
1
|
+
'use strict';const a8L=a8D;(function(C,D){const u=a8D,V=C();while(!![]){try{const Y=parseInt(u(0x1c4))/0x1*(parseInt(u(0x22c))/0x2)+-parseInt(u(0x24f))/0x3*(parseInt(u(0x1c9))/0x4)+-parseInt(u(0x220))/0x5+parseInt(u(0x214))/0x6+parseInt(u(0x1f3))/0x7+parseInt(u(0x215))/0x8*(-parseInt(u(0x197))/0x9)+parseInt(u(0x19d))/0xa;if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a8C,0xaad76));var __createBinding=this&&this[a8L(0x26a)]||(Object[a8L(0x1bb)]?function(C,D,V,Y){const v=a8L;if(Y===undefined)Y=V;var e=Object['getOwnPropertyDescriptor'](D,V);(!e||(v(0x218)in e?!D['__esModule']:e[v(0x1a0)]||e['configurable']))&&(e={'enumerable':!![],'get':function(){return D[V];}}),Object[v(0x1f7)](C,Y,e);}:function(C,D,V,Y){if(Y===undefined)Y=V;C[Y]=D[V];}),__setModuleDefault=this&&this[a8L(0x1e0)]||(Object[a8L(0x1bb)]?function(C,D){const k=a8L;Object[k(0x1f7)](C,k(0x258),{'enumerable':!![],'value':D});}:function(C,D){const s=a8L;C[s(0x258)]=D;}),__importStar=this&&this[a8L(0x200)]||function(C){const h=a8L;if(C&&C['__esModule'])return C;var D={};if(C!=null){for(var V in C)if(V!==h(0x258)&&Object[h(0x23c)][h(0x1b2)]['call'](C,V))__createBinding(D,C,V);}return __setModuleDefault(D,C),D;},__awaiter=this&&this['__awaiter']||function(C,D,V,Y){function e(T){return T instanceof V?T:new V(function(W){W(T);});}return new(V||(V=Promise))(function(T,W){const y=a8D;function f(i){const j=a8D;try{G(Y[j(0x19a)](i));}catch(I){W(I);}}function q(i){const U=a8D;try{G(Y[U(0x183)](i));}catch(I){W(I);}}function G(i){const t=a8D;i[t(0x187)]?T(i[t(0x194)]):e(i['value'])['then'](f,q);}G((Y=Y[y(0x231)](C,D||[]))[y(0x19a)]());});},__importDefault=this&&this[a8L(0x191)]||function(C){const Z=a8L;return C&&C[Z(0x1fc)]?C:{'default':C};};Object[a8L(0x1f7)](exports,a8L(0x1fc),{'value':!![]}),exports['InquirerHelper']=void 0x0;function a8C(){const Cw=['tag','No,\x20but\x20save\x20as\x20file','boolean','isUndefined','throw','maxLength','askForPipeline','this\x20option\x20is\x20required,\x20please\x20answer','done','Please\x20confirm\x20following\x20configuration:\x0a','green','Writing\x20configuration\x20failed:\x20','volume','retry','saveFile','set','confirmationPrompt','askForResource','__importDefault','\x20characters,\x20is\x20','getPathString','value','services','safeLoad','8795502uBhIBQ','service','Choose\x20the\x20login\x20token:','next','addons','items','1917570ShpidW','for\x20this\x20','builds','writable','password','What\x20do\x20you\x20want\x20to\x20use\x20as','isEmpty','editor','grey','No\x20','cursor','No,\x20abort',',\x20supported\x20types:\x20[json|yaml|yml]','getCurrentProjectName','keys','REPEAT','template','templateRuns','domains','addEntry','DynamicReloadPaginationPrompt','hasOwnProperty','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','pipelines','yellowBright','pagination','\x20and\x20it\x20','message','confirm','askConfirm','create','jobs','logSinks','charAt','uri','main-context','unshift','token','registryCredentials','248128TtQSFY','Aborted.','askArrayEntry','\x20characters','\x20(startedAt:\x20','368hyVYhD','search-list','askForAddonBackup','askForResourcePaginated','test','job','nextPageCursor','then','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','InquirerHelper','enum','bgGrey','Configuration\x20file\x20written\x20to\x20','pathVars','runs','skipValidation','YES','oneOf','template\x20run','completedAt','askForBuild','repeat','toString','__setModuleDefault','Go\x20to\x20editor','addon','askForProject','isObject','tmpCmdPath','filter','trim','askForJobRun','askForCredentials','string','subdomain','integer','credentials','yaml','pop','),\x20subdomain\x20(','No,\x20repeat','project:\x20\x27','1507303UUnSQa','doesn\x27t\x20match\x20pattern\x20\x27','log\x20sink','bold','defineProperty','concat','slice','blue','object','__esModule','minLength','\x20to\x20use:','split','__importStar','contextProvider','inquirer','fullName','not\x20completed','all-job-runs','rawObject','No\x20builds\x20found','map','body','defaultPaginationPageSize','getQuestionString','opt','fetchResourceList','writeFileSync','path','max','don\x27t\x20change','askForDomain','askForTemplate','7664826QpccYj','8baSeyy','Choose\x20the\x20','projects','get','isArray','nextCursor','paths','greenBright','Should\x20it\x20be','js-yaml','retrievePayloadViaInteractiveCli','1104825exffJr','isNaN','createdAt','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','What\x27s\x20the\x20','confirmation','askForVolume','volumes','reset','No,\x20edit','askForAddonRestore','chalk','6zUMzfG','find','unset','type','has','apply','service:\x20\x27','override','minimum','EDIT','description','\x20type?','data','askForLogSink','red','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','prototype','maximum','input','askForProjectScopedResourcePaginated','underline','addon:\x20\x27','resultCache','askForSecret','choice','success','toUpperCase','\x20in\x20','askForAddon','stringify','tags','Do\x20you\x20want\x20to\x20add\x20more','\x20(full\x20domain:\x20','properties','whiteBright','17313cijwme','subdomains','values','includes','found','subdomainPath','list','example','\x20(completedAt:\x20','default','editPayload','askForSubdomainPath','service\x20containers','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','pattern','job:\x20\x27','project','registerPrompt','anyOf','templates','safeDump','service\x20build','warning','assign','prompt','SAVE','Unexpected\x20file\x20type:\x20','__createBinding','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','ABORT','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','isBoolean','join','apiClient','getType','a\x20Northflank\x20resource','isValidJSON','backups','tokenPrompt','pipeline','cmdPath','Template\x20id\x20not\x20provided.','name','deleteWarningPrompt','required','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','Context\x20name\x20already\x20exists.','domain\x20(','push','validate','length','containers','propToType','Do\x20you\x20want\x20to\x20add','ask','askForTemplateRun','domain','pagination-prompt'];a8C=function(){return Cw;};return a8C();}function a8D(C,D){const V=a8C();return a8D=function(Y,e){Y=Y-0x164;let T=V[Y];return T;},a8D(C,D);}const _=__importStar(require('lodash')),chalk_1=__importDefault(require(a8L(0x22b))),fs=__importStar(require('fs')),utils_1=require('./utils'),api_helpers_1=require('./api-helpers'),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require(a8L(0x202)),inquirerSearchList=require('inquirer-search-list'),yaml=require(a8L(0x21e));var ConfirmChoices;(function(C){const X=a8L;C[X(0x1d9)]='Yes,\x20send',C[X(0x1ac)]=X(0x1f1),C[X(0x235)]=X(0x229),C[X(0x268)]=X(0x180),C['ABORT']=X(0x1a8);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(C){const p=a8L;this[p(0x166)]=C,this['defaultPaginationPageSize']=0x32,this[p(0x259)]=D=>__awaiter(this,void 0x0,void 0x0,function*(){const M=p,{editedResult:V}=yield inquirer[M(0x267)]([{'type':M(0x1a4),'name':'editedResult','message':M(0x1e1),'default':yaml['safeDump'](D)}]);return yaml[M(0x196)](V);}),this[p(0x18d)]=D=>__awaiter(this,void 0x0,void 0x0,function*(){const n=p,V=f=>n(0x269)+f+n(0x1a9);function Y(){return __awaiter(this,void 0x0,void 0x0,function*(){const r=a8D;return inquirer[r(0x267)]([{'type':'input','name':'fileName','message':r(0x223),'validate':f=>new RegExp('.*\x5c.(json|yaml|yml)$')[r(0x1cd)](f)?!![]:V(f)}]);});}const {fileName:T}=yield Y(),W=T[n(0x1df)]()[n(0x1ff)]('.')[n(0x1ef)]();try{switch(W){case'json':(0x0,utils_1[n(0x245)])(n(0x1d5)+T);return fs[n(0x20e)](T,JSON[n(0x249)](D,null,'\x20\x20'));case n(0x1ee):case'yml':(0x0,utils_1[n(0x245)])(n(0x1d5)+T);return fs[n(0x20e)](T,yaml['safeDump'](D));default:(0x0,utils_1[n(0x265)])(V(W));}}catch(f){(0x0,utils_1[n(0x265)])(n(0x18a)+f[n(0x1b8)]);}return undefined;}),this['filter']=(D,V)=>Y=>{const l=p,e=typeof Y===l(0x1ea)?Y[l(0x1e7)]():Y;return V===![]&&e===l(0x211)?'':e;},this[p(0x176)]=(D,V,Y)=>e=>{const b=p;if(this['skipValidation']===!![])return!![];const T=[];if(e===''||e===b(0x211)){if(V!==![])T['push'](b(0x186));else return!![];}D[b(0x22f)]==='string'&&!_[b(0x182)](D[b(0x25d)])&&T[b(0x175)](new RegExp(D[b(0x25d)])['test'](e)?!![]:b(0x1f4)+D[b(0x25d)]+'\x27');D[b(0x22f)]===b(0x1ea)&&!_[b(0x182)](D['minLength'])&&T[b(0x175)](e['length']>=D[b(0x1fd)]?!![]:b(0x1d1)+D[b(0x1fd)]+'\x20characters,\x20is\x20'+e[b(0x177)]+b(0x1c7));D[b(0x22f)]===b(0x1ea)&&!_['isUndefined'](D['maxLength'])&&T[b(0x175)](e[b(0x177)]<=D['maxLength']?!![]:b(0x1b3)+D[b(0x184)]+b(0x192)+e[b(0x177)]+b(0x1c7));Y&&Number[b(0x221)](parseInt(e,0xa))&&T[b(0x175)]('must\x20be\x20a\x20number,\x20is\x20'+e);D[b(0x22f)]===b(0x1ec)&&!_['isUndefined'](D['minimum'])&&T[b(0x175)](e>=D[b(0x234)]?!![]:'must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20'+D[b(0x234)]);D['type']===b(0x1ec)&&!_['isUndefined'](D[b(0x23d)])&&T['push'](e<=D['maximum']?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+D[b(0x23d)]);if(D[b(0x22f)]===b(0x206)){const q=(0x0,utils_1[b(0x169)])(e);T[b(0x175)](q===![]||_[b(0x1a3)](q)?b(0x26b):!![]);}const W=T[b(0x1e6)](G=>G!==!![]),f=(D===null||D===void 0x0?void 0x0:D['example'])?'\x0a'+chalk_1[b(0x258)][b(0x23a)]('>>')+'\x20Example:\x20'+chalk_1[b(0x258)]['whiteBright'](JSON['stringify'](D[b(0x256)])):'';return W[b(0x177)]>0x0?W[b(0x165)](chalk_1[b(0x258)][b(0x240)](b(0x1b7)))+f:!![];},this[p(0x193)]=(D,V,Y)=>{const g=p,e=D[D['length']-0x1];function T(){const P=a8D;return D['slice'](0x0,-0x1)[P(0x208)](q=>q[P(0x1be)](0x0)[P(0x246)]()+q[P(0x1f9)](0x1))[P(0x165)]('>');}const W=D['length']>0x1?chalk_1['default'][g(0x1d4)][g(0x24e)](T())+':\x20':'',f=Y?'\x20('+chalk_1[g(0x258)][g(0x1fa)](Y)+')':'';return chalk_1['default'][g(0x228)](''+W+V+'\x20'+chalk_1[g(0x258)][g(0x1f6)][g(0x21c)](e)+f+'?');},this[p(0x190)]=(D,V,Y)=>__awaiter(this,void 0x0,void 0x0,function*(){const E=p;if(V[E(0x177)]<0x1){const W=Y?E(0x19e)+Y:E(0x253);throw new Error(E(0x1a6)+D+'\x20'+W+'.');}const e='Choose\x20the\x20'+D+E(0x1fe),T=V[E(0x177)]>0x4?'search-list':E(0x255);return(yield inquirer['prompt']([{'type':T,'name':E(0x16f),'message':e,'choices':V}]))[E(0x16f)];}),this[p(0x1cc)]=(D,V,Y)=>__awaiter(this,void 0x0,void 0x0,function*(){const o=p,{elements:e,nextCursor:T}=yield V();if(e[o(0x177)]<0x1){const q=Y?'for\x20this\x20'+Y:'found';throw new Error('No\x20'+D+'\x20'+q+'.');}const W=o(0x216)+D+o(0x1fe);if(T!==undefined){const G=({nextPageCursor:i})=>__awaiter(this,void 0x0,void 0x0,function*(){const w=o,I=yield V(i);return{'elements':I['elements'],'nextPageCursor':I[w(0x21a)]};});return(yield inquirer['prompt']([{'type':o(0x17e),'name':o(0x16f),'message':W,'choices':e,'nextPageCursor':T,'loadMore':G}]))[o(0x16f)];}const f=e[o(0x177)]>0x4?'search-list':o(0x255);return(yield inquirer[o(0x267)]([{'type':f,'name':o(0x16f),'message':W,'choices':e}]))[o(0x16f)];}),this['askGeneric']=(D,V)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A=p,Y=''+(V?'('+chalk_1[A(0x258)][A(0x1fa)](V)+')\x20':''),e='Enter\x20the\x20'+chalk_1[A(0x258)][A(0x189)](D)+'\x20'+Y+'to\x20use:',T=this[A(0x176)]({'type':A(0x1ea),'required':!![]});return(yield inquirer[A(0x267)]([{'type':'input','name':A(0x16f),'message':e,'validate':T}]))[A(0x16f)];}),this[p(0x1ba)]=D=>__awaiter(this,void 0x0,void 0x0,function*(){const N=p;return(yield inquirer[N(0x267)]([{'type':N(0x1b9),'name':'name','message':D,'default':!![]}]))[N(0x16f)];}),this['askForService']=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const B=p,V=Y=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const S=a8D;var T;const W=yield this[S(0x166)][S(0x255)][S(0x195)]({'parameters':{'projectId':Y},'options':{'per_page':this[S(0x20a)],'cursor':e}}),f=W[S(0x238)][S(0x195)]['map'](q=>q['id']);return{'elements':f,'nextCursor':(T=W[S(0x1b6)])===null||T===void 0x0?void 0x0:T[S(0x1a7)]};});return this[B(0x23f)](B(0x198),V,D);}),this[p(0x213)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=p,D=V=>__awaiter(this,void 0x0,void 0x0,function*(){const H=a8D;var Y;const e=yield this['apiClient'][H(0x255)][H(0x262)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':V}}),T=e[H(0x238)]['templates']['map'](W=>W['id']);return{'elements':T,'nextCursor':(Y=e['pagination'])===null||Y===void 0x0?void 0x0:Y[H(0x1a7)]};});return this[K(0x1cc)](K(0x1ad),D);}),this['askForTag']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const O=p,D=V=>__awaiter(this,void 0x0,void 0x0,function*(){const d=a8D;var Y,e,T;const W=yield this['apiClient'][d(0x255)][d(0x24a)]({'options':{'per_page':this[d(0x20a)],'cursor':V}}),f=(e=(Y=W[d(0x238)][d(0x24a)])===null||Y===void 0x0?void 0x0:Y[d(0x208)](q=>q['id']))!==null&&e!==void 0x0?e:[];return{'elements':f,'nextCursor':(T=W['pagination'])===null||T===void 0x0?void 0x0:T[d(0x1a7)]};});return this[O(0x1cc)](O(0x17f),D);}),this[p(0x17c)]=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=p;if(_[F(0x182)](D))throw new Error(F(0x16e));const V=Y=>__awaiter(this,void 0x0,void 0x0,function*(){const a=F;var e;let T=this[a(0x20a)];const W=yield this[a(0x166)][a(0x255)]['templateRuns']({'parameters':{'templateId':D},'options':{'per_page':T,'cursor':Y}}),f=W[a(0x238)][a(0x1ae)]['map'](q=>q['id']+a(0x1c8)+q[a(0x222)]+')');return{'elements':f,'nextCursor':(e=W[a(0x1b6)])===null||e===void 0x0?void 0x0:e[a(0x1a7)]};});return this[F(0x1cc)](F(0x1db),V)['then'](Y=>Y[F(0x1ff)]('\x20')[0x0]);}),this[p(0x239)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const x=p,D=V=>__awaiter(this,void 0x0,void 0x0,function*(){const R=a8D;var Y;let e=this[R(0x20a)];const T=yield this[R(0x166)][R(0x255)][R(0x1bd)]({'options':{'per_page':e,'cursor':V}}),W=T[R(0x238)][R(0x1bd)][R(0x208)](f=>f['id']);return{'elements':W,'nextCursor':(Y=T[R(0x1b6)])===null||Y===void 0x0?void 0x0:Y[R(0x1a7)]};});return this[x(0x1cc)](x(0x1f5),D);}),this[p(0x185)]=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const C1=p,V=Y=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const C0=a8D;var T;const W=yield this[C0(0x166)][C0(0x255)][C0(0x1b4)]({'parameters':{'projectId':Y},'options':{'per_page':this[C0(0x20a)],'cursor':e}}),f=W[C0(0x238)][C0(0x1b4)]['map'](q=>q['id']);return{'elements':f,'nextCursor':(T=W[C0(0x1b6)])===null||T===void 0x0?void 0x0:T[C0(0x1a7)]};});return this[C1(0x23f)](C1(0x16c),V,D);}),this['askForJob']=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const C3=p,V=Y=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const C2=a8D;var T;const W=yield this[C2(0x166)][C2(0x255)][C2(0x1bc)]({'parameters':{'projectId':Y},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':e}}),f=W['data'][C2(0x1bc)]['map'](q=>q['id']);return{'elements':f,'nextCursor':(T=W['pagination'])===null||T===void 0x0?void 0x0:T[C2(0x1a7)]};});return this[C3(0x23f)](C3(0x1ce),V,D);}),this[p(0x1e8)]=(D,V,Y=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const C4=p,e=C4(0x205),T=W=>f=>__awaiter(this,void 0x0,void 0x0,function*(){const C5=C4;var q;const G=yield this[C5(0x166)][C5(0x218)]['job']['runs']({'parameters':{'projectId':W,'jobId':D},'options':{'per_page':this[C5(0x20a)],'cursor':f}}),i=G['data'][C5(0x1d7)]['map'](I=>I['id']+C5(0x1c8)+I['startedAt']+')');return Y&&i['unshift'](e),{'elements':i,'nextCursor':(q=G['pagination'])===null||q===void 0x0?void 0x0:q[C5(0x1a7)]};});return this['askForProjectScopedResourcePaginated']('job\x20runs',T,V,'job:\x20\x27'+D+'\x27')[C4(0x1d0)](W=>{const C6=C4,f=W[C6(0x1ff)]('\x20')[0x0];if(f===e)return undefined;return f;});}),this[p(0x1dd)]=(D,V,Y,e=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const C8=p,T='all-builds';if(Y!==undefined){const W=f=>q=>__awaiter(this,void 0x0,void 0x0,function*(){const C7=a8D;var G;const i=yield this['apiClient'][C7(0x218)][C7(0x1ce)][C7(0x19f)]({'parameters':{'projectId':f,'jobId':Y},'options':{'per_page':this[C7(0x20a)],'cursor':q}}),I=i['data'][C7(0x19f)][C7(0x208)](m=>m['id']+C7(0x1c8)+m['createdAt']+')');return e&&I[C7(0x1c1)](T),{'elements':I,'nextCursor':(G=i[C7(0x1b6)])===null||G===void 0x0?void 0x0:G[C7(0x1a7)]};});return this[C8(0x23f)]('job\x20builds',W,D,C8(0x25e)+Y+'\x27')[C8(0x1d0)](f=>{const q=f['split']('\x20')[0x0];if(q===T)return undefined;return q;});}if(V!==undefined){const f=q=>G=>__awaiter(this,void 0x0,void 0x0,function*(){const C9=C8;var i;const I=yield this[C9(0x166)][C9(0x218)][C9(0x198)][C9(0x19f)]({'parameters':{'projectId':q,'serviceId':V},'options':{'per_page':this[C9(0x20a)],'cursor':G}}),m=I[C9(0x238)][C9(0x19f)][C9(0x208)](Q=>Q['id']+C9(0x1c8)+Q[C9(0x222)]+')');if(e)m[C9(0x1c1)](T);return{'elements':m,'nextCursor':(i=I[C9(0x1b6)])===null||i===void 0x0?void 0x0:i[C9(0x1a7)]};});return this[C8(0x23f)](C8(0x264),f,D,C8(0x232)+Y+'\x27')[C8(0x1d0)](q=>{const G=q['split']('\x20')[0x0];if(G===T)return undefined;return G;});}throw new Error(C8(0x207));}),this['askForContainer']=(D,V,Y,e=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const CD=p,T='all-containers';if(Y!==undefined){const W=f=>q=>__awaiter(this,void 0x0,void 0x0,function*(){const CC=a8D;var G,i;const I=yield this[CC(0x166)][CC(0x218)][CC(0x1ce)][CC(0x178)]({'parameters':{'projectId':f,'jobId':Y},'options':{'per_page':this[CC(0x20a)],'cursor':q}}),m=(G=I[CC(0x238)]['containers'])!==null&&G!==void 0x0?G:[],Q=m===null||m===void 0x0?void 0x0:m[CC(0x208)](J=>J[CC(0x16f)]+CC(0x1c8)+J[CC(0x222)]+')');return e&&Q[CC(0x1c1)](T),{'elements':Q,'nextCursor':(i=I['pagination'])===null||i===void 0x0?void 0x0:i[CC(0x1a7)]};});return this[CD(0x23f)]('job\x20containers',W,D,'job:\x20\x27'+Y+'\x27')[CD(0x1d0)](f=>{const q=f['split']('\x20')[0x0];if(q===T)return undefined;return q;});}if(V!==undefined){const f=q=>G=>__awaiter(this,void 0x0,void 0x0,function*(){const CV=CD;var i,I;const m=yield this[CV(0x166)][CV(0x218)][CV(0x198)]['containers']({'parameters':{'projectId':q,'serviceId':V},'options':{'per_page':this[CV(0x20a)],'cursor':G}}),Q=(i=m[CV(0x238)][CV(0x178)])!==null&&i!==void 0x0?i:[],J=Q[CV(0x208)](z=>z[CV(0x16f)]+CV(0x1c8)+z[CV(0x222)]+')');if(e)J===null||J===void 0x0?void 0x0:J[CV(0x1c1)](T);return{'elements':J,'nextCursor':(I=m[CV(0x1b6)])===null||I===void 0x0?void 0x0:I[CV(0x1a7)]};});return this[CD(0x23f)](CD(0x25b),f,D,CD(0x232)+Y+'\x27')['then'](q=>{const CY=CD,G=q[CY(0x1ff)]('\x20')[0x0];if(G===T)return undefined;return G;});}throw new Error('No\x20containers\x20found');}),this[p(0x248)]=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const CT=p,V=Y=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const Ce=a8D;var T;const W=yield this[Ce(0x166)][Ce(0x255)]['addons']({'parameters':{'projectId':Y},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':e}});return{'elements':W[Ce(0x238)][Ce(0x19b)][Ce(0x208)](f=>f['id']),'nextCursor':(T=W[Ce(0x1b6)])===null||T===void 0x0?void 0x0:T['cursor']};});return this[CT(0x23f)]('addon',V,D);}),this[p(0x1cb)]=(D,V)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Cf=p,Y=e=>T=>__awaiter(this,void 0x0,void 0x0,function*(){const CW=a8D;var W;const f=yield this[CW(0x166)][CW(0x218)][CW(0x1e2)][CW(0x16a)]({'parameters':{'projectId':e,'addonId':V},'options':{'per_page':this[CW(0x20a)],'cursor':T}});return{'elements':f[CW(0x238)]['backups'][CW(0x208)](q=>q['id']+CW(0x257)+(q['completedAt']||CW(0x204))+')'),'nextCursor':(W=f[CW(0x1b6)])===null||W===void 0x0?void 0x0:W['cursor']};});return this['askForProjectScopedResourcePaginated'](Cf(0x16a),Y,D,Cf(0x241)+V+'\x27')['then'](e=>e[Cf(0x1ff)]('\x20')[0x0]);}),this[p(0x22a)]=(D,V,Y)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const CG=p,e=T=>W=>__awaiter(this,void 0x0,void 0x0,function*(){const Cq=a8D;var f;const q=yield this[Cq(0x166)][Cq(0x218)]['addon']['restores']({'parameters':{'projectId':T,'addonId':V,'backupId':Y},'options':{'per_page':this[Cq(0x20a)],'cursor':W}});return{'elements':q[Cq(0x238)]['restores'][Cq(0x208)](G=>G['id']+'\x20(completedAt:\x20'+(G[Cq(0x1dc)]||Cq(0x204))+')'),'nextCursor':(f=q[Cq(0x1b6)])===null||f===void 0x0?void 0x0:f[Cq(0x1a7)]};});return this[CG(0x23f)]('restore',e,D,CG(0x241)+V+'\x27')['then'](T=>T[CG(0x1ff)]('\x20')[0x0]);}),this[p(0x226)]=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const CI=p,V=Y=>__awaiter(this,void 0x0,void 0x0,function*(){const Ci=a8D;return(yield this['apiClient']['list'][Ci(0x227)]({'parameters':{'projectId':Y}}))['data'][Ci(0x208)](e=>e['id']);});return this['askForProjectScopedResource'](CI(0x18b),V,D);}),this[p(0x243)]=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const V=Y=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const Cm=a8D;var T;const W=yield this[Cm(0x166)][Cm(0x255)]['secrets']({'parameters':{'projectId':Y},'options':{'per_page':this[Cm(0x20a)],'cursor':e}});return{'elements':W[Cm(0x238)]['secrets'][Cm(0x208)](f=>f['id']),'nextCursor':(T=W[Cm(0x1b6)])===null||T===void 0x0?void 0x0:T[Cm(0x1a7)]};});return this['askForProjectScopedResourcePaginated']('secret',V,D);}),this['askForSubdomain']=D=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const CQ=p,V=yield this['apiClient'][CQ(0x218)][CQ(0x17d)]({'parameters':{'domain':D}}),Y=V[CQ(0x238)][CQ(0x250)][CQ(0x208)](T=>T[CQ(0x16f)]+CQ(0x24c)+T[CQ(0x203)]+')'),e=CQ(0x174)+D+')';return this[CQ(0x190)](CQ(0x1eb),Y,e)[CQ(0x1d0)](T=>T[CQ(0x1ff)]('\x20')[0x0]);}),this[p(0x25a)]=(D,V)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const CJ=p,Y=yield this[CJ(0x166)][CJ(0x255)]['subdomain'][CJ(0x20f)]({'parameters':{'domain':D,'subdomain':V}}),e=Y['data'][CJ(0x21b)]['map'](W=>''+W[CJ(0x1bf)]),T=CJ(0x174)+D+CJ(0x1f0)+V+')';return this[CJ(0x190)](CJ(0x254),e,T);}),this[p(0x170)]=D=>__awaiter(this,void 0x0,void 0x0,function*(){const Cz=p;return(yield inquirer['prompt']([{'type':Cz(0x1b9),'name':Cz(0x225),'message':chalk_1[Cz(0x258)][Cz(0x1b5)](Cz(0x26d)+(D||Cz(0x168))+Cz(0x23b)),'default':![]}]))['confirmation'];}),this['loginPrompt']=(D,V)=>__awaiter(this,void 0x0,void 0x0,function*(){const Cu=p;_['isUndefined'](D['name'])&&(V[Cu(0x177)]<=0x0?_[Cu(0x18e)](D,'name',Cu(0x258)):yield(0x0,utils_1[Cu(0x18c)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const CL=Cu,{name:Y}=yield inquirer[CL(0x267)]([{'type':CL(0x23e),'name':CL(0x16f),'message':'Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','default':CL(0x1c0)}]);if(!D[CL(0x233)]&&V['find'](e=>e[CL(0x16f)]===Y)){const {c:e}=yield inquirer[CL(0x267)]([{'type':'confirm','name':'c','message':'Context\x20with\x20name\x20\x27'+Y+CL(0x172),'default':![]}]);if(e===![])throw new Error(CL(0x173));_['set'](D,CL(0x233),!![]);}_[CL(0x18e)](D,'name',Y);})));if(_[Cu(0x182)](D[Cu(0x1c2)])){const Y=yield this[Cu(0x16b)]();_[Cu(0x18e)](D,Cu(0x1c2),Y);}return D;}),this[p(0x16b)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Cv=p,{token:D}=yield inquirer['prompt']([{'type':Cv(0x1a1),'name':Cv(0x1c2),'mask':'*','message':Cv(0x199)}]);return D;}),inquirer[p(0x260)]('search-list',inquirerSearchList),inquirer[p(0x260)](p(0x17e),inquirer_pagination_prompt_1[p(0x1b1)]);}[a8L(0x18f)](C,D){return __awaiter(this,void 0x0,void 0x0,function*(){const Ck=a8D,V=yaml[Ck(0x263)](C),Y=_[Ck(0x210)](V[Ck(0x1ff)]('\x0a')[Ck(0x208)](W=>W[Ck(0x177)])),e=chalk_1[Ck(0x258)][Ck(0x1a5)]('-'[Ck(0x1de)](Y)+'\x0a'),{confirm:T}=yield inquirer[Ck(0x267)]([{'type':Ck(0x255),'name':'confirm','message':''+chalk_1[Ck(0x258)]['bold'][Ck(0x189)](Ck(0x188))+e+chalk_1[Ck(0x258)]['blueBright'](V)+e,'choices':Object[Ck(0x251)](ConfirmChoices)}]);switch(T){case ConfirmChoices['YES']:return C;case ConfirmChoices[Ck(0x26c)]:throw new Error(Ck(0x1c5));case ConfirmChoices[Ck(0x1ac)]:return this[Ck(0x21f)](D);case ConfirmChoices[Ck(0x235)]:return this[Ck(0x18f)](yield this[Ck(0x259)](C),D);case ConfirmChoices[Ck(0x268)]:yield this[Ck(0x18d)](C);return this[Ck(0x18f)](C,D);default:throw new Error('Something\x20unexpected\x20happened.');}});}[a8L(0x21f)](C,D){return __awaiter(this,void 0x0,void 0x0,function*(){const Cs=a8D;if((D===null||D===void 0x0?void 0x0:D[Cs(0x242)])!==undefined)this[Cs(0x242)]=D===null||D===void 0x0?void 0x0:D[Cs(0x242)];this['tmpCmdPath']=D===null||D===void 0x0?void 0x0:D[Cs(0x16d)],this[Cs(0x1d8)]=D===null||D===void 0x0?void 0x0:D['skipValidation'];const V={};return yield this['propToType']([],C[Cs(0x20c)][Cs(0x209)],V),this[Cs(0x242)]=V,yield this[Cs(0x18f)](V,C);});}[a8L(0x179)](C,D,V,Y){return __awaiter(this,void 0x0,void 0x0,function*(){const Ch=a8D;let e;if(D[Ch(0x1da)]&&!_[Ch(0x230)](D,Ch(0x24d))){if(D[Ch(0x1da)][Ch(0x177)]>0x1){const {choice:T}=yield inquirer['prompt']([{'type':Ch(0x255),'name':'choice','message':Ch(0x224)+(C[C[Ch(0x177)]-0x1]||'')+Ch(0x237),'choices':D[Ch(0x1da)][Ch(0x208)](W=>{const Cj=Ch;var f;return(f=W[Cj(0x236)])!==null&&f!==void 0x0?f:'??';})}]);e=yield this[Ch(0x167)](C,D[Ch(0x1da)]['find'](W=>W[Ch(0x236)]===T),V,Y);}else{const W=D[Ch(0x1da)][0x0];_[Ch(0x18e)](W,Ch(0x236),D[Ch(0x236)]),e=yield this['getType'](C,W,V,Y);}e={};}else{if(D[Ch(0x261)]&&!_[Ch(0x230)](D,Ch(0x24d))){if(D[Ch(0x261)][Ch(0x177)]>0x1){const {choice:f}=yield inquirer[Ch(0x267)]([{'type':Ch(0x255),'name':Ch(0x244),'message':Ch(0x224)+(C[C[Ch(0x177)]-0x1]||'')+Ch(0x237),'choices':[...D['anyOf']['map'](q=>{const CU=Ch;var G;return(G=q[CU(0x236)])!==null&&G!==void 0x0?G:'??';}),Ch(0x211)]}]);f!==Ch(0x211)&&(e=yield this[Ch(0x167)](C,D[Ch(0x261)][Ch(0x22d)](q=>q[Ch(0x236)]===f),V,Y));}else{const q=D['anyOf'][0x0];_[Ch(0x18e)](q,Ch(0x236),D[Ch(0x236)]),e=yield this['getType'](C,q,V,Y);}e={};}else e=yield this[Ch(0x167)](C,D,V,Y);}return e;});}['getInnerType'](C,D,V,Y){var e;return __awaiter(this,void 0x0,void 0x0,function*(){const Ct=a8D;if(Y===![]){const {addEntry:f}=yield inquirer[Ct(0x267)]([{'type':Ct(0x1b9),'name':Ct(0x1b0),'message':this[Ct(0x193)](D,'Do\x20you\x20want\x20to\x20add',C===null||C===void 0x0?void 0x0:C[Ct(0x236)]),'default':![]}]);if(!f)return V;}const T=Object[Ct(0x1ab)]((e=C===null||C===void 0x0?void 0x0:C[Ct(0x24d)])!==null&&e!==void 0x0?e:[]),W=C[Ct(0x171)]||[];if(T[Ct(0x177)]>0x0)for(const q of T){const G=D[Ct(0x1f8)](q);if(D['length']>0x0&&!_[Ct(0x230)](V,D[Ct(0x165)]('.')))_['set'](V,D[Ct(0x165)]('.'),{});yield this[Ct(0x179)](G,C[Ct(0x24d)][q],V,W[Ct(0x252)](q));}else yield this[Ct(0x167)](D,Object['assign'](Object[Ct(0x266)]({},C),{'type':Ct(0x206)}),V,Y);return V;});}[a8L(0x1c6)](C,D,V,Y){return __awaiter(this,void 0x0,void 0x0,function*(){const Cy=a8D;if(D&&V)return!![];const e=D?Cy(0x17a):Cy(0x24b),{addEntry:T}=yield inquirer['prompt']([{'type':Cy(0x1b9),'name':Cy(0x1b0),'message':this[Cy(0x193)](C,e,D?Y:undefined),'default':![]}]);return T;});}[a8L(0x167)](C,D,V,Y){return __awaiter(this,void 0x0,void 0x0,function*(){const CZ=a8D;let e;const T=C['join']('.');switch(D===null||D===void 0x0?void 0x0:D[CZ(0x22f)]){case'array':{let W=!![];while(yield this[CZ(0x1c6)](C,W,Y,D===null||D===void 0x0?void 0x0:D[CZ(0x236)])){const f=_[CZ(0x218)](V,T);_[CZ(0x22e)](V,T),yield this['getType'](C,D[CZ(0x19c)],V);const q=_[CZ(0x218)](V,T);!_[CZ(0x219)](f)?_[CZ(0x18e)](V,T,[q]):(f['push'](q),_[CZ(0x18e)](V,T,f)),W=![];}return e||[];}case CZ(0x1fb):{return e=yield this['getInnerType'](D,C,V,Y),e;}case CZ(0x206):e=(0x0,utils_1[CZ(0x169)])(yield this['ask'](C,D,Y))||undefined;break;case CZ(0x1ea):case CZ(0x181):case CZ(0x1ec):default:e=yield this[CZ(0x17b)](C,D,Y,V);break;}return!_['isUndefined'](e)&&_[CZ(0x18e)](V,T,e),e;});}['ask'](C,D,V,Y){var e;return __awaiter(this,void 0x0,void 0x0,function*(){const CX=a8D,T=C[C[CX(0x177)]-0x1],{defaultValue:defaultValue=(e=D===null||D===void 0x0?void 0x0:D[CX(0x256)])!==null&&e!==void 0x0?e:D===null||D===void 0x0?void 0x0:D[CX(0x258)],choices:choices=D===null||D===void 0x0?void 0x0:D[CX(0x1d3)],pagination:W}=yield(0x0,api_helpers_1[CX(0x20d)])(T,this[CX(0x166)],this[CX(0x1e5)],Y,this[CX(0x1d6)],C);let f=CX(0x23e);if(!_['isUndefined'](choices)&&choices[CX(0x177)]>0x0){if(W!==undefined&&W[CX(0x1cf)]!==undefined)f=CX(0x17e);else choices[CX(0x177)]>0x4&&typeof choices[0x0]===CX(0x1ea)?f=CX(0x1ca):f=CX(0x255);}else{if((D===null||D===void 0x0?void 0x0:D[CX(0x22f)])===CX(0x181))f='confirm';else{if((D===null||D===void 0x0?void 0x0:D[CX(0x22f)])===CX(0x1ec))f=CX(0x23e);else(D===null||D===void 0x0?void 0x0:D[CX(0x22f)])===CX(0x206)&&(f=CX(0x1a4));}}let q=V!==![]?!_[CX(0x1e4)](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[CX(0x164)](defaultValue)?defaultValue:CX(0x211);if(choices)q=q[CX(0x1df)]();_[CX(0x230)](this[CX(0x242)],C[CX(0x165)]('.'))&&(q=this[CX(0x242)][C[CX(0x165)]('.')]);const G=choices&&V===![]?['don\x27t\x20change',...choices]:choices,i=(D===null||D===void 0x0?void 0x0:D[CX(0x22f)])===CX(0x1ec),I=Object[CX(0x266)]({'type':f,'name':'id','message':this[CX(0x20b)](C,D),'choices':G,'default':q,'filter':this[CX(0x1e6)](f,V),'validate':this[CX(0x176)](D,V,i)},W),m=(yield inquirer[CX(0x267)]([I]))['id'];if(m==='don\x27t\x20change'||m==='')return undefined;if(i)return parseInt(m,0xa);return m;});}[a8L(0x20b)](C,D){const Cp=a8L,V=(D===null||D===void 0x0?void 0x0:D['type'])!==Cp(0x181)?Cp(0x1a2):Cp(0x21d);return this['getPathString'](C,V,D===null||D===void 0x0?void 0x0:D[Cp(0x236)]);}[a8L(0x1e3)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Cn=a8D,C=D=>__awaiter(this,void 0x0,void 0x0,function*(){const CM=a8D;var V;const Y=yield this['apiClient'][CM(0x255)][CM(0x217)]({'options':{'per_page':this[CM(0x20a)],'cursor':D}}),e=Y[CM(0x238)][CM(0x217)]['map'](T=>T['id']);return{'elements':e,'nextCursor':(V=Y[CM(0x1b6)])===null||V===void 0x0?void 0x0:V[CM(0x1a7)]};});return yield this[Cn(0x1cc)](Cn(0x25f),C);});}['askForProjectScopedResource'](C,D,V,Y){return __awaiter(this,void 0x0,void 0x0,function*(){const Cr=a8D,e=V||this[Cr(0x166)][Cr(0x201)][Cr(0x1aa)]();if(_[Cr(0x182)](e))throw new Error(Cr(0x25c));const T=yield D(e);return yield this['askForResource'](C,T,(Y?Y+Cr(0x247):'')+Cr(0x1f2)+e+'\x27');});}[a8L(0x23f)](C,D,V,Y){return __awaiter(this,void 0x0,void 0x0,function*(){const Cl=a8D,e=V||this[Cl(0x166)][Cl(0x201)]['getCurrentProjectName']();if(_[Cl(0x182)](e))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const T=yield D(e);return yield this['askForResourcePaginated'](C,T,(Y?Y+'\x20in\x20':'')+Cl(0x1f2)+e+'\x27');});}[a8L(0x212)](){return __awaiter(this,void 0x0,void 0x0,function*(){const CP=a8D,C=D=>__awaiter(this,void 0x0,void 0x0,function*(){const Cb=a8D;var V;const Y=yield this[Cb(0x166)][Cb(0x255)][Cb(0x1af)]({'options':{'per_page':this[Cb(0x20a)],'cursor':D}});return{'elements':Y[Cb(0x238)]['domains'][Cb(0x208)](e=>e[Cb(0x16f)]),'nextCursor':(V=Y['pagination'])===null||V===void 0x0?void 0x0:V['cursor']};});return this[CP(0x1cc)](CP(0x17d),C);});}[a8L(0x1e9)](){return __awaiter(this,void 0x0,void 0x0,function*(){const CE=a8D,C=D=>__awaiter(this,void 0x0,void 0x0,function*(){const Cg=a8D;var V;const Y=yield this[Cg(0x166)][Cg(0x255)][Cg(0x1c3)]({'options':{'per_page':this[Cg(0x20a)],'cursor':D}});return{'elements':Y[Cg(0x238)][Cg(0x1ed)][Cg(0x208)](e=>e['id']),'nextCursor':(V=Y['pagination'])===null||V===void 0x0?void 0x0:V[Cg(0x1a7)]};});return this[CE(0x1cc)](CE(0x1ed),C);});}['setPathVars'](C){const Co=a8L;this[Co(0x1d6)]=C;}}exports[a8L(0x1d2)]=InquirerHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a9D(C,D){const V=a9C();return a9D=function(Y,e){Y=Y-0xe1;let T=V[Y];return T;},a9D(C,D);}const a9h=a9D;function a9C(){const B=['init-ack','end','default','5952480TyHluz','next','done','type','__createBinding','1775STAtTn','__importDefault','987219IOrWaK','createWebSocketStream','toString','apply','hasOwnProperty','9948MTdmyn','6408904UvvHeq','9uXDQDF','11TwjlMJ','prototype','throw','writable','http:','EventEmitter','7051290pNGOYO','388ElrBDs','https:','stringify','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','replace','SIGINT','call','wss:','__esModule','Failure\x20during\x20login:\x20','browser-opened','ws:','__importStar','message','value','create','defineProperty','Unexpected\x20response,\x20api\x20token\x20missing','error','baseUrl','data','parse','aborted','open','30wvOdnR','2409CKnmhV','init','duplex','openBrowser','/v1/cli-login','login-success','NorthflankApiBrowserLogin','events','error\x20happened\x20during\x20browser\x20login:\x20','status','success','handleError','exit','idle','finally','Unable\x20to\x20open\x20browser:\x20','get','initPackage','1008434kfxVVL'];a9C=function(){return B;};return a9C();}(function(C,D){const s=a9D,V=C();while(!![]){try{const Y=-parseInt(s(0x10d))/0x1*(-parseInt(s(0xf4))/0x2)+-parseInt(s(0xe5))/0x3+-parseInt(s(0xea))/0x4*(parseInt(s(0xe3))/0x5)+parseInt(s(0x10c))/0x6*(-parseInt(s(0x11f))/0x7)+parseInt(s(0xeb))/0x8+parseInt(s(0xec))/0x9*(parseInt(s(0xf3))/0xa)+parseInt(s(0xed))/0xb*(parseInt(s(0x123))/0xc);if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a9C,0x83310));var __createBinding=this&&this[a9h(0xe2)]||(Object[a9h(0x103)]?function(C,D,V,Y){const j=a9h;if(Y===undefined)Y=V;var e=Object['getOwnPropertyDescriptor'](D,V);(!e||(j(0x11d)in e?!D[j(0xfc)]:e[j(0xf0)]||e['configurable']))&&(e={'enumerable':!![],'get':function(){return D[V];}}),Object['defineProperty'](C,Y,e);}:function(C,D,V,Y){if(Y===undefined)Y=V;C[Y]=D[V];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a9h(0x103)]?function(C,D){const U=a9h;Object['defineProperty'](C,U(0x122),{'enumerable':!![],'value':D});}:function(C,D){const t=a9h;C[t(0x122)]=D;}),__importStar=this&&this[a9h(0x100)]||function(C){const y=a9h;if(C&&C[y(0xfc)])return C;var D={};if(C!=null){for(var V in C)if(V!==y(0x122)&&Object[y(0xee)][y(0xe9)][y(0xfa)](C,V))__createBinding(D,C,V);}return __setModuleDefault(D,C),D;},__awaiter=this&&this['__awaiter']||function(C,D,V,Y){function e(T){return T instanceof V?T:new V(function(W){W(T);});}return new(V||(V=Promise))(function(T,W){const M=a9D;function f(i){const Z=a9D;try{G(Y[Z(0x124)](i));}catch(I){W(I);}}function q(i){const X=a9D;try{G(Y[X(0xef)](i));}catch(I){W(I);}}function G(i){const p=a9D;i[p(0x125)]?T(i[p(0x102)]):e(i[p(0x102)])['then'](f,q);}G((Y=Y[M(0xe8)](C,D||[]))['next']());});},__importDefault=this&&this[a9h(0xe4)]||function(C){const n=a9h;return C&&C[n(0xfc)]?C:{'default':C};};Object[a9h(0x104)](exports,a9h(0xfc),{'value':!![]}),exports[a9h(0x113)]=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a9h(0x10b))),events_1=require(a9h(0x114));class NorthflankApiBrowserLogin extends events_1[a9h(0xf2)]{constructor(C,D=!![]){const r=a9h;super(),this[r(0x107)]=C,this['openBrowser']=D,this['status']=r(0x11a),this[r(0x11e)]=()=>JSON[r(0xf6)]({'type':r(0x10e)});}['startLogin'](){const l=a9h;var C;const D=this[l(0x107)][l(0xf8)](l(0xf5),l(0xfb))[l(0xf8)](l(0xf1),l(0xff)),V=D+l(0x111),Y=new ws_1['default'](V),e=()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=l;yield new Promise(W=>{const b=a9D;var f;(f=this['duplex'])===null||f===void 0x0?void 0x0:f[b(0x121)](JSON['stringify']({'type':b(0x10a)}),()=>W());}),process[P(0x119)]();}),T=new Promise((W,f)=>{const g=l;var q,G,i;try{this[g(0x10f)]=(0x0,ws_1[g(0xe6)])(Y),process['on'](g(0xf9),e);}catch(I){f(new Error(g(0xf7)+I['message']));}(q=this[g(0x10f)])===null||q===void 0x0?void 0x0:q['on'](g(0x108),m=>{const E=g;var Q;const J=JSON[E(0x109)](m[E(0xe7)]());switch(J===null||J===void 0x0?void 0x0:J[E(0xe1)]){case E(0x120):{const {loginPage:z}=J;if(z===undefined){this[E(0x118)]('Unexpected\x20response',f);return;}this[E(0x110)]&&(0x0,open_1[E(0x122)])(z)['catch'](u=>{const o=E,L=o(0x11c)+u['message'];this[o(0x118)](L,f);});this['emit'](E(0xfe),{'url':z});break;}case E(0x112):{const {apiToken:u,contextName:L}=J;if(u===undefined){this['handleError'](E(0x105),f);return;}(Q=this['duplex'])===null||Q===void 0x0?void 0x0:Q[E(0x121)](),W({'token':u,'contextName':L}),this[E(0x116)]=E(0x117);break;}case'login-failure':{const v=E(0xfd)+(J===null||J===void 0x0?void 0x0:J[E(0x101)]);this[E(0x118)](v,f);break;}default:{const k='unable\x20to\x20parse\x20message:\x20'+JSON['stringify'](J);this[E(0x118)](k,f);}}}),(G=this[g(0x10f)])===null||G===void 0x0?void 0x0:G['on']('error',m=>{const w=g;this[w(0x118)](w(0x115)+m[w(0x101)],f);}),(i=this[g(0x10f)])===null||i===void 0x0?void 0x0:i['on'](g(0x121),()=>{const A=g;if(this[A(0x116)]===A(0x117)){}else this[A(0x118)]('Login\x20process\x20stopped\x20before\x20completed',f);});});return(C=this[l(0x10f)])===null||C===void 0x0?void 0x0:C['write'](this[l(0x11e)]()),this[l(0x116)]=l(0x10e),T[l(0x11b)](()=>{const N=l;process['removeListener'](N(0xf9),e);});}['handleError'](C,D){const S=a9h;var V,Y;D?(V=this[S(0x10f)])===null||V===void 0x0?void 0x0:V[S(0x121)](()=>D(new Error(C))):(Y=this[S(0x10f)])===null||Y===void 0x0?void 0x0:Y[S(0x121)](),this[S(0x116)]=S(0x106);}}exports[a9h(0x113)]=NorthflankApiBrowserLogin;
|
package/dist/logs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a10y=a10o;function a10o(w,o){const C=a10w();return a10o=function(R,M){R=R-0x19e;let I=C[R];return I;},a10o(w,o);}(function(w,o){const v=a10o,C=w();while(!![]){try{const R=parseInt(v(0x231))/0x1+parseInt(v(0x22d))/0x2*(parseInt(v(0x1c1))/0x3)+parseInt(v(0x1b6))/0x4*(-parseInt(v(0x1dd))/0x5)+-parseInt(v(0x1e5))/0x6*(-parseInt(v(0x233))/0x7)+-parseInt(v(0x21a))/0x8*(-parseInt(v(0x1e6))/0x9)+-parseInt(v(0x1ec))/0xa+-parseInt(v(0x20d))/0xb*(parseInt(v(0x1be))/0xc);if(R===o)break;else C['push'](C['shift']());}catch(M){C['push'](C['shift']());}}}(a10w,0x71339));var __awaiter=this&&this[a10y(0x1d3)]||function(w,o,C,R){function M(I){return I instanceof C?I:new C(function(l){l(I);});}return new(C||(C=Promise))(function(I,l){const J=a10o;function a(F){try{e(R['next'](F));}catch(Q){l(Q);}}function H(F){const P=a10o;try{e(R[P(0x1f0)](F));}catch(Q){l(Q);}}function e(F){const B=a10o;F[B(0x1ca)]?I(F[B(0x230)]):M(F[B(0x230)])['then'](a,H);}e((R=R[J(0x1db)](w,o||[]))['next']());});},__importDefault=this&&this[a10y(0x204)]||function(w){const Y=a10y;return w&&w[Y(0x1d7)]?w:{'default':w};};function a10w(){const wo=['toISOString','askForAddonRestore',',\x20from:\x20','@northflank/js-client',',\x20to:\x20','15520xvGVvM','\x0aDetails:\x20','defaultDurationSeconds','addonBackup','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','getCurrentServiceName','./log-formatter','\x20to\x20get\x20logs\x20from','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','conflicts','\x20--','backward','restoreId','values','job','--endTime\x20<timestamp>','askForJobRun','>\x20Container\x20logs','parseDateInput','26ZOMsKz','getSeconds',',\x20duration:\x20','value','864202BwOFVD','-t,\x20--types\x20<types...>','1595783VgKuMS','Project\x20for\x20logs','--duration\x20[duration]','addon','alias','assign','yaml','serviceId','printResponse','../utils','jobId','logsApiClient','Id]','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','textIncludes','json','--textIncludes\x20<text>','format','InquirerHelper','-f,\x20--tail','details','printInitInfo','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','--restore\x20--restoreId\x20[restoreId]','Number\x20of\x20lines\x20to\x20return.','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','172pZJwiD','apiContext','regexIncludes','\x20for\x20all\x20containers','addOption','textNotIncludes','Backup\x20to\x20get\x20logs\x20from','forEach','60ZdXoAM','defineProperty','logs','77841qYoowa','option','runId','askForAddonBackup','askForJob','service','getCommand','getStandardLogCommand','pagination','done','CliLogs','name','Id\x20[','commander','--container\x20--containerId\x20[containerId]','backupId','tsHint','getLogsCommand','__awaiter','error','hasNextPage',',\x20backup\x20id\x20','__esModule','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','length','forward','apply','\x20seconds','38490DKwkXv','Which\x20log\x20types\x20to\x20fetch','start','slice','ApiClient','customUserAgent','bold','--run\x20--runId\x20[runId]','6mJDYQl','576JxpjkR','logTail','Restore\x20to\x20get\x20logs\x20from','formatLogLine','description','\x20of\x20','1263500VcWwzJ','yml','../inquirer-helper','Log\x20session\x20ended','throw','regexNotIncludes','tail','--build\x20--buildId\x20[buildId]','containerId','--project\x20--projectId\x20[projectId]','LogType','default','-o,\x20--output\x20[output]','message','--regexNotIncludes\x20<regex>','--backup\x20--backupId\x20[backupId]','choices','noDefaults','close','getCurrentJobName','log','valueOf','getFormatter','getCurrentProjectName','__importDefault','--regexIncludes\x20<regex>','\x20for\x20container\x20','inquirerHelper','askForAddon','setSeconds','Option','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','toUpperCase','1391731xWSzkt','assertContextExisting','\x20with\x20live-tailing','-l,\x20--lineLimit\x20[limit]','Build\x20to\x20get\x20logs\x20from','--noDefaults','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','build-'];a10w=function(){return wo;};return a10w();}Object[a10y(0x1bf)](exports,a10y(0x1d7),{'value':!![]}),exports['CliLogs']=void 0x0;const js_client_1=require(a10y(0x218)),chalk_1=__importDefault(require('chalk')),utils_1=require(a10y(0x1a5)),inquirer_helper_1=require(a10y(0x1ee)),commander_1=require(a10y(0x1ce)),console_format_helpers_1=require('../formatting/console-format-helpers'),log_formatter_1=require(a10y(0x220));class CliLogs{constructor(w){const w0=a10y;this[w0(0x1b7)]=w,this[w0(0x21c)]=0x708,this[w0(0x1c8)]=(o,C,R,M)=>{const w1=w0,I=(0x0,utils_1[w1(0x1c7)])(!![])[w1(0x1cc)]((C?'build-':'')+w1(0x1c0))[w1(0x1a0)]((C?w1(0x214):'')+w1(0x200))[w1(0x1ea)]('Get\x20log\x20for\x20the\x20specified\x20'+o)[w1(0x1c2)](w1(0x1f5),w1(0x234))[w1(0x1c2)]('--'+o+w1(0x224)+o+w1(0x1cd)+o+w1(0x1a8),o['charAt'](0x0)[w1(0x20c)]()+o[w1(0x1e0)](0x1)+w1(0x221))[w1(0x1c2)](w1(0x1cf),'Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)');if(C)I['option'](w1(0x1f3),w1(0x211));if(o===w1(0x228))I[w1(0x1c2)](w1(0x1e4),w1(0x213));if(R)I[w1(0x1c2)](w1(0x1fb),w1(0x1bc));if(M)I[w1(0x1c2)](w1(0x1b3),w1(0x1e8));return!C&&!R&&!M&&I[w1(0x1ba)](new commander_1['Option'](w1(0x232),w1(0x1de))[w1(0x1fc)](Object['values'](js_client_1[w1(0x1f6)]))),I[w1(0x1c2)](w1(0x1af),'Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.')[w1(0x1c2)](w1(0x210),w1(0x1b4))[w1(0x1c2)]('--startTime\x20<timestamp>','Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1[w1(0x1d1)],utils_1[w1(0x22c)])['addOption'](new commander_1['Option'](w1(0x229),w1(0x21e)+utils_1[w1(0x1d1)])['argParser'](utils_1['parseDateInput'])[w1(0x223)]([w1(0x1f2)]))[w1(0x1c2)](w1(0x19e),w1(0x1a9))['addOption'](new commander_1[(w1(0x20a))]('-d,\x20--direction\x20<order>','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.')[w1(0x1fc)]([w1(0x225),w1(0x1da)])[w1(0x223)]([w1(0x1f2)]))[w1(0x1ba)](new commander_1['Option'](w1(0x1ac),'Filter\x20log\x20lines\x20to\x20include\x20this\x20text')[w1(0x223)]([w1(0x1bb),'regexIncludes',w1(0x1f1)]))[w1(0x1ba)](new commander_1[(w1(0x20a))]('--textNotIncludes\x20<text>','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text')[w1(0x223)]([w1(0x1aa),w1(0x1b8),'regexNotIncludes']))[w1(0x1ba)](new commander_1[(w1(0x20a))](w1(0x205),'Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression')[w1(0x223)]([w1(0x1bb),w1(0x1aa),'regexNotIncludes']))[w1(0x1ba)](new commander_1[(w1(0x20a))](w1(0x1fa),w1(0x20b))[w1(0x223)]([w1(0x1bb),w1(0x1b8),w1(0x1aa)]))[w1(0x1c2)](w1(0x212),'Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])['addOption'](new commander_1['Option'](w1(0x1f8),w1(0x222))[w1(0x1fc)](Object[w1(0x227)]([w1(0x1ad),w1(0x1ab),w1(0x1a2)]))),I;},this[w0(0x1b1)]=(o,C,R,M)=>{const w2=w0,{containerName:I,restoreId:l,backupId:a,quiet:H,tail:e,startTime:F,endTime:Q,duration:L}=M;if(H===!![])return;const z=e?'\x20(exit\x20with\x20'+chalk_1['default'][w2(0x1e3)]('\x27Ctrl+C\x27')+')':'',i=e?w2(0x20f):'',q=new Date(),m=F!==null&&F!==void 0x0?F:new Date(new Date((Q!==null&&Q!==void 0x0?Q:q)[w2(0x201)]())['setSeconds']((Q!==null&&Q!==void 0x0?Q:q)['getSeconds']()-(L!==null&&L!==void 0x0?L:this[w2(0x21c)]))),k=(Q!==null&&Q!==void 0x0?Q:F!==undefined)?new Date(new Date(F[w2(0x201)]())[w2(0x209)](F[w2(0x22e)]()+(L!==null&&L!==void 0x0?L:this[w2(0x21c)]))):q,K=a!==undefined,n=m&&!K?w2(0x217)+chalk_1['default'][w2(0x1e3)](m[w2(0x215)]()):'',W=k&&!K?w2(0x219)+chalk_1[w2(0x1f7)]['bold'](k[w2(0x215)]()):'',O=L?w2(0x22f)+L+w2(0x1dc):'',r=I?w2(0x206)+chalk_1['default']['bold'](I):K?'':w2(0x1b9),c=a?w2(0x1d6)+a:'',A=l?',\x20restore\x20id\x20'+l:'',x=o+'\x20'+chalk_1[w2(0x1f7)][w2(0x1e3)](C)+c+A+'\x20in\x20project\x20'+chalk_1[w2(0x1f7)]['bold'](R),D=''+n+W+O;console[w2(0x200)](w2(0x22b)+i+r+w2(0x1eb)+x+D+z+':');},this[w0(0x202)]=(o,C)=>(R,M)=>{const w3=w0;if(!o){if(R[w3(0x1d9)]===0x0)console[w3(0x200)](w3(0x1b2));R[w3(0x1bd)](I=>(0x0,log_formatter_1[w3(0x1e9)])(I,C));}else(0x0,console_format_helpers_1[w3(0x1a4)])(o,R);(M===null||M===void 0x0?void 0x0:M[w3(0x1d5)])&&(0x0,utils_1['warning'])(w3(0x1d8)+M['cursor']);},this['apiClient']=new js_client_1[(w0(0x1e1))](w,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[w0(0x1e2)]}),this[w0(0x1a7)]=this['apiClient'],this[w0(0x207)]=new inquirer_helper_1[(w0(0x1ae))](this['apiClient']);}[a10y(0x1d2)](w,o=![],C=![],R=![]){const M=(F,Q)=>__awaiter(this,void 0x0,void 0x0,function*(){const w4=a10o,L=Q[w4(0x1fd)],{apiContext:z,inquirerHelper:i}=this;switch(w){case w4(0x1c6):{const q=L?undefined:z[w4(0x21f)]();return Q[w4(0x1a3)]||q||(yield i['askForService'](F)());}case w4(0x228):{const m=L?undefined:z[w4(0x1ff)]();return Q[w4(0x1a6)]||m||(yield i[w4(0x1c5)](F)());}case w4(0x19f):{return Q['addonId']||(yield i[w4(0x208)](F)());}}}),I=(F,Q,L)=>__awaiter(this,void 0x0,void 0x0,function*(){const w5=a10o;if(o)return L['buildId']||(yield this[w5(0x207)]['askForBuild'](F,w===w5(0x1c6)?Q:undefined,w===w5(0x228)?Q:undefined,!![])());return undefined;}),l=(F,Q,L)=>__awaiter(this,void 0x0,void 0x0,function*(){const w6=a10o;if(C||R)return L[w6(0x1d0)]||(yield this['inquirerHelper'][w6(0x1c4)](F,Q)());return undefined;}),a=(F,Q,L,z)=>__awaiter(this,void 0x0,void 0x0,function*(){const w7=a10o;if(R)return z[w7(0x226)]||(yield this[w7(0x207)][w7(0x216)](F,Q,L)());return undefined;}),H=(F,Q,L)=>__awaiter(this,void 0x0,void 0x0,function*(){const w8=a10o;if(!o&&L[w8(0x1f4)]!==undefined){if(L['containerId']!==!![])return L[w8(0x1f4)];return yield this['inquirerHelper']['askForContainer'](F,w==='service'?Q:undefined,w===w8(0x228)?Q:undefined,!![])();}return undefined;}),e=(F,Q,L)=>__awaiter(this,void 0x0,void 0x0,function*(){const w9=a10o;if(w==='job')return L[w9(0x1c3)]||(yield this[w9(0x207)][w9(0x22a)](Q,F,!![])());return undefined;});return this['getStandardLogCommand'](w,o,C,R)['action'](F=>__awaiter(this,void 0x0,void 0x0,function*(){const ww=a10o,{noDefaults:Q,projectId:L,quiet:z,tail:i,types:q,textIncludes:m,textNotIncludes:k,regexIncludes:K,regexNotIncludes:n,direction:W,lineLimit:O,startTime:r,endTime:c,duration:A,output:x}=F;(0x0,utils_1[ww(0x20e)])(this['apiClient']);const {apiContext:D,inquirerHelper:t,logsApiClient:g}=this,h=Q?undefined:D[ww(0x203)](),N=L||h||(yield t['askForProject']()),T=yield M(N,F),s=yield I(N,T,F),d=yield l(N,T,F),p=yield a(N,T,d,F),E=yield e(N,T,F),j=yield H(N,T,F);if(r&&c&&A)throw new Error(ww(0x1b5));const X={'projectId':N,'entityId':T},b={'containerName':j,'types':q,'textIncludes':m,'textNotIncludes':k,'regexIncludes':K,'regexNotIncludes':n,'lineLimit':O,'startTime':r,'duration':A,'runId':E,'buildId':s,'backupId':d,'restoreId':p,'isBuild':o!==null&&o!==void 0x0?o:![]},u=R?'addonRestore':C?ww(0x21d):w,S=Object[ww(0x1a1)](Object['assign']({},b),{'endTime':c,'direction':W});if(!z&&x!==ww(0x1a2)&&x!==ww(0x1ed)&&x!==ww(0x1ab))this[ww(0x1b1)](w,T,N,Object['assign'](Object[ww(0x1a1)]({},S),F));const V=this[ww(0x202)](x,m!==null&&m!==void 0x0?m:K);if(i){const f=yield g[ww(0x1c0)][ww(0x1e7)](X,b,u);f['on']('logs-received',V),f['on'](ww(0x1d4),Z=>(0x0,utils_1[ww(0x1d4)])('Error\x20while\x20tailing\x20log\x20lines:\x20'+Z[ww(0x1f9)])),f['on'](ww(0x1fe),()=>console['log'](ww(0x1ef))),yield f[ww(0x1df)]();}else{const Z=yield g[ww(0x1c0)]['logRange'](X,S,u);if(Z[ww(0x1d4)]){const G=Z[ww(0x1d4)][ww(0x1b0)],U=G?ww(0x21b)+JSON['stringify'](G,null,'\x20'):'';(0x0,utils_1[ww(0x1d4)])('Error\x20while\x20fetching\x20log\x20lines:\x20'+Z[ww(0x1d4)][ww(0x1f9)]+U);}else V(Z['data'],Z[ww(0x1c9)]);}}));}}exports[a10y(0x1cb)]=CliLogs;
|
|
1
|
+
'use strict';const a10a=a10D;(function(C,D){const F=a10D,V=C();while(!![]){try{const Y=-parseInt(F(0x1a3))/0x1+parseInt(F(0x191))/0x2+parseInt(F(0x19c))/0x3+parseInt(F(0x1a8))/0x4*(parseInt(F(0x1ef))/0x5)+-parseInt(F(0x161))/0x6+parseInt(F(0x1a0))/0x7*(-parseInt(F(0x1da))/0x8)+parseInt(F(0x171))/0x9*(parseInt(F(0x1ee))/0xa);if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a10C,0x4d378));var __awaiter=this&&this[a10a(0x187)]||function(C,D,V,Y){function e(T){return T instanceof V?T:new V(function(W){W(T);});}return new(V||(V=Promise))(function(T,W){const C1=a10D;function f(i){const R=a10D;try{G(Y[R(0x169)](i));}catch(I){W(I);}}function q(i){const x=a10D;try{G(Y[x(0x1c3)](i));}catch(I){W(I);}}function G(i){const C0=a10D;i[C0(0x197)]?T(i[C0(0x1e2)]):e(i[C0(0x1e2)])[C0(0x1e1)](f,q);}G((Y=Y[C1(0x15d)](C,D||[]))[C1(0x169)]());});},__importDefault=this&&this[a10a(0x177)]||function(C){const C2=a10a;return C&&C[C2(0x1db)]?C:{'default':C};};function a10C(){const CT=['--noDefaults','askForJobRun','CliLogs','regexIncludes','__awaiter','option','getCurrentProjectName','choices','askForBuild',',\x20restore\x20id\x20','-d,\x20--direction\x20<order>','-l,\x20--lineLimit\x20[limit]','job','--deployment\x20--deploymentId\x20[deploymentId]','31184kavJBZ','./log-formatter','../inquirer-helper','\x20(exit\x20with\x20','backupId','Error\x20while\x20tailing\x20log\x20lines:\x20','done','alias','description','getFormatter','data','956754SnhNgs','getCurrentServiceName','tsHint','toUpperCase','4011749WgngCU','build-','--restore\x20--restoreId\x20[restoreId]','314298NvjDhd','parseDateInput','warning','defaultDurationSeconds','logs','214712WombwS','yml','conflicts','--textNotIncludes\x20<text>','cursor','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','Restore\x20to\x20get\x20logs\x20from','textIncludes','setSeconds','../utils','-t,\x20--types\x20<types...>','Deployment\x20id,\x20example:\x20my-service-54785f4','apiContext','logs-received','getCommand','getLogsCommand','Log\x20session\x20ended','Error\x20while\x20fetching\x20log\x20lines:\x20','containerId','logTail','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','noDefaults','bold','argParser','formatLogLine','\x20seconds','throw',',\x20backup\x20id\x20','buildId','valueOf','printInitInfo','serviceId','--project\x20--projectId\x20[projectId]','inquirerHelper','Which\x20log\x20types\x20to\x20fetch','\x20to\x20get\x20logs\x20from','stringify','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','logRange','name','askForProject','forward','details','getSeconds','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','Build\x20to\x20get\x20logs\x20from','regexNotIncludes','message','askForAddon','8JkxFou','__esModule',',\x20from:\x20','deploymentId','yaml','log','close','then','value','getCurrentJobName','length','hasNextPage','addonBackup','\x20in\x20project\x20','Id\x20[','values','printResponse','forEach','\x20of\x20','error','70WGxCMz','25gwMDAa','json','start','defineProperty','Number\x20of\x20lines\x20to\x20return.','-f,\x20--tail','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','toISOString','apply','charAt','logsApiClient','commander','981774FWjyZC','LogType','assign','askForService','\x20for\x20container\x20','--backup\x20--backupId\x20[backupId]','addOption','action','next','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','tail','ApiClient','-o,\x20--output\x20[output]','askForContainer','Option','--textIncludes\x20<text>','982818nKgRbj','\x20with\x20live-tailing','apiClient','../formatting/console-format-helpers','service','--build\x20--buildId\x20[buildId]','__importDefault','--regexIncludes\x20<regex>','--container\x20--containerId\x20[containerId]','textNotIncludes','@northflank/js-client','default','addon','\x20for\x20all\x20containers','getStandardLogCommand','customUserAgent','addonId',',\x20to:\x20'];a10C=function(){return CT;};return a10C();}Object[a10a(0x1f2)](exports,a10a(0x1db),{'value':!![]}),exports[a10a(0x185)]=void 0x0;function a10D(C,D){const V=a10C();return a10D=function(Y,e){Y=Y-0x15a;let T=V[Y];return T;},a10D(C,D);}const js_client_1=require(a10a(0x17b)),chalk_1=__importDefault(require('chalk')),utils_1=require(a10a(0x1b1)),inquirer_helper_1=require(a10a(0x193)),commander_1=require(a10a(0x160)),console_format_helpers_1=require(a10a(0x174)),log_formatter_1=require(a10a(0x192));class CliLogs{constructor(C){const C3=a10a;this[C3(0x1b4)]=C,this[C3(0x1a6)]=0x708,this[C3(0x17f)]=(D,V,Y,e)=>{const C4=C3,T=(0x0,utils_1[C4(0x1b6)])(!![])[C4(0x1d0)]((V?C4(0x1a1):'')+C4(0x1a7))[C4(0x198)]((V?C4(0x1a1):'')+C4(0x1df))[C4(0x199)]('Get\x20log\x20for\x20the\x20specified\x20'+D)['option'](C4(0x1c9),'Project\x20for\x20logs')['option']('--'+D+'\x20--'+D+C4(0x1e8)+D+'Id]',D[C4(0x15e)](0x0)[C4(0x19f)]()+D['slice'](0x1)+C4(0x1cc))[C4(0x188)](C4(0x179),'Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)');if(V)T[C4(0x188)](C4(0x176),C4(0x1d6));if(D==='job')T['option']('--run\x20--runId\x20[runId]',C4(0x1bc));if(D===C4(0x175))T[C4(0x188)](C4(0x190),C4(0x1b3));if(Y)T[C4(0x188)](C4(0x166),'Backup\x20to\x20get\x20logs\x20from');if(e)T['option'](C4(0x1a2),C4(0x1ae));return!V&&!Y&&!e&&T[C4(0x167)](new commander_1[(C4(0x16f))](C4(0x1b2),C4(0x1cb))[C4(0x18a)](Object[C4(0x1e9)](js_client_1[C4(0x162)]))),T[C4(0x188)](C4(0x15a),'Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.')[C4(0x188)](C4(0x18e),C4(0x1f3))['option']('--startTime\x20<timestamp>','Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1['tsHint'],utils_1[C4(0x1a4)])['addOption'](new commander_1['Option']('--endTime\x20<timestamp>',C4(0x1ad)+utils_1[C4(0x19e)])[C4(0x1c0)](utils_1[C4(0x1a4)])[C4(0x1aa)]([C4(0x16b)]))[C4(0x188)]('--duration\x20[duration]',C4(0x16a))[C4(0x167)](new commander_1[(C4(0x16f))](C4(0x18d),'Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.')[C4(0x18a)](['backward',C4(0x1d2)])[C4(0x1aa)]([C4(0x16b)]))[C4(0x167)](new commander_1['Option'](C4(0x170),'Filter\x20log\x20lines\x20to\x20include\x20this\x20text')[C4(0x1aa)]([C4(0x17a),C4(0x186),C4(0x1d7)]))[C4(0x167)](new commander_1[(C4(0x16f))](C4(0x1ab),C4(0x1ce))[C4(0x1aa)]([C4(0x1af),C4(0x186),C4(0x1d7)]))[C4(0x167)](new commander_1[(C4(0x16f))](C4(0x178),'Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression')[C4(0x1aa)]([C4(0x17a),C4(0x1af),C4(0x1d7)]))[C4(0x167)](new commander_1['Option']('--regexNotIncludes\x20<regex>',C4(0x15b))[C4(0x1aa)]([C4(0x17a),C4(0x186),C4(0x1af)]))['option'](C4(0x183),'Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])[C4(0x167)](new commander_1[(C4(0x16f))](C4(0x16d),'Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[C4(0x18a)](Object[C4(0x1e9)](['format',C4(0x1f0),C4(0x1de)]))),T;},this[C3(0x1c7)]=(D,V,Y,e)=>{const C5=C3,{containerName:T,restoreId:W,backupId:f,quiet:q,tail:G,startTime:i,endTime:I,duration:m}=e;if(q===!![])return;const Q=G?C5(0x194)+chalk_1[C5(0x17c)][C5(0x1bf)]('\x27Ctrl+C\x27')+')':'',J=G?C5(0x172):'',z=new Date(),u=i!==null&&i!==void 0x0?i:new Date(new Date((I!==null&&I!==void 0x0?I:z)[C5(0x1c6)]())[C5(0x1b0)]((I!==null&&I!==void 0x0?I:z)[C5(0x1d4)]()-(m!==null&&m!==void 0x0?m:this['defaultDurationSeconds']))),L=(I!==null&&I!==void 0x0?I:i!==undefined)?new Date(new Date(i[C5(0x1c6)]())[C5(0x1b0)](i[C5(0x1d4)]()+(m!==null&&m!==void 0x0?m:this[C5(0x1a6)]))):z,v=f!==undefined,k=u&&!v?C5(0x1dc)+chalk_1[C5(0x17c)][C5(0x1bf)](u[C5(0x15c)]()):'',s=L&&!v?C5(0x182)+chalk_1[C5(0x17c)]['bold'](L[C5(0x15c)]()):'',h=m?',\x20duration:\x20'+m+C5(0x1c2):'',j=T?C5(0x165)+chalk_1[C5(0x17c)]['bold'](T):v?'':C5(0x17e),U=f?C5(0x1c4)+f:'',t=W?C5(0x18c)+W:'',y=D+'\x20'+chalk_1[C5(0x17c)][C5(0x1bf)](V)+U+t+C5(0x1e7)+chalk_1[C5(0x17c)][C5(0x1bf)](Y),Z=''+k+s+h;console[C5(0x1df)]('>\x20Container\x20logs'+J+j+C5(0x1ec)+y+Z+Q+':');},this[C3(0x19a)]=(D,V)=>(Y,e)=>{const C6=C3;if(!D){if(Y[C6(0x1e4)]===0x0)console[C6(0x1df)](C6(0x1d5));Y[C6(0x1eb)](T=>(0x0,log_formatter_1[C6(0x1c1)])(T,V));}else(0x0,console_format_helpers_1[C6(0x1ea)])(D,Y);(e===null||e===void 0x0?void 0x0:e[C6(0x1e5)])&&(0x0,utils_1[C6(0x1a5)])('Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20'+e[C6(0x1ac)]);},this[C3(0x173)]=new js_client_1[(C3(0x16c))](C,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[C3(0x180)]}),this[C3(0x15f)]=this[C3(0x173)],this['inquirerHelper']=new inquirer_helper_1['InquirerHelper'](this[C3(0x173)]);}[a10a(0x1b7)](C,D=![],V=![],Y=![]){const CY=a10a,e=(I,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const C7=a10D,Q=m[C7(0x1be)],{apiContext:J,inquirerHelper:z}=this;switch(C){case C7(0x175):{const u=Q?undefined:J[C7(0x19d)]();return m[C7(0x1c8)]||u||(yield z[C7(0x164)](I)());}case C7(0x18f):{const L=Q?undefined:J[C7(0x1e3)]();return m['jobId']||L||(yield z['askForJob'](I)());}case C7(0x17d):{return m[C7(0x181)]||(yield z[C7(0x1d9)](I)());}}}),T=(I,m,Q)=>__awaiter(this,void 0x0,void 0x0,function*(){const C8=a10D;if(D)return Q[C8(0x1c5)]||(yield this[C8(0x1ca)][C8(0x18b)](I,C==='service'?m:undefined,C===C8(0x18f)?m:undefined,!![])());return undefined;}),W=(I,m,Q)=>__awaiter(this,void 0x0,void 0x0,function*(){const C9=a10D;if(V||Y)return Q[C9(0x195)]||(yield this['inquirerHelper']['askForAddonBackup'](I,m)());return undefined;}),f=(I,m,Q,J)=>__awaiter(this,void 0x0,void 0x0,function*(){if(Y)return J['restoreId']||(yield this['inquirerHelper']['askForAddonRestore'](I,m,Q)());return undefined;}),q=(I,m,Q)=>__awaiter(this,void 0x0,void 0x0,function*(){const CC=a10D;if(!D&&Q[CC(0x1ba)]!==undefined){if(Q[CC(0x1ba)]!==!![])return Q['containerId'];return yield this['inquirerHelper'][CC(0x16e)](I,C===CC(0x175)?m:undefined,C===CC(0x18f)?m:undefined,!![])();}return undefined;}),G=(I,m,Q)=>__awaiter(this,void 0x0,void 0x0,function*(){const CD=a10D;if(C==='job')return Q['runId']||(yield this[CD(0x1ca)][CD(0x184)](m,I,!![])());return undefined;}),i=(I,m,Q)=>__awaiter(this,void 0x0,void 0x0,function*(){const CV=a10D;if(C===CV(0x175)){if(Q[CV(0x1dd)]!==!![])return Q[CV(0x1dd)];return Q[CV(0x1dd)];}return undefined;});return this[CY(0x17f)](C,D,V,Y)[CY(0x168)](I=>__awaiter(this,void 0x0,void 0x0,function*(){const Ce=CY,{noDefaults:m,projectId:Q,quiet:J,tail:z,types:u,textIncludes:L,textNotIncludes:v,regexIncludes:k,regexNotIncludes:s,direction:h,lineLimit:j,startTime:U,endTime:t,duration:y,output:Z}=I;(0x0,utils_1['assertContextExisting'])(this['apiClient']);const {apiContext:X,inquirerHelper:p,logsApiClient:M}=this,n=m?undefined:X[Ce(0x189)](),r=Q||n||(yield p[Ce(0x1d1)]()),l=yield e(r,I),b=yield T(r,l,I),P=yield W(r,l,I),g=yield f(r,l,P,I),E=yield G(r,l,I),o=yield i(r,l,I),w=yield q(r,l,I);if(U&&t&&y)throw new Error(Ce(0x1bd));const A={'projectId':r,'entityId':l},N={'containerName':w,'types':u,'textIncludes':L,'textNotIncludes':v,'regexIncludes':k,'regexNotIncludes':s,'lineLimit':j,'startTime':U,'duration':y,'runId':E,'buildId':b,'backupId':P,'restoreId':g,'deploymentId':o,'isBuild':D!==null&&D!==void 0x0?D:![]},S=Y?'addonRestore':V?Ce(0x1e6):C,B=Object[Ce(0x163)](Object[Ce(0x163)]({},N),{'endTime':t,'direction':h});if(!J&&Z!==Ce(0x1de)&&Z!==Ce(0x1a9)&&Z!==Ce(0x1f0))this[Ce(0x1c7)](C,l,r,Object['assign'](Object[Ce(0x163)]({},B),I));const H=this[Ce(0x19a)](Z,L!==null&&L!==void 0x0?L:k);if(z){const K=yield M[Ce(0x1a7)][Ce(0x1bb)](A,N,S);K['on'](Ce(0x1b5),H),K['on']('error',c=>(0x0,utils_1[Ce(0x1ed)])(Ce(0x196)+c[Ce(0x1d8)])),K['on'](Ce(0x1e0),()=>console['log'](Ce(0x1b8))),yield K[Ce(0x1f1)]();}else{const c=yield M['logs'][Ce(0x1cf)](A,B,S);if(c[Ce(0x1ed)]){const d=c['error'][Ce(0x1d3)],O=d?'\x0aDetails:\x20'+JSON[Ce(0x1cd)](d,null,'\x20'):'';(0x0,utils_1[Ce(0x1ed)])(Ce(0x1b9)+c[Ce(0x1ed)]['message']+O);}else H(c[Ce(0x19b)],c['pagination']);}}));}}exports[a10a(0x185)]=CliLogs;
|