@northflank/cli 0.9.15 → 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 -3
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
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';
|
|
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 a8Q(){const Qu=['pagination-prompt','isObject','getPathString','join','1012449LNTQqH','token','domains','job:\x20\x27','./utils','split','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','startedAt','setPathVars','No,\x20but\x20save\x20as\x20file','template\x20run','registryCredentials','tmpCmdPath','No,\x20repeat','max','services','backups','\x20(startedAt:\x20','volumes','logSinks','isBoolean','\x20characters,\x20is\x20','success','Writing\x20configuration\x20failed:\x20','blue','then','yaml','apiClient','projects','stringify','inquirer-search-list','safeLoad','domain\x20(','confirmationPrompt','isValidJSON','ask','askForService','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','6698590YGSuSu','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','__awaiter','anyOf','defineProperty','getOwnPropertyDescriptor','boolean','create','isUndefined','SAVE','askArrayEntry','Go\x20to\x20editor','InquirerHelper','job\x20runs','list','askConfirm','Template\x20id\x20not\x20provided.','templates','askForLogSink','builds','yellowBright','don\x27t\x20change','No\x20containers\x20found','unshift','main-context','override','all-builds','value','getQuestionString','Please\x20confirm\x20following\x20configuration:\x0a','\x20type?','minimum','Choose\x20the\x20','uri','pathVars','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','configurable','\x20(completedAt:\x20','askForSubdomainPath','askForProjectScopedResource','Configuration\x20file\x20written\x20to\x20','\x20and\x20it\x20','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','volume','doesn\x27t\x20match\x20pattern\x20\x27','properties','__esModule','js-yaml','password','containers','__importDefault','__createBinding','map','validate','charAt','log\x20sink','filter','subdomain','What\x27s\x20the\x20','bgGrey','isNaN','runs','Do\x20you\x20want\x20to\x20add','default','askForSecret','job\x20builds','yml','greenBright','No,\x20edit','pattern','./api-helpers','chalk','example','credentials','askForJob','confirm','path','service\x20containers','Yes,\x20send','trim','69114KhzRfe','test','Should\x20it\x20be','find','for\x20this\x20','Aborted.','not\x20completed','No\x20','613112Eqotay','askForVolume','getType','73773QcgtIl','6GaZWER','askGeneric','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','safeDump','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','askForAddonRestore','\x20characters','prototype','REPEAT','askForSubdomain','nextPageCursor','warning','items','toUpperCase','all-containers','askForPipeline','service:\x20\x27','bold','confirmation','propToType','subdomains','must\x20be\x20a\x20number,\x20is\x20','createdAt','contextProvider','registerPrompt','isEmpty','templateRuns','533715OGkaUF','\x20to\x20use:','has','subdomainPath','YES','service','keys','askForJobRun','job','push','body','askForTemplateRun','addon','oneOf','retrievePayloadViaInteractiveCli','askForResource','181215hcrEPy','maximum','values','done','paths','all-job-runs','length','message','found','assign','isArray','slice','resultCache','project:\x20\x27','),\x20subdomain\x20(','log','Context\x20name\x20already\x20exists.','Do\x20you\x20want\x20to\x20add\x20more','string','apply','pipelines','repeat','hasOwnProperty','toString','askForProjectScopedResourcePaginated','cmdPath','blueBright','choice','restores','askForContainer','integer','get','addons','pagination','description','cursor','underline','call','throw','fileName','DynamicReloadPaginationPrompt','input','editPayload','176ZjgVpY','rawObject','minLength','jobs','red','editedResult','data','getInnerType','Enter\x20the\x20','a\x20Northflank\x20resource','80mXMaVu','getCurrentProjectName','__setModuleDefault','pipeline','concat','Unexpected\x20file\x20type:\x20','askForResourcePaginated','deleteWarningPrompt','secrets','maxLength','tokenPrompt','writeFileSync','inquirer','\x20in\x20',',\x20supported\x20types:\x20[json|yaml|yml]','No,\x20abort','type','askForProject','prompt','object','search-list','whiteBright','set','ABORT','addEntry','No\x20builds\x20found','defaultPaginationPageSize','name','__importStar'];a8Q=function(){return Qu;};return a8Q();}const a8O=a8L;(function(Q,L){const g=a8L,z=Q();while(!![]){try{const A=-parseInt(g(0x270))/0x1*(-parseInt(g(0x271))/0x2)+parseInt(g(0x1ef))/0x3+-parseInt(g(0x26d))/0x4+parseInt(g(0x1ce))/0x5*(parseInt(g(0x265))/0x6)+-parseInt(g(0x189))/0x7+-parseInt(g(0x1c4))/0x8*(-parseInt(g(0x199))/0x9)+-parseInt(g(0x215))/0xa;if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a8Q,0x45fe6));var __createBinding=this&&this[a8O(0x248)]||(Object[a8O(0x21c)]?function(Q,L,z,A){const Y=a8O;if(A===undefined)A=z;var b=Object[Y(0x21a)](L,z);(!b||('get'in b?!L[Y(0x243)]:b['writable']||b[Y(0x239)]))&&(b={'enumerable':!![],'get':function(){return L[z];}}),Object[Y(0x219)](Q,A,b);}:function(Q,L,z,A){if(A===undefined)A=z;Q[A]=L[z];}),__setModuleDefault=this&&this[a8O(0x1d0)]||(Object['create']?function(Q,L){const j=a8O;Object[j(0x219)](Q,'default',{'enumerable':!![],'value':L});}:function(Q,L){const B=a8O;Q[B(0x254)]=L;}),__importStar=this&&this[a8O(0x1ea)]||function(Q){const l=a8O;if(Q&&Q[l(0x243)])return Q;var L={};if(Q!=null){for(var z in Q)if(z!==l(0x254)&&Object[l(0x278)][l(0x1af)][l(0x1be)](Q,z))__createBinding(L,Q,z);}return __setModuleDefault(L,Q),L;},__awaiter=this&&this[a8O(0x217)]||function(Q,L,z,A){function b(M){return M instanceof z?M:new z(function(S){S(M);});}return new(z||(z=Promise))(function(M,S){const E=a8L;function k(Z){try{q(A['next'](Z));}catch(V){S(V);}}function i(Z){const o=a8L;try{q(A[o(0x1bf)](Z));}catch(V){S(V);}}function q(Z){const r=a8L;Z[r(0x19c)]?M(Z['value']):b(Z[r(0x230)])[r(0x208)](k,i);}q((A=A[E(0x1ac)](Q,L||[]))['next']());});},__importDefault=this&&this[a8O(0x247)]||function(Q){return Q&&Q['__esModule']?Q:{'default':Q};};Object[a8O(0x219)](exports,a8O(0x243),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require('lodash')),chalk_1=__importDefault(require(a8O(0x25c))),fs=__importStar(require('fs')),utils_1=require(a8O(0x1f3)),api_helpers_1=require(a8O(0x25b)),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require(a8O(0x1da)),inquirerSearchList=require(a8O(0x20d)),yaml=require(a8O(0x244));var ConfirmChoices;(function(Q){const N=a8O;Q[N(0x18d)]=N(0x263),Q[N(0x279)]=N(0x1fc),Q['EDIT']=N(0x259),Q['SAVE']=N(0x1f8),Q['ABORT']=N(0x1dd);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(Q){const T=a8O;this[T(0x20a)]=Q,this[T(0x1e8)]=0x32,this[T(0x1c3)]=L=>__awaiter(this,void 0x0,void 0x0,function*(){const v=T,{editedResult:z}=yield inquirer[v(0x1e0)]([{'type':'editor','name':v(0x1c9),'message':v(0x220),'default':yaml[v(0x274)](L)}]);return yaml[v(0x20e)](z);}),this['saveFile']=L=>__awaiter(this,void 0x0,void 0x0,function*(){const h=T,z=S=>h(0x1d3)+S+h(0x1dc);function A(){return __awaiter(this,void 0x0,void 0x0,function*(){const C=a8L;return inquirer[C(0x1e0)]([{'type':'input','name':C(0x1c0),'message':C(0x238),'validate':S=>new RegExp('.*\x5c.(json|yaml|yml)$')[C(0x266)](S)?!![]:z(S)}]);});}const {fileName:b}=yield A(),M=b['toString']()[h(0x1f4)]('.')['pop']();try{switch(M){case'json':(0x0,utils_1[h(0x205)])(h(0x23d)+b);return fs[h(0x1d9)](b,JSON[h(0x20c)](L,null,'\x20\x20'));case h(0x209):case h(0x257):(0x0,utils_1['success'])(h(0x23d)+b);return fs[h(0x1d9)](b,yaml['safeDump'](L));default:(0x0,utils_1[h(0x27c)])(z(M));}}catch(S){(0x0,utils_1[h(0x27c)])(h(0x206)+S[h(0x1a0)]);}return undefined;}),this[T(0x24d)]=(L,z)=>A=>{const W=T,b=typeof A===W(0x1ab)?A[W(0x264)]():A;return z===![]&&b==='don\x27t\x20change'?'':b;},this['validate']=(L,z,A)=>b=>{const w=T,M=[];if(b===''||b===w(0x22a)){if(z!==![])M[w(0x192)]('this\x20option\x20is\x20required,\x20please\x20answer');else return!![];}L[w(0x1de)]===w(0x1ab)&&!_[w(0x21d)](L[w(0x25a)])&&(console[w(0x1a8)](L[w(0x25a)]),console['log'](b),M[w(0x192)](new RegExp(L[w(0x25a)])[w(0x266)](b)?!![]:w(0x241)+L[w(0x25a)]+'\x27'));L['type']===w(0x1ab)&&!_['isUndefined'](L[w(0x1c6)])&&M[w(0x192)](b[w(0x19f)]>=L['minLength']?!![]:w(0x216)+L[w(0x1c6)]+w(0x204)+b['length']+w(0x277));L[w(0x1de)]===w(0x1ab)&&!_[w(0x21d)](L['maxLength'])&&M[w(0x192)](b[w(0x19f)]<=L[w(0x1d7)]?!![]:w(0x275)+L[w(0x1d7)]+w(0x204)+b[w(0x19f)]+w(0x277));A&&Number[w(0x251)](parseInt(b,0xa))&&M[w(0x192)](w(0x286)+b);L[w(0x1de)]===w(0x1b7)&&!_[w(0x21d)](L[w(0x234)])&&M[w(0x192)](b>=L[w(0x234)]?!![]:w(0x1f5)+L[w(0x234)]);L['type']===w(0x1b7)&&!_['isUndefined'](L[w(0x19a)])&&M[w(0x192)](b<=L[w(0x19a)]?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+L[w(0x19a)]);if(L[w(0x1de)]===w(0x1c5)){const i=(0x0,utils_1[w(0x211)])(b);M['push'](i===![]||_[w(0x187)](i)?w(0x23f):!![]);}const S=M['filter'](q=>q!==!![]),k=(L===null||L===void 0x0?void 0x0:L[w(0x25d)])?'\x0a'+chalk_1[w(0x254)][w(0x1c8)]('>>')+'\x20Example:\x20'+chalk_1[w(0x254)][w(0x1e3)](JSON[w(0x20c)](L[w(0x25d)])):'';return S[w(0x19f)]>0x0?S[w(0x1ee)](chalk_1[w(0x254)][w(0x1bd)](w(0x23e)))+k:!![];},this[T(0x1ed)]=(L,z,A)=>{const H=T,b=L[L[H(0x19f)]-0x1];function M(){const x=H;return L[x(0x1a4)](0x0,-0x1)['map'](i=>i[x(0x24b)](0x0)[x(0x27e)]()+i[x(0x1a4)](0x1))['join']('>');}const S=L[H(0x19f)]>0x1?chalk_1[H(0x254)][H(0x250)][H(0x1e3)](M())+':\x20':'',k=A?'\x20('+chalk_1[H(0x254)][H(0x207)](A)+')':'';return chalk_1[H(0x254)]['reset'](''+S+z+'\x20'+chalk_1[H(0x254)][H(0x282)][H(0x258)](b)+k+'?');},this[T(0x198)]=(L,z,A)=>__awaiter(this,void 0x0,void 0x0,function*(){const J=T;if(z[J(0x19f)]<0x1){const S=A?J(0x269)+A:J(0x1a1);throw new Error(J(0x26c)+L+'\x20'+S+'.');}const b=J(0x235)+L+J(0x18a),M=z[J(0x19f)]>0x4?J(0x1e2):'list';return(yield inquirer[J(0x1e0)]([{'type':M,'name':'name','message':b,'choices':z}]))[J(0x1e9)];}),this[T(0x1d4)]=(L,z,A)=>__awaiter(this,void 0x0,void 0x0,function*(){const u=T,{elements:b,nextCursor:M}=yield z();if(b[u(0x19f)]<0x1){const i=A?'for\x20this\x20'+A:u(0x1a1);throw new Error(u(0x26c)+L+'\x20'+i+'.');}const S=u(0x235)+L+u(0x18a);if(M!==undefined){const q=({nextPageCursor:Z})=>__awaiter(this,void 0x0,void 0x0,function*(){const V=yield z(Z);return{'elements':V['elements'],'nextPageCursor':V['nextCursor']};});return(yield inquirer[u(0x1e0)]([{'type':'pagination-prompt','name':'name','message':S,'choices':b,'nextPageCursor':M,'loadMore':q}]))['name'];}const k=b[u(0x19f)]>0x4?'search-list':'list';return(yield inquirer[u(0x1e0)]([{'type':k,'name':u(0x1e9),'message':S,'choices':b}]))[u(0x1e9)];}),this[T(0x272)]=(L,z)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n=T,A=''+(z?'('+chalk_1[n(0x254)][n(0x207)](z)+')\x20':''),b=n(0x1cc)+chalk_1[n(0x254)]['green'](L)+'\x20'+A+'to\x20use:',M=this['validate']({'type':n(0x1ab),'required':!![]});return(yield inquirer[n(0x1e0)]([{'type':n(0x1c2),'name':'name','message':b,'validate':M}]))['name'];}),this[T(0x224)]=L=>__awaiter(this,void 0x0,void 0x0,function*(){const R=T;return(yield inquirer[R(0x1e0)]([{'type':R(0x260),'name':R(0x1e9),'message':L,'default':!![]}]))[R(0x1e9)];}),this[T(0x213)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const m=a8L;var M;const S=yield this['apiClient'][m(0x223)][m(0x1fe)]({'parameters':{'projectId':A},'options':{'per_page':this[m(0x1e8)],'cursor':b}}),k=S[m(0x1ca)]['services'][m(0x249)](i=>i['id']);return{'elements':k,'nextCursor':(M=S[m(0x1ba)])===null||M===void 0x0?void 0x0:M['cursor']};});return this[F(0x1b1)](F(0x18e),z,L);}),this['askForTemplate']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const f=T,L=z=>__awaiter(this,void 0x0,void 0x0,function*(){const t=a8L;var A;const b=yield this[t(0x20a)][t(0x223)][t(0x226)]({'options':{'per_page':this[t(0x1e8)],'cursor':z}}),M=b[t(0x1ca)][t(0x226)]['map'](S=>S['id']);return{'elements':M,'nextCursor':(A=b['pagination'])===null||A===void 0x0?void 0x0:A['cursor']};});return this[f(0x1d4)]('template',L);}),this[T(0x194)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=T;if(_['isUndefined'](L))throw new Error(K(0x225));const z=A=>__awaiter(this,void 0x0,void 0x0,function*(){const D=K;var b;let M=this[D(0x1e8)];const S=yield this[D(0x20a)][D(0x223)][D(0x188)]({'parameters':{'templateId':L},'options':{'per_page':M,'cursor':A}}),k=S[D(0x1ca)][D(0x188)][D(0x249)](i=>i['id']+D(0x200)+i[D(0x287)]+')');return{'elements':k,'nextCursor':(b=S[D(0x1ba)])===null||b===void 0x0?void 0x0:b['cursor']};});return this[K(0x1d4)](K(0x1f9),z)['then'](A=>A[K(0x1f4)]('\x20')[0x0]);}),this[T(0x227)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const p=T,L=z=>__awaiter(this,void 0x0,void 0x0,function*(){const U=a8L;var A;let b=this[U(0x1e8)];const M=yield this[U(0x20a)][U(0x223)][U(0x202)]({'options':{'per_page':b,'cursor':z}}),S=M['data'][U(0x202)][U(0x249)](k=>k['id']);return{'elements':S,'nextCursor':(A=M[U(0x1ba)])===null||A===void 0x0?void 0x0:A[U(0x1bc)]};});return this[p(0x1d4)](p(0x24c),L);}),this[T(0x280)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const s=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const e=a8L;var M;const S=yield this['apiClient'][e(0x223)][e(0x1ad)]({'parameters':{'projectId':A},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':b}}),k=S[e(0x1ca)][e(0x1ad)]['map'](i=>i['id']);return{'elements':k,'nextCursor':(M=S[e(0x1ba)])===null||M===void 0x0?void 0x0:M[e(0x1bc)]};});return this[s(0x1b1)](s(0x1d1),z,L);}),this[T(0x25f)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const X=a8L;var M;const S=yield this['apiClient'][X(0x223)][X(0x1c7)]({'parameters':{'projectId':A},'options':{'per_page':this[X(0x1e8)],'cursor':b}}),k=S[X(0x1ca)]['jobs']['map'](i=>i['id']);return{'elements':k,'nextCursor':(M=S[X(0x1ba)])===null||M===void 0x0?void 0x0:M[X(0x1bc)]};});return this['askForProjectScopedResourcePaginated'](P(0x191),z,L);}),this[T(0x190)]=(L,z,A=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=T,b=y(0x19e),M=S=>k=>__awaiter(this,void 0x0,void 0x0,function*(){const Q0=y;var i;const q=yield this[Q0(0x20a)][Q0(0x1b8)]['job']['runs']({'parameters':{'projectId':S,'jobId':L},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':k}}),Z=q[Q0(0x1ca)][Q0(0x252)]['map'](V=>V['id']+'\x20(startedAt:\x20'+V[Q0(0x1f6)]+')');return A&&Z[Q0(0x22c)](b),{'elements':Z,'nextCursor':(i=q[Q0(0x1ba)])===null||i===void 0x0?void 0x0:i[Q0(0x1bc)]};});return this[y(0x1b1)](y(0x222),M,z,y(0x1f2)+L+'\x27')['then'](S=>{const k=S['split']('\x20')[0x0];if(k===b)return undefined;return k;});}),this['askForBuild']=(L,z,A,b=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Q1=T,M=Q1(0x22f);if(A!==undefined){const S=k=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const Q2=Q1;var q;const Z=yield this[Q2(0x20a)][Q2(0x1b8)][Q2(0x191)][Q2(0x228)]({'parameters':{'projectId':k,'jobId':A},'options':{'per_page':this[Q2(0x1e8)],'cursor':i}}),V=Z[Q2(0x1ca)]['builds']['map'](d=>d['id']+Q2(0x200)+d[Q2(0x287)]+')');return b&&V[Q2(0x22c)](M),{'elements':V,'nextCursor':(q=Z[Q2(0x1ba)])===null||q===void 0x0?void 0x0:q['cursor']};});return this[Q1(0x1b1)](Q1(0x256),S,L,'job:\x20\x27'+A+'\x27')[Q1(0x208)](k=>{const Q3=Q1,i=k[Q3(0x1f4)]('\x20')[0x0];if(i===M)return undefined;return i;});}if(z!==undefined){const k=i=>q=>__awaiter(this,void 0x0,void 0x0,function*(){const Q4=Q1;var Z;const V=yield this[Q4(0x20a)][Q4(0x1b8)][Q4(0x18e)][Q4(0x228)]({'parameters':{'projectId':i,'serviceId':z},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':q}}),d=V[Q4(0x1ca)][Q4(0x228)][Q4(0x249)](a=>a['id']+Q4(0x200)+a[Q4(0x287)]+')');if(b)d[Q4(0x22c)](M);return{'elements':d,'nextCursor':(Z=V[Q4(0x1ba)])===null||Z===void 0x0?void 0x0:Z['cursor']};});return this[Q1(0x1b1)]('service\x20build',k,L,Q1(0x281)+A+'\x27')[Q1(0x208)](i=>{const Q5=Q1,q=i[Q5(0x1f4)]('\x20')[0x0];if(q===M)return undefined;return q;});}throw new Error(Q1(0x1e7));}),this[T(0x1b6)]=(L,z,A,b=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Q6=T,M=Q6(0x27f);if(A!==undefined){const S=k=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const Q7=Q6;var q,Z;const V=yield this[Q7(0x20a)][Q7(0x1b8)][Q7(0x191)][Q7(0x246)]({'parameters':{'projectId':k,'jobId':A},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':i}}),d=(q=V[Q7(0x1ca)][Q7(0x246)])!==null&&q!==void 0x0?q:[],a=d===null||d===void 0x0?void 0x0:d[Q7(0x249)](G=>G['name']+Q7(0x200)+G[Q7(0x287)]+')');return b&&a[Q7(0x22c)](M),{'elements':a,'nextCursor':(Z=V[Q7(0x1ba)])===null||Z===void 0x0?void 0x0:Z[Q7(0x1bc)]};});return this[Q6(0x1b1)]('job\x20containers',S,L,Q6(0x1f2)+A+'\x27')[Q6(0x208)](k=>{const Q8=Q6,i=k[Q8(0x1f4)]('\x20')[0x0];if(i===M)return undefined;return i;});}if(z!==undefined){const k=i=>q=>__awaiter(this,void 0x0,void 0x0,function*(){const Q9=Q6;var Z,V;const d=yield this[Q9(0x20a)][Q9(0x1b8)][Q9(0x18e)][Q9(0x246)]({'parameters':{'projectId':i,'serviceId':z},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':q}}),a=(Z=d[Q9(0x1ca)][Q9(0x246)])!==null&&Z!==void 0x0?Z:[],G=a[Q9(0x249)](I=>I[Q9(0x1e9)]+'\x20(startedAt:\x20'+I[Q9(0x287)]+')');if(b)G===null||G===void 0x0?void 0x0:G[Q9(0x22c)](M);return{'elements':G,'nextCursor':(V=d[Q9(0x1ba)])===null||V===void 0x0?void 0x0:V['cursor']};});return this['askForProjectScopedResourcePaginated'](Q6(0x262),k,L,Q6(0x281)+A+'\x27')[Q6(0x208)](i=>{const QQ=Q6,q=i[QQ(0x1f4)]('\x20')[0x0];if(q===M)return undefined;return q;});}throw new Error(Q6(0x22b));}),this['askForAddon']=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qz=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const QL=a8L;var M;const S=yield this['apiClient'][QL(0x223)][QL(0x1b9)]({'parameters':{'projectId':A},'options':{'per_page':this[QL(0x1e8)],'cursor':b}});return{'elements':S['data']['addons']['map'](k=>k['id']),'nextCursor':(M=S[QL(0x1ba)])===null||M===void 0x0?void 0x0:M['cursor']};});return this[Qz(0x1b1)]('addon',z,L);}),this['askForAddonBackup']=(L,z)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qb=T,A=b=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const QA=a8L;var S;const k=yield this[QA(0x20a)][QA(0x1b8)][QA(0x195)][QA(0x1ff)]({'parameters':{'projectId':b,'addonId':z},'options':{'per_page':this[QA(0x1e8)],'cursor':M}});return{'elements':k['data']['backups']['map'](i=>i['id']+QA(0x23a)+(i['completedAt']||QA(0x26b))+')'),'nextCursor':(S=k[QA(0x1ba)])===null||S===void 0x0?void 0x0:S[QA(0x1bc)]};});return this['askForProjectScopedResourcePaginated'](Qb(0x1ff),A,L,'addon:\x20\x27'+z+'\x27')[Qb(0x208)](b=>b[Qb(0x1f4)]('\x20')[0x0]);}),this[T(0x276)]=(L,z,A)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const QS=T,b=M=>S=>__awaiter(this,void 0x0,void 0x0,function*(){const QM=a8L;var k;const i=yield this['apiClient']['get'][QM(0x195)][QM(0x1b5)]({'parameters':{'projectId':M,'addonId':z,'backupId':A},'options':{'per_page':this[QM(0x1e8)],'cursor':S}});return{'elements':i['data'][QM(0x1b5)][QM(0x249)](q=>q['id']+QM(0x23a)+(q['completedAt']||QM(0x26b))+')'),'nextCursor':(k=i['pagination'])===null||k===void 0x0?void 0x0:k['cursor']};});return this[QS(0x1b1)]('restore',b,L,'addon:\x20\x27'+z+'\x27')[QS(0x208)](M=>M[QS(0x1f4)]('\x20')[0x0]);}),this[T(0x26e)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qi=T,z=A=>__awaiter(this,void 0x0,void 0x0,function*(){const Qk=a8L;return(yield this[Qk(0x20a)][Qk(0x223)][Qk(0x201)]({'parameters':{'projectId':A}}))[Qk(0x1ca)]['map'](b=>b['id']);});return this['askForProjectScopedResource'](Qi(0x240),z,L);}),this[T(0x255)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const QZ=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const Qq=a8L;var M;const S=yield this[Qq(0x20a)][Qq(0x223)][Qq(0x1d6)]({'parameters':{'projectId':A},'options':{'per_page':this[Qq(0x1e8)],'cursor':b}});return{'elements':S[Qq(0x1ca)]['secrets']['map'](k=>k['id']),'nextCursor':(M=S['pagination'])===null||M===void 0x0?void 0x0:M[Qq(0x1bc)]};});return this[QZ(0x1b1)]('secret',z,L);}),this[T(0x27a)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const QV=T,z=yield this['apiClient']['get']['domain']({'parameters':{'domain':L}}),A=z['data'][QV(0x285)][QV(0x249)](M=>M[QV(0x1e9)]+'\x20(full\x20domain:\x20'+M['fullName']+')'),b=QV(0x20f)+L+')';return this[QV(0x198)](QV(0x24e),A,b)[QV(0x208)](M=>M[QV(0x1f4)]('\x20')[0x0]);}),this[T(0x23b)]=(L,z)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qd=T,A=yield this['apiClient'][Qd(0x223)][Qd(0x24e)][Qd(0x261)]({'parameters':{'domain':L,'subdomain':z}}),b=A['data'][Qd(0x19d)][Qd(0x249)](S=>''+S[Qd(0x236)]),M=Qd(0x20f)+L+Qd(0x1a7)+z+')';return this[Qd(0x198)](Qd(0x18c),b,M);}),this[T(0x1d5)]=L=>__awaiter(this,void 0x0,void 0x0,function*(){const Qa=T;return(yield inquirer['prompt']([{'type':Qa(0x260),'name':Qa(0x283),'message':chalk_1[Qa(0x254)][Qa(0x229)]('WARNING:\x20You\x20are\x20about\x20to\x20delete\x20'+(L||Qa(0x1cd))+Qa(0x214)),'default':![]}]))['confirmation'];}),this['loginPrompt']=(L,z)=>__awaiter(this,void 0x0,void 0x0,function*(){const QG=T;_[QG(0x21d)](L['name'])&&(z[QG(0x19f)]<=0x0?_['set'](L,'name',QG(0x254)):yield(0x0,utils_1['retry'])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const QI=QG,{name:A}=yield inquirer[QI(0x1e0)]([{'type':QI(0x1c2),'name':QI(0x1e9),'message':QI(0x273),'default':QI(0x22d)}]);if(!L['override']&&z[QI(0x268)](b=>b[QI(0x1e9)]===A)){const {c:b}=yield inquirer[QI(0x1e0)]([{'type':'confirm','name':'c','message':'Context\x20with\x20name\x20\x27'+A+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(b===![])throw new Error(QI(0x1a9));_[QI(0x1e4)](L,QI(0x22e),!![]);}_[QI(0x1e4)](L,'name',A);})));if(_[QG(0x21d)](L['token'])){const A=yield this['tokenPrompt']();_[QG(0x1e4)](L,QG(0x1f0),A);}return L;}),this[T(0x1d8)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qg=T,{token:L}=yield inquirer['prompt']([{'type':Qg(0x245),'name':Qg(0x1f0),'mask':'*','message':'Choose\x20the\x20login\x20token:'}]);return L;}),inquirer[T(0x186)](T(0x1e2),inquirerSearchList),inquirer[T(0x186)](T(0x1eb),inquirer_pagination_prompt_1[T(0x1c1)]);}[a8O(0x210)](Q,L){return __awaiter(this,void 0x0,void 0x0,function*(){const QO=a8L,z=yaml['safeDump'](Q),A=_[QO(0x1fd)](z[QO(0x1f4)]('\x0a')[QO(0x249)](S=>S[QO(0x19f)])),b=chalk_1[QO(0x254)]['grey']('-'[QO(0x1ae)](A)+'\x0a'),{confirm:M}=yield inquirer[QO(0x1e0)]([{'type':QO(0x223),'name':QO(0x260),'message':''+chalk_1[QO(0x254)][QO(0x282)]['green'](QO(0x232))+b+chalk_1[QO(0x254)][QO(0x1b3)](z)+b,'choices':Object[QO(0x19b)](ConfirmChoices)}]);switch(M){case ConfirmChoices[QO(0x18d)]:return Q;case ConfirmChoices[QO(0x1e5)]:throw new Error(QO(0x26a));case ConfirmChoices[QO(0x279)]:return this['retrievePayloadViaInteractiveCli'](L);case ConfirmChoices['EDIT']:return this[QO(0x210)](yield this['editPayload'](Q),L);case ConfirmChoices[QO(0x21e)]:yield this['saveFile'](Q);return this[QO(0x210)](Q,L);default:throw new Error('Something\x20unexpected\x20happened.');}});}[a8O(0x197)](Q,L){return __awaiter(this,void 0x0,void 0x0,function*(){const QY=a8L;if((L===null||L===void 0x0?void 0x0:L['resultCache'])!==undefined)this['resultCache']=L===null||L===void 0x0?void 0x0:L[QY(0x1a5)];this[QY(0x1fb)]=L===null||L===void 0x0?void 0x0:L[QY(0x1b2)];const z={};return yield this[QY(0x284)]([],Q['opt'][QY(0x193)],z),this[QY(0x1a5)]=z,yield this[QY(0x210)](z,Q);});}[a8O(0x284)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const Qj=a8L;let b;if(L[Qj(0x196)]&&!_[Qj(0x18b)](L,Qj(0x242))){if(L[Qj(0x196)]['length']>0x1){const {choice:M}=yield inquirer[Qj(0x1e0)]([{'type':'list','name':Qj(0x1b4),'message':Qj(0x24f)+(Q[Q['length']-0x1]||'')+Qj(0x233),'choices':L['oneOf']['map'](S=>{const QB=Qj;var k;return(k=S[QB(0x1bb)])!==null&&k!==void 0x0?k:'??';})}]);b=yield this[Qj(0x26f)](Q,L[Qj(0x196)][Qj(0x268)](S=>S['description']===M),z,A);}else{const S=L[Qj(0x196)][0x0];_[Qj(0x1e4)](S,Qj(0x1bb),L[Qj(0x1bb)]),b=yield this[Qj(0x26f)](Q,S,z,A);}b={};}else{if(L[Qj(0x218)]&&!_[Qj(0x18b)](L,'properties')){if(L[Qj(0x218)][Qj(0x19f)]>0x1){const {choice:k}=yield inquirer[Qj(0x1e0)]([{'type':'list','name':'choice','message':Qj(0x24f)+(Q[Q[Qj(0x19f)]-0x1]||'')+Qj(0x233),'choices':[...L['anyOf'][Qj(0x249)](i=>{const Ql=Qj;var q;return(q=i[Ql(0x1bb)])!==null&&q!==void 0x0?q:'??';}),'don\x27t\x20change']}]);k!==Qj(0x22a)&&(b=yield this[Qj(0x26f)](Q,L[Qj(0x218)][Qj(0x268)](i=>i[Qj(0x1bb)]===k),z,A));}else{const i=L['anyOf'][0x0];_[Qj(0x1e4)](i,Qj(0x1bb),L[Qj(0x1bb)]),b=yield this['getType'](Q,i,z,A);}b={};}else b=yield this[Qj(0x26f)](Q,L,z,A);}return b;});}[a8O(0x1cb)](Q,L,z,A){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const Qo=a8L;if(A===![]){const {addEntry:k}=yield inquirer[Qo(0x1e0)]([{'type':Qo(0x260),'name':Qo(0x1e6),'message':this['getPathString'](L,Qo(0x253),Q===null||Q===void 0x0?void 0x0:Q[Qo(0x1bb)]),'default':![]}]);if(!k)return z;}const M=Object[Qo(0x18f)]((b=Q===null||Q===void 0x0?void 0x0:Q['properties'])!==null&&b!==void 0x0?b:[]),S=Q['required']||[];if(M['length']>0x0)for(const i of M){const q=L[Qo(0x1d2)](i);if(L[Qo(0x19f)]>0x0&&!_['has'](z,L[Qo(0x1ee)]('.')))_[Qo(0x1e4)](z,L[Qo(0x1ee)]('.'),{});yield this[Qo(0x284)](q,Q['properties'][i],z,S['includes'](i));}else yield this[Qo(0x26f)](L,Object[Qo(0x1a2)](Object[Qo(0x1a2)]({},Q),{'type':Qo(0x1c5)}),z,A);return z;});}[a8O(0x21f)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const Qr=a8L;if(L&&z)return!![];const b=L?Qr(0x253):Qr(0x1aa),{addEntry:M}=yield inquirer['prompt']([{'type':'confirm','name':Qr(0x1e6),'message':this[Qr(0x1ed)](Q,b,L?A:undefined),'default':![]}]);return M;});}[a8O(0x26f)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const QE=a8L;let b;const M=Q['join']('.');switch(L===null||L===void 0x0?void 0x0:L[QE(0x1de)]){case'array':{let S=!![];while(yield this['askArrayEntry'](Q,S,A,L===null||L===void 0x0?void 0x0:L[QE(0x1bb)])){const k=_[QE(0x1b8)](z,M);_['unset'](z,M),yield this['getType'](Q,L[QE(0x27d)],z);const i=_[QE(0x1b8)](z,M);!_[QE(0x1a3)](k)?_[QE(0x1e4)](z,M,[i]):(k[QE(0x192)](i),_[QE(0x1e4)](z,M,k)),S=![];}return b||[];}case QE(0x1e1):{return b=yield this[QE(0x1cb)](L,Q,z,A),b;}case QE(0x1c5):b=(0x0,utils_1[QE(0x211)])(yield this[QE(0x212)](Q,L,A))||undefined;break;case'string':case QE(0x21b):case QE(0x1b7):default:b=yield this[QE(0x212)](Q,L,A,z);break;}return!_['isUndefined'](b)&&_['set'](z,M,b),b;});}['ask'](Q,L,z,A){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const QN=a8L,M=Q[Q[QN(0x19f)]-0x1],{defaultValue:defaultValue=(b=L===null||L===void 0x0?void 0x0:L[QN(0x25d)])!==null&&b!==void 0x0?b:L===null||L===void 0x0?void 0x0:L['default'],choices:choices=L===null||L===void 0x0?void 0x0:L['enum'],pagination:S}=yield(0x0,api_helpers_1['fetchResourceList'])(M,this['apiClient'],this['tmpCmdPath'],A,this[QN(0x237)],Q);let k='input';if(!_[QN(0x21d)](choices)&&choices[QN(0x19f)]>0x0){if(S!==undefined&&S[QN(0x27b)]!==undefined)k=QN(0x1eb);else choices[QN(0x19f)]>0x4&&typeof choices[0x0]===QN(0x1ab)?k=QN(0x1e2):k=QN(0x223);}else{if((L===null||L===void 0x0?void 0x0:L[QN(0x1de)])===QN(0x21b))k=QN(0x260);else{if((L===null||L===void 0x0?void 0x0:L[QN(0x1de)])===QN(0x1b7))k='input';else(L===null||L===void 0x0?void 0x0:L[QN(0x1de)])==='rawObject'&&(k='editor');}}let i=z!==![]?!_[QN(0x1ec)](defaultValue)?defaultValue:JSON[QN(0x20c)](defaultValue):_[QN(0x203)](defaultValue)?defaultValue:'don\x27t\x20change';if(choices)i=i[QN(0x1b0)]();_[QN(0x18b)](this[QN(0x1a5)],Q[QN(0x1ee)]('.'))&&(i=this[QN(0x1a5)][Q['join']('.')]);const q=choices&&z===![]?[QN(0x22a),...choices]:choices,Z=(L===null||L===void 0x0?void 0x0:L['type'])===QN(0x1b7),V=Object[QN(0x1a2)]({'type':k,'name':'id','message':this[QN(0x231)](Q,L),'choices':q,'default':i,'filter':this[QN(0x24d)](k,z),'validate':this[QN(0x24a)](L,z,Z)},S),d=(yield inquirer[QN(0x1e0)]([V]))['id'];if(d===QN(0x22a)||d==='')return undefined;if(Z)return parseInt(d,0xa);return d;});}[a8O(0x231)](Q,L){const QT=a8O,z=(L===null||L===void 0x0?void 0x0:L['type'])!==QT(0x21b)?'What\x20do\x20you\x20want\x20to\x20use\x20as':QT(0x267);return this[QT(0x1ed)](Q,z,L===null||L===void 0x0?void 0x0:L['description']);}[a8O(0x1df)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Qh=a8L,Q=L=>__awaiter(this,void 0x0,void 0x0,function*(){const Qv=a8L;var z;const A=yield this[Qv(0x20a)][Qv(0x223)][Qv(0x20b)]({'options':{'per_page':this[Qv(0x1e8)],'cursor':L}}),b=A['data'][Qv(0x20b)]['map'](M=>M['id']);return{'elements':b,'nextCursor':(z=A['pagination'])===null||z===void 0x0?void 0x0:z['cursor']};});return yield this[Qh(0x1d4)]('project',Q);});}[a8O(0x23c)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const QC=a8L,b=z||this[QC(0x20a)][QC(0x288)][QC(0x1cf)]();if(_['isUndefined'](b))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const M=yield L(b);return yield this['askForResource'](Q,M,(A?A+QC(0x1db):'')+QC(0x1a6)+b+'\x27');});}[a8O(0x1b1)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const QW=a8L,b=z||this[QW(0x20a)][QW(0x288)][QW(0x1cf)]();if(_[QW(0x21d)](b))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const M=yield L(b);return yield this['askForResourcePaginated'](Q,M,(A?A+QW(0x1db):'')+QW(0x1a6)+b+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Q=L=>__awaiter(this,void 0x0,void 0x0,function*(){const Qw=a8L;var z;const A=yield this[Qw(0x20a)][Qw(0x223)][Qw(0x1f1)]({'options':{'per_page':this[Qw(0x1e8)],'cursor':L}});return{'elements':A[Qw(0x1ca)][Qw(0x1f1)]['map'](b=>b[Qw(0x1e9)]),'nextCursor':(z=A[Qw(0x1ba)])===null||z===void 0x0?void 0x0:z[Qw(0x1bc)]};});return this['askForResourcePaginated']('domain',Q);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Qx=a8L,Q=L=>__awaiter(this,void 0x0,void 0x0,function*(){const QH=a8L;var z;const A=yield this[QH(0x20a)]['list'][QH(0x1fa)]({'options':{'per_page':this[QH(0x1e8)],'cursor':L}});return{'elements':A[QH(0x1ca)][QH(0x25e)]['map'](b=>b['id']),'nextCursor':(z=A[QH(0x1ba)])===null||z===void 0x0?void 0x0:z[QH(0x1bc)]};});return this[Qx(0x1d4)]('credentials',Q);});}[a8O(0x1f7)](Q){const QJ=a8O;this[QJ(0x237)]=Q;}}function a8L(Q,L){const z=a8Q();return a8L=function(A,b){A=A-0x186;let M=z[A];return M;},a8L(Q,L);}exports[a8O(0x221)]=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';function
|
|
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=a10L;(function(Q,L){const p=a10L,z=Q();while(!![]){try{const A=parseInt(p(0x154))/0x1+parseInt(p(0x14f))/0x2*(-parseInt(p(0x177))/0x3)+-parseInt(p(0x168))/0x4+parseInt(p(0x198))/0x5*(-parseInt(p(0x18a))/0x6)+-parseInt(p(0x189))/0x7+-parseInt(p(0x157))/0x8*(-parseInt(p(0x17b))/0x9)+parseInt(p(0x193))/0xa;if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a10Q,0xed210));function a10L(Q,L){const z=a10Q();return a10L=function(A,b){A=A-0x11d;let M=z[A];return M;},a10L(Q,L);}var __awaiter=this&&this['__awaiter']||function(Q,L,z,A){function b(M){return M instanceof z?M:new z(function(S){S(M);});}return new(z||(z=Promise))(function(M,S){const P=a10L;function k(Z){const e=a10L;try{q(A[e(0x173)](Z));}catch(V){S(V);}}function i(Z){const s=a10L;try{q(A[s(0x141)](Z));}catch(V){S(V);}}function q(Z){const X=a10L;Z[X(0x1ad)]?M(Z['value']):b(Z[X(0x196)])[X(0x16e)](k,i);}q((A=A[P(0x181)](Q,L||[]))['next']());});},__importDefault=this&&this[a10y(0x191)]||function(Q){const Q0=a10y;return Q&&Q[Q0(0x158)]?Q:{'default':Q};};Object[a10y(0x122)](exports,'__esModule',{'value':!![]}),exports['CliLogs']=void 0x0;const js_client_1=require(a10y(0x133)),chalk_1=__importDefault(require(a10y(0x18c))),utils_1=require(a10y(0x123)),inquirer_helper_1=require(a10y(0x145)),commander_1=require(a10y(0x169)),console_format_helpers_1=require(a10y(0x1b5)),log_formatter_1=require('./log-formatter');function a10Q(){const QA=['getCommand','\x20for\x20container\x20','runId','apply','printInitInfo','ApiClient','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','getSeconds','--noDefaults','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','Option','4696888gBSCVU','375678ZfSVrt','close','chalk','CliLogs','Restore\x20to\x20get\x20logs\x20from','\x20(exit\x20with\x20','--restore\x20--restoreId\x20[restoreId]','__importDefault','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','18031460TslMiM','regexNotIncludes','defaultDurationSeconds','value','getCurrentProjectName','95BXizwT','--build\x20--buildId\x20[buildId]','Build\x20to\x20get\x20logs\x20from','pagination','jobId','textNotIncludes','assign','askForAddonBackup','LogType','setSeconds','default','yml','logsApiClient','logRange','buildId','formatLogLine','Error\x20while\x20fetching\x20log\x20lines:\x20','\x20with\x20live-tailing','>\x20Container\x20logs','addonId','length','done','Get\x20logs\x20generated\x20after\x20this\x20time,\x20','getCurrentServiceName','backward','Id]','InquirerHelper',',\x20to:\x20','--regexIncludes\x20<regex>','../formatting/console-format-helpers',',\x20restore\x20id\x20','tsHint','details','serviceId','apiClient','choices','tail','addon','\x20to\x20get\x20logs\x20from','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','start','-d,\x20--direction\x20<order>','defineProperty','../utils','name','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','containerId','askForJob','toISOString','stringify','noDefaults','Get\x20log\x20for\x20the\x20specified\x20','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','askForAddonRestore','addonBackup','\x20in\x20project\x20','format','values','cursor','@northflank/js-client','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','--backup\x20--backupId\x20[backupId]','slice','askForProject','--regexNotIncludes\x20<regex>','backupId','Number\x20of\x20lines\x20to\x20return.','toUpperCase','build-','alias','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.',',\x20duration:\x20','--textIncludes\x20<text>','throw','error','warning','parseDateInput','../inquirer-helper','askForContainer','service','textIncludes','inquirerHelper','conflicts','assertContextExisting',',\x20backup\x20id\x20','getStandardLogCommand','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','2FlMuSx','\x20seconds','description','Log\x20session\x20ended','--run\x20--runId\x20[runId]','1716367DqgXxP','log','hasNextPage','56XTsYjv','__esModule','logs','apiContext','bold','Id\x20[','askForService','argParser','-t,\x20--types\x20<types...>','customUserAgent','addonRestore','job','yaml','--duration\x20[duration]','logTail','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','--startTime\x20<timestamp>','7204580zapxOI','commander','data','regexIncludes','message','getFormatter','then','--container\x20--containerId\x20[containerId]','printResponse','--project\x20--projectId\x20[projectId]','--endTime\x20<timestamp>','next','json','askForJobRun','-f,\x20--tail','1605228vWTCeb','\x0aDetails:\x20','option','addOption','2119653wudeWo','action','forEach'];a10Q=function(){return QA;};return a10Q();}class CliLogs{constructor(Q){const Q1=a10y;this[Q1(0x15a)]=Q,this[Q1(0x195)]=0x708,this[Q1(0x14d)]=(L,z,A,b)=>{const Q2=Q1,M=(0x0,utils_1[Q2(0x17e)])(!![])[Q2(0x124)]((z?'build-':'')+Q2(0x159))[Q2(0x13d)]((z?Q2(0x13c):'')+Q2(0x155))[Q2(0x151)](Q2(0x12b)+L)['option'](Q2(0x171),'Project\x20for\x20logs')['option']('--'+L+'\x20--'+L+Q2(0x15c)+L+Q2(0x1b1),L['charAt'](0x0)[Q2(0x13b)]()+L[Q2(0x136)](0x1)+Q2(0x11e))['option'](Q2(0x16f),Q2(0x14e));if(z)M['option'](Q2(0x199),Q2(0x19a));if(L===Q2(0x162))M['option'](Q2(0x153),Q2(0x12c));if(A)M['option'](Q2(0x135),'Backup\x20to\x20get\x20logs\x20from');if(b)M['option'](Q2(0x190),Q2(0x18e));return!z&&!A&&!b&&M[Q2(0x17a)](new commander_1[(Q2(0x188))](Q2(0x15f),'Which\x20log\x20types\x20to\x20fetch')[Q2(0x1bb)](Object[Q2(0x131)](js_client_1[Q2(0x1a0)]))),M['option'](Q2(0x176),Q2(0x13e))[Q2(0x179)]('-l,\x20--lineLimit\x20[limit]',Q2(0x13a))[Q2(0x179)](Q2(0x167),Q2(0x1ae)+utils_1[Q2(0x1b7)],utils_1[Q2(0x144)])[Q2(0x17a)](new commander_1[(Q2(0x188))](Q2(0x172),'Get\x20logs\x20generated\x20before\x20this\x20time,\x20'+utils_1[Q2(0x1b7)])[Q2(0x15e)](utils_1[Q2(0x144)])[Q2(0x14a)]([Q2(0x1bc)]))[Q2(0x179)](Q2(0x164),Q2(0x187))['addOption'](new commander_1[(Q2(0x188))](Q2(0x121),Q2(0x166))[Q2(0x1bb)]([Q2(0x1b0),'forward'])['conflicts']([Q2(0x1bc)]))[Q2(0x17a)](new commander_1['Option'](Q2(0x140),'Filter\x20log\x20lines\x20to\x20include\x20this\x20text')[Q2(0x14a)]([Q2(0x19d),Q2(0x16b),Q2(0x194)]))[Q2(0x17a)](new commander_1['Option']('--textNotIncludes\x20<text>','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text')[Q2(0x14a)]([Q2(0x148),'regexIncludes',Q2(0x194)]))['addOption'](new commander_1['Option'](Q2(0x1b4),'Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression')[Q2(0x14a)]([Q2(0x19d),Q2(0x148),Q2(0x194)]))[Q2(0x17a)](new commander_1[(Q2(0x188))](Q2(0x138),Q2(0x192))['conflicts']([Q2(0x19d),Q2(0x16b),Q2(0x148)]))[Q2(0x179)](Q2(0x186),Q2(0x11f),![])[Q2(0x17a)](new commander_1[(Q2(0x188))]('-o,\x20--output\x20[output]',Q2(0x125))['choices'](Object[Q2(0x131)]([Q2(0x130),Q2(0x174),Q2(0x163)]))),M;},this[Q1(0x182)]=(L,z,A,b)=>{const Q3=Q1,{containerName:M,restoreId:S,backupId:k,quiet:i,tail:q,startTime:Z,endTime:V,duration:d}=b;if(i===!![])return;const a=q?Q3(0x18f)+chalk_1['default'][Q3(0x15b)]('\x27Ctrl+C\x27')+')':'',G=q?Q3(0x1a9):'',I=new Date(),g=Z!==null&&Z!==void 0x0?Z:new Date(new Date((V!==null&&V!==void 0x0?V:I)['valueOf']())[Q3(0x1a1)]((V!==null&&V!==void 0x0?V:I)[Q3(0x185)]()-(d!==null&&d!==void 0x0?d:this[Q3(0x195)]))),O=(V!==null&&V!==void 0x0?V:Z!==undefined)?new Date(new Date(Z['valueOf']())[Q3(0x1a1)](Z[Q3(0x185)]()+(d!==null&&d!==void 0x0?d:this[Q3(0x195)]))):I,Y=k!==undefined,j=g&&!Y?',\x20from:\x20'+chalk_1[Q3(0x1a2)][Q3(0x15b)](g[Q3(0x128)]()):'',B=O&&!Y?Q3(0x1b3)+chalk_1['default'][Q3(0x15b)](O['toISOString']()):'',l=d?Q3(0x13f)+d+Q3(0x150):'',o=M?Q3(0x17f)+chalk_1[Q3(0x1a2)][Q3(0x15b)](M):Y?'':'\x20for\x20all\x20containers',r=k?Q3(0x14c)+k:'',E=S?Q3(0x1b6)+S:'',N=L+'\x20'+chalk_1[Q3(0x1a2)]['bold'](z)+r+E+Q3(0x12f)+chalk_1[Q3(0x1a2)][Q3(0x15b)](A),T=''+j+B+l;console[Q3(0x155)](Q3(0x1aa)+G+o+'\x20of\x20'+N+T+a+':');},this[Q1(0x16d)]=(L,z)=>(A,b)=>{const Q4=Q1;if(!L){if(A[Q4(0x1ac)]===0x0)console[Q4(0x155)](Q4(0x134));A[Q4(0x17d)](M=>(0x0,log_formatter_1[Q4(0x1a7)])(M,z));}else(0x0,console_format_helpers_1[Q4(0x170)])(L,A);(b===null||b===void 0x0?void 0x0:b[Q4(0x156)])&&(0x0,utils_1[Q4(0x143)])(Q4(0x184)+b[Q4(0x132)]);},this[Q1(0x1ba)]=new js_client_1[(Q1(0x183))](Q,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Q1(0x160)]}),this[Q1(0x1a4)]=this['apiClient'],this[Q1(0x149)]=new inquirer_helper_1[(Q1(0x1b2))](this[Q1(0x1ba)]);}['getLogsCommand'](Q,L=![],z=![],A=![]){const QL=a10y,b=(Z,V)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q5=a10L,d=V[Q5(0x12a)],{apiContext:a,inquirerHelper:G}=this;switch(Q){case Q5(0x147):{const I=d?undefined:a[Q5(0x1af)]();return V[Q5(0x1b9)]||I||(yield G[Q5(0x15d)](Z)());}case Q5(0x162):{const g=d?undefined:a['getCurrentJobName']();return V[Q5(0x19c)]||g||(yield G[Q5(0x127)](Z)());}case Q5(0x11d):{return V[Q5(0x1ab)]||(yield G['askForAddon'](Z)());}}}),M=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q6=a10L;if(L)return d[Q6(0x1a6)]||(yield this[Q6(0x149)]['askForBuild'](Z,Q==='service'?V:undefined,Q===Q6(0x162)?V:undefined,!![])());return undefined;}),S=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q7=a10L;if(z||A)return d[Q7(0x139)]||(yield this[Q7(0x149)][Q7(0x19f)](Z,V)());return undefined;}),k=(Z,V,d,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q8=a10L;if(A)return a['restoreId']||(yield this[Q8(0x149)][Q8(0x12d)](Z,V,d)());return undefined;}),i=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q9=a10L;if(!L&&d[Q9(0x126)]!==undefined){if(d[Q9(0x126)]!==!![])return d[Q9(0x126)];return yield this[Q9(0x149)][Q9(0x146)](Z,Q===Q9(0x147)?V:undefined,Q===Q9(0x162)?V:undefined,!![])();}return undefined;}),q=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const QQ=a10L;if(Q===QQ(0x162))return d[QQ(0x180)]||(yield this[QQ(0x149)][QQ(0x175)](V,Z,!![])());return undefined;});return this[QL(0x14d)](Q,L,z,A)[QL(0x17c)](Z=>__awaiter(this,void 0x0,void 0x0,function*(){const Qz=QL,{noDefaults:V,projectId:d,quiet:a,tail:G,types:I,textIncludes:g,textNotIncludes:O,regexIncludes:Y,regexNotIncludes:j,direction:B,lineLimit:l,startTime:o,endTime:r,duration:E,output:N}=Z;(0x0,utils_1[Qz(0x14b)])(this[Qz(0x1ba)]);const {apiContext:T,inquirerHelper:v,logsApiClient:h}=this,C=V?undefined:T[Qz(0x197)](),W=d||C||(yield v[Qz(0x137)]()),w=yield b(W,Z),H=yield M(W,w,Z),x=yield S(W,w,Z),J=yield k(W,w,x,Z),u=yield q(W,w,Z),n=yield i(W,w,Z);if(o&&r&&E)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const R={'projectId':W,'entityId':w},m={'containerName':n,'types':I,'textIncludes':g,'textNotIncludes':O,'regexIncludes':Y,'regexNotIncludes':j,'lineLimit':l,'startTime':o,'duration':E,'runId':u,'buildId':H,'backupId':x,'restoreId':J,'isBuild':L!==null&&L!==void 0x0?L:![]},F=A?Qz(0x161):z?Qz(0x12e):Q,t=Object[Qz(0x19e)](Object[Qz(0x19e)]({},m),{'endTime':r,'direction':B});if(!a&&N!==Qz(0x163)&&N!==Qz(0x1a3)&&N!==Qz(0x174))this[Qz(0x182)](Q,w,W,Object[Qz(0x19e)](Object['assign']({},t),Z));const f=this[Qz(0x16d)](N,g!==null&&g!==void 0x0?g:Y);if(G){const K=yield h[Qz(0x159)][Qz(0x165)](R,m,F);K['on']('logs-received',f),K['on'](Qz(0x142),D=>(0x0,utils_1[Qz(0x142)])('Error\x20while\x20tailing\x20log\x20lines:\x20'+D[Qz(0x16c)])),K['on'](Qz(0x18b),()=>console[Qz(0x155)](Qz(0x152))),yield K[Qz(0x120)]();}else{const D=yield h[Qz(0x159)][Qz(0x1a5)](R,t,F);if(D[Qz(0x142)]){const c=D['error'][Qz(0x1b8)],U=c?Qz(0x178)+JSON[Qz(0x129)](c,null,'\x20'):'';(0x0,utils_1[Qz(0x142)])(Qz(0x1a8)+D[Qz(0x142)][Qz(0x16c)]+U);}else f(D[Qz(0x16a)],D[Qz(0x19b)]);}}));}}exports[a10y(0x18d)]=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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a11I=a11D;(function(C,D){const G=a11D,V=C();while(!![]){try{const Y=parseInt(G(0x1b0))/0x1+parseInt(G(0x1c7))/0x2*(parseInt(G(0x1b9))/0x3)+parseInt(G(0x1b3))/0x4+parseInt(G(0x1b7))/0x5*(-parseInt(G(0x1c2))/0x6)+parseInt(G(0x1ba))/0x7+parseInt(G(0x1c9))/0x8+-parseInt(G(0x1ad))/0x9*(parseInt(G(0x1bc))/0xa);if(Y===D)break;else V['push'](V['shift']());}catch(e){V['push'](V['shift']());}}}(a11C,0x280b0));function a11C(){const J=['greenBright','350hNVdxz','color','chalk','grey','toISOString','__esModule','6baYgEr','reduce','log','default','defaultLogSyntax','2rwuoXT','dim','2079776VJTakJ','yellow','cyan','131715qbKdqd','pattern','bold','182672JOsbbA','containerId','blue','54752XbgjSE','\x20--\x20','formatLogLine','s\x08(?!mailto:)(?:(?:http|https|ftp)://)(?:\x5cS+(?::\x5cS*)?@)?(?:(?:(?:[1-9]\x5cd?|1\x5cd\x5cd|2[01]\x5cd|22[0-3])(?:\x5c.(?:1?\x5cd{1,2}|2[0-4]\x5cd|25[0-5])){2}(?:\x5c.(?:[0-9]\x5cd?|1\x5cd\x5cd|2[0-4]\x5cd|25[0-4]))|(?:(?:[a-z\x5cu00a1-\x5cuffff0-9]+-?)*[a-z\x5cu00a1-\x5cuffff0-9]+)(?:\x5c.(?:[a-z\x5cu00a1-\x5cuffff0-9]+-?)*[a-z\x5cu00a1-\x5cuffff0-9]+)*(?:\x5c.(?:[a-z\x5cu00a1-\x5cuffff]{2,})))|localhost)(?::\x5cd{2,5})?(?:(/|\x5c?|#)[^\x5cs]*)?\x08s','935195tBjWjE','red','701106OXRBeq','1212722McCNDP'];a11C=function(){return J;};return a11C();}var __importDefault=this&&this['__importDefault']||function(C){const i=a11D;return C&&C[i(0x1c1)]?C:{'default':C};};Object['defineProperty'](exports,a11I(0x1c1),{'value':!![]}),exports[a11I(0x1b5)]=exports[a11I(0x1c6)]=void 0x0;function a11D(C,D){const V=a11C();return a11D=function(Y,e){Y=Y-0x1ac;let T=V[Y];return T;},a11D(C,D);}const chalk_1=__importDefault(require(a11I(0x1be)));exports[a11I(0x1c6)]=[{'color':a11I(0x1bf),'pattern':/\[[0-9]{1,2}\/[a-z]{3}\/[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{2} \+[0-9]{4}\]/i},{'color':'grey','pattern':/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]+)?Z/i},{'color':'grey','pattern':/[0-9]{4}\/[0-9]{2}\/[0-9]{2}/i},{'color':a11I(0x1bf),'pattern':/\s\b([0-9]{2}:){1,2}[0-9]{2}\b\s/i},{'color':a11I(0x1af),'pattern':new RegExp(a11I(0x1b6),'i')},{'color':'green','pattern':/(?:\d{1,3}\.){3}\d{1,3}/i},{'color':'green','pattern':/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/},{'color':a11I(0x1b2),'pattern':/\b(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH)\b/},{'color':a11I(0x1bb),'pattern':/\b(successful|success|completed|complete|done)\b/i},{'color':a11I(0x1b8),'pattern':/\b(failed|fail|stderr|error|err)\b/i},{'color':'gray','pattern':/\b(information|info|debug)\b/i},{'color':a11I(0x1ca),'pattern':/\b(warning|warn)\b/i},{'color':a11I(0x1b2),'pattern':/[0-9a-f]{64}/i},{'color':'blue','pattern':/[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}/i}];const formatLogLine=(C,D)=>{const m=a11I,V=chalk_1[m(0x1c5)][m(0x1c8)](C['ts'][m(0x1c0)]()),Y=chalk_1[m(0x1c5)][m(0x1ac)](C[m(0x1b1)]),e=exports[m(0x1c6)][m(0x1c3)]((W,f)=>{const Q=m;return W['replace'](f[Q(0x1ae)],q=>f[Q(0x1bd)]?chalk_1[Q(0x1c5)][f[Q(0x1bd)]](q):chalk_1['default'][Q(0x1bf)](q));},C['log']),T=D?e['replace'](new RegExp(D,'g'),W=>chalk_1[m(0x1c5)][m(0x1af)](W)):e;console[m(0x1c4)](V+'\x20'+Y+m(0x1b4)+T);};exports[a11I(0x1b5)]=formatLogLine;
|