@northflank/cli 0.10.1 → 0.10.2
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/copy/index.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/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a5K(U,K){const q=a5U();return a5K=function(X,J){X=X-0x96;let v=q[X];return v;},a5K(U,K);}const a5i=a5K;(function(U,K){const m=a5K,q=U();while(!![]){try{const X=-parseInt(m(0xbb))/0x1+-parseInt(m(0xaa))/0x2*(parseInt(m(0xf1))/0x3)+parseInt(m(0xf3))/0x4+parseInt(m(0xae))/0x5*(parseInt(m(0xb8))/0x6)+parseInt(m(0xb5))/0x7*(-parseInt(m(0xf5))/0x8)+-parseInt(m(0xf4))/0x9*(-parseInt(m(0xac))/0xa)+-parseInt(m(0xb2))/0xb*(-parseInt(m(0xe0))/0xc);if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a5U,0x7f677));var __awaiter=this&&this[a5i(0xe8)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const D=a5K;function L(z){const G=a5K;try{E(X[G(0xd8)](z));}catch(p){f(p);}}function M(z){const A=a5K;try{E(X[A(0x100)](z));}catch(p){f(p);}}function E(z){const s=a5K;z[s(0xfe)]?v(z[s(0xfa)]):J(z[s(0xfa)])['then'](L,M);}E((X=X[D(0xe6)](U,K||[]))[D(0xd8)]());});},__importDefault=this&&this['__importDefault']||function(U){const H=a5i;return U&&U[H(0xc9)]?U:{'default':U};};Object[a5i(0xa6)](exports,a5i(0xc9),{'value':!![]}),exports[a5i(0xc7)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a5i(0xf0))),utils_1=require('../utils'),inquirer_helper_1=require(a5i(0x102));class CliExec{constructor(U,K){const g=a5i;this[g(0x9c)]=v=>(0x0,utils_1['getCommand'])(!![])['name'](v)[g(0xec)]('Command\x20exec\x20for\x20the\x20specified\x20'+v+'.\x0aExamples:\x0a\x20\x20Shell\x20session:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20northflank\x20exec\x20'+v+'\x0a\x20\x20Single\x20command,\x20no\x20shell:\x20\x20\x20\x20\x20northflank\x20exec\x20'+v+g(0xe4)+v+g(0xd3)+v+g(0xa3))[g(0x101)]('--project\x20--projectId\x20[NAME]','Project\x20for\x20exec')[g(0x101)]('--'+v+g(0xc3)+v+g(0xb6),v['charAt'](0x0)[g(0xa4)]()+v[g(0xc1)](0x1)+g(0xd5))[g(0x101)](g(0xd6),'Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)')[g(0x101)]('--shell-cmd\x20[SHELL-CMD]',g(0xf6))['option'](g(0xd4),'Run\x20command\x20with\x20this\x20user')[g(0x101)](g(0xc6),g(0xfd))[g(0x101)]('--noDefaults',g(0x9e),![])[g(0x101)](g(0xca),'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.'),this[g(0xdb)]=()=>({'columns':process[g(0xcd)][g(0xcf)],'rows':process['stdout'][g(0xb3)]}),this[g(0xcb)]=(v,f,L,M,E,z,p,O)=>{const S=g;if(O===!![])return;const F=M===S(0xb1),o=F?'without\x20shell':M===undefined?S(0xab):S(0xc2)+chalk_1[S(0xe7)]['greenBright'](M),Q=E!==undefined?S(0xad)+E:'',w=z!==undefined?S(0x9b)+z:'',R=p!==undefined?S(0xda)+chalk_1[S(0xe7)][S(0xb4)](p)+'\x27':'',W=[R,o,Q,w][S(0x99)](b=>b!=='')[S(0xed)]('\x20'),V='(exit\x20with\x20two\x20quick\x20'+chalk_1[S(0xe7)][S(0xcc)](S(0xe9))+')';console[S(0xf2)](S(0xd7)+v+'\x20'+chalk_1[S(0xe7)][S(0xcc)](f)+S(0xb9)+chalk_1[S(0xe7)][S(0xcc)](L)+'\x20'+W+'\x20'+V);},this[g(0xb7)]=(v,f,L=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const C=g;var M,E;let z=![];try{if(process[C(0xa2)][C(0xdf)]){const O=require(C(0xea));O[C(0xe5)](process[C(0xa2)]),process[C(0xa2)]['setRawMode'](!![]),process[C(0xcd)]['on'](C(0x98),()=>{const N=C;v[N(0xc5)](this[N(0xdb)]());}),process[C(0xa2)]['on'](C(0xc0),(F,o)=>{const Z=C;o[Z(0xd1)]==='\x04'&&(z?(process[Z(0xa2)]['setRawMode'](![]),(0x0,utils_1[Z(0xe1)])(Z(0xd0)),process[Z(0xa1)]()):(z=!![],setTimeout(()=>z=![],0x190)));});}process[C(0xa2)][C(0xdd)](v['stdIn']),v[C(0xfc)][C(0xdd)](process[C(0x103)]),v[C(0xa9)][C(0xdd)](process['stdout']),v['on'](C(0x97),F=>{const e=C;var o;(0x0,utils_1['error'])(e(0xa0)+f+e(0xdc)+((o=F[e(0xde)])!==null&&o!==void 0x0?o:F)),process['stdin'][e(0xdf)]&&process[e(0xa2)][e(0xb0)](![]),process[e(0xa1)](-0x1);});const p=yield v[C(0xff)]();if(L!==!![]){const F=(M=p===null||p===void 0x0?void 0x0:p[C(0xaf)])!==null&&M!==void 0x0?M:C(0xd9),o=(E=p===null||p===void 0x0?void 0x0:p[C(0x9a)])!==null&&E!==void 0x0?E:-0x1,Q=(p===null||p===void 0x0?void 0x0:p['message'])?C(0xf7)+p[C(0xde)]:'';F==='Success'?(0x0,utils_1[C(0xfb)])('Command\x20completed\x20successfully,\x20exit\x20code:\x20'+o):(0x0,utils_1[C(0xe1)])(C(0xba)+F+C(0x9f)+o+Q);}return p;}finally{process[C(0xa2)][C(0xdf)]&&process[C(0xa2)][C(0xb0)](![]);}}),this[g(0xee)]=new js_client_1[(g(0xbc))](U,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[g(0x96)],'agent':K});const q=new inquirer_helper_1[(g(0xeb))](this['apiClient']);this[g(0xe2)]=(0x0,utils_1['getCommand'])()['name'](g(0xef))[g(0x9d)]('exec')[g(0xec)](g(0xf9));const X=this[g(0x9c)]('service')[g(0xce)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const n=g,{noDefaults:f,projectId:L,serviceId:M,containerId:E,shellCmd:z,user:p,group:O,command:F,quiet:o}=v;(0x0,utils_1['assertContextExisting'])(this[n(0xee)]);try{const Q=f?undefined:U[n(0xd2)](),w=L||Q||(yield q[n(0xbf)]()),R=f?undefined:U[n(0xa5)](),W=M||R||(yield q[n(0xbd)](w)()),V=z!==null&&z!==void 0x0?z:F!==undefined?n(0xb1):undefined;this[n(0xcb)](n(0xf8),W,w,V,p,O,F,o);const b=process[n(0xcd)][n(0xcf)],B=process[n(0xcd)]['rows'],y={'projectId':w,'serviceId':W},x=yield this[n(0xee)][n(0xa8)]['execServiceSession'](y,{'containerName':E,'command':F,'shell':V,'user':p,'group':O,'ttyColumns':b,'ttyRows':B});yield this['handleShellSession'](x,n(0xf8),o);}catch(a){(0x0,utils_1[n(0x97)])(''+a['message']);}finally{process[n(0xa1)]();}})),J=this[g(0x9c)](g(0xc4))[g(0xce)](v=>__awaiter(this,void 0x0,void 0x0,function*(){const t=g,{projectId:f,jobId:L,containerId:M,noDefaults:E,shellCmd:z,user:p,group:O,command:F,quiet:o}=v;(0x0,utils_1[t(0xa7)])(this[t(0xee)]);try{const Q=E?undefined:U[t(0xd2)](),w=f||Q||(yield q['askForProject']()),R=L||(yield q[t(0xc8)](w)());this[t(0xcb)](t(0xc4),R,w,z,o);const {rows:W,columns:V}=this['getTerminalSize'](),b={'projectId':w,'jobId':R},B=yield this[t(0xee)][t(0xa8)][t(0xe3)](b,{'containerName':M,'command':F,'shell':z,'user':p,'group':O,'ttyColumns':V,'ttyRows':W});yield this[t(0xb7)](B,t(0xc4),o);}catch(y){(0x0,utils_1['error'])(''+y['message']);}finally{process[t(0xa1)]();}}));this[g(0xe2)][g(0xbe)](X),this['execCmd'][g(0xbe)](J);}}exports[a5i(0xc7)]=CliExec;function a5U(){const Y=['../inquirer-helper','stderr','customUserAgent','error','resize','filter','exitCode','with\x20group:','getStandardExecCommand','alias','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',',\x20exit\x20code:\x20','Error\x20occured\x20during\x20','exit','stdin','\x20--shell-cmd\x20\x27sh\x27','toUpperCase','getCurrentServiceName','defineProperty','assertContextExisting','exec','stdOut','284650sKCNmo','with\x20shell\x20session','572030zCDHFy','with\x20user:','10aZazuz','status','setRawMode','none','33bzlGie','rows','greenBright','677880eelSjp','Id\x20[NAME]','handleShellSession','1128768fZEsZD','\x20in\x20project\x20','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','732677RRKHVY','ApiClient','askForService','addCommand','askForProject','keypress','slice','shell\x20command\x20','\x20--','job','resizeTerminal','--group\x20[GROUP]','CliExec','askForJob','__esModule','--cmd\x20--command\x20[COMMAND]','execStartLog','bold','stdout','action','columns','Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.','sequence','getCurrentProjectName','\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','--user\x20[USER]','\x20to\x20exec\x20into','--container\x20--containerId\x20[NAME]','Exec\x20','next','Unknown','with\x20command\x20\x27','getTerminalSize','\x20command\x20exec:\x20','pipe','message','isTTY','1973172mykYRL','warning','execCmd','execJobSession','\x20--cmd\x20\x27date\x27\x0a\x20\x20Single\x20command,\x20custom\x20shell:\x20northflank\x20exec\x20','emitKeypressEvents','apply','default','__awaiter','\x27Ctrl+D\x27','readline','InquirerHelper','description','join','apiClient','command-exec','chalk','9UBvFQk','log','3424368sxrSVp','54GwhUZz','32TfvujV','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.',',\x20details:\x20','service','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','value','success','stdErr','Run\x20command\x20with\x20this\x20group','done','waitForCommandResult','throw','option'];a5U=function(){return Y;};return a5U();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a6y=a6K;(function(U,K){const B=a6K,q=U();while(!![]){try{const X=-parseInt(B(0x118))/0x1*(parseInt(B(0x106))/0x2)+-parseInt(B(0x11e))/0x3+-parseInt(B(0x11f))/0x4+parseInt(B(0xf9))/0x5+parseInt(B(0x107))/0x6*(parseInt(B(0xfe))/0x7)+parseInt(B(0x117))/0x8*(-parseInt(B(0x110))/0x9)+parseInt(B(0xff))/0xa;if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a6U,0x960ad));function a6U(){const D=['action','then','defineProperty','command-overview','2208LotPeo','483047HvNfGL','value','--verbose','slice','name','Prints\x20a\x20tree\x20view\x20of\x20all\x20available\x20commands','1596801pzOhXP','3628016rNCzgj','4159435DgNmgg','__importDefault','green','length','description','2142ZJwKUA','15366080sreaaL','option','keys','../utils','opts','commands','done','2MpzQsT','23412hvwQoM','throw','every','next','forEach','__awaiter','apply','__esModule','log','33444bOzkGy','bold','map'];a6U=function(){return D;};return a6U();}var __awaiter=this&&this[a6y(0x10c)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const i=a6K;function L(z){const x=a6K;try{E(X[x(0x10a)](z));}catch(p){f(p);}}function M(z){const a=a6K;try{E(X[a(0x108)](z));}catch(p){f(p);}}function E(z){const m=a6K;z[m(0x105)]?v(z[m(0x119)]):J(z[m(0x119)])[m(0x114)](L,M);}E((X=X[i(0x10d)](U,K||[]))[i(0x10a)]());});},__importDefault=this&&this[a6y(0xfa)]||function(U){const G=a6y;return U&&U[G(0x10e)]?U:{'default':U};};Object[a6y(0x115)](exports,'__esModule',{'value':!![]}),exports['getCommandOverview']=void 0x0;const chalk_1=__importDefault(require('chalk')),utils_1=require(a6y(0x102));function a6K(U,K){const q=a6U();return a6K=function(X,J){X=X-0xf9;let v=q[X];return v;},a6K(U,K);}function getCommandOverview(U){const A=a6y;return(0x0,utils_1['getCommand'])()[A(0x11c)](A(0x116))['description'](A(0x11d))[A(0x100)](A(0x11a),'Print\x20command\x20descriptions')[A(0x113)](K=>__awaiter(this,void 0x0,void 0x0,function*(){const {verbose:q}=K;function X(J,v){const s=a6K;var f;const L=(W,V=!![])=>V?chalk_1['default'][s(0x111)][s(0xfb)](W[s(0x11c)]()):W['name'](),M=v['length']===0x0,E=J['commands'];let z='';const p=E[s(0xfc)]===0x0,O=p||((f=Object[s(0x101)](J===null||J===void 0x0?void 0x0:J[s(0x103)]()))===null||f===void 0x0?void 0x0:f[s(0xfc)])>0x0;!M&&(z=E&&!p?'┬\x20':'─\x20');const F=q&&O&&J['description']()?':\x20'+J[s(0xfd)]():'';console[s(0x10f)](''+v+z+L(J,O)+F);let o=v;if(!M){const W=v[s(0x11b)](-0x2)==='└─';o=v[s(0x11b)](0x0,-0x2)+(W?'\x20\x20':'│\x20');}const Q=o+'├─',w=o+'└─',R=E[s(0x109)](V=>V[s(0x104)]['length']===0x0);R&&!p&&!q?console['log'](w+'\x20'+E[s(0x112)](V=>L(V))['join'](',\x20')):E[s(0x10b)]((V,b)=>{X(V,E['length']-0x1===b?w:Q);});}X(U,'');}));}exports['getCommandOverview']=getCommandOverview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a7Q=a7K;function a7K(U,K){const q=a7U();return a7K=function(X,J){X=X-0x1eb;let v=q[X];return v;},a7K(U,K);}(function(U,K){const o=a7K,q=U();while(!![]){try{const X=parseInt(o(0x20a))/0x1*(-parseInt(o(0x1fc))/0x2)+parseInt(o(0x212))/0x3+-parseInt(o(0x210))/0x4*(-parseInt(o(0x1fb))/0x5)+parseInt(o(0x1f2))/0x6+parseInt(o(0x1f3))/0x7+parseInt(o(0x20c))/0x8*(-parseInt(o(0x20e))/0x9)+-parseInt(o(0x1f8))/0xa*(parseInt(o(0x227))/0xb);if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a7U,0x35f8d));var __createBinding=this&&this[a7Q(0x21f)]||(Object['create']?function(U,K,q,X){const w=a7Q;if(X===undefined)X=q;var J=Object['getOwnPropertyDescriptor'](K,q);(!J||(w(0x1f9)in J?!K[w(0x1ff)]:J['writable']||J[w(0x1ec)]))&&(J={'enumerable':!![],'get':function(){return K[q];}}),Object[w(0x20b)](U,X,J);}:function(U,K,q,X){if(X===undefined)X=q;U[X]=K[q];}),__setModuleDefault=this&&this[a7Q(0x21a)]||(Object[a7Q(0x218)]?function(U,K){const R=a7Q;Object[R(0x20b)](U,R(0x208),{'enumerable':!![],'value':K});}:function(U,K){const W=a7Q;U[W(0x208)]=K;}),__importStar=this&&this[a7Q(0x226)]||function(U){const V=a7Q;if(U&&U[V(0x1ff)])return U;var K={};if(U!=null){for(var q in U)if(q!==V(0x208)&&Object[V(0x207)][V(0x1f1)][V(0x201)](U,q))__createBinding(K,U,q);}return __setModuleDefault(K,U),K;},__importDefault=this&&this[a7Q(0x1f7)]||function(U){return U&&U['__esModule']?U:{'default':U};};Object[a7Q(0x20b)](exports,'__esModule',{'value':!![]}),exports[a7Q(0x216)]=exports[a7Q(0x200)]=exports['handleYamlOutput']=exports['handleJsonOutput']=exports[a7Q(0x219)]=exports[a7Q(0x1ee)]=void 0x0;const chalk_1=__importDefault(require('chalk')),_=__importStar(require(a7Q(0x224))),util=__importStar(require('util')),yaml=require(a7Q(0x217)),columnify=require('columnify');function printAsTable(U,K,q,X=![],J=0x0){const b=a7Q;!X&&console['log'](''+chalk_1[b(0x208)][b(0x221)](K));function v(L){const B=b;return L===B(0x20f)?L:L[B(0x213)]('disabled','');}function f(L,M){const x=b;function E(p){const y=a7K,O=new Date(p);return O['getDate']()+'/'+O[y(0x21e)]()+'/'+O[y(0x214)]()+'\x0a'+O[y(0x21d)]()+':'+O[y(0x225)]()+':'+O[y(0x21b)]();}const z=[x(0x206),x(0x1fe)];if(z[x(0x215)](M['toLowerCase']())&&_[x(0x1ed)](L)&&L[x(0x223)]()[x(0x21c)]===0xd)return E(Number(L));if(_['isBoolean'](L)){if(M!=='disabled'&&M[x(0x215)](x(0x20f)))return L?'x':'✔';return L?'✔':'x';}if(_[x(0x1fd)](L))return util['inspect'](L,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});return L;}if(_[b(0x1ef)](U)){U[b(0x21c)]===0x0&&console[b(0x202)]('No\x20'+K[b(0x222)]()+'\x20found');const L=U[b(0x1f5)]((z,p)=>{const a=b,O={'i':p+J};return Object[a(0x1f6)](z)[a(0x1fa)](F=>{const m=a;(_['isUndefined'](q)||q[m(0x215)](F[m(0x222)]()))&&_['set'](O,v(F),f(z[F],F));}),O;}),M=_['clone'](Object['keys']((L===null||L===void 0x0?void 0x0:L[0x0])||[]))[b(0x1f0)]((z,p)=>{const i=b,O=F=>F!=='i'?F!==i(0x211)?0x0:0x1:0x2;return O(p)-O(z);}),E={'maxWidth':0x1e,'preserveNewLines':!![],'showHeaders':!X,'config':{'_id':{'maxWidth':0x5,'truncate':!![]},'i':{'showHeaders':![]}},'columns':M};console[b(0x202)](columnify(L,E));}else console['log'](U);}exports['printAsTable']=printAsTable;function consoleFormat(U,K){const G=a7Q;if(_[G(0x209)](U)){const q=K?'\x20(HTTP\x20status:\x20'+K+')':'';return chalk_1[G(0x208)]['green']('The\x20request\x20was\x20completed\x20successfully')+q;}if(!_[G(0x1fd)](U))return U===null||U===void 0x0?void 0x0:U['toString']();return util[G(0x220)](U,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});}exports[a7Q(0x219)]=consoleFormat;const handleJsonOutput=(U,K)=>{const A=a7Q,q=U===A(0x205);if(q)console[A(0x202)](JSON[A(0x20d)](K,null,'\x20'));};exports[a7Q(0x1f4)]=handleJsonOutput;const handleYamlOutput=(U,K)=>{const s=a7Q,q=U==='yaml'||U===s(0x203);if(q)console[s(0x202)](yaml[s(0x1eb)](K));};exports['handleYamlOutput']=handleYamlOutput;const handleFormattedOutput=(U,K)=>{const D=a7Q,q=U===D(0x204);if(q)console[D(0x202)](consoleFormat(K));};exports['handleFormattedOutput']=handleFormattedOutput;function a7U(){const g=['668886mpImXH','1720397WMbnZJ','handleJsonOutput','map','keys','__importDefault','243330dyTJOi','get','forEach','3245bSeegu','354jHuIyd','isObjectLike','updatedat','__esModule','handleFormattedOutput','call','log','yml','format','json','createdat','prototype','default','isEmpty','676WvagIG','defineProperty','145288oNmsAR','stringify','153RRqIXB','disabled','1896BNsHeU','internalId','1048725UzFFCg','replace','getFullYear','includes','printResponse','js-yaml','create','consoleFormat','__setModuleDefault','getSeconds','length','getHours','getMonth','__createBinding','inspect','bold','toLowerCase','toString','lodash','getMinutes','__importStar','165mOHjjv','safeDump','configurable','isFinite','printAsTable','isArrayLike','sort','hasOwnProperty'];a7U=function(){return g;};return a7U();}const printResponse=(U,K)=>{const H=a7Q;(0x0,exports[H(0x1f4)])(U,K),(0x0,exports['handleYamlOutput'])(U,K),(0x0,exports['handleFormattedOutput'])(U,K);};exports[a7Q(0x216)]=printResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a8U(){const U3=['649464HtrzrX','min','green','2194NwzyCH','toLocaleDateString','2042178vzIwjU','padding','5agnlFU','max','push','isArray','unit','height','format','abs','colors','2305366tSyeLq','downSampleData','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','chalk','5266217PQkkcJ','1466730sXxoRY','grey','floor','length','blue','offset','18kJuapA','2-digit','repeat','getAsciiChart','undefined','round','join','652268CgkZKe','60PzLzGg','3018TwgZZF','__esModule','slice','toLocaleTimeString','symbols','map'];a8U=function(){return U3;};return a8U();}const a8r=a8K;(function(U,K){const u=a8K,q=U();while(!![]){try{const X=-parseInt(u(0x8b))/0x1+-parseInt(u(0x79))/0x2*(parseInt(u(0x9a))/0x3)+-parseInt(u(0x98))/0x4*(-parseInt(u(0x7d))/0x5)+parseInt(u(0x7b))/0x6+parseInt(u(0x86))/0x7+parseInt(u(0x76))/0x8*(-parseInt(u(0x91))/0x9)+-parseInt(u(0x99))/0xa*(-parseInt(u(0x8a))/0xb);if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a8U,0xed71c));function a8K(U,K){const q=a8U();return a8K=function(X,J){X=X-0x71;let v=q[X];return v;},a8K(U,K);}var __importDefault=this&&this['__importDefault']||function(U){const d=a8K;return U&&U[d(0x71)]?U:{'default':U};};Object['defineProperty'](exports,a8r(0x71),{'value':!![]}),exports[a8r(0x87)]=exports[a8r(0x94)]=void 0x0;const chalk_1=__importDefault(require(a8r(0x89))),colored=(U,K)=>{return K===undefined?U:chalk_1['default'][K](U);},getAsciiChart=(U,K={})=>{const j=a8r,q=Array[j(0x80)](U[0x0])?U:[U];let X=typeof K[j(0x77)]!==j(0x95)?K[j(0x77)]:q[0x0][0x0],J=typeof K[j(0x7e)]!==j(0x95)?K[j(0x7e)]:q[0x0][0x0];for(let B=0x0;B<q[j(0x8e)];B++){for(let a=0x0;a<q[B][j(0x8e)];a++){X=Math[j(0x77)](X,q[B][a]),J=Math[j(0x7e)](J,q[B][a]);}}let v=['┼','┤','╶','╴','─','╰','╭','╮','╯','│'],f=Math[j(0x84)](J-X),L=typeof K[j(0x90)]!=='undefined'?K[j(0x90)]:0x3,M=typeof K['padding']!==j(0x95)?K[j(0x7c)]:j(0x88),E=typeof K[j(0x82)]!=='undefined'?K['height']:f,z=typeof K['colors']!==j(0x95)?K[j(0x85)]:[j(0x8f),'red',j(0x78),j(0x8c),'black'],p=f!==0x0?E/f:0x1,O=Math[j(0x96)](X*p),F=Math[j(0x96)](J*p),o=Math['abs'](F-O),Q=0x0;for(let m=0x0;m<q[j(0x8e)];m++){Q=Math[j(0x7e)](Q,q[m][j(0x8e)]);}Q=Q+L;let w=typeof K[j(0x74)]!==j(0x95)?K[j(0x74)]:v,R=K['format']!==undefined?K[j(0x83)]:function(G){const U0=j;return(M+G['toFixed'](0x2)+K[U0(0x81)])['slice'](-M[U0(0x8e)]);},W=new Array(o+0x1);for(let G=0x0;G<=o;G++){W[G]=new Array(Q);for(let A=0x0;A<Q;A++){W[G][A]='\x20';}}for(let s=O;s<=F;++s){const D=R(o>0x0?J-(s-O)*f/o:s,s-O);W[s-O][Math['max'](L-D[j(0x8e)],0x0)]=D,W[s-O][L-0x1]=s==0x0?w[0x0]:w[0x1];}for(let H=0x0;H<q['length'];H++){let g=z[H%z[j(0x8e)]],S=Math['round'](q[H][0x0]*p)-O;W[o-S][L-0x1]=colored(w[0x0],g);for(let C=0x0;C<q[H]['length']-0x1;C++){let N=Math[j(0x96)](q[H][C+0x0]*p)-O,Z=Math[j(0x96)](q[H][C+0x1]*p)-O;if(N==Z)W[o-N][C+L]=colored(w[0x4],g);else{W[o-Z][C+L]=colored(N>Z?w[0x5]:w[0x6],g),W[o-N][C+L]=colored(N>Z?w[0x7]:w[0x8],g);let e=Math[j(0x77)](N,Z),n=Math[j(0x7e)](N,Z);for(let t=e+0x1;t<n;t++){W[o-t][C+L]=colored(w[0x9],g);}}}}const {startTs:V,endTs:b}=K;if(V||b){const Y=h=>{const U1=j;if(!h)return'\x20\x20\x20';const P=h[U1(0x7a)](undefined,{'day':'2-digit','month':U1(0x92),'year':U1(0x92)}),k=h[U1(0x73)](undefined,{'hourCycle':'h24'});return P+'\x20'+k;},l=Y(b),T=Y(V),I=M[j(0x72)](0x0,Math[j(0x7e)](0x2,M[j(0x8e)]-T[j(0x8e)]/0x2+0x1)),c='\x20'[j(0x93)](Math[j(0x7e)](Q-(M[j(0x8e)]+l[j(0x8e)]/0x2),0x1));W[j(0x7f)]([''+I+T+c+l]),W[j(0x7f)]([]);}return W[j(0x75)](h=>h['join'](''))[j(0x97)]('\x0a');};exports[a8r(0x94)]=getAsciiChart;const downSampleData=(U,K)=>{const U2=a8r,q=U[U2(0x8e)];if(K>=q||K===0x0)return U;const X=[];let J=0x0;const v=(q-0x2)/(K-0x2);let f=0x0,L,M,E,z;X[J++]=U[f];for(var p=0x0;p<K-0x2;p++){let R=0x0,W=0x0,V=Math[U2(0x8d)]((p+0x1)*v)+0x1,b=Math[U2(0x8d)]((p+0x2)*v)+0x1;b=b<q?b:q;var O=b-V;for(;V<b;V++){R+=U[V][0x0],W+=U[V][0x1];}R/=O,W/=O;var F=Math[U2(0x8d)](p*v)+0x1,o=Math[U2(0x8d)]((p+0x1)*v)+0x1,Q=U[f][0x0],w=U[f][0x1];M=E=-0x1;for(;F<o;F++){E=Math[U2(0x84)]((Q-R)*(U[F][0x1]-w)-(Q-U[F][0x0])*(W-w))*0.5,E>M&&(M=E,L=U[F],z=F);}X[J++]=L,f=z;}return X[J++]=U[q-0x1],X;};exports['downSampleData']=downSampleData;
|
package/dist/inquirer-helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a9f=a9E;(function(E,S){const H=a9E,X=E();while(!![]){try{const u=-parseInt(H(0x271))/0x1+parseInt(H(0x1fe))/0x2+parseInt(H(0x298))/0x3+-parseInt(H(0x278))/0x4*(-parseInt(H(0x24b))/0x5)+parseInt(H(0x2ba))/0x6+parseInt(H(0x205))/0x7*(parseInt(H(0x1f3))/0x8)+-parseInt(H(0x1fa))/0x9;if(u===S)break;else X['push'](X['shift']());}catch(Y){X['push'](X['shift']());}}}(a9c,0xe57ea));var __createBinding=this&&this[a9f(0x249)]||(Object[a9f(0x2a6)]?function(E,S,X,u){const Z=a9f;if(u===undefined)u=X;var Y=Object[Z(0x2b8)](S,X);(!Y||('get'in Y?!S['__esModule']:Y[Z(0x215)]||Y[Z(0x22b)]))&&(Y={'enumerable':!![],'get':function(){return S[X];}}),Object[Z(0x2b5)](E,u,Y);}:function(E,S,X,u){if(u===undefined)u=X;E[u]=S[X];}),__setModuleDefault=this&&this[a9f(0x1d0)]||(Object[a9f(0x2a6)]?function(E,S){const K=a9f;Object[K(0x2b5)](E,'default',{'enumerable':!![],'value':S});}:function(E,S){const t=a9f;E[t(0x1f7)]=S;}),__importStar=this&&this['__importStar']||function(E){const G=a9f;if(E&&E[G(0x1f0)])return E;var S={};if(E!=null){for(var X in E)if(X!==G(0x1f7)&&Object[G(0x20e)]['hasOwnProperty'][G(0x25a)](E,X))__createBinding(S,E,X);}return __setModuleDefault(S,E),S;},__awaiter=this&&this['__awaiter']||function(E,S,X,u){function Y(R){return R instanceof X?R:new X(function(d){d(R);});}return new(X||(X=Promise))(function(R,d){const I=a9E;function w(q){const b=a9E;try{p(u[b(0x285)](q));}catch(B){d(B);}}function U(q){const l=a9E;try{p(u[l(0x1c1)](q));}catch(B){d(B);}}function p(q){const A=a9E;q[A(0x234)]?R(q[A(0x239)]):Y(q[A(0x239)])[A(0x27e)](w,U);}p((u=u[I(0x269)](E,S||[]))['next']());});},__importDefault=this&&this[a9f(0x236)]||function(E){return E&&E['__esModule']?E:{'default':E};};function a9c(){const cD=['Context\x20name\x20already\x20exists.','not\x20completed','input','Aborted.','addon:\x20\x27','project:\x20\x27','pipelines','askForTemplate','yaml','registerPrompt','retry','apply','ask','askForAddonRestore','boolean','volume','validate','getInnerType','project','1852653wQgJQa','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','override','chalk','nextPageCursor','service\x20containers','prompt','124VrAwZI','set','blue','toString','js-yaml','includes','then','unset','askForProjectScopedResourcePaginated','confirm','domain','opt','askForResourcePaginated','next','templateRuns','main-context','services','Something\x20unexpected\x20happened.','.*\x5c.(json|yaml|yml)$','askArrayEntry','containers','maximum','tokenPrompt','Choose\x20the\x20','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','jobs','editedResult','No,\x20repeat','get','./pagination/inquirer-pagination-prompt','No,\x20edit','saveFile','3413844cnPaik','for\x20this\x20','don\x27t\x20change','object','slice','askForTemplateRun','minimum','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','filter','addons','underline','length','oneOf','test','create','fetchResourceList','EDIT','red','loginPrompt','safeDump','has','job:\x20\x27','No,\x20abort','credentials','backups','askForCredentials','template\x20run','\x20Example:\x20','a\x20Northflank\x20resource','defineProperty','safeLoad','whiteBright','getOwnPropertyDescriptor','service:\x20\x27','10943802iHToOd','\x20(full\x20domain:\x20','pathVars','addEntry','properties','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','REPEAT','editor','minLength','ABORT','retrievePayloadViaInteractiveCli','\x20type?','getCurrentProjectName','map','./api-helpers','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','tmpCmdPath','templates','yml','service\x20build','\x20characters','anyOf','nextCursor','askForAddonBackup','assign','job','isArray','logSinks','bold','pagination-prompt','throw','subdomain','No\x20','description','Go\x20to\x20editor','\x20(completedAt:\x20','yellowBright','pipeline','Do\x20you\x20want\x20to\x20add\x20more','\x20(startedAt:\x20','askForResource','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','name','inquirer-search-list','unshift','__setModuleDefault','reset','askForClusterId','find','deleteWarningPrompt','message','clusters','\x20and\x20it\x20','choice','backup\x20destination','apiClient','tag','search-list','isUndefined','builds','doesn\x27t\x20match\x20pattern\x20\x27','\x20in\x20','getQuestionString','backup','askForProjectScopedResource','confirmationPrompt','askForDomain','all-builds','askForSubdomain','Template\x20id\x20not\x20provided.','lodash','No\x20containers\x20found','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','addon','SAVE','max','createdAt','__esModule','subdomains','bgGrey','4424FEYsVg','integer','domain\x20(','blueBright','default','maxLength','token','24705918YOeSBb','greenBright','example','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','1100792oCCaFC','isValidJSON','all','pattern','cursor','array','pagination','12229HbEsPB','askForJobRun','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','askForAddon','type','projects','askForVolume','resultCache','runs','prototype','Enter\x20the\x20','all-containers','uri','askForPipeline','YES','charAt','writable','editPayload','\x20characters,\x20is\x20','cmdPath','askForLogSink','stringify','success','volumes','askForProject','DynamicReloadPaginationPrompt','push','propToType','Yes,\x20send','askGeneric','Do\x20you\x20want\x20to\x20add','password','askConfirm','required','getPathString','pop','askForBuild','string','configurable','json','skipValidation','backupDestinations','service','template','askForSecret','join','askForService','done','list','__importDefault','all-job-runs','elements','value','What\x27s\x20the\x20','trim','job\x20runs','completedAt','tags','warning','values','writeFileSync','startedAt','Choose\x20the\x20login\x20token:','registryCredentials','contextProvider','data','restores','\x20to\x20use:','__createBinding','defaultPaginationPageSize','170865LrjvpV','setPathVars','confirmation','rawObject','getType','secret','Should\x20it\x20be','secrets','./utils','green','subdomainPath','grey','split','isBoolean','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','call','found','keys','askForBackupDestination'];a9c=function(){return cD;};return a9c();}Object[a9f(0x2b5)](exports,a9f(0x1f0),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a9f(0x1e9))),chalk_1=__importDefault(require(a9f(0x274))),fs=__importStar(require('fs')),utils_1=require(a9f(0x253)),api_helpers_1=require(a9f(0x1b1)),inquirer_pagination_prompt_1=require(a9f(0x295)),inquirer=require('inquirer'),inquirerSearchList=require(a9f(0x1ce)),yaml=require(a9f(0x27c));function a9E(c,E){const S=a9c();return a9E=function(X,u){X=X-0x1ae;let Y=S[X];return Y;},a9E(c,E);}var ConfirmChoices;(function(E){const T=a9f;E[T(0x213)]=T(0x221),E[T(0x2c0)]=T(0x293),E[T(0x2a8)]=T(0x296),E[T(0x1ed)]='No,\x20but\x20save\x20as\x20file',E[T(0x2c3)]=T(0x2ae);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(E){const M=a9f;this[M(0x1da)]=E,this['defaultPaginationPageSize']=0x32,this[M(0x216)]=S=>__awaiter(this,void 0x0,void 0x0,function*(){const m=M,{editedResult:X}=yield inquirer[m(0x277)]([{'type':'editor','name':m(0x292),'message':m(0x1c5),'default':yaml[m(0x2ab)](S)}]);return yaml[m(0x2b6)](X);}),this[M(0x297)]=S=>__awaiter(this,void 0x0,void 0x0,function*(){const z=M,X=d=>'Unexpected\x20file\x20type:\x20'+d+',\x20supported\x20types:\x20[json|yaml|yml]';function u(){return __awaiter(this,void 0x0,void 0x0,function*(){const N=a9E;return inquirer[N(0x277)]([{'type':N(0x260),'name':'fileName','message':N(0x1b2),'validate':d=>new RegExp(N(0x28a))[N(0x2a5)](d)?!![]:X(d)}]);});}const {fileName:Y}=yield u(),R=Y[z(0x27b)]()[z(0x257)]('.')[z(0x228)]();try{switch(R){case z(0x22c):(0x0,utils_1['success'])('Configuration\x20file\x20written\x20to\x20'+Y);return fs[z(0x241)](Y,JSON['stringify'](S,null,'\x20\x20'));case z(0x266):case z(0x1b5):(0x0,utils_1[z(0x21b)])('Configuration\x20file\x20written\x20to\x20'+Y);return fs[z(0x241)](Y,yaml[z(0x2ab)](S));default:(0x0,utils_1[z(0x23f)])(X(R));}}catch(d){(0x0,utils_1['warning'])('Writing\x20configuration\x20failed:\x20'+d[z(0x1d5)]);}return undefined;}),this['filter']=(S,X)=>u=>{const J=M,Y=typeof u==='string'?u[J(0x23b)]():u;return X===![]&&Y==='don\x27t\x20change'?'':Y;},this['validate']=(S,X,u)=>Y=>{const O=M;if(this[O(0x22d)]===!![])return!![];const R=[];if(Y===''||Y===O(0x29a)){if(X!==![])R[O(0x21f)]('this\x20option\x20is\x20required,\x20please\x20answer');else return!![];}S[O(0x209)]===O(0x22a)&&!_[O(0x1dd)](S[O(0x201)])&&R[O(0x21f)](new RegExp(S['pattern'])[O(0x2a5)](Y)?!![]:O(0x1df)+S[O(0x201)]+'\x27');S[O(0x209)]==='string'&&!_[O(0x1dd)](S[O(0x2c2)])&&R['push'](Y[O(0x2a3)]>=S[O(0x2c2)]?!![]:O(0x207)+S[O(0x2c2)]+O(0x217)+Y[O(0x2a3)]+'\x20characters');S[O(0x209)]==='string'&&!_[O(0x1dd)](S[O(0x1f8)])&&R[O(0x21f)](Y[O(0x2a3)]<=S[O(0x1f8)]?!![]:O(0x2bf)+S[O(0x1f8)]+'\x20characters,\x20is\x20'+Y[O(0x2a3)]+O(0x1b7));u&&Number['isNaN'](parseInt(Y,0xa))&&R[O(0x21f)]('must\x20be\x20a\x20number,\x20is\x20'+Y);S[O(0x209)]===O(0x1f4)&&!_[O(0x1dd)](S['minimum'])&&R[O(0x21f)](Y>=S[O(0x29e)]?!![]:O(0x272)+S[O(0x29e)]);S[O(0x209)]===O(0x1f4)&&!_[O(0x1dd)](S[O(0x28d)])&&R['push'](Y<=S[O(0x28d)]?!![]:O(0x29f)+S['maximum']);if(S[O(0x209)]===O(0x24e)){const P=(0x0,utils_1[O(0x1ff)])(Y);R['push'](P===![]||_['isEmpty'](P)?O(0x259):!![]);}const d=R[O(0x2a0)](U=>U!==!![]),w=(S===null||S===void 0x0?void 0x0:S[O(0x1fc)])?'\x0a'+chalk_1[O(0x1f7)][O(0x2a9)]('>>')+O(0x2b3)+chalk_1[O(0x1f7)]['whiteBright'](JSON['stringify'](S[O(0x1fc)])):'';return d['length']>0x0?d['join'](chalk_1[O(0x1f7)][O(0x2a2)](O(0x1d7)))+w:!![];},this[M(0x227)]=(S,X,u)=>{const C=M,Y=S[S[C(0x2a3)]-0x1];function R(){const k=C;return S[k(0x29c)](0x0,-0x1)['map'](P=>P[k(0x214)](0x0)['toUpperCase']()+P['slice'](0x1))[k(0x232)]('>');}const d=S[C(0x2a3)]>0x1?chalk_1[C(0x1f7)][C(0x1f2)][C(0x2b7)](R())+':\x20':'',w=u?'\x20('+chalk_1[C(0x1f7)]['blue'](u)+')':'';return chalk_1[C(0x1f7)][C(0x1d1)](''+d+X+'\x20'+chalk_1[C(0x1f7)][C(0x1bf)][C(0x1fb)](Y)+w+'?');},this[M(0x1cb)]=(S,X,u)=>__awaiter(this,void 0x0,void 0x0,function*(){const o=M;if(X[o(0x2a3)]<0x1){const d=u?o(0x299)+u:o(0x25b);throw new Error(o(0x1c3)+S+'\x20'+d+'.');}const Y=o(0x28f)+S+o(0x248),R=X[o(0x2a3)]>0x4?o(0x1dc):o(0x235);return(yield inquirer[o(0x277)]([{'type':R,'name':'name','message':Y,'choices':X}]))[o(0x1cd)];}),this[M(0x284)]=(S,X,u)=>__awaiter(this,void 0x0,void 0x0,function*(){const y=M,{elements:Y,nextCursor:R}=yield X();if(Y['length']<0x1){const P=u?y(0x299)+u:y(0x25b);throw new Error(y(0x1c3)+S+'\x20'+P+'.');}const d=y(0x28f)+S+y(0x248);if(R!==undefined){const U=({nextPageCursor:p})=>__awaiter(this,void 0x0,void 0x0,function*(){const e=y,q=yield X(p);return{'elements':q[e(0x238)],'nextPageCursor':q[e(0x1b9)]};});return(yield inquirer[y(0x277)]([{'type':'pagination-prompt','name':y(0x1cd),'message':d,'choices':Y,'nextPageCursor':R,'loadMore':U}]))[y(0x1cd)];}const w=Y[y(0x2a3)]>0x4?y(0x1dc):y(0x235);return(yield inquirer[y(0x277)]([{'type':w,'name':y(0x1cd),'message':d,'choices':Y}]))['name'];}),this[M(0x222)]=(S,X)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=M,u=''+(X?'('+chalk_1['default'][D(0x27a)](X)+')\x20':''),Y=D(0x20f)+chalk_1['default'][D(0x254)](S)+'\x20'+u+'to\x20use:',R=this[D(0x26e)]({'type':'string','required':!![]});return(yield inquirer[D(0x277)]([{'type':D(0x260),'name':D(0x1cd),'message':Y,'validate':R}]))[D(0x1cd)];}),this[M(0x225)]=S=>__awaiter(this,void 0x0,void 0x0,function*(){const x=M;return(yield inquirer[x(0x277)]([{'type':x(0x281),'name':x(0x1cd),'message':S,'default':!![]}]))['name'];}),this[M(0x233)]=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n=M,X=u=>__awaiter(this,void 0x0,void 0x0,function*(){const h=a9E,Y=yield this[h(0x1da)]['list'][h(0x288)][h(0x200)]({'parameters':{'projectId':u}}),R=Y['data'][h(0x288)][h(0x1b0)](d=>d['id']);return R;});return this[n(0x1e3)](n(0x22f),X,S);}),this[M(0x265)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const j=M,S=X=>__awaiter(this,void 0x0,void 0x0,function*(){const s=a9E;var u;const Y=yield this[s(0x1da)]['list'][s(0x1b4)]({'options':{'per_page':this[s(0x24a)],'cursor':X}}),R=Y[s(0x246)][s(0x1b4)][s(0x1b0)](d=>d['id']);return{'elements':R,'nextCursor':(u=Y[s(0x204)])===null||u===void 0x0?void 0x0:u['cursor']};});return this[j(0x284)](j(0x230),S);}),this['askForTag']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=M,S=X=>__awaiter(this,void 0x0,void 0x0,function*(){const a=a9E;var u,Y,R;const d=yield this[a(0x1da)][a(0x235)][a(0x23e)]({'options':{'per_page':this[a(0x24a)],'cursor':X}}),w=(Y=(u=d[a(0x246)][a(0x23e)])===null||u===void 0x0?void 0x0:u[a(0x1b0)](P=>P['id']))!==null&&Y!==void 0x0?Y:[];return{'elements':w,'nextCursor':(R=d[a(0x204)])===null||R===void 0x0?void 0x0:R[a(0x202)]};});return this[Q(0x284)](Q(0x1db),S);}),this[M(0x25d)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const L=M;var S;const X=yield this[L(0x1da)][L(0x235)][L(0x22e)][L(0x200)]({}),u=(S=X[L(0x246)][L(0x22e)][L(0x1b0)](Y=>Y['name']))!==null&&S!==void 0x0?S:[];return this['askForResource'](L(0x1d9),u);}),this[M(0x1d2)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=M,S=X=>__awaiter(this,void 0x0,void 0x0,function*(){const W=a9E;var u,Y,R;const d=yield this[W(0x1da)][W(0x235)]['cloud'][W(0x1d6)]({'options':{'per_page':this[W(0x24a)],'cursor':X}}),w=(Y=(u=d[W(0x246)]['clusters'])===null||u===void 0x0?void 0x0:u[W(0x1b0)](P=>P['name']))!==null&&Y!==void 0x0?Y:[];return{'elements':w,'nextCursor':(R=d[W(0x204)])===null||R===void 0x0?void 0x0:R[W(0x202)]};});return this[F(0x284)]('cluster\x20id',S);}),this[M(0x29d)]=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const i=M;if(_['isUndefined'](S))throw new Error(i(0x1e8));const X=u=>__awaiter(this,void 0x0,void 0x0,function*(){const v=i;var Y;let R=this['defaultPaginationPageSize'];const d=yield this[v(0x1da)][v(0x235)][v(0x286)]({'parameters':{'templateId':S},'options':{'per_page':R,'cursor':u}}),w=d[v(0x246)][v(0x286)][v(0x1b0)](P=>P['id']+v(0x1ca)+P[v(0x1ef)]+')');return{'elements':w,'nextCursor':(Y=d[v(0x204)])===null||Y===void 0x0?void 0x0:Y['cursor']};});return this[i(0x284)](i(0x2b2),X)[i(0x27e)](u=>u['split']('\x20')[0x0]);}),this[M(0x219)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const c1=M,S=X=>__awaiter(this,void 0x0,void 0x0,function*(){const c0=a9E;var u;let Y=this[c0(0x24a)];const R=yield this[c0(0x1da)]['list']['logSinks']({'options':{'per_page':Y,'cursor':X}}),d=R['data'][c0(0x1be)][c0(0x1b0)](w=>w['id']);return{'elements':d,'nextCursor':(u=R[c0(0x204)])===null||u===void 0x0?void 0x0:u[c0(0x202)]};});return this[c1(0x284)]('log\x20sink',S);}),this[M(0x212)]=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const c3=M,X=u=>__awaiter(this,void 0x0,void 0x0,function*(){const c2=a9E,Y=yield this[c2(0x1da)][c2(0x235)][c2(0x264)]['all']({'parameters':{'projectId':u}});return Y[c2(0x246)][c2(0x264)]['map'](R=>R['id']);});return this[c3(0x1e3)](c3(0x1c8),X,S);}),this['askForJob']=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const c5=M,X=u=>__awaiter(this,void 0x0,void 0x0,function*(){const c4=a9E,Y=yield this[c4(0x1da)][c4(0x235)]['jobs'][c4(0x200)]({'parameters':{'projectId':u}}),R=Y['data'][c4(0x291)][c4(0x1b0)](d=>d['id']);return R;});return this[c5(0x1e3)]('job',X,S);}),this[M(0x206)]=(S,X,u=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const c6=M,Y=c6(0x237),R=d=>w=>__awaiter(this,void 0x0,void 0x0,function*(){const c7=c6;var P;const U=yield this[c7(0x1da)]['get'][c7(0x1bc)][c7(0x20d)]({'parameters':{'projectId':d,'jobId':S},'options':{'per_page':this[c7(0x24a)],'cursor':w}}),p=U[c7(0x246)]['runs'][c7(0x1b0)](q=>q['id']+c7(0x1ca)+q[c7(0x242)]+')');return u&&p['unshift'](Y),{'elements':p,'nextCursor':(P=U[c7(0x204)])===null||P===void 0x0?void 0x0:P[c7(0x202)]};});return this[c6(0x280)](c6(0x23c),R,X,'job:\x20\x27'+S+'\x27')[c6(0x27e)](d=>{const c8=c6,w=d[c8(0x257)]('\x20')[0x0];if(w===Y)return undefined;return w;});}),this[M(0x229)]=(S,X,u,Y=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const c9=M,R=c9(0x1e6);if(u!==undefined){const d=w=>P=>__awaiter(this,void 0x0,void 0x0,function*(){const cc=c9;var U;const p=yield this[cc(0x1da)][cc(0x294)][cc(0x1bc)][cc(0x1de)]({'parameters':{'projectId':w,'jobId':u},'options':{'per_page':this[cc(0x24a)],'cursor':P}}),q=p['data'][cc(0x1de)][cc(0x1b0)](B=>B['id']+'\x20(startedAt:\x20'+B[cc(0x1ef)]+')');return Y&&q[cc(0x1cf)](R),{'elements':q,'nextCursor':(U=p[cc(0x204)])===null||U===void 0x0?void 0x0:U[cc(0x202)]};});return this[c9(0x280)]('job\x20builds',d,S,c9(0x2ad)+u+'\x27')[c9(0x27e)](w=>{const cE=c9,P=w[cE(0x257)]('\x20')[0x0];if(P===R)return undefined;return P;});}if(X!==undefined){const w=P=>U=>__awaiter(this,void 0x0,void 0x0,function*(){const cS=c9;var p;const q=yield this[cS(0x1da)]['get'][cS(0x22f)]['builds']({'parameters':{'projectId':P,'serviceId':X},'options':{'per_page':this[cS(0x24a)],'cursor':U}}),B=q[cS(0x246)][cS(0x1de)]['map'](V=>V['id']+cS(0x1ca)+V[cS(0x1ef)]+')');if(Y)B['unshift'](R);return{'elements':B,'nextCursor':(p=q[cS(0x204)])===null||p===void 0x0?void 0x0:p[cS(0x202)]};});return this[c9(0x280)](c9(0x1b6),w,S,c9(0x2b9)+u+'\x27')[c9(0x27e)](P=>{const cX=c9,U=P[cX(0x257)]('\x20')[0x0];if(U===R)return undefined;return U;});}throw new Error('No\x20builds\x20found');}),this['askForContainer']=(S,X,u,Y=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cu=M,R=cu(0x210);if(u!==undefined){const d=w=>P=>__awaiter(this,void 0x0,void 0x0,function*(){const cY=cu;var U,p;const q=yield this[cY(0x1da)]['get'][cY(0x1bc)][cY(0x28c)]({'parameters':{'projectId':w,'jobId':u},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':P}}),B=(U=q[cY(0x246)][cY(0x28c)])!==null&&U!==void 0x0?U:[],V=B===null||B===void 0x0?void 0x0:B['map'](g=>g['name']+'\x20(startedAt:\x20'+g['createdAt']+')');return Y&&V[cY(0x1cf)](R),{'elements':V,'nextCursor':(p=q['pagination'])===null||p===void 0x0?void 0x0:p[cY(0x202)]};});return this[cu(0x280)]('job\x20containers',d,S,cu(0x2ad)+u+'\x27')[cu(0x27e)](w=>{const P=w['split']('\x20')[0x0];if(P===R)return undefined;return P;});}if(X!==undefined){const w=P=>U=>__awaiter(this,void 0x0,void 0x0,function*(){const cR=cu;var p,q;const B=yield this[cR(0x1da)][cR(0x294)][cR(0x22f)][cR(0x28c)]({'parameters':{'projectId':P,'serviceId':X},'options':{'per_page':this[cR(0x24a)],'cursor':U}}),V=(p=B['data']['containers'])!==null&&p!==void 0x0?p:[],g=V[cR(0x1b0)](r=>r['name']+cR(0x1ca)+r[cR(0x1ef)]+')');if(Y)g===null||g===void 0x0?void 0x0:g[cR(0x1cf)](R);return{'elements':g,'nextCursor':(q=B['pagination'])===null||q===void 0x0?void 0x0:q['cursor']};});return this[cu(0x280)](cu(0x276),w,S,'service:\x20\x27'+u+'\x27')[cu(0x27e)](P=>{const U=P['split']('\x20')[0x0];if(U===R)return undefined;return U;});}throw new Error(cu(0x1ea));}),this[M(0x208)]=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cw=M,X=u=>__awaiter(this,void 0x0,void 0x0,function*(){const cd=a9E,Y=yield this['apiClient']['list'][cd(0x2a1)][cd(0x200)]({'parameters':{'projectId':u}});return Y[cd(0x246)]['addons'][cd(0x1b0)](R=>R['id']);});return this[cw(0x1e3)](cw(0x1ec),X,S);}),this[M(0x1ba)]=(S,X)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cU=M,u=Y=>R=>__awaiter(this,void 0x0,void 0x0,function*(){const cP=a9E;var d;const w=yield this[cP(0x1da)]['get'][cP(0x1ec)][cP(0x2b0)]({'parameters':{'projectId':Y,'addonId':X},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':R}});return{'elements':w[cP(0x246)][cP(0x2b0)][cP(0x1b0)](P=>P['id']+cP(0x1c6)+(P[cP(0x23d)]||cP(0x25f))+')'),'nextCursor':(d=w['pagination'])===null||d===void 0x0?void 0x0:d['cursor']};});return this[cU(0x280)](cU(0x2b0),u,S,cU(0x262)+X+'\x27')[cU(0x27e)](Y=>Y['split']('\x20')[0x0]);}),this[M(0x26b)]=(S,X,u)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cq=M,Y=R=>d=>__awaiter(this,void 0x0,void 0x0,function*(){const cp=a9E;var w;const P=yield this[cp(0x1da)]['get'][cp(0x1ec)][cp(0x1e2)][cp(0x247)]({'parameters':{'projectId':R,'addonId':X,'backupId':u},'options':{'per_page':this[cp(0x24a)],'cursor':d}});return{'elements':P[cp(0x246)][cp(0x247)][cp(0x1b0)](U=>U['id']+'\x20(completedAt:\x20'+(U[cp(0x23d)]||cp(0x25f))+')'),'nextCursor':(w=P[cp(0x204)])===null||w===void 0x0?void 0x0:w['cursor']};});return this['askForProjectScopedResourcePaginated']('restore',Y,S,'addon:\x20\x27'+X+'\x27')[cq(0x27e)](R=>R[cq(0x257)]('\x20')[0x0]);}),this[M(0x20b)]=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cV=M,X=u=>__awaiter(this,void 0x0,void 0x0,function*(){const cB=a9E;return(yield this[cB(0x1da)]['list'][cB(0x21c)]({'parameters':{'projectId':u}}))['data']['map'](Y=>Y['id']);});return this[cV(0x1e3)](cV(0x26d),X,S);}),this[M(0x231)]=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cr=M,X=u=>__awaiter(this,void 0x0,void 0x0,function*(){const cg=a9E,Y=yield this[cg(0x1da)][cg(0x235)][cg(0x252)][cg(0x200)]({'parameters':{'projectId':u}});return Y['data'][cg(0x252)][cg(0x1b0)](R=>R['id']);});return this[cr(0x1e3)](cr(0x250),X,S);}),this[M(0x1e7)]=S=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cH=M,X=yield this[cH(0x1da)]['get'][cH(0x282)]({'parameters':{'domain':S}}),u=X['data'][cH(0x1f1)]['map'](R=>R['name']+cH(0x2bb)+R['fullName']+')'),Y=cH(0x1f5)+S+')';return this['askForResource'](cH(0x1c2),u,Y)[cH(0x27e)](R=>R['split']('\x20')[0x0]);}),this['askForSubdomainPath']=(S,X)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const cf=M,u=yield this[cf(0x1da)]['list'][cf(0x1c2)]['path']({'parameters':{'domain':S,'subdomain':X}}),Y=u[cf(0x246)]['paths'][cf(0x1b0)](w=>''+w[cf(0x211)]),R=cf(0x1f5)+S+'),\x20subdomain\x20('+X+')';return this['askForResource'](cf(0x255),Y,R);}),this[M(0x1d4)]=S=>__awaiter(this,void 0x0,void 0x0,function*(){const cZ=M;return(yield inquirer[cZ(0x277)]([{'type':cZ(0x281),'name':cZ(0x24d),'message':chalk_1[cZ(0x1f7)][cZ(0x1c7)](cZ(0x290)+(S||cZ(0x2b4))+cZ(0x1fd)),'default':![]}]))['confirmation'];}),this[M(0x2aa)]=(S,X)=>__awaiter(this,void 0x0,void 0x0,function*(){const cK=M;_[cK(0x1dd)](S['name'])&&(X['length']<=0x0?_[cK(0x279)](S,cK(0x1cd),cK(0x1f7)):yield(0x0,utils_1[cK(0x268)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const ct=cK,{name:u}=yield inquirer[ct(0x277)]([{'type':ct(0x260),'name':ct(0x1cd),'message':'Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','default':ct(0x287)}]);if(!S[ct(0x273)]&&X[ct(0x1d3)](Y=>Y[ct(0x1cd)]===u)){const {c:Y}=yield inquirer[ct(0x277)]([{'type':ct(0x281),'name':'c','message':'Context\x20with\x20name\x20\x27'+u+ct(0x1cc),'default':![]}]);if(Y===![])throw new Error(ct(0x25e));_['set'](S,ct(0x273),!![]);}_[ct(0x279)](S,ct(0x1cd),u);})));if(_['isUndefined'](S[cK(0x1f9)])){const u=yield this['tokenPrompt']();_[cK(0x279)](S,cK(0x1f9),u);}return S;}),this[M(0x28e)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const cG=M,{token:S}=yield inquirer[cG(0x277)]([{'type':cG(0x224),'name':cG(0x1f9),'mask':'*','message':cG(0x243)}]);return S;}),inquirer[M(0x267)]('search-list',inquirerSearchList),inquirer[M(0x267)](M(0x1c0),inquirer_pagination_prompt_1[M(0x21e)]);}[a9f(0x1e4)](E,S){return __awaiter(this,void 0x0,void 0x0,function*(){const cb=a9E,X=yaml[cb(0x2ab)](E),u=_[cb(0x1ee)](X[cb(0x257)]('\x0a')[cb(0x1b0)](d=>d[cb(0x2a3)])),Y=chalk_1['default'][cb(0x256)]('-'['repeat'](u)+'\x0a'),{confirm:R}=yield inquirer['prompt']([{'type':'list','name':cb(0x281),'message':''+chalk_1[cb(0x1f7)][cb(0x1bf)][cb(0x254)]('Please\x20confirm\x20following\x20configuration:\x0a')+Y+chalk_1['default'][cb(0x1f6)](X)+Y,'choices':Object[cb(0x240)](ConfirmChoices)}]);switch(R){case ConfirmChoices[cb(0x213)]:return E;case ConfirmChoices[cb(0x2c3)]:throw new Error(cb(0x261));case ConfirmChoices[cb(0x2c0)]:return this[cb(0x2c4)](S);case ConfirmChoices[cb(0x2a8)]:return this[cb(0x1e4)](yield this['editPayload'](E),S);case ConfirmChoices['SAVE']:yield this[cb(0x297)](E);return this[cb(0x1e4)](E,S);default:throw new Error(cb(0x289));}});}[a9f(0x2c4)](E,S){return __awaiter(this,void 0x0,void 0x0,function*(){const cl=a9E;if((S===null||S===void 0x0?void 0x0:S[cl(0x20c)])!==undefined)this[cl(0x20c)]=S===null||S===void 0x0?void 0x0:S[cl(0x20c)];this['tmpCmdPath']=S===null||S===void 0x0?void 0x0:S[cl(0x218)],this[cl(0x22d)]=S===null||S===void 0x0?void 0x0:S['skipValidation'];const X={};return yield this[cl(0x220)]([],E[cl(0x283)]['body'],X),this[cl(0x20c)]=X,yield this['confirmationPrompt'](X,E);});}['propToType'](E,S,X,u){return __awaiter(this,void 0x0,void 0x0,function*(){const cA=a9E;let Y;if(S[cA(0x2a4)]&&!_[cA(0x2ac)](S,cA(0x2be))){if(S[cA(0x2a4)][cA(0x2a3)]>0x1){const {choice:R}=yield inquirer[cA(0x277)]([{'type':'list','name':cA(0x1d8),'message':'What\x27s\x20the\x20'+(E[E['length']-0x1]||'')+cA(0x1ae),'choices':S[cA(0x2a4)][cA(0x1b0)](d=>{const cI=cA;var w;return(w=d[cI(0x1c4)])!==null&&w!==void 0x0?w:'??';})}]);Y=yield this[cA(0x24f)](E,S['oneOf'][cA(0x1d3)](d=>d[cA(0x1c4)]===R),X,u);}else{const d=S[cA(0x2a4)][0x0];_['set'](d,cA(0x1c4),S['description']),Y=yield this[cA(0x24f)](E,d,X,u);}Y={};}else{if(S[cA(0x1b8)]&&!_[cA(0x2ac)](S,cA(0x2be))){if(S[cA(0x1b8)][cA(0x2a3)]>0x1){const {choice:w}=yield inquirer[cA(0x277)]([{'type':cA(0x235),'name':cA(0x1d8),'message':cA(0x23a)+(E[E[cA(0x2a3)]-0x1]||'')+cA(0x1ae),'choices':[...S[cA(0x1b8)][cA(0x1b0)](P=>{const cT=cA;var U;return(U=P[cT(0x1c4)])!==null&&U!==void 0x0?U:'??';}),cA(0x29a)]}]);w!==cA(0x29a)&&(Y=yield this[cA(0x24f)](E,S[cA(0x1b8)][cA(0x1d3)](P=>P[cA(0x1c4)]===w),X,u));}else{const P=S['anyOf'][0x0];_[cA(0x279)](P,cA(0x1c4),S['description']),Y=yield this[cA(0x24f)](E,P,X,u);}Y={};}else Y=yield this[cA(0x24f)](E,S,X,u);}return Y;});}['getInnerType'](E,S,X,u){var Y;return __awaiter(this,void 0x0,void 0x0,function*(){const cM=a9E;if(u===![]){const {addEntry:w}=yield inquirer['prompt']([{'type':'confirm','name':cM(0x2bd),'message':this[cM(0x227)](S,cM(0x223),E===null||E===void 0x0?void 0x0:E[cM(0x1c4)]),'default':![]}]);if(!w)return X;}const R=Object[cM(0x25c)]((Y=E===null||E===void 0x0?void 0x0:E[cM(0x2be)])!==null&&Y!==void 0x0?Y:[]),d=E[cM(0x226)]||[];if(R[cM(0x2a3)]>0x0)for(const P of R){const U=S['concat'](P);if(S[cM(0x2a3)]>0x0&&!_[cM(0x2ac)](X,S[cM(0x232)]('.')))_[cM(0x279)](X,S['join']('.'),{});yield this[cM(0x220)](U,E[cM(0x2be)][P],X,d[cM(0x27d)](P));}else yield this[cM(0x24f)](S,Object['assign'](Object[cM(0x1bb)]({},E),{'type':cM(0x24e)}),X,u);return X;});}[a9f(0x28b)](E,S,X,u){return __awaiter(this,void 0x0,void 0x0,function*(){const cm=a9E;if(S&&X)return!![];const Y=S?'Do\x20you\x20want\x20to\x20add':cm(0x1c9),{addEntry:R}=yield inquirer[cm(0x277)]([{'type':cm(0x281),'name':cm(0x2bd),'message':this[cm(0x227)](E,Y,S?u:undefined),'default':![]}]);return R;});}[a9f(0x24f)](E,S,X,u){return __awaiter(this,void 0x0,void 0x0,function*(){const cN=a9E;let Y;const R=E[cN(0x232)]('.');switch(S===null||S===void 0x0?void 0x0:S[cN(0x209)]){case cN(0x203):{let d=!![];while(yield this[cN(0x28b)](E,d,u,S===null||S===void 0x0?void 0x0:S[cN(0x1c4)])){const w=_['get'](X,R);_[cN(0x27f)](X,R),yield this[cN(0x24f)](E,S['items'],X);const P=_[cN(0x294)](X,R);!_[cN(0x1bd)](w)?_[cN(0x279)](X,R,[P]):(w[cN(0x21f)](P),_[cN(0x279)](X,R,w)),d=![];}return Y||[];}case cN(0x29b):{return Y=yield this[cN(0x26f)](S,E,X,u),Y;}case'rawObject':Y=(0x0,utils_1[cN(0x1ff)])(yield this[cN(0x26a)](E,S,u))||undefined;break;case cN(0x22a):case cN(0x26c):case'integer':default:Y=yield this[cN(0x26a)](E,S,u,X);break;}return!_['isUndefined'](Y)&&_[cN(0x279)](X,R,Y),Y;});}[a9f(0x26a)](E,S,X,u){var Y;return __awaiter(this,void 0x0,void 0x0,function*(){const cz=a9E,R=E[E[cz(0x2a3)]-0x1],{defaultValue:defaultValue=(Y=S===null||S===void 0x0?void 0x0:S[cz(0x1fc)])!==null&&Y!==void 0x0?Y:S===null||S===void 0x0?void 0x0:S[cz(0x1f7)],choices:choices=S===null||S===void 0x0?void 0x0:S['enum'],pagination:d}=yield(0x0,api_helpers_1[cz(0x2a7)])(R,this[cz(0x1da)],this[cz(0x1b3)],u,this[cz(0x2bc)],E);let w=cz(0x260);if(!_['isUndefined'](choices)&&choices[cz(0x2a3)]>0x0){if(d!==undefined&&d[cz(0x275)]!==undefined)w=cz(0x1c0);else choices['length']>0x4&&typeof choices[0x0]==='string'?w=cz(0x1dc):w=cz(0x235);}else{if((S===null||S===void 0x0?void 0x0:S[cz(0x209)])===cz(0x26c))w=cz(0x281);else{if((S===null||S===void 0x0?void 0x0:S[cz(0x209)])===cz(0x1f4))w=cz(0x260);else(S===null||S===void 0x0?void 0x0:S['type'])===cz(0x24e)&&(w=cz(0x2c1));}}let P=X!==![]?!_['isObject'](defaultValue)?defaultValue:JSON[cz(0x21a)](defaultValue):_[cz(0x258)](defaultValue)?defaultValue:'don\x27t\x20change';if(choices)P=P[cz(0x27b)]();_[cz(0x2ac)](this[cz(0x20c)],E[cz(0x232)]('.'))&&(P=this[cz(0x20c)][E[cz(0x232)]('.')]);const U=choices&&X===![]?[cz(0x29a),...choices]:choices,p=(S===null||S===void 0x0?void 0x0:S[cz(0x209)])===cz(0x1f4),q=Object[cz(0x1bb)]({'type':w,'name':'id','message':this[cz(0x1e1)](E,S),'choices':U,'default':P,'filter':this['filter'](w,X),'validate':this[cz(0x26e)](S,X,p)},d),B=(yield inquirer[cz(0x277)]([q]))['id'];if(B===cz(0x29a)||B==='')return undefined;if(p)return parseInt(B,0xa);return B;});}[a9f(0x1e1)](E,S){const cJ=a9f,X=(S===null||S===void 0x0?void 0x0:S[cJ(0x209)])!==cJ(0x26c)?'What\x20do\x20you\x20want\x20to\x20use\x20as':cJ(0x251);return this['getPathString'](E,X,S===null||S===void 0x0?void 0x0:S['description']);}[a9f(0x21d)](){return __awaiter(this,void 0x0,void 0x0,function*(){const cO=a9E,E=yield this[cO(0x1da)]['list'][cO(0x20a)]['all']({})['then'](S=>S[cO(0x246)]['projects'][cO(0x1b0)](X=>X['id']));return yield this[cO(0x1cb)](cO(0x270),E);});}[a9f(0x1e3)](E,S,X,u){return __awaiter(this,void 0x0,void 0x0,function*(){const cC=a9E,Y=X||this[cC(0x1da)][cC(0x245)][cC(0x1af)]();if(_['isUndefined'](Y))throw new Error(cC(0x1eb));const R=yield S(Y);return yield this[cC(0x1cb)](E,R,(u?u+cC(0x1e0):'')+cC(0x263)+Y+'\x27');});}[a9f(0x280)](E,S,X,u){return __awaiter(this,void 0x0,void 0x0,function*(){const ck=a9E,Y=X||this['apiClient'][ck(0x245)][ck(0x1af)]();if(_[ck(0x1dd)](Y))throw new Error(ck(0x1eb));const R=yield S(Y);return yield this[ck(0x284)](E,R,(u?u+ck(0x1e0):'')+ck(0x263)+Y+'\x27');});}[a9f(0x1e5)](){return __awaiter(this,void 0x0,void 0x0,function*(){const co=a9E,E=yield this[co(0x1da)]['list']['domains'][co(0x200)]({}),S=E['data']['domains'][co(0x1b0)](X=>X['name']);return this[co(0x1cb)](co(0x282),S);});}[a9f(0x2b1)](){return __awaiter(this,void 0x0,void 0x0,function*(){const cy=a9E,E=yield this[cy(0x1da)][cy(0x235)][cy(0x244)][cy(0x200)]({}),S=E[cy(0x246)]['credentials'][cy(0x1b0)](X=>X['id']);return this['askForResource'](cy(0x2af),S);});}[a9f(0x24c)](E){const ce=a9f;this[ce(0x2bc)]=E;}}exports['InquirerHelper']=InquirerHelper;
|
|
1
|
+
'use strict';function a9K(U,K){const q=a9U();return a9K=function(X,J){X=X-0xb6;let v=q[X];return v;},a9K(U,K);}const a9R=a9K;(function(U,K){const w=a9K,q=U();while(!![]){try{const X=parseInt(w(0xc1))/0x1+parseInt(w(0x144))/0x2*(parseInt(w(0xcf))/0x3)+parseInt(w(0x111))/0x4*(parseInt(w(0x190))/0x5)+-parseInt(w(0xe3))/0x6+-parseInt(w(0x182))/0x7*(parseInt(w(0x10c))/0x8)+-parseInt(w(0x1c0))/0x9*(-parseInt(w(0x11f))/0xa)+-parseInt(w(0x107))/0xb*(parseInt(w(0xd9))/0xc);if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a9U,0x6766d));function a9U(){const Ut=['askForAddonBackup','yaml','3274578smgURO','charAt','slice','domains','service\x20build','fetchResourceList','isUndefined','items','askConfirm','data','paths','askForTemplate','tmpCmdPath','bold','__createBinding','prompt','What\x20do\x20you\x20want\x20to\x20use\x20as','setPathVars','trim','unshift','askForJob','No,\x20but\x20save\x20as\x20file','to\x20use:','writable','validate','No\x20','askForResource','domain\x20(','askArrayEntry','path','Do\x20you\x20want\x20to\x20add\x20more','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','toString','addon','then','REPEAT','33fNvCEa','create','startedAt','\x20(full\x20domain:\x20','isArray','8LOACFX','EDIT','greenBright','pattern','nextCursor','20PSXRaK','type','found','hasOwnProperty','domain','name','list','addEntry','No\x20builds\x20found','boolean','set','askForPipeline','minimum','ask','10030UcOxmS','Please\x20confirm\x20following\x20configuration:\x0a','nextPageCursor','safeDump','string','chalk','Do\x20you\x20want\x20to\x20add','saveFile','cmdPath','service:\x20\x27','askForClusterId','secret','throw','defaultPaginationPageSize','askForSubdomainPath','Choose\x20the\x20','choice','default','InquirerHelper','confirm','tokenPrompt','askForProjectScopedResourcePaginated','No\x20containers\x20found','all-job-runs','Enter\x20the\x20','\x20(startedAt:\x20','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','askForResourcePaginated','call','pipeline','body','resultCache','createdAt','unset','./api-helpers','askForBuild','askForLogSink','25150cqbfvM','getPathString','warning','get','rawObject','all-builds','getType','green','uri','addon:\x20\x27','values','a\x20Northflank\x20resource','Configuration\x20file\x20written\x20to\x20','addons','subdomainPath','projects','next','fileName','askForSecret','find','maxLength','job','pathVars','apiClient','\x20(completedAt:\x20','completedAt','askForService','blueBright','blue','\x20characters','__esModule','join','job:\x20\x27','concat','this\x20option\x20is\x20required,\x20please\x20answer','split','\x20Example:\x20','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','askForTag','anyOf','search-list','isObject','services','filter','clusters','grey','opt','\x20characters,\x20is\x20','main-context','volume','registerPrompt','backupDestinations','secrets','for\x20this\x20','editor','object','getInnerType','Choose\x20the\x20login\x20token:','YES','\x20in\x20','\x20type?','properties','1983954AinfiA','project:\x20\x27','oneOf',',\x20supported\x20types:\x20[json|yaml|yml]','skipValidation','\x20and\x20it\x20','required','cloud','pipelines','job\x20builds','defineProperty','length','template\x20run','isValidJSON','560605wWarXx','cursor','token','backups','logSinks','red','includes','all','configurable','credentials','service','override','stringify','cluster\x20id','containers','doesn\x27t\x20match\x20pattern\x20\x27','Unexpected\x20file\x20type:\x20','propToType','assign','__setModuleDefault','__importDefault','builds','pagination-prompt','askForTemplateRun','restores','js-yaml','templateRuns','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','Context\x20name\x20already\x20exists.','has','contextProvider','Context\x20with\x20name\x20\x27','whiteBright','description','Something\x20unexpected\x20happened.','array','isEmpty','job\x20containers','askForDomain','restore','writeFileSync','integer','input','jobs','SAVE','askForBackupDestination','DynamicReloadPaginationPrompt','\x20to\x20use:','6732Zkyxlk','map','isBoolean','example','Aborted.','Writing\x20configuration\x20failed:\x20','askGeneric','.*\x5c.(json|yaml|yml)$','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','push','test','minLength','826573GmFTkw','editPayload','confirmationPrompt','volumes','askForProject','done','templates','),\x20subdomain\x20(','fullName','retrievePayloadViaInteractiveCli','askForCredentials','maximum','askForProjectScopedResource','pop','3HgJFZj','runs','__importStar','getQuestionString','value','don\x27t\x20change','subdomain','job\x20runs','log\x20sink','service\x20containers','3589116WScPvG','tags','pagination','not\x20completed','No,\x20edit','retry','yellowBright','lodash'];a9U=function(){return Ut;};return a9U();}var __createBinding=this&&this[a9R(0xf1)]||(Object[a9R(0x108)]?function(U,K,q,X){const W=a9R;if(X===undefined)X=q;var J=Object['getOwnPropertyDescriptor'](K,q);(!J||(W(0x147)in J?!K[W(0x162)]:J[W(0xfa)]||J[W(0x198)]))&&(J={'enumerable':!![],'get':function(){return K[q];}}),Object[W(0x18c)](U,X,J);}:function(U,K,q,X){if(X===undefined)X=q;U[X]=K[q];}),__setModuleDefault=this&&this[a9R(0x1a3)]||(Object[a9R(0x108)]?function(U,K){const V=a9R;Object['defineProperty'](U,V(0x130),{'enumerable':!![],'value':K});}:function(U,K){U['default']=K;}),__importStar=this&&this[a9R(0xd1)]||function(U){const b=a9R;if(U&&U[b(0x162)])return U;var K={};if(U!=null){for(var q in U)if(q!==b(0x130)&&Object['prototype'][b(0x114)][b(0x13b)](U,q))__createBinding(K,U,q);}return __setModuleDefault(K,U),K;},__awaiter=this&&this['__awaiter']||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const a=a9K;function L(z){const B=a9K;try{E(X[B(0x154)](z));}catch(p){f(p);}}function M(z){const y=a9K;try{E(X[y(0x12b)](z));}catch(p){f(p);}}function E(z){const x=a9K;z[x(0xc6)]?v(z[x(0xd3)]):J(z[x(0xd3)])[x(0x105)](L,M);}E((X=X['apply'](U,K||[]))[a(0x154)]());});},__importDefault=this&&this[a9R(0x1a4)]||function(U){const m=a9R;return U&&U[m(0x162)]?U:{'default':U};};Object['defineProperty'](exports,a9R(0x162),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a9R(0xe0))),chalk_1=__importDefault(require(a9R(0x124))),fs=__importStar(require('fs')),utils_1=require('./utils'),api_helpers_1=require(a9R(0x141)),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require('inquirer'),inquirerSearchList=require('inquirer-search-list'),yaml=require(a9R(0x1a9));var ConfirmChoices;(function(U){const i=a9R;U[i(0x17e)]='Yes,\x20send',U[i(0x106)]='No,\x20repeat',U['EDIT']=i(0xdd),U[i(0x1bc)]=i(0xf8),U['ABORT']='No,\x20abort';}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(U){const G=a9R;this[G(0x15b)]=U,this[G(0x12c)]=0x32,this[G(0xc2)]=K=>__awaiter(this,void 0x0,void 0x0,function*(){const A=G,{editedResult:q}=yield inquirer['prompt']([{'type':A(0x17a),'name':'editedResult','message':'Go\x20to\x20editor','default':yaml[A(0x122)](K)}]);return yaml['safeLoad'](q);}),this[G(0x126)]=K=>__awaiter(this,void 0x0,void 0x0,function*(){const s=G,q=f=>s(0x1a0)+f+s(0x185);function X(){return __awaiter(this,void 0x0,void 0x0,function*(){const D=a9K;return inquirer['prompt']([{'type':'input','name':D(0x155),'message':'Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','validate':f=>new RegExp(D(0xbc))[D(0xbf)](f)?!![]:q(f)}]);});}const {fileName:J}=yield X(),v=J[s(0x103)]()['split']('.')[s(0xce)]();try{switch(v){case'json':(0x0,utils_1['success'])(s(0x150)+J);return fs[s(0x1b8)](J,JSON['stringify'](K,null,'\x20\x20'));case s(0xe2):case'yml':(0x0,utils_1['success'])(s(0x150)+J);return fs[s(0x1b8)](J,yaml[s(0x122)](K));default:(0x0,utils_1[s(0x146)])(q(v));}}catch(f){(0x0,utils_1[s(0x146)])(s(0xba)+f['message']);}return undefined;}),this[G(0x16f)]=(K,q)=>X=>{const H=G,J=typeof X===H(0x123)?X[H(0xf5)]():X;return q===![]&&J===H(0xd4)?'':J;},this[G(0xfb)]=(K,q,X)=>J=>{const g=G;if(this[g(0x186)]===!![])return!![];const v=[];if(J===''||J===g(0xd4)){if(q!==![])v[g(0xbe)](g(0x166));else return!![];}K[g(0x112)]==='string'&&!_[g(0xe9)](K[g(0x10f)])&&v['push'](new RegExp(K[g(0x10f)])[g(0xbf)](J)?!![]:g(0x19f)+K['pattern']+'\x27');K[g(0x112)]===g(0x123)&&!_['isUndefined'](K['minLength'])&&v[g(0xbe)](J[g(0x18d)]>=K['minLength']?!![]:g(0x1ab)+K[g(0xc0)]+g(0x173)+J[g(0x18d)]+g(0x161));K[g(0x112)]===g(0x123)&&!_[g(0xe9)](K[g(0x158)])&&v[g(0xbe)](J[g(0x18d)]<=K[g(0x158)]?!![]:g(0xbd)+K['maxLength']+'\x20characters,\x20is\x20'+J[g(0x18d)]+g(0x161));X&&Number['isNaN'](parseInt(J,0xa))&&v[g(0xbe)]('must\x20be\x20a\x20number,\x20is\x20'+J);K[g(0x112)]==='integer'&&!_[g(0xe9)](K[g(0x11d)])&&v[g(0xbe)](J>=K['minimum']?!![]:'must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20'+K[g(0x11d)]);K[g(0x112)]===g(0x1b9)&&!_[g(0xe9)](K[g(0xcc)])&&v[g(0xbe)](J<=K['maximum']?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+K[g(0xcc)]);if(K[g(0x112)]===g(0x148)){const M=(0x0,utils_1['isValidJSON'])(J);v[g(0xbe)](M===![]||_[g(0x1b4)](M)?'must\x20be\x20a\x20valid\x20non-empty\x20json\x20string':!![]);}const f=v[g(0x16f)](E=>E!==!![]),L=(K===null||K===void 0x0?void 0x0:K['example'])?'\x0a'+chalk_1[g(0x130)][g(0x195)]('>>')+g(0x168)+chalk_1[g(0x130)][g(0x1b0)](JSON[g(0x19c)](K['example'])):'';return f['length']>0x0?f[g(0x163)](chalk_1[g(0x130)]['underline'](g(0x187)))+L:!![];},this[G(0x145)]=(K,q,X)=>{const S=G,J=K[K[S(0x18d)]-0x1];function v(){const C=S;return K[C(0xe5)](0x0,-0x1)[C(0xb6)](M=>M[C(0xe4)](0x0)['toUpperCase']()+M[C(0xe5)](0x1))[C(0x163)]('>');}const f=K[S(0x18d)]>0x1?chalk_1[S(0x130)]['bgGrey'][S(0x1b0)](v())+':\x20':'',L=X?'\x20('+chalk_1['default'][S(0x160)](X)+')':'';return chalk_1[S(0x130)]['reset'](''+f+q+'\x20'+chalk_1[S(0x130)]['bold'][S(0x10e)](J)+L+'?');},this[G(0xfd)]=(K,q,X)=>__awaiter(this,void 0x0,void 0x0,function*(){const N=G;if(q['length']<0x1){const f=X?N(0x179)+X:N(0x113);throw new Error(N(0xfc)+K+'\x20'+f+'.');}const J=N(0x12e)+K+N(0x1bf),v=q['length']>0x4?N(0x16c):'list';return(yield inquirer[N(0xf2)]([{'type':v,'name':N(0x116),'message':J,'choices':q}]))[N(0x116)];}),this[G(0x13a)]=(K,q,X)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=G,{elements:J,nextCursor:v}=yield q();if(J[Z(0x18d)]<0x1){const M=X?Z(0x179)+X:Z(0x113);throw new Error(Z(0xfc)+K+'\x20'+M+'.');}const f=Z(0x12e)+K+Z(0x1bf);if(v!==undefined){const E=({nextPageCursor:z})=>__awaiter(this,void 0x0,void 0x0,function*(){const e=Z,p=yield q(z);return{'elements':p['elements'],'nextPageCursor':p[e(0x110)]};});return(yield inquirer['prompt']([{'type':Z(0x1a6),'name':'name','message':f,'choices':J,'nextPageCursor':v,'loadMore':E}]))[Z(0x116)];}const L=J[Z(0x18d)]>0x4?Z(0x16c):Z(0x117);return(yield inquirer[Z(0xf2)]([{'type':L,'name':Z(0x116),'message':f,'choices':J}]))[Z(0x116)];}),this[G(0xbb)]=(K,q)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n=G,X=''+(q?'('+chalk_1[n(0x130)][n(0x160)](q)+')\x20':''),J=n(0x137)+chalk_1[n(0x130)][n(0x14b)](K)+'\x20'+X+n(0xf9),v=this['validate']({'type':n(0x123),'required':!![]});return(yield inquirer['prompt']([{'type':n(0x1ba),'name':'name','message':J,'validate':v}]))[n(0x116)];}),this[G(0xeb)]=K=>__awaiter(this,void 0x0,void 0x0,function*(){const t=G;return(yield inquirer[t(0xf2)]([{'type':t(0x132),'name':'name','message':K,'default':!![]}]))[t(0x116)];}),this[G(0x15e)]=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l=G,q=X=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a9K,J=yield this[Y(0x15b)][Y(0x117)][Y(0x16e)][Y(0x197)]({'parameters':{'projectId':X}}),v=J[Y(0xec)]['services'][Y(0xb6)](f=>f['id']);return v;});return this[l(0xcd)](l(0x19a),q,K);}),this[G(0xee)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const I=G,K=q=>__awaiter(this,void 0x0,void 0x0,function*(){const T=a9K;var X;const J=yield this['apiClient'][T(0x117)][T(0xc7)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':q}}),v=J['data']['templates'][T(0xb6)](f=>f['id']);return{'elements':v,'nextCursor':(X=J[T(0xdb)])===null||X===void 0x0?void 0x0:X['cursor']};});return this[I(0x13a)]('template',K);}),this[G(0x16a)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=G,K=q=>__awaiter(this,void 0x0,void 0x0,function*(){const h=a9K;var X,J,v;const f=yield this[h(0x15b)][h(0x117)]['tags']({'options':{'per_page':this[h(0x12c)],'cursor':q}}),L=(J=(X=f[h(0xec)][h(0xda)])===null||X===void 0x0?void 0x0:X[h(0xb6)](M=>M['id']))!==null&&J!==void 0x0?J:[];return{'elements':L,'nextCursor':(v=f['pagination'])===null||v===void 0x0?void 0x0:v[h(0x191)]};});return this[P(0x13a)]('tag',K);}),this[G(0x1bd)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const k=G;var K;const q=yield this[k(0x15b)][k(0x117)][k(0x177)][k(0x197)]({}),X=(K=q[k(0xec)][k(0x177)][k(0xb6)](J=>J[k(0x116)]))!==null&&K!==void 0x0?K:[];return this[k(0xfd)]('backup\x20destination',X);}),this[G(0x129)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const d=G,K=q=>__awaiter(this,void 0x0,void 0x0,function*(){const u=a9K;var X,J,v;const f=yield this[u(0x15b)]['list'][u(0x189)][u(0x170)]({'options':{'per_page':this[u(0x12c)],'cursor':q}}),L=(J=(X=f[u(0xec)][u(0x170)])===null||X===void 0x0?void 0x0:X[u(0xb6)](M=>M[u(0x116)]))!==null&&J!==void 0x0?J:[];return{'elements':L,'nextCursor':(v=f[u(0xdb)])===null||v===void 0x0?void 0x0:v[u(0x191)]};});return this[d(0x13a)](d(0x19d),K);}),this[G(0x1a7)]=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const r=G;if(_[r(0xe9)](K))throw new Error('Template\x20id\x20not\x20provided.');const q=X=>__awaiter(this,void 0x0,void 0x0,function*(){const j=r;var J;let v=this[j(0x12c)];const f=yield this[j(0x15b)][j(0x117)][j(0x1aa)]({'parameters':{'templateId':K},'options':{'per_page':v,'cursor':X}}),L=f['data'][j(0x1aa)]['map'](M=>M['id']+j(0x138)+M['createdAt']+')');return{'elements':L,'nextCursor':(J=f['pagination'])===null||J===void 0x0?void 0x0:J[j(0x191)]};});return this[r(0x13a)](r(0x18e),q)['then'](X=>X[r(0x167)]('\x20')[0x0]);}),this[G(0x143)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const U1=G,K=q=>__awaiter(this,void 0x0,void 0x0,function*(){const U0=a9K;var X;let J=this['defaultPaginationPageSize'];const v=yield this['apiClient']['list']['logSinks']({'options':{'per_page':J,'cursor':q}}),f=v[U0(0xec)][U0(0x194)][U0(0xb6)](L=>L['id']);return{'elements':f,'nextCursor':(X=v[U0(0xdb)])===null||X===void 0x0?void 0x0:X[U0(0x191)]};});return this[U1(0x13a)](U1(0xd7),K);}),this[G(0x11c)]=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const U3=G,q=X=>__awaiter(this,void 0x0,void 0x0,function*(){const U2=a9K,J=yield this[U2(0x15b)][U2(0x117)][U2(0x18a)][U2(0x197)]({'parameters':{'projectId':X}});return J[U2(0xec)][U2(0x18a)]['map'](v=>v['id']);});return this['askForProjectScopedResource'](U3(0x13c),q,K);}),this[G(0xf7)]=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const U5=G,q=X=>__awaiter(this,void 0x0,void 0x0,function*(){const U4=a9K,J=yield this['apiClient'][U4(0x117)][U4(0x1bb)][U4(0x197)]({'parameters':{'projectId':X}}),v=J[U4(0xec)][U4(0x1bb)][U4(0xb6)](f=>f['id']);return v;});return this[U5(0xcd)]('job',q,K);}),this['askForJobRun']=(K,q,X=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const U6=G,J=U6(0x136),v=f=>L=>__awaiter(this,void 0x0,void 0x0,function*(){const U7=U6;var M;const E=yield this[U7(0x15b)]['get'][U7(0x159)][U7(0xd0)]({'parameters':{'projectId':f,'jobId':K},'options':{'per_page':this[U7(0x12c)],'cursor':L}}),z=E['data'][U7(0xd0)]['map'](p=>p['id']+U7(0x138)+p[U7(0x109)]+')');return X&&z[U7(0xf6)](J),{'elements':z,'nextCursor':(M=E[U7(0xdb)])===null||M===void 0x0?void 0x0:M[U7(0x191)]};});return this[U6(0x134)](U6(0xd6),v,q,U6(0x164)+K+'\x27')[U6(0x105)](f=>{const L=f['split']('\x20')[0x0];if(L===J)return undefined;return L;});}),this[G(0x142)]=(K,q,X,J=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const U8=G,v=U8(0x149);if(X!==undefined){const f=L=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const U9=U8;var E;const z=yield this[U9(0x15b)][U9(0x147)][U9(0x159)][U9(0x1a5)]({'parameters':{'projectId':L,'jobId':X},'options':{'per_page':this[U9(0x12c)],'cursor':M}}),p=z['data'][U9(0x1a5)][U9(0xb6)](O=>O['id']+U9(0x138)+O[U9(0x13f)]+')');return J&&p[U9(0xf6)](v),{'elements':p,'nextCursor':(E=z['pagination'])===null||E===void 0x0?void 0x0:E[U9(0x191)]};});return this[U8(0x134)](U8(0x18b),f,K,'job:\x20\x27'+X+'\x27')[U8(0x105)](L=>{const UU=U8,M=L[UU(0x167)]('\x20')[0x0];if(M===v)return undefined;return M;});}if(q!==undefined){const L=M=>E=>__awaiter(this,void 0x0,void 0x0,function*(){const UK=U8;var z;const p=yield this[UK(0x15b)][UK(0x147)][UK(0x19a)][UK(0x1a5)]({'parameters':{'projectId':M,'serviceId':q},'options':{'per_page':this[UK(0x12c)],'cursor':E}}),O=p['data'][UK(0x1a5)][UK(0xb6)](F=>F['id']+'\x20(startedAt:\x20'+F[UK(0x13f)]+')');if(J)O[UK(0xf6)](v);return{'elements':O,'nextCursor':(z=p['pagination'])===null||z===void 0x0?void 0x0:z[UK(0x191)]};});return this[U8(0x134)](U8(0xe7),L,K,'service:\x20\x27'+X+'\x27')[U8(0x105)](M=>{const Uq=U8,E=M[Uq(0x167)]('\x20')[0x0];if(E===v)return undefined;return E;});}throw new Error(U8(0x119));}),this['askForContainer']=(K,q,X,J=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const UJ=G,v='all-containers';if(X!==undefined){const f=L=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const UX=a9K;var E,z;const p=yield this[UX(0x15b)][UX(0x147)]['job'][UX(0x19e)]({'parameters':{'projectId':L,'jobId':X},'options':{'per_page':this[UX(0x12c)],'cursor':M}}),O=(E=p[UX(0xec)][UX(0x19e)])!==null&&E!==void 0x0?E:[],F=O===null||O===void 0x0?void 0x0:O[UX(0xb6)](o=>o['name']+'\x20(startedAt:\x20'+o[UX(0x13f)]+')');return J&&F['unshift'](v),{'elements':F,'nextCursor':(z=p[UX(0xdb)])===null||z===void 0x0?void 0x0:z[UX(0x191)]};});return this[UJ(0x134)](UJ(0x1b5),f,K,'job:\x20\x27'+X+'\x27')[UJ(0x105)](L=>{const M=L['split']('\x20')[0x0];if(M===v)return undefined;return M;});}if(q!==undefined){const L=M=>E=>__awaiter(this,void 0x0,void 0x0,function*(){const Uv=UJ;var z,p;const O=yield this[Uv(0x15b)]['get'][Uv(0x19a)][Uv(0x19e)]({'parameters':{'projectId':M,'serviceId':q},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':E}}),F=(z=O[Uv(0xec)]['containers'])!==null&&z!==void 0x0?z:[],o=F[Uv(0xb6)](Q=>Q[Uv(0x116)]+Uv(0x138)+Q[Uv(0x13f)]+')');if(J)o===null||o===void 0x0?void 0x0:o[Uv(0xf6)](v);return{'elements':o,'nextCursor':(p=O[Uv(0xdb)])===null||p===void 0x0?void 0x0:p[Uv(0x191)]};});return this['askForProjectScopedResourcePaginated'](UJ(0xd8),L,K,UJ(0x128)+X+'\x27')[UJ(0x105)](M=>{const Uf=UJ,E=M[Uf(0x167)]('\x20')[0x0];if(E===v)return undefined;return E;});}throw new Error(UJ(0x135));}),this['askForAddon']=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const UM=G,q=X=>__awaiter(this,void 0x0,void 0x0,function*(){const UL=a9K,J=yield this[UL(0x15b)][UL(0x117)][UL(0x151)][UL(0x197)]({'parameters':{'projectId':X}});return J[UL(0xec)][UL(0x151)][UL(0xb6)](v=>v['id']);});return this[UM(0xcd)]('addon',q,K);}),this[G(0xe1)]=(K,q)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Uz=G,X=J=>v=>__awaiter(this,void 0x0,void 0x0,function*(){const UE=a9K;var f;const L=yield this['apiClient']['get'][UE(0x104)][UE(0x193)]({'parameters':{'projectId':J,'addonId':q},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':v}});return{'elements':L[UE(0xec)][UE(0x193)][UE(0xb6)](M=>M['id']+'\x20(completedAt:\x20'+(M[UE(0x15d)]||UE(0xdc))+')'),'nextCursor':(f=L[UE(0xdb)])===null||f===void 0x0?void 0x0:f[UE(0x191)]};});return this[Uz(0x134)](Uz(0x193),X,K,Uz(0x14d)+q+'\x27')[Uz(0x105)](J=>J[Uz(0x167)]('\x20')[0x0]);}),this['askForAddonRestore']=(K,q,X)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const UO=G,J=v=>f=>__awaiter(this,void 0x0,void 0x0,function*(){const Up=a9K;var L;const M=yield this['apiClient']['get'][Up(0x104)]['backup'][Up(0x1a8)]({'parameters':{'projectId':v,'addonId':q,'backupId':X},'options':{'per_page':this[Up(0x12c)],'cursor':f}});return{'elements':M[Up(0xec)][Up(0x1a8)]['map'](E=>E['id']+Up(0x15c)+(E[Up(0x15d)]||Up(0xdc))+')'),'nextCursor':(L=M[Up(0xdb)])===null||L===void 0x0?void 0x0:L[Up(0x191)]};});return this[UO(0x134)](UO(0x1b7),J,K,UO(0x14d)+q+'\x27')[UO(0x105)](v=>v[UO(0x167)]('\x20')[0x0]);}),this['askForVolume']=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Uo=G,q=X=>__awaiter(this,void 0x0,void 0x0,function*(){const UF=a9K;return(yield this[UF(0x15b)][UF(0x117)][UF(0xc4)]({'parameters':{'projectId':X}}))['data'][UF(0xb6)](J=>J['id']);});return this[Uo(0xcd)](Uo(0x175),q,K);}),this[G(0x156)]=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Uw=G,q=X=>__awaiter(this,void 0x0,void 0x0,function*(){const UQ=a9K,J=yield this[UQ(0x15b)][UQ(0x117)][UQ(0x178)][UQ(0x197)]({'parameters':{'projectId':X}});return J[UQ(0xec)][UQ(0x178)][UQ(0xb6)](v=>v['id']);});return this[Uw(0xcd)](Uw(0x12a),q,K);}),this['askForSubdomain']=K=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const UR=G,q=yield this[UR(0x15b)][UR(0x147)][UR(0x115)]({'parameters':{'domain':K}}),X=q[UR(0xec)]['subdomains']['map'](v=>v[UR(0x116)]+UR(0x10a)+v[UR(0xc9)]+')'),J='domain\x20('+K+')';return this[UR(0xfd)](UR(0xd5),X,J)['then'](v=>v['split']('\x20')[0x0]);}),this[G(0x12d)]=(K,q)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const UW=G,X=yield this[UW(0x15b)][UW(0x117)][UW(0xd5)][UW(0x100)]({'parameters':{'domain':K,'subdomain':q}}),J=X[UW(0xec)][UW(0xed)][UW(0xb6)](f=>''+f[UW(0x14c)]),v=UW(0xfe)+K+UW(0xc8)+q+')';return this['askForResource'](UW(0x152),J,v);}),this['deleteWarningPrompt']=K=>__awaiter(this,void 0x0,void 0x0,function*(){const UV=G;return(yield inquirer[UV(0xf2)]([{'type':'confirm','name':'confirmation','message':chalk_1[UV(0x130)][UV(0xdf)]('WARNING:\x20You\x20are\x20about\x20to\x20delete\x20'+(K||UV(0x14f))+UV(0x169)),'default':![]}]))['confirmation'];}),this['loginPrompt']=(K,q)=>__awaiter(this,void 0x0,void 0x0,function*(){const Ub=G;_['isUndefined'](K['name'])&&(q['length']<=0x0?_[Ub(0x11b)](K,Ub(0x116),Ub(0x130)):yield(0x0,utils_1[Ub(0xde)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const UB=Ub,{name:X}=yield inquirer[UB(0xf2)]([{'type':UB(0x1ba),'name':UB(0x116),'message':UB(0x139),'default':UB(0x174)}]);if(!K[UB(0x19b)]&&q[UB(0x157)](J=>J[UB(0x116)]===X)){const {c:J}=yield inquirer[UB(0xf2)]([{'type':UB(0x132),'name':'c','message':UB(0x1af)+X+UB(0x102),'default':![]}]);if(J===![])throw new Error(UB(0x1ac));_[UB(0x11b)](K,UB(0x19b),!![]);}_[UB(0x11b)](K,UB(0x116),X);})));if(_[Ub(0xe9)](K['token'])){const X=yield this['tokenPrompt']();_[Ub(0x11b)](K,Ub(0x192),X);}return K;}),this[G(0x133)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Uy=G,{token:K}=yield inquirer[Uy(0xf2)]([{'type':'password','name':Uy(0x192),'mask':'*','message':Uy(0x17d)}]);return K;}),inquirer[G(0x176)](G(0x16c),inquirerSearchList),inquirer[G(0x176)](G(0x1a6),inquirer_pagination_prompt_1[G(0x1be)]);}[a9R(0xc3)](U,K){return __awaiter(this,void 0x0,void 0x0,function*(){const Ux=a9K,q=yaml[Ux(0x122)](U),X=_['max'](q[Ux(0x167)]('\x0a')[Ux(0xb6)](f=>f[Ux(0x18d)])),J=chalk_1[Ux(0x130)][Ux(0x171)]('-'['repeat'](X)+'\x0a'),{confirm:v}=yield inquirer['prompt']([{'type':'list','name':Ux(0x132),'message':''+chalk_1[Ux(0x130)][Ux(0xf0)][Ux(0x14b)](Ux(0x120))+J+chalk_1[Ux(0x130)][Ux(0x15f)](q)+J,'choices':Object[Ux(0x14e)](ConfirmChoices)}]);switch(v){case ConfirmChoices[Ux(0x17e)]:return U;case ConfirmChoices['ABORT']:throw new Error(Ux(0xb9));case ConfirmChoices['REPEAT']:return this[Ux(0xca)](K);case ConfirmChoices[Ux(0x10d)]:return this[Ux(0xc3)](yield this[Ux(0xc2)](U),K);case ConfirmChoices[Ux(0x1bc)]:yield this[Ux(0x126)](U);return this['confirmationPrompt'](U,K);default:throw new Error(Ux(0x1b2));}});}[a9R(0xca)](U,K){return __awaiter(this,void 0x0,void 0x0,function*(){const Ua=a9K;if((K===null||K===void 0x0?void 0x0:K[Ua(0x13e)])!==undefined)this[Ua(0x13e)]=K===null||K===void 0x0?void 0x0:K[Ua(0x13e)];this['tmpCmdPath']=K===null||K===void 0x0?void 0x0:K[Ua(0x127)],this['skipValidation']=K===null||K===void 0x0?void 0x0:K['skipValidation'];const q={};return yield this[Ua(0x1a1)]([],U[Ua(0x172)][Ua(0x13d)],q),this[Ua(0x13e)]=q,yield this['confirmationPrompt'](q,U);});}[a9R(0x1a1)](U,K,q,X){return __awaiter(this,void 0x0,void 0x0,function*(){const Um=a9K;let J;if(K['oneOf']&&!_['has'](K,Um(0x181))){if(K['oneOf']['length']>0x1){const {choice:v}=yield inquirer[Um(0xf2)]([{'type':Um(0x117),'name':'choice','message':'What\x27s\x20the\x20'+(U[U[Um(0x18d)]-0x1]||'')+Um(0x180),'choices':K[Um(0x184)][Um(0xb6)](f=>{const Ui=Um;var L;return(L=f[Ui(0x1b1)])!==null&&L!==void 0x0?L:'??';})}]);J=yield this[Um(0x14a)](U,K[Um(0x184)]['find'](f=>f[Um(0x1b1)]===v),q,X);}else{const f=K[Um(0x184)][0x0];_[Um(0x11b)](f,Um(0x1b1),K[Um(0x1b1)]),J=yield this[Um(0x14a)](U,f,q,X);}J={};}else{if(K[Um(0x16b)]&&!_[Um(0x1ad)](K,Um(0x181))){if(K[Um(0x16b)][Um(0x18d)]>0x1){const {choice:L}=yield inquirer[Um(0xf2)]([{'type':Um(0x117),'name':Um(0x12f),'message':'What\x27s\x20the\x20'+(U[U[Um(0x18d)]-0x1]||'')+Um(0x180),'choices':[...K['anyOf'][Um(0xb6)](M=>{const UG=Um;var E;return(E=M[UG(0x1b1)])!==null&&E!==void 0x0?E:'??';}),Um(0xd4)]}]);L!==Um(0xd4)&&(J=yield this[Um(0x14a)](U,K[Um(0x16b)][Um(0x157)](M=>M[Um(0x1b1)]===L),q,X));}else{const M=K['anyOf'][0x0];_[Um(0x11b)](M,'description',K[Um(0x1b1)]),J=yield this['getType'](U,M,q,X);}J={};}else J=yield this[Um(0x14a)](U,K,q,X);}return J;});}['getInnerType'](U,K,q,X){var J;return __awaiter(this,void 0x0,void 0x0,function*(){const UA=a9K;if(X===![]){const {addEntry:L}=yield inquirer[UA(0xf2)]([{'type':UA(0x132),'name':UA(0x118),'message':this[UA(0x145)](K,UA(0x125),U===null||U===void 0x0?void 0x0:U['description']),'default':![]}]);if(!L)return q;}const v=Object['keys']((J=U===null||U===void 0x0?void 0x0:U[UA(0x181)])!==null&&J!==void 0x0?J:[]),f=U[UA(0x188)]||[];if(v[UA(0x18d)]>0x0)for(const M of v){const E=K[UA(0x165)](M);if(K[UA(0x18d)]>0x0&&!_[UA(0x1ad)](q,K[UA(0x163)]('.')))_[UA(0x11b)](q,K['join']('.'),{});yield this[UA(0x1a1)](E,U[UA(0x181)][M],q,f[UA(0x196)](M));}else yield this[UA(0x14a)](K,Object['assign'](Object[UA(0x1a2)]({},U),{'type':UA(0x148)}),q,X);return q;});}['askArrayEntry'](U,K,q,X){return __awaiter(this,void 0x0,void 0x0,function*(){const Us=a9K;if(K&&q)return!![];const J=K?Us(0x125):Us(0x101),{addEntry:v}=yield inquirer[Us(0xf2)]([{'type':Us(0x132),'name':'addEntry','message':this[Us(0x145)](U,J,K?X:undefined),'default':![]}]);return v;});}[a9R(0x14a)](U,K,q,X){return __awaiter(this,void 0x0,void 0x0,function*(){const UD=a9K;let J;const v=U['join']('.');switch(K===null||K===void 0x0?void 0x0:K[UD(0x112)]){case UD(0x1b3):{let f=!![];while(yield this[UD(0xff)](U,f,X,K===null||K===void 0x0?void 0x0:K[UD(0x1b1)])){const L=_[UD(0x147)](q,v);_[UD(0x140)](q,v),yield this[UD(0x14a)](U,K[UD(0xea)],q);const M=_['get'](q,v);!_[UD(0x10b)](L)?_[UD(0x11b)](q,v,[M]):(L['push'](M),_[UD(0x11b)](q,v,L)),f=![];}return J||[];}case UD(0x17b):{return J=yield this[UD(0x17c)](K,U,q,X),J;}case UD(0x148):J=(0x0,utils_1[UD(0x18f)])(yield this[UD(0x11e)](U,K,X))||undefined;break;case UD(0x123):case UD(0x11a):case UD(0x1b9):default:J=yield this['ask'](U,K,X,q);break;}return!_['isUndefined'](J)&&_[UD(0x11b)](q,v,J),J;});}[a9R(0x11e)](U,K,q,X){var J;return __awaiter(this,void 0x0,void 0x0,function*(){const UH=a9K,v=U[U[UH(0x18d)]-0x1],{defaultValue:defaultValue=(J=K===null||K===void 0x0?void 0x0:K[UH(0xb8)])!==null&&J!==void 0x0?J:K===null||K===void 0x0?void 0x0:K[UH(0x130)],choices:choices=K===null||K===void 0x0?void 0x0:K['enum'],pagination:f}=yield(0x0,api_helpers_1[UH(0xe8)])(v,this[UH(0x15b)],this[UH(0xef)],X,this[UH(0x15a)],U);let L='input';if(!_[UH(0xe9)](choices)&&choices['length']>0x0){if(f!==undefined&&f[UH(0x121)]!==undefined)L=UH(0x1a6);else choices[UH(0x18d)]>0x4&&typeof choices[0x0]==='string'?L='search-list':L='list';}else{if((K===null||K===void 0x0?void 0x0:K[UH(0x112)])==='boolean')L=UH(0x132);else{if((K===null||K===void 0x0?void 0x0:K[UH(0x112)])===UH(0x1b9))L=UH(0x1ba);else(K===null||K===void 0x0?void 0x0:K[UH(0x112)])===UH(0x148)&&(L=UH(0x17a));}}let M=q!==![]?!_[UH(0x16d)](defaultValue)?defaultValue:JSON[UH(0x19c)](defaultValue):_[UH(0xb7)](defaultValue)?defaultValue:UH(0xd4);if(choices)M=M['toString']();_['has'](this[UH(0x13e)],U['join']('.'))&&(M=this['resultCache'][U[UH(0x163)]('.')]);const E=choices&&q===![]?[UH(0xd4),...choices]:choices,z=(K===null||K===void 0x0?void 0x0:K['type'])===UH(0x1b9),p=Object[UH(0x1a2)]({'type':L,'name':'id','message':this[UH(0xd2)](U,K),'choices':E,'default':M,'filter':this[UH(0x16f)](L,q),'validate':this['validate'](K,q,z)},f),O=(yield inquirer[UH(0xf2)]([p]))['id'];if(O===UH(0xd4)||O==='')return undefined;if(z)return parseInt(O,0xa);return O;});}[a9R(0xd2)](U,K){const Ug=a9R,q=(K===null||K===void 0x0?void 0x0:K[Ug(0x112)])!==Ug(0x11a)?Ug(0xf3):'Should\x20it\x20be';return this[Ug(0x145)](U,q,K===null||K===void 0x0?void 0x0:K['description']);}[a9R(0xc5)](){return __awaiter(this,void 0x0,void 0x0,function*(){const US=a9K,U=yield this[US(0x15b)][US(0x117)][US(0x153)][US(0x197)]({})['then'](K=>K[US(0xec)][US(0x153)][US(0xb6)](q=>q['id']));return yield this[US(0xfd)]('project',U);});}[a9R(0xcd)](U,K,q,X){return __awaiter(this,void 0x0,void 0x0,function*(){const UC=a9K,J=q||this[UC(0x15b)]['contextProvider']['getCurrentProjectName']();if(_['isUndefined'](J))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const v=yield K(J);return yield this[UC(0xfd)](U,v,(X?X+UC(0x17f):'')+'project:\x20\x27'+J+'\x27');});}[a9R(0x134)](U,K,q,X){return __awaiter(this,void 0x0,void 0x0,function*(){const UN=a9K,J=q||this[UN(0x15b)][UN(0x1ae)]['getCurrentProjectName']();if(_['isUndefined'](J))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const v=yield K(J);return yield this[UN(0x13a)](U,v,(X?X+UN(0x17f):'')+UN(0x183)+J+'\x27');});}[a9R(0x1b6)](){return __awaiter(this,void 0x0,void 0x0,function*(){const UZ=a9K,U=yield this['apiClient'][UZ(0x117)][UZ(0xe6)][UZ(0x197)]({}),K=U[UZ(0xec)][UZ(0xe6)][UZ(0xb6)](q=>q[UZ(0x116)]);return this[UZ(0xfd)](UZ(0x115),K);});}[a9R(0xcb)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Ue=a9K,U=yield this['apiClient'][Ue(0x117)]['registryCredentials'][Ue(0x197)]({}),K=U[Ue(0xec)][Ue(0x199)][Ue(0xb6)](q=>q['id']);return this[Ue(0xfd)](Ue(0x199),K);});}[a9R(0xf4)](U){const Un=a9R;this[Un(0x15a)]=U;}}exports[a9R(0x131)]=InquirerHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a10U(){const t=['__awaiter','baseUrl','apply','__esModule','3LuUbqh','http:','aborted','unable\x20to\x20parse\x20message:\x20','value','write','idle','getOwnPropertyDescriptor','status','1104555OYRqMJ','create','error','Unexpected\x20response','call','init','NorthflankApiBrowserLogin','agent','SIGINT','initPackage','removeListener','Unexpected\x20response,\x20api\x20token\x20missing','8229144gNaYZe','default','parse','init-ack','configurable','browser-opened','90300NacCbd','2582391cgKCte','next','EventEmitter','duplex','stringify','finally','openBrowser','replace','end','18999zROgGk','10730SqhykH','message','open','createWebSocketStream','writable','done','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','handleError','__importStar','data','exit','1962498dSsyWr','success','error\x20happened\x20during\x20browser\x20login:\x20','login-failure','emit','Failure\x20during\x20login:\x20','prototype','6hFXaLB','ws:','startLogin','hasOwnProperty','defineProperty','3993720vIXdDM','Unable\x20to\x20open\x20browser:\x20','then','get','Login\x20process\x20stopped\x20before\x20completed','wss:'];a10U=function(){return t;};return a10U();}const a10y=a10K;(function(U,K){const b=a10K,q=U();while(!![]){try{const X=-parseInt(b(0x164))/0x1+parseInt(b(0x17a))/0x2*(-parseInt(b(0x149))/0x3)+parseInt(b(0x13f))/0x4+-parseInt(b(0x152))/0x5+-parseInt(b(0x13a))/0x6*(parseInt(b(0x165))/0x7)+-parseInt(b(0x15e))/0x8+-parseInt(b(0x16e))/0x9*(-parseInt(b(0x16f))/0xa);if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a10U,0x8c04d));var __createBinding=this&&this['__createBinding']||(Object['create']?function(U,K,q,X){const B=a10K;if(X===undefined)X=q;var J=Object[B(0x150)](K,q);(!J||(B(0x142)in J?!K[B(0x148)]:J[B(0x173)]||J[B(0x162)]))&&(J={'enumerable':!![],'get':function(){return K[q];}}),Object['defineProperty'](U,X,J);}:function(U,K,q,X){if(X===undefined)X=q;U[X]=K[q];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a10y(0x153)]?function(U,K){const x=a10y;Object[x(0x13e)](U,x(0x15f),{'enumerable':!![],'value':K});}:function(U,K){U['default']=K;}),__importStar=this&&this[a10y(0x177)]||function(U){const a=a10y;if(U&&U[a(0x148)])return U;var K={};if(U!=null){for(var q in U)if(q!==a(0x15f)&&Object[a(0x180)][a(0x13d)][a(0x156)](U,q))__createBinding(K,U,q);}return __setModuleDefault(K,U),K;},__awaiter=this&&this[a10y(0x145)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const i=a10K;function L(z){try{E(X['next'](z));}catch(p){f(p);}}function M(z){try{E(X['throw'](z));}catch(p){f(p);}}function E(z){const m=a10K;z[m(0x174)]?v(z[m(0x14d)]):J(z[m(0x14d)])[m(0x141)](L,M);}E((X=X[i(0x147)](U,K||[]))[i(0x166)]());});},__importDefault=this&&this['__importDefault']||function(U){const G=a10y;return U&&U[G(0x148)]?U:{'default':U};};function a10K(U,K){const q=a10U();return a10K=function(X,J){X=X-0x13a;let v=q[X];return v;},a10K(U,K);}Object[a10y(0x13e)](exports,a10y(0x148),{'value':!![]}),exports[a10y(0x158)]=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a10y(0x171))),events_1=require('events');class NorthflankApiBrowserLogin extends events_1[a10y(0x167)]{constructor(U,K=!![],q){const A=a10y;super(),this[A(0x146)]=U,this[A(0x16b)]=K,this['agent']=q,this[A(0x151)]=A(0x14f),this[A(0x15b)]=()=>JSON[A(0x169)]({'type':A(0x157)});}[a10y(0x13c)](){const s=a10y;var U;const K=this[s(0x146)][s(0x16c)]('https:',s(0x144))[s(0x16c)](s(0x14a),s(0x13b)),q=K+'/v1/cli-login',X=new ws_1['default'](q,{'agent':this[s(0x159)]}),J=()=>__awaiter(this,void 0x0,void 0x0,function*(){const H=s;yield new Promise(f=>{const D=a10K;var L;(L=this[D(0x168)])===null||L===void 0x0?void 0x0:L[D(0x16d)](JSON[D(0x169)]({'type':D(0x14b)}),()=>f());}),process[H(0x179)]();}),v=new Promise((f,L)=>{const g=s;var M,E,z;try{this['duplex']=(0x0,ws_1[g(0x172)])(X),process['on'](g(0x15a),J);}catch(p){L(new Error(g(0x175)+p['message']));}(M=this[g(0x168)])===null||M===void 0x0?void 0x0:M['on'](g(0x178),O=>{const S=g;var F;const o=JSON[S(0x160)](O['toString']());switch(o===null||o===void 0x0?void 0x0:o['type']){case S(0x161):{const {loginPage:Q}=o;if(Q===undefined){this[S(0x176)](S(0x155),L);return;}this[S(0x16b)]&&(0x0,open_1[S(0x15f)])(Q)['catch'](w=>{const C=S,R=C(0x140)+w['message'];this[C(0x176)](R,L);});this[S(0x17e)](S(0x163),{'url':Q});break;}case'login-success':{const {apiToken:w,contextName:R}=o;if(w===undefined){this[S(0x176)](S(0x15d),L);return;}(F=this[S(0x168)])===null||F===void 0x0?void 0x0:F[S(0x16d)](),f({'token':w,'contextName':R}),this[S(0x151)]=S(0x17b);break;}case S(0x17d):{const W=S(0x17f)+(o===null||o===void 0x0?void 0x0:o[S(0x170)]);this[S(0x176)](W,L);break;}default:{const V=S(0x14c)+JSON[S(0x169)](o);this[S(0x176)](V,L);}}}),(E=this['duplex'])===null||E===void 0x0?void 0x0:E['on']('error',O=>{const N=g;this[N(0x176)](N(0x17c)+O['message'],L);}),(z=this[g(0x168)])===null||z===void 0x0?void 0x0:z['on']('end',()=>{const Z=g;if(this[Z(0x151)]===Z(0x17b)){}else this[Z(0x176)](Z(0x143),L);});});return(U=this[s(0x168)])===null||U===void 0x0?void 0x0:U[s(0x14e)](this[s(0x15b)]()),this[s(0x151)]=s(0x157),v[s(0x16a)](()=>{const e=s;process[e(0x15c)](e(0x15a),J);});}[a10y(0x176)](U,K){const n=a10y;var q,X;K?(q=this[n(0x168)])===null||q===void 0x0?void 0x0:q[n(0x16d)](()=>K(new Error(U))):(X=this[n(0x168)])===null||X===void 0x0?void 0x0:X[n(0x16d)](),this[n(0x151)]=n(0x154);}}exports['NorthflankApiBrowserLogin']=NorthflankApiBrowserLogin;
|
package/dist/logs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a11F=a11E;(function(c,E){const W=a11E,S=c();while(!![]){try{const X=parseInt(W(0x13f))/0x1+parseInt(W(0x161))/0x2*(parseInt(W(0x163))/0x3)+-parseInt(W(0x1ae))/0x4+-parseInt(W(0x133))/0x5*(parseInt(W(0x182))/0x6)+parseInt(W(0x1a9))/0x7+-parseInt(W(0x19f))/0x8+parseInt(W(0x178))/0x9*(parseInt(W(0x1b7))/0xa);if(X===E)break;else S['push'](S['shift']());}catch(u){S['push'](S['shift']());}}}(a11c,0x543c4));var __awaiter=this&&this[a11F(0x146)]||function(c,E,S,X){function u(Y){return Y instanceof S?Y:new S(function(R){R(Y);});}return new(S||(S=Promise))(function(Y,R){const c0=a11E;function d(p){const i=a11E;try{U(X[i(0x174)](p));}catch(q){R(q);}}function w(p){try{U(X['throw'](p));}catch(q){R(q);}}function U(p){const v=a11E;p[v(0x15c)]?Y(p[v(0x17e)]):u(p[v(0x17e)])[v(0x149)](d,w);}U((X=X['apply'](c,E||[]))[c0(0x174)]());});},__importDefault=this&&this[a11F(0x1bb)]||function(c){const c1=a11F;return c&&c[c1(0x19e)]?c:{'default':c};};Object['defineProperty'](exports,a11F(0x19e),{'value':!![]}),exports[a11F(0x177)]=void 0x0;function a11c(){const cY=['>\x20Container\x20logs','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','build-','Id]','\x20(exit\x20with\x20','getStandardLogCommand','--textIncludes\x20<text>','getSeconds','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','inquirerHelper','charAt','Restore\x20to\x20get\x20logs\x20from','customUserAgent','next','--startTime\x20<timestamp>','runId','CliLogs','65187VMVfNy','--backup\x20--backupId\x20[backupId]','deploymentId','\x27Ctrl+C\x27','values','--project\x20--projectId\x20[projectId]','value','data','json','forEach','41550TtjjVd','\x20for\x20all\x20containers','getLogsCommand','Project\x20for\x20logs','-d,\x20--direction\x20<order>','logRange','@northflank/js-client','option','start','Which\x20log\x20types\x20to\x20fetch','getCurrentProjectName','addonRestore','Number\x20of\x20lines\x20to\x20return.','logsApiClient','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.','../inquirer-helper','-o,\x20--output\x20[output]','setSeconds','parseDateInput','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','../utils','logs','tail','printInitInfo','textIncludes','printResponse','restoreId','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','__esModule','3490848nppBRs','Error\x20while\x20fetching\x20log\x20lines:\x20','--build\x20--buildId\x20[buildId]','--run\x20--runId\x20[runId]','--container\x20--containerId\x20[containerId]','\x20of\x20','containerId','buildId',',\x20to:\x20','Error\x20while\x20tailing\x20log\x20lines:\x20','4694746zDqfhm','askForContainer','tsHint','addonBackup','getFormatter','491412vATAGI','\x20for\x20container\x20','Get\x20logs\x20generated\x20after\x20this\x20time,\x20','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','regexNotIncludes','hasNextPage','textNotIncludes','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','askForJobRun','250ROQXCc','--restore\x20--restoreId\x20[restoreId]','forward','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','__importDefault','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','askForAddonRestore','yaml','commander','default','logTail','--regexNotIncludes\x20<regex>','service','valueOf','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','addOption',',\x20restore\x20id\x20','Backup\x20to\x20get\x20logs\x20from','\x0aDetails:\x20','length','-l,\x20--lineLimit\x20[limit]','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','Get\x20log\x20for\x20the\x20specified\x20','close','error','375GNVaPa','apiClient','details','log','LogType','askForBuild','regexIncludes','addon','\x20seconds','askForJob','-t,\x20--types\x20<types...>','slice','571526dpelMD','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','askForAddonBackup','argParser','\x20--','format','yml','__awaiter','conflicts','job','then','\x20with\x20live-tailing','bold','--noDefaults','--deployment\x20--deploymentId\x20[deploymentId]','--textNotIncludes\x20<text>','cursor','Build\x20to\x20get\x20logs\x20from','assign','addonId','chalk','defaultDurationSeconds','askForProject','--endTime\x20<timestamp>','getCurrentJobName','choices','description','Option','askForService','done','InquirerHelper','noDefaults','toISOString','backward','666gGtITa','Deployment\x20id,\x20example:\x20my-service-54785f4','3eUXtem','-f,\x20--tail','warning',',\x20from:\x20'];a11c=function(){return cY;};return a11c();}const js_client_1=require(a11F(0x188)),chalk_1=__importDefault(require(a11F(0x153))),utils_1=require(a11F(0x196)),inquirer_helper_1=require(a11F(0x191)),commander_1=require(a11F(0x1bf)),console_format_helpers_1=require('../formatting/console-format-helpers'),log_formatter_1=require('./log-formatter');class CliLogs{constructor(c,E){const c2=a11F;this['apiContext']=c,this[c2(0x154)]=0x708,this[c2(0x16c)]=(S,X,u,Y)=>{const c3=c2,R=(0x0,utils_1['getCommand'])(!![])['name']((X?c3(0x169):'')+c3(0x197))['alias']((X?c3(0x169):'')+c3(0x136))[c3(0x159)](c3(0x130)+S)[c3(0x189)](c3(0x17d),c3(0x185))[c3(0x189)]('--'+S+c3(0x143)+S+'Id\x20['+S+c3(0x16a),S[c3(0x171)](0x0)['toUpperCase']()+S[c3(0x13e)](0x1)+'\x20to\x20get\x20logs\x20from')[c3(0x189)](c3(0x1a3),c3(0x140));if(X)R[c3(0x189)](c3(0x1a1),c3(0x150));if(S==='job')R[c3(0x189)](c3(0x1a2),c3(0x12f));if(S===c3(0x1c3))R['option'](c3(0x14d),c3(0x162));if(u)R[c3(0x189)](c3(0x179),c3(0x12b));if(Y)R[c3(0x189)](c3(0x1b8),c3(0x172));return!X&&!u&&!Y&&R['addOption'](new commander_1[(c3(0x15a))](c3(0x13d),c3(0x18b))[c3(0x158)](Object[c3(0x17c)](js_client_1[c3(0x137)]))),R[c3(0x189)](c3(0x164),c3(0x190))[c3(0x189)](c3(0x12e),c3(0x18e))[c3(0x189)](c3(0x175),c3(0x1b0)+utils_1[c3(0x1ab)],utils_1[c3(0x194)])[c3(0x129)](new commander_1[(c3(0x15a))](c3(0x156),c3(0x195)+utils_1[c3(0x1ab)])[c3(0x142)](utils_1[c3(0x194)])[c3(0x147)]([c3(0x198)]))[c3(0x189)]('--duration\x20[duration]',c3(0x16f))['addOption'](new commander_1['Option'](c3(0x186),c3(0x19d))['choices']([c3(0x160),c3(0x1b9)])[c3(0x147)]([c3(0x198)]))['addOption'](new commander_1[(c3(0x15a))](c3(0x16d),'Filter\x20log\x20lines\x20to\x20include\x20this\x20text')[c3(0x147)]([c3(0x1b4),c3(0x139),c3(0x1b2)]))['addOption'](new commander_1[(c3(0x15a))](c3(0x14e),'Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text')['conflicts'](['textIncludes',c3(0x139),c3(0x1b2)]))[c3(0x129)](new commander_1[(c3(0x15a))]('--regexIncludes\x20<regex>',c3(0x1b5))[c3(0x147)]([c3(0x1b4),'textIncludes','regexNotIncludes']))['addOption'](new commander_1['Option'](c3(0x1c2),c3(0x168))[c3(0x147)]([c3(0x1b4),c3(0x139),c3(0x19a)]))['option'](c3(0x14c),c3(0x1b1),![])['addOption'](new commander_1[(c3(0x15a))](c3(0x192),c3(0x1ba))[c3(0x158)](Object[c3(0x17c)]([c3(0x144),c3(0x180),'yaml']))),R;},this[c2(0x199)]=(S,X,u,Y)=>{const c4=c2,{containerName:R,restoreId:d,backupId:w,quiet:P,tail:U,startTime:p,endTime:q,duration:B}=Y;if(P===!![])return;const V=U?c4(0x16b)+chalk_1[c4(0x1c0)]['bold'](c4(0x17b))+')':'',g=U?c4(0x14a):'',r=new Date(),H=p!==null&&p!==void 0x0?p:new Date(new Date((q!==null&&q!==void 0x0?q:r)[c4(0x1c4)]())[c4(0x193)]((q!==null&&q!==void 0x0?q:r)[c4(0x16e)]()-(B!==null&&B!==void 0x0?B:this[c4(0x154)]))),f=(q!==null&&q!==void 0x0?q:p!==undefined)?new Date(new Date(p[c4(0x1c4)]())['setSeconds'](p[c4(0x16e)]()+(B!==null&&B!==void 0x0?B:this[c4(0x154)]))):r,Z=w!==undefined,K=H&&!Z?c4(0x166)+chalk_1[c4(0x1c0)][c4(0x14b)](H[c4(0x15f)]()):'',t=f&&!Z?c4(0x1a7)+chalk_1[c4(0x1c0)]['bold'](f[c4(0x15f)]()):'',G=B?',\x20duration:\x20'+B+c4(0x13b):'',b=R?c4(0x1af)+chalk_1[c4(0x1c0)][c4(0x14b)](R):Z?'':c4(0x183),l=w?',\x20backup\x20id\x20'+w:'',A=d?c4(0x12a)+d:'',I=S+'\x20'+chalk_1[c4(0x1c0)][c4(0x14b)](X)+l+A+'\x20in\x20project\x20'+chalk_1[c4(0x1c0)][c4(0x14b)](u),T=''+K+t+G;console[c4(0x136)](c4(0x167)+g+b+c4(0x1a4)+I+T+V+':');},this[c2(0x1ad)]=(S,X)=>(u,Y)=>{const c5=c2;if(!S){if(u[c5(0x12d)]===0x0)console[c5(0x136)]('No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.');u[c5(0x181)](R=>(0x0,log_formatter_1['formatLogLine'])(R,X));}else(0x0,console_format_helpers_1[c5(0x19b)])(S,u);(Y===null||Y===void 0x0?void 0x0:Y[c5(0x1b3)])&&(0x0,utils_1[c5(0x165)])(c5(0x128)+Y[c5(0x14f)]);},this[c2(0x134)]=new js_client_1['ApiClient'](c,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[c2(0x173)],'agent':E}),this[c2(0x18f)]=this[c2(0x134)],this[c2(0x170)]=new inquirer_helper_1[(c2(0x15d))](this[c2(0x134)]);}[a11F(0x184)](c,E=![],S=![],X=![]){const cX=a11F,u=(p,q)=>__awaiter(this,void 0x0,void 0x0,function*(){const c6=a11E,B=q[c6(0x15e)],{apiContext:V,inquirerHelper:g}=this;switch(c){case c6(0x1c3):{const r=B?undefined:V['getCurrentServiceName']();return q['serviceId']||r||(yield g[c6(0x15b)](p)());}case c6(0x148):{const H=B?undefined:V[c6(0x157)]();return q['jobId']||H||(yield g[c6(0x13c)](p)());}case c6(0x13a):{return q[c6(0x152)]||(yield g['askForAddon'](p)());}}}),Y=(p,q,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const c7=a11E;if(E)return B[c7(0x1a6)]||(yield this[c7(0x170)][c7(0x138)](p,c===c7(0x1c3)?q:undefined,c===c7(0x148)?q:undefined,!![])());return undefined;}),R=(p,q,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const c8=a11E;if(S||X)return B['backupId']||(yield this[c8(0x170)][c8(0x141)](p,q)());return undefined;}),d=(p,q,B,V)=>__awaiter(this,void 0x0,void 0x0,function*(){const c9=a11E;if(X)return V[c9(0x19c)]||(yield this[c9(0x170)][c9(0x1bd)](p,q,B)());return undefined;}),w=(p,q,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const cc=a11E;if(!E&&B[cc(0x1a5)]!==undefined){if(B[cc(0x1a5)]!==!![])return B[cc(0x1a5)];return yield this['inquirerHelper'][cc(0x1aa)](p,c==='service'?q:undefined,c===cc(0x148)?q:undefined,!![])();}return undefined;}),P=(p,q,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const cE=a11E;if(c==='job')return B[cE(0x176)]||(yield this[cE(0x170)][cE(0x1b6)](q,p,!![])());return undefined;}),U=(p,q,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const cS=a11E;if(c===cS(0x1c3)){if(B[cS(0x17a)]!==!![])return B[cS(0x17a)];return B[cS(0x17a)];}return undefined;});return this[cX(0x16c)](c,E,S,X)['action'](p=>__awaiter(this,void 0x0,void 0x0,function*(){const cu=cX,{noDefaults:q,projectId:B,quiet:V,tail:g,types:r,textIncludes:H,textNotIncludes:f,regexIncludes:Z,regexNotIncludes:K,direction:t,lineLimit:G,startTime:b,endTime:l,duration:A,output:I}=p;(0x0,utils_1['assertContextExisting'])(this[cu(0x134)]);const {apiContext:T,inquirerHelper:M,logsApiClient:m}=this,N=q?undefined:T[cu(0x18c)](),z=B||N||(yield M[cu(0x155)]()),J=yield u(z,p),O=yield Y(z,J,p),C=yield R(z,J,p),k=yield d(z,J,C,p),o=yield P(z,J,p),y=yield U(z,J,p),e=yield w(z,J,p);if(b&&l&&A)throw new Error(cu(0x1bc));const D={'projectId':z,'entityId':J},x={'containerName':e,'types':r,'textIncludes':H,'textNotIncludes':f,'regexIncludes':Z,'regexNotIncludes':K,'lineLimit':G,'startTime':b,'duration':A,'runId':o,'buildId':O,'backupId':C,'restoreId':k,'deploymentId':y,'isBuild':E!==null&&E!==void 0x0?E:![]},h=X?cu(0x18d):S?cu(0x1ac):c,n=Object['assign'](Object['assign']({},x),{'endTime':l,'direction':t});if(!V&&I!==cu(0x1be)&&I!==cu(0x145)&&I!=='json')this[cu(0x199)](c,J,z,Object[cu(0x151)](Object['assign']({},n),p));const s=this['getFormatter'](I,H!==null&&H!==void 0x0?H:Z);if(g){const j=yield m['logs'][cu(0x1c1)](D,x,h);j['on']('logs-received',s),j['on']('error',a=>(0x0,utils_1[cu(0x132)])(cu(0x1a8)+a['message'])),j['on'](cu(0x131),()=>console['log']('Log\x20session\x20ended')),yield j[cu(0x18a)]();}else{const a=yield m[cu(0x197)][cu(0x187)](D,n,h);if(a['error']){const Q=a[cu(0x132)][cu(0x135)],L=Q?cu(0x12c)+JSON['stringify'](Q,null,'\x20'):'';(0x0,utils_1[cu(0x132)])(cu(0x1a0)+a[cu(0x132)]['message']+L);}else s(a[cu(0x17f)],a['pagination']);}}));}}function a11E(c,E){const S=a11c();return a11E=function(X,u){X=X-0x128;let Y=S[X];return Y;},a11E(c,E);}exports['CliLogs']=CliLogs;
|
|
1
|
+
'use strict';const a11d=a11K;function a11U(){const Uf=['Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',',\x20restore\x20id\x20','slice','LogType','argParser','yml','then','-d,\x20--direction\x20<order>','pagination','logTail','data','--backup\x20--backupId\x20[backupId]','json','--restore\x20--restoreId\x20[restoreId]','values','conflicts','yaml','Id]','length','regexNotIncludes','throw','Option','logs-received','Deployment\x20id,\x20example:\x20my-service-54785f4','warning','logsApiClient','apiClient','\x20--',',\x20to:\x20','build-','2685472wBMgnF','\x20in\x20project\x20','-l,\x20--lineLimit\x20[limit]','--noDefaults','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','--project\x20--projectId\x20[projectId]','1442hnwEma','addonId','getCurrentProjectName','Build\x20to\x20get\x20logs\x20from','error',',\x20from:\x20','alias','logRange','hasNextPage','parseDateInput','\x20for\x20all\x20containers','--run\x20--runId\x20[runId]','details','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','--textNotIncludes\x20<text>','--regexIncludes\x20<regex>','service','value','Project\x20for\x20logs','-f,\x20--tail','204084XGkrzP','./log-formatter','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','>\x20Container\x20logs','Get\x20logs\x20generated\x20after\x20this\x20time,\x20','printInitInfo','deploymentId','valueOf','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','format','4295WFTtFY','askForProject','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','Id\x20[','done','--startTime\x20<timestamp>','formatLogLine','apiContext','printResponse','bold','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','restoreId','getLogsCommand','containerId','askForAddon','getStandardLogCommand','CliLogs','message','1518306nKTcyr','--textIncludes\x20<text>','tsHint','ApiClient','toISOString','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','askForContainer','toUpperCase','textNotIncludes','\x27Ctrl+C\x27','addOption','20536swsBJq','askForAddonRestore','logs','22789283rVBnon','\x20to\x20get\x20logs\x20from','getCurrentServiceName','../formatting/console-format-helpers','stringify','next','option','addon','runId','--endTime\x20<timestamp>','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','assign','regexIncludes','getCommand','log','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','default','\x20with\x20live-tailing','--build\x20--buildId\x20[buildId]','job',',\x20duration:\x20','name','forward','forEach','tail','\x20seconds','getSeconds','\x20of\x20','close','--regexNotIncludes\x20<regex>','Backup\x20to\x20get\x20logs\x20from','noDefaults','getFormatter','setSeconds','InquirerHelper','__awaiter','Which\x20log\x20types\x20to\x20fetch','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','textIncludes','Log\x20session\x20ended','5206662QQlaXA','defaultDurationSeconds','280sXLLqt','__esModule','3VfLfsQ','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','1136WerqEV','Restore\x20to\x20get\x20logs\x20from','\x20(exit\x20with\x20','description','apply','-o,\x20--output\x20[output]','inquirerHelper','addonRestore','serviceId','customUserAgent'];a11U=function(){return Uf;};return a11U();}(function(U,K){const u=a11K,q=U();while(!![]){try{const X=parseInt(u(0x125))/0x1+parseInt(u(0xef))/0x2*(parseInt(u(0xc5))/0x3)+parseInt(u(0xc7))/0x4*(-parseInt(u(0x113))/0x5)+-parseInt(u(0xc1))/0x6+parseInt(u(0xf5))/0x7*(parseInt(u(0x130))/0x8)+-parseInt(u(0x109))/0x9*(-parseInt(u(0xc3))/0xa)+-parseInt(u(0x133))/0xb;if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a11U,0xcd646));function a11K(U,K){const q=a11U();return a11K=function(X,J){X=X-0xbf;let v=q[X];return v;},a11K(U,K);}var __awaiter=this&&this[a11d(0x156)]||function(U,K,q,X){function J(v){return v instanceof q?v:new q(function(f){f(v);});}return new(q||(q=Promise))(function(v,f){const U1=a11K;function L(z){const r=a11K;try{E(X[r(0x138)](z));}catch(p){f(p);}}function M(z){const j=a11K;try{E(X[j(0xe5)](z));}catch(p){f(p);}}function E(z){const U0=a11K;z[U0(0x117)]?v(z[U0(0x106)]):J(z[U0(0x106)])[U0(0xd7)](L,M);}E((X=X[U1(0xcb)](U,K||[]))['next']());});},__importDefault=this&&this['__importDefault']||function(U){const U2=a11d;return U&&U[U2(0xc4)]?U:{'default':U};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a11d(0x123)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require('chalk')),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),commander_1=require('commander'),console_format_helpers_1=require(a11d(0x136)),log_formatter_1=require(a11d(0x10a));class CliLogs{constructor(U,K){const U3=a11d;this[U3(0x11a)]=U,this[U3(0xc2)]=0x708,this['getStandardLogCommand']=(q,X,J,v)=>{const U4=U3,f=(0x0,utils_1[U4(0x140)])(!![])[U4(0x148)]((X?U4(0xee):'')+U4(0x132))[U4(0xfb)]((X?'build-':'')+'log')[U4(0xca)]('Get\x20log\x20for\x20the\x20specified\x20'+q)[U4(0x139)](U4(0xf4),U4(0x107))[U4(0x139)]('--'+q+U4(0xec)+q+U4(0x116)+q+U4(0xe2),q['charAt'](0x0)[U4(0x12c)]()+q[U4(0xd3)](0x1)+U4(0x134))[U4(0x139)]('--container\x20--containerId\x20[containerId]',U4(0x111));if(X)f[U4(0x139)](U4(0x145),U4(0xf8));if(q===U4(0x146))f[U4(0x139)](U4(0x100),U4(0x11d));if(q==='service')f[U4(0x139)]('--deployment\x20--deploymentId\x20[deploymentId]',U4(0xe8));if(J)f['option'](U4(0xdc),U4(0x151));if(v)f['option'](U4(0xde),U4(0xc8));return!X&&!J&&!v&&f[U4(0x12f)](new commander_1[(U4(0xe6))]('-t,\x20--types\x20<types...>',U4(0x157))['choices'](Object[U4(0xdf)](js_client_1[U4(0xd4)]))),f['option'](U4(0x108),'Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.')[U4(0x139)](U4(0xf1),'Number\x20of\x20lines\x20to\x20return.')[U4(0x139)](U4(0x118),U4(0x10d)+utils_1[U4(0x127)],utils_1[U4(0xfe)])['addOption'](new commander_1[(U4(0xe6))](U4(0x13c),U4(0x12a)+utils_1[U4(0x127)])[U4(0xd5)](utils_1[U4(0xfe)])[U4(0xe0)]([U4(0x14b)]))[U4(0x139)]('--duration\x20[duration]','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set')[U4(0x12f)](new commander_1[(U4(0xe6))](U4(0xd8),U4(0x115))['choices'](['backward',U4(0x149)])[U4(0xe0)]([U4(0x14b)]))[U4(0x12f)](new commander_1[(U4(0xe6))](U4(0x126),U4(0x102))['conflicts']([U4(0x12d),U4(0x13f),'regexNotIncludes']))[U4(0x12f)](new commander_1['Option'](U4(0x103),U4(0x142))['conflicts']([U4(0xbf),'regexIncludes',U4(0xe4)]))['addOption'](new commander_1[(U4(0xe6))](U4(0x104),U4(0x10b))['conflicts']([U4(0x12d),U4(0xbf),U4(0xe4)]))[U4(0x12f)](new commander_1[(U4(0xe6))](U4(0x150),'Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression')['conflicts'](['textNotIncludes','regexIncludes',U4(0xbf)]))['option'](U4(0xf2),U4(0xd1),![])[U4(0x12f)](new commander_1[(U4(0xe6))](U4(0xcc),U4(0x13d))['choices'](Object[U4(0xdf)]([U4(0x112),U4(0xdd),U4(0xe1)]))),f;},this['printInitInfo']=(q,X,J,v)=>{const U5=U3,{containerName:f,restoreId:L,backupId:M,quiet:E,tail:z,startTime:p,endTime:O,duration:F}=v;if(E===!![])return;const o=z?U5(0xc9)+chalk_1[U5(0x143)]['bold'](U5(0x12e))+')':'',Q=z?U5(0x144):'',w=new Date(),R=p!==null&&p!==void 0x0?p:new Date(new Date((O!==null&&O!==void 0x0?O:w)[U5(0x110)]())[U5(0x154)]((O!==null&&O!==void 0x0?O:w)[U5(0x14d)]()-(F!==null&&F!==void 0x0?F:this[U5(0xc2)]))),W=(O!==null&&O!==void 0x0?O:p!==undefined)?new Date(new Date(p['valueOf']())[U5(0x154)](p[U5(0x14d)]()+(F!==null&&F!==void 0x0?F:this[U5(0xc2)]))):w,V=M!==undefined,b=R&&!V?U5(0xfa)+chalk_1['default'][U5(0x11c)](R[U5(0x129)]()):'',B=W&&!V?U5(0xed)+chalk_1['default'][U5(0x11c)](W['toISOString']()):'',y=F?U5(0x147)+F+U5(0x14c):'',x=f?'\x20for\x20container\x20'+chalk_1['default'][U5(0x11c)](f):V?'':U5(0xff),a=M?',\x20backup\x20id\x20'+M:'',m=L?U5(0xd2)+L:'',i=q+'\x20'+chalk_1[U5(0x143)]['bold'](X)+a+m+U5(0xf0)+chalk_1[U5(0x143)][U5(0x11c)](J),G=''+b+B+y;console['log'](U5(0x10c)+Q+x+U5(0x14e)+i+G+o+':');},this[U3(0x153)]=(q,X)=>(J,v)=>{const U6=U3;if(!q){if(J[U6(0xe3)]===0x0)console[U6(0x141)](U6(0xf3));J[U6(0x14a)](f=>(0x0,log_formatter_1[U6(0x119)])(f,X));}else(0x0,console_format_helpers_1[U6(0x11b)])(q,J);(v===null||v===void 0x0?void 0x0:v[U6(0xfd)])&&(0x0,utils_1[U6(0xe9)])(U6(0x158)+v['cursor']);},this[U3(0xeb)]=new js_client_1[(U3(0x128))](U,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[U3(0xd0)],'agent':K}),this[U3(0xea)]=this[U3(0xeb)],this[U3(0xcd)]=new inquirer_helper_1[(U3(0x155))](this[U3(0xeb)]);}[a11d(0x11f)](U,K=![],q=![],X=![]){const UJ=a11d,J=(p,O)=>__awaiter(this,void 0x0,void 0x0,function*(){const U7=a11K,F=O[U7(0x152)],{apiContext:o,inquirerHelper:Q}=this;switch(U){case U7(0x105):{const w=F?undefined:o[U7(0x135)]();return O[U7(0xcf)]||w||(yield Q['askForService'](p)());}case U7(0x146):{const R=F?undefined:o['getCurrentJobName']();return O['jobId']||R||(yield Q['askForJob'](p)());}case U7(0x13a):{return O[U7(0xf6)]||(yield Q[U7(0x121)](p)());}}}),v=(p,O,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const U8=a11K;if(K)return F['buildId']||(yield this['inquirerHelper']['askForBuild'](p,U===U8(0x105)?O:undefined,U==='job'?O:undefined,!![])());return undefined;}),f=(p,O,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const U9=a11K;if(q||X)return F['backupId']||(yield this[U9(0xcd)]['askForAddonBackup'](p,O)());return undefined;}),L=(p,O,F,o)=>__awaiter(this,void 0x0,void 0x0,function*(){const UU=a11K;if(X)return o[UU(0x11e)]||(yield this['inquirerHelper'][UU(0x131)](p,O,F)());return undefined;}),M=(p,O,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const UK=a11K;if(!K&&F[UK(0x120)]!==undefined){if(F[UK(0x120)]!==!![])return F['containerId'];return yield this[UK(0xcd)][UK(0x12b)](p,U==='service'?O:undefined,U===UK(0x146)?O:undefined,!![])();}return undefined;}),E=(p,O,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const Uq=a11K;if(U===Uq(0x146))return F[Uq(0x13b)]||(yield this[Uq(0xcd)]['askForJobRun'](O,p,!![])());return undefined;}),z=(p,O,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const UX=a11K;if(U==='service'){if(F[UX(0x10f)]!==!![])return F[UX(0x10f)];return F[UX(0x10f)];}return undefined;});return this[UJ(0x122)](U,K,q,X)['action'](p=>__awaiter(this,void 0x0,void 0x0,function*(){const Uv=UJ,{noDefaults:O,projectId:F,quiet:o,tail:Q,types:w,textIncludes:R,textNotIncludes:W,regexIncludes:V,regexNotIncludes:b,direction:B,lineLimit:y,startTime:x,endTime:a,duration:m,output:i}=p;(0x0,utils_1['assertContextExisting'])(this[Uv(0xeb)]);const {apiContext:G,inquirerHelper:A,logsApiClient:s}=this,D=O?undefined:G[Uv(0xf7)](),H=F||D||(yield A[Uv(0x114)]()),g=yield J(H,p),S=yield v(H,g,p),C=yield f(H,g,p),N=yield L(H,g,C,p),Z=yield E(H,g,p),e=yield z(H,g,p),n=yield M(H,g,p);if(x&&a&&m)throw new Error(Uv(0xc6));const t={'projectId':H,'entityId':g},Y={'containerName':n,'types':w,'textIncludes':R,'textNotIncludes':W,'regexIncludes':V,'regexNotIncludes':b,'lineLimit':y,'startTime':x,'duration':m,'runId':Z,'buildId':S,'backupId':C,'restoreId':N,'deploymentId':e,'isBuild':K!==null&&K!==void 0x0?K:![]},l=X?Uv(0xce):q?'addonBackup':U,T=Object[Uv(0x13e)](Object[Uv(0x13e)]({},Y),{'endTime':a,'direction':B});if(!o&&i!=='yaml'&&i!==Uv(0xd6)&&i!==Uv(0xdd))this[Uv(0x10e)](U,g,H,Object[Uv(0x13e)](Object[Uv(0x13e)]({},T),p));const I=this[Uv(0x153)](i,R!==null&&R!==void 0x0?R:V);if(Q){const c=yield s[Uv(0x132)][Uv(0xda)](t,Y,l);c['on'](Uv(0xe7),I),c['on'](Uv(0xf9),h=>(0x0,utils_1[Uv(0xf9)])('Error\x20while\x20tailing\x20log\x20lines:\x20'+h[Uv(0x124)])),c['on'](Uv(0x14f),()=>console[Uv(0x141)](Uv(0xc0))),yield c['start']();}else{const h=yield s[Uv(0x132)][Uv(0xfc)](t,T,l);if(h[Uv(0xf9)]){const P=h[Uv(0xf9)][Uv(0x101)],k=P?'\x0aDetails:\x20'+JSON[Uv(0x137)](P,null,'\x20'):'';(0x0,utils_1[Uv(0xf9)])('Error\x20while\x20fetching\x20log\x20lines:\x20'+h[Uv(0xf9)]['message']+k);}else I(h[Uv(0xdb)],h[Uv(0xd9)]);}}));}}exports[a11d(0x123)]=CliLogs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a12U(){const F=['cyan','default','11126556xVfJKH','__importDefault','406yVsKOE','formatLogLine','red','\x20--\x20','__esModule','log','replace','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','reduce','bold','green','pattern','gray','toISOString','59329950KNCaOV','223383jxOEzv','1776861mXWhMF','183256gwNwfQ','defineProperty','5847588SfoGpq','dim','greenBright','grey','yellow','chalk','color','2gWGWwi','6613060reOvsa','4EhUjPO'];a12U=function(){return F;};return a12U();}const a12z=a12K;(function(U,K){const E=a12K,q=U();while(!![]){try{const X=parseInt(E(0x8d))/0x1+parseInt(E(0x77))/0x2*(-parseInt(E(0x8e))/0x3)+parseInt(E(0x79))/0x4*(-parseInt(E(0x78))/0x5)+-parseInt(E(0x91))/0x6+-parseInt(E(0x7e))/0x7*(parseInt(E(0x8f))/0x8)+-parseInt(E(0x7c))/0x9+parseInt(E(0x8c))/0xa;if(X===K)break;else q['push'](q['shift']());}catch(J){q['push'](q['shift']());}}}(a12U,0xab627));var __importDefault=this&&this[a12z(0x7d)]||function(U){return U&&U['__esModule']?U:{'default':U};};Object[a12z(0x90)](exports,a12z(0x82),{'value':!![]}),exports[a12z(0x7f)]=exports['defaultLogSyntax']=void 0x0;const chalk_1=__importDefault(require(a12z(0x96)));exports['defaultLogSyntax']=[{'color':a12z(0x94),'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':a12z(0x94),'pattern':/[0-9]{4}\/[0-9]{2}\/[0-9]{2}/i},{'color':a12z(0x94),'pattern':/\s\b([0-9]{2}:){1,2}[0-9]{2}\b\s/i},{'color':a12z(0x87),'pattern':new RegExp(a12z(0x85),'i')},{'color':a12z(0x88),'pattern':/(?:\d{1,3}\.){3}\d{1,3}/i},{'color':a12z(0x88),'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':'blue','pattern':/\b(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH)\b/},{'color':a12z(0x93),'pattern':/\b(successful|success|completed|complete|done)\b/i},{'color':a12z(0x80),'pattern':/\b(failed|fail|stderr|error|err)\b/i},{'color':a12z(0x8a),'pattern':/\b(information|info|debug)\b/i},{'color':a12z(0x95),'pattern':/\b(warning|warn)\b/i},{'color':'blue','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=(U,K)=>{const p=a12z,q=chalk_1[p(0x7b)][p(0x92)](U['ts'][p(0x8b)]()),X=chalk_1[p(0x7b)][p(0x7a)](U['containerId']),J=exports['defaultLogSyntax'][p(0x86)]((f,L)=>{const O=p;return f['replace'](L[O(0x89)],M=>L[O(0x76)]?chalk_1[O(0x7b)][L[O(0x76)]](M):chalk_1[O(0x7b)][O(0x94)](M));},U[p(0x83)]),v=K?J[p(0x84)](new RegExp(K,'g'),f=>chalk_1[p(0x7b)]['bold'](f)):J;console['log'](q+'\x20'+X+p(0x81)+v);};function a12K(U,K){const q=a12U();return a12K=function(X,J){X=X-0x76;let v=q[X];return v;},a12K(U,K);}exports['formatLogLine']=formatLogLine;
|