@northflank/cli 0.9.27 → 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 +2 -2
- package/dist/context/contextCommands.js +1 -1
- package/dist/copy/index.js +1 -0
- 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 +16 -4
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
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';
|
|
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';const
|
|
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 a8n=a8k;function a8k(Y,k){const X=a8Y();return a8k=function(B,l){B=B-0x1e1;let S=X[B];return S;},a8k(Y,k);}(function(Y,k){const Q=a8k,X=Y();while(!![]){try{const B=-parseInt(Q(0x211))/0x1+-parseInt(Q(0x257))/0x2*(-parseInt(Q(0x20f))/0x3)+parseInt(Q(0x253))/0x4*(-parseInt(Q(0x26b))/0x5)+parseInt(Q(0x27d))/0x6+parseInt(Q(0x2c6))/0x7*(parseInt(Q(0x2c0))/0x8)+-parseInt(Q(0x224))/0x9*(parseInt(Q(0x24a))/0xa)+parseInt(Q(0x2b2))/0xb*(parseInt(Q(0x23c))/0xc);if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a8Y,0x901ae));function a8Y(){const YZ=['length','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','jobs','inquirer-search-list','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','subdomain','subdomains','createdAt','Unexpected\x20file\x20type:\x20','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','bold','propToType','not\x20completed','getQuestionString','rawObject','backups','askForPipeline','nextPageCursor','filter','unshift','askForCredentials','./pagination/inquirer-pagination-prompt','InquirerHelper','search-list','No,\x20but\x20save\x20as\x20file','service:\x20\x27','split','Template\x20id\x20not\x20provided.','\x20in\x20','Writing\x20configuration\x20failed:\x20','templates','ABORT','yaml','all','create','boolean','3719694quAlRk','askForBackupDestination','token','input','then','askForAddonBackup','askForLogSink','pagination-prompt','No,\x20repeat','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','opt','throw','\x20(completedAt:\x20','maxLength','17592OGPVZF','backupDestinations','set','minLength','job\x20builds','reset','2653tdHvGm','pipelines','getInnerType','__setModuleDefault','secrets','volume','backup\x20destination','askArrayEntry','skipValidation','tmpCmdPath','\x20characters','isNaN','fullName','clusters','push','underline','green','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','resultCache','credentials','restore','No\x20','oneOf','addons','completedAt','chalk','containers','getCurrentProjectName','confirm','pipeline','apply','this\x20option\x20is\x20required,\x20please\x20answer','nextCursor','uri','deleteWarningPrompt','confirmation','\x20and\x20it\x20','pop','askForProjectScopedResourcePaginated','Something\x20unexpected\x20happened.','retry','concat','example','fileName','job\x20containers','defineProperty','must\x20be\x20a\x20number,\x20is\x20','No,\x20edit','template\x20run','askForAddonRestore','retrievePayloadViaInteractiveCli','service\x20containers','askForVolume','services','domain','startedAt','next','contextProvider','registryCredentials','askForSubdomainPath','trim','What\x27s\x20the\x20','service','getPathString','default','Aborted.','askForSecret','askForService','value','\x20(startedAt:\x20','editor','restores','__importStar','__importDefault','js-yaml','hasOwnProperty','builds','cmdPath','password','ask','setPathVars','enum','get','logSinks','Choose\x20the\x20','job:\x20\x27','join','isValidJSON','\x20(full\x20domain:\x20','tokenPrompt','editedResult','domain\x20(','addon:\x20\x27','whiteBright','writeFileSync','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','18141sDJPNx','getOwnPropertyDescriptor','918539jBYPZH','string','project','project:\x20\x27','__createBinding','blue','Enter\x20the\x20','isUndefined','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','found','properties','askForSubdomain','volumes','\x20characters,\x20is\x20','pagination','askForTag','red','Choose\x20the\x20login\x20token:','askForProjectScopedResource','6523353jqklnP','values','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','pattern','success','\x20to\x20use:','askForResourcePaginated','lodash','charAt','validate','greenBright','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','cursor','test','prompt','No\x20builds\x20found','pathVars','to\x20use:','secret','array','DynamicReloadPaginationPrompt','find','path','type','72yVAGHq','list','saveFile','apiClient','Yes,\x20send','call','job','No,\x20abort','maximum','\x20type?','No\x20containers\x20found','isBoolean','integer','unset','10FeAKMO','isObject','all-containers','runs','__awaiter','map','askForResource','registerPrompt','safeDump','4DyIFFR','getType','subdomainPath','Should\x20it\x20be','6ifQJYd','json','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','),\x20subdomain\x20(','domains','\x20Example:\x20','override','templateRuns','toString','Configuration\x20file\x20written\x20to\x20','__esModule','askForJob','includes','askForAddon','for\x20this\x20','stringify','addEntry','name','isArray','grey','3869345WIYGuJ','assign','REPEAT','inquirer','safeLoad','tags','defaultPaginationPageSize',',\x20supported\x20types:\x20[json|yaml|yml]','EDIT','data','askForJobRun','projects','description','configurable','Do\x20you\x20want\x20to\x20add','job\x20runs','doesn\x27t\x20match\x20pattern\x20\x27','SAVE','761958sdZhKp','has','don\x27t\x20change','askGeneric','yml','object','askForProject','anyOf','prototype','paths','addon','editPayload','warning','minimum','Context\x20with\x20name\x20\x27','all-builds','confirmationPrompt'];a8Y=function(){return YZ;};return a8Y();}var __createBinding=this&&this[a8n(0x215)]||(Object['create']?function(Y,X,B,l){const M=a8n;if(l===undefined)l=B;var S=Object[M(0x210)](X,B);(!S||(M(0x201)in S?!X['__esModule']:S['writable']||S[M(0x278)]))&&(S={'enumerable':!![],'get':function(){return X[B];}}),Object['defineProperty'](Y,l,S);}:function(Y,X,B,l){if(l===undefined)l=B;Y[l]=X[B];}),__setModuleDefault=this&&this[a8n(0x2c9)]||(Object[a8n(0x2b0)]?function(Y,k){const p=a8n;Object[p(0x2f3)](Y,p(0x1ef),{'enumerable':!![],'value':k});}:function(Y,k){const d=a8n;Y[d(0x1ef)]=k;}),__importStar=this&&this[a8n(0x1f7)]||function(Y){const P=a8n;if(Y&&Y[P(0x261)])return Y;var X={};if(Y!=null){for(var B in Y)if(B!==P(0x1ef)&&Object[P(0x285)][P(0x1fa)][P(0x241)](Y,B))__createBinding(X,Y,B);}return __setModuleDefault(X,Y),X;},__awaiter=this&&this[a8n(0x24e)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const r=a8k;function j(O){const f=a8k;try{e(B[f(0x1e7)](O));}catch(T){C(T);}}function o(O){const N=a8k;try{e(B[N(0x2bd)](O));}catch(T){C(T);}}function e(O){const K=a8k;O['done']?S(O[K(0x1f3)]):l(O[K(0x1f3)])[K(0x2b6)](j,o);}e((B=B[r(0x2e4)](Y,k||[]))[r(0x1e7)]());});},__importDefault=this&&this[a8n(0x1f8)]||function(Y){const w=a8n;return Y&&Y[w(0x261)]?Y:{'default':Y};};Object[a8n(0x2f3)](exports,a8n(0x261),{'value':!![]}),exports[a8n(0x2a4)]=void 0x0;const _=__importStar(require(a8n(0x22b))),chalk_1=__importDefault(require(a8n(0x2df))),fs=__importStar(require('fs')),utils_1=require('./utils'),api_helpers_1=require('./api-helpers'),inquirer_pagination_prompt_1=require(a8n(0x2a3)),inquirer=require(a8n(0x26e)),inquirerSearchList=require(a8n(0x291)),yaml=require(a8n(0x1f9));var ConfirmChoices;(function(Y){const h=a8n;Y['YES']=h(0x240),Y[h(0x26d)]=h(0x2ba),Y[h(0x273)]=h(0x2f5),Y[h(0x27c)]=h(0x2a6),Y[h(0x2ad)]=h(0x243);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(Y){const g=a8n;this['apiClient']=Y,this[g(0x271)]=0x32,this['editPayload']=k=>__awaiter(this,void 0x0,void 0x0,function*(){const y=g,{editedResult:X}=yield inquirer['prompt']([{'type':'editor','name':y(0x209),'message':'Go\x20to\x20editor','default':yaml[y(0x252)](k)}]);return yaml[y(0x26f)](X);}),this['saveFile']=k=>__awaiter(this,void 0x0,void 0x0,function*(){const R=g,X=C=>R(0x296)+C+R(0x272);function B(){return __awaiter(this,void 0x0,void 0x0,function*(){const q=a8k;return inquirer[q(0x232)]([{'type':q(0x2b5),'name':q(0x2f1),'message':q(0x2bb),'validate':C=>new RegExp('.*\x5c.(json|yaml|yml)$')[q(0x231)](C)?!![]:X(C)}]);});}const {fileName:l}=yield B(),S=l['toString']()[R(0x2a8)]('.')[R(0x2eb)]();try{switch(S){case R(0x258):(0x0,utils_1[R(0x228)])(R(0x260)+l);return fs[R(0x20d)](l,JSON['stringify'](k,null,'\x20\x20'));case R(0x2ae):case R(0x281):(0x0,utils_1[R(0x228)])(R(0x260)+l);return fs[R(0x20d)](l,yaml[R(0x252)](k));default:(0x0,utils_1[R(0x289)])(X(S));}}catch(C){(0x0,utils_1[R(0x289)])(R(0x2ab)+C['message']);}return undefined;}),this[g(0x2a0)]=(k,X)=>B=>{const U=g,l=typeof B===U(0x212)?B[U(0x1eb)]():B;return X===![]&&l===U(0x27f)?'':l;},this['validate']=(k,X,B)=>l=>{const L=g;if(this[L(0x2ce)]===!![])return!![];const S=[];if(l===''||l===L(0x27f)){if(X!==![])S[L(0x2d4)](L(0x2e5));else return!![];}k[L(0x23b)]==='string'&&!_[L(0x218)](k[L(0x227)])&&S[L(0x2d4)](new RegExp(k['pattern'])['test'](l)?!![]:L(0x27b)+k[L(0x227)]+'\x27');k['type']==='string'&&!_[L(0x218)](k[L(0x2c3)])&&S['push'](l['length']>=k[L(0x2c3)]?!![]:L(0x259)+k[L(0x2c3)]+L(0x21e)+l['length']+L(0x2d0));k[L(0x23b)]==='string'&&!_[L(0x218)](k[L(0x2bf)])&&S[L(0x2d4)](l[L(0x28e)]<=k['maxLength']?!![]:'must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20'+k[L(0x2bf)]+L(0x21e)+l[L(0x28e)]+L(0x2d0));B&&Number[L(0x2d1)](parseInt(l,0xa))&&S[L(0x2d4)](L(0x2f4)+l);k[L(0x23b)]==='integer'&&!_['isUndefined'](k[L(0x28a)])&&S[L(0x2d4)](l>=k[L(0x28a)]?!![]:L(0x28f)+k['minimum']);k[L(0x23b)]===L(0x248)&&!_[L(0x218)](k[L(0x244)])&&S[L(0x2d4)](l<=k['maximum']?!![]:L(0x2d7)+k[L(0x244)]);if(k[L(0x23b)]===L(0x29c)){const o=(0x0,utils_1[L(0x206)])(l);S['push'](o===![]||_['isEmpty'](o)?L(0x226):!![]);}const C=S[L(0x2a0)](O=>O!==!![]),j=(k===null||k===void 0x0?void 0x0:k['example'])?'\x0a'+chalk_1[L(0x1ef)][L(0x221)]('>>')+L(0x25c)+chalk_1[L(0x1ef)]['whiteBright'](JSON['stringify'](k[L(0x2f0)])):'';return C['length']>0x0?C['join'](chalk_1[L(0x1ef)][L(0x2d5)](L(0x2ea)))+j:!![];},this[g(0x1ee)]=(k,X,B)=>{const z=g,l=k[k[z(0x28e)]-0x1];function S(){const A=z;return k['slice'](0x0,-0x1)[A(0x24f)](o=>o[A(0x22c)](0x0)['toUpperCase']()+o['slice'](0x1))[A(0x205)]('>');}const C=k[z(0x28e)]>0x1?chalk_1['default']['bgGrey'][z(0x20c)](S())+':\x20':'',j=B?'\x20('+chalk_1[z(0x1ef)][z(0x216)](B)+')':'';return chalk_1[z(0x1ef)][z(0x2c5)](''+C+X+'\x20'+chalk_1[z(0x1ef)]['bold'][z(0x22e)](l)+j+'?');},this['askForResource']=(k,X,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const D=g;if(X[D(0x28e)]<0x1){const C=B?D(0x265)+B:D(0x21a);throw new Error(D(0x2db)+k+'\x20'+C+'.');}const l='Choose\x20the\x20'+k+'\x20to\x20use:',S=X['length']>0x4?D(0x2a5):'list';return(yield inquirer['prompt']([{'type':S,'name':D(0x268),'message':l,'choices':X}]))[D(0x268)];}),this['askForResourcePaginated']=(k,X,B)=>__awaiter(this,void 0x0,void 0x0,function*(){const E=g,{elements:l,nextCursor:S}=yield X();if(l[E(0x28e)]<0x1){const o=B?E(0x265)+B:E(0x21a);throw new Error(E(0x2db)+k+'\x20'+o+'.');}const C=E(0x203)+k+E(0x229);if(S!==undefined){const e=({nextPageCursor:O})=>__awaiter(this,void 0x0,void 0x0,function*(){const b=E,T=yield X(O);return{'elements':T['elements'],'nextPageCursor':T[b(0x2e6)]};});return(yield inquirer[E(0x232)]([{'type':'pagination-prompt','name':E(0x268),'message':C,'choices':l,'nextPageCursor':S,'loadMore':e}]))[E(0x268)];}const j=l[E(0x28e)]>0x4?'search-list':E(0x23d);return(yield inquirer[E(0x232)]([{'type':j,'name':E(0x268),'message':C,'choices':l}]))[E(0x268)];}),this[g(0x280)]=(k,X)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const a=g,B=''+(X?'('+chalk_1[a(0x1ef)][a(0x216)](X)+')\x20':''),l=a(0x217)+chalk_1['default'][a(0x2d6)](k)+'\x20'+B+a(0x235),S=this[a(0x22d)]({'type':a(0x212),'required':!![]});return(yield inquirer['prompt']([{'type':a(0x2b5),'name':a(0x268),'message':l,'validate':S}]))['name'];}),this['askConfirm']=k=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=g;return(yield inquirer[Z(0x232)]([{'type':Z(0x2e2),'name':Z(0x268),'message':k,'default':!![]}]))['name'];}),this[g(0x1f2)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const m=g,X=B=>__awaiter(this,void 0x0,void 0x0,function*(){const V=a8k,l=yield this[V(0x23f)][V(0x23d)][V(0x1e4)][V(0x2af)]({'parameters':{'projectId':B}}),S=l['data']['services'][V(0x24f)](C=>C['id']);return S;});return this[m(0x223)]('service',X,k);}),this['askForTemplate']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H=g,k=X=>__awaiter(this,void 0x0,void 0x0,function*(){const J=a8k;var B;const l=yield this['apiClient'][J(0x23d)][J(0x2ac)]({'options':{'per_page':this[J(0x271)],'cursor':X}}),S=l[J(0x274)][J(0x2ac)]['map'](C=>C['id']);return{'elements':S,'nextCursor':(B=l[J(0x21f)])===null||B===void 0x0?void 0x0:B['cursor']};});return this[H(0x22a)]('template',k);}),this[g(0x220)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const s=g,k=X=>__awaiter(this,void 0x0,void 0x0,function*(){const G=a8k;var B,l,S;const C=yield this[G(0x23f)][G(0x23d)]['tags']({'options':{'per_page':this[G(0x271)],'cursor':X}}),j=(l=(B=C['data'][G(0x270)])===null||B===void 0x0?void 0x0:B[G(0x24f)](o=>o['id']))!==null&&l!==void 0x0?l:[];return{'elements':j,'nextCursor':(S=C['pagination'])===null||S===void 0x0?void 0x0:S['cursor']};});return this[s(0x22a)]('tag',k);}),this[g(0x2b3)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const I=g;var k;const X=yield this[I(0x23f)]['list']['backupDestinations'][I(0x2af)]({}),B=(k=X[I(0x274)][I(0x2c1)]['map'](l=>l['name']))!==null&&k!==void 0x0?k:[];return this['askForResource'](I(0x2cc),B);}),this['askForClusterId']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const i=g,k=X=>__awaiter(this,void 0x0,void 0x0,function*(){const u=a8k;var B,l,S;const C=yield this[u(0x23f)][u(0x23d)]['cloud'][u(0x2d3)]({'options':{'per_page':this[u(0x271)],'cursor':X}}),j=(l=(B=C['data'][u(0x2d3)])===null||B===void 0x0?void 0x0:B[u(0x24f)](o=>o[u(0x268)]))!==null&&l!==void 0x0?l:[];return{'elements':j,'nextCursor':(S=C[u(0x21f)])===null||S===void 0x0?void 0x0:S[u(0x230)]};});return this[i(0x22a)]('cluster\x20id',k);}),this['askForTemplateRun']=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const W=g;if(_[W(0x218)](k))throw new Error(W(0x2a9));const X=B=>__awaiter(this,void 0x0,void 0x0,function*(){const Y0=W;var l;let S=this['defaultPaginationPageSize'];const C=yield this[Y0(0x23f)][Y0(0x23d)][Y0(0x25e)]({'parameters':{'templateId':k},'options':{'per_page':S,'cursor':B}}),j=C['data'][Y0(0x25e)][Y0(0x24f)](o=>o['id']+'\x20(startedAt:\x20'+o[Y0(0x295)]+')');return{'elements':j,'nextCursor':(l=C[Y0(0x21f)])===null||l===void 0x0?void 0x0:l[Y0(0x230)]};});return this[W(0x22a)](W(0x2f6),X)['then'](B=>B[W(0x2a8)]('\x20')[0x0]);}),this[g(0x2b8)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y2=g,k=X=>__awaiter(this,void 0x0,void 0x0,function*(){const Y1=a8k;var B;let l=this['defaultPaginationPageSize'];const S=yield this[Y1(0x23f)]['list']['logSinks']({'options':{'per_page':l,'cursor':X}}),C=S[Y1(0x274)][Y1(0x202)][Y1(0x24f)](j=>j['id']);return{'elements':C,'nextCursor':(B=S[Y1(0x21f)])===null||B===void 0x0?void 0x0:B[Y1(0x230)]};});return this[Y2(0x22a)]('log\x20sink',k);}),this[g(0x29e)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y4=g,X=B=>__awaiter(this,void 0x0,void 0x0,function*(){const Y3=a8k,l=yield this['apiClient'][Y3(0x23d)][Y3(0x2c7)]['all']({'parameters':{'projectId':B}});return l[Y3(0x274)][Y3(0x2c7)]['map'](S=>S['id']);});return this[Y4(0x223)](Y4(0x2e3),X,k);}),this[g(0x262)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y6=g,X=B=>__awaiter(this,void 0x0,void 0x0,function*(){const Y5=a8k,l=yield this[Y5(0x23f)]['list'][Y5(0x290)][Y5(0x2af)]({'parameters':{'projectId':B}}),S=l[Y5(0x274)]['jobs'][Y5(0x24f)](C=>C['id']);return S;});return this['askForProjectScopedResource'](Y6(0x242),X,k);}),this[g(0x275)]=(k,X,B=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y8=g,l='all-job-runs',S=C=>j=>__awaiter(this,void 0x0,void 0x0,function*(){const Y7=a8k;var o;const e=yield this[Y7(0x23f)][Y7(0x201)]['job'][Y7(0x24d)]({'parameters':{'projectId':C,'jobId':k},'options':{'per_page':this[Y7(0x271)],'cursor':j}}),O=e[Y7(0x274)]['runs']['map'](T=>T['id']+'\x20(startedAt:\x20'+T[Y7(0x1e6)]+')');return B&&O['unshift'](l),{'elements':O,'nextCursor':(o=e[Y7(0x21f)])===null||o===void 0x0?void 0x0:o[Y7(0x230)]};});return this[Y8(0x2ec)](Y8(0x27a),S,X,Y8(0x204)+k+'\x27')['then'](C=>{const Y9=Y8,o=C[Y9(0x2a8)]('\x20')[0x0];if(o===l)return undefined;return o;});}),this['askForBuild']=(k,X,B,l=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const YY=g,S=YY(0x28c);if(B!==undefined){const C=j=>o=>__awaiter(this,void 0x0,void 0x0,function*(){const Yk=YY;var e;const O=yield this[Yk(0x23f)][Yk(0x201)][Yk(0x242)]['builds']({'parameters':{'projectId':j,'jobId':B},'options':{'per_page':this[Yk(0x271)],'cursor':o}}),T=O['data'][Yk(0x1fb)][Yk(0x24f)](v=>v['id']+Yk(0x1f4)+v['createdAt']+')');return l&&T['unshift'](S),{'elements':T,'nextCursor':(e=O['pagination'])===null||e===void 0x0?void 0x0:e[Yk(0x230)]};});return this['askForProjectScopedResourcePaginated'](YY(0x2c4),C,k,YY(0x204)+B+'\x27')[YY(0x2b6)](o=>{const YX=YY,e=o[YX(0x2a8)]('\x20')[0x0];if(e===S)return undefined;return e;});}if(X!==undefined){const j=o=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const YB=YY;var O;const T=yield this['apiClient'][YB(0x201)][YB(0x1ed)][YB(0x1fb)]({'parameters':{'projectId':o,'serviceId':X},'options':{'per_page':this[YB(0x271)],'cursor':e}}),v=T[YB(0x274)]['builds'][YB(0x24f)](F=>F['id']+YB(0x1f4)+F[YB(0x295)]+')');if(l)v[YB(0x2a1)](S);return{'elements':v,'nextCursor':(O=T[YB(0x21f)])===null||O===void 0x0?void 0x0:O['cursor']};});return this[YY(0x2ec)]('service\x20build',j,k,YY(0x2a7)+B+'\x27')['then'](o=>{const Yl=YY,e=o[Yl(0x2a8)]('\x20')[0x0];if(e===S)return undefined;return e;});}throw new Error(YY(0x233));}),this['askForContainer']=(k,X,B,l=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const YS=g,S=YS(0x24c);if(B!==undefined){const C=j=>o=>__awaiter(this,void 0x0,void 0x0,function*(){const YC=YS;var e,O;const T=yield this[YC(0x23f)][YC(0x201)]['job'][YC(0x2e0)]({'parameters':{'projectId':j,'jobId':B},'options':{'per_page':this[YC(0x271)],'cursor':o}}),v=(e=T[YC(0x274)]['containers'])!==null&&e!==void 0x0?e:[],F=v===null||v===void 0x0?void 0x0:v[YC(0x24f)](x=>x[YC(0x268)]+'\x20(startedAt:\x20'+x[YC(0x295)]+')');return l&&F[YC(0x2a1)](S),{'elements':F,'nextCursor':(O=T[YC(0x21f)])===null||O===void 0x0?void 0x0:O[YC(0x230)]};});return this[YS(0x2ec)](YS(0x2f2),C,k,YS(0x204)+B+'\x27')[YS(0x2b6)](o=>{const Yj=YS,e=o[Yj(0x2a8)]('\x20')[0x0];if(e===S)return undefined;return e;});}if(X!==undefined){const j=o=>e=>__awaiter(this,void 0x0,void 0x0,function*(){const Yo=YS;var O,T;const v=yield this[Yo(0x23f)]['get'][Yo(0x1ed)][Yo(0x2e0)]({'parameters':{'projectId':o,'serviceId':X},'options':{'per_page':this[Yo(0x271)],'cursor':e}}),F=(O=v[Yo(0x274)][Yo(0x2e0)])!==null&&O!==void 0x0?O:[],x=F[Yo(0x24f)](t=>t[Yo(0x268)]+Yo(0x1f4)+t[Yo(0x295)]+')');if(l)x===null||x===void 0x0?void 0x0:x[Yo(0x2a1)](S);return{'elements':x,'nextCursor':(T=v[Yo(0x21f)])===null||T===void 0x0?void 0x0:T[Yo(0x230)]};});return this['askForProjectScopedResourcePaginated'](YS(0x1e2),j,k,YS(0x2a7)+B+'\x27')[YS(0x2b6)](o=>{const Ye=YS,e=o[Ye(0x2a8)]('\x20')[0x0];if(e===S)return undefined;return e;});}throw new Error(YS(0x246));}),this[g(0x264)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const YT=g,X=B=>__awaiter(this,void 0x0,void 0x0,function*(){const YO=a8k,l=yield this[YO(0x23f)][YO(0x23d)][YO(0x2dd)][YO(0x2af)]({'parameters':{'projectId':B}});return l[YO(0x274)][YO(0x2dd)]['map'](S=>S['id']);});return this[YT(0x223)](YT(0x287),X,k);}),this[g(0x2b7)]=(k,X)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const YF=g,B=l=>S=>__awaiter(this,void 0x0,void 0x0,function*(){const Yv=a8k;var C;const j=yield this[Yv(0x23f)][Yv(0x201)][Yv(0x287)]['backups']({'parameters':{'projectId':l,'addonId':X},'options':{'per_page':this[Yv(0x271)],'cursor':S}});return{'elements':j[Yv(0x274)]['backups']['map'](o=>o['id']+Yv(0x2be)+(o[Yv(0x2de)]||Yv(0x29a))+')'),'nextCursor':(C=j[Yv(0x21f)])===null||C===void 0x0?void 0x0:C[Yv(0x230)]};});return this[YF(0x2ec)](YF(0x29d),B,k,YF(0x20b)+X+'\x27')[YF(0x2b6)](l=>l[YF(0x2a8)]('\x20')[0x0]);}),this[g(0x2f7)]=(k,X,B)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Yt=g,l=S=>C=>__awaiter(this,void 0x0,void 0x0,function*(){const Yx=a8k;var j;const o=yield this[Yx(0x23f)][Yx(0x201)][Yx(0x287)]['backup'][Yx(0x1f6)]({'parameters':{'projectId':S,'addonId':X,'backupId':B},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':C}});return{'elements':o[Yx(0x274)][Yx(0x1f6)]['map'](e=>e['id']+Yx(0x2be)+(e['completedAt']||Yx(0x29a))+')'),'nextCursor':(j=o['pagination'])===null||j===void 0x0?void 0x0:j[Yx(0x230)]};});return this[Yt(0x2ec)](Yt(0x2da),l,k,Yt(0x20b)+X+'\x27')['then'](S=>S['split']('\x20')[0x0]);}),this[g(0x1e3)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Yn=g,X=B=>__awaiter(this,void 0x0,void 0x0,function*(){const YQ=a8k;return(yield this[YQ(0x23f)][YQ(0x23d)][YQ(0x21d)]({'parameters':{'projectId':B}}))[YQ(0x274)]['map'](l=>l['id']);});return this[Yn(0x223)](Yn(0x2cb),X,k);}),this[g(0x1f1)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Yp=g,X=B=>__awaiter(this,void 0x0,void 0x0,function*(){const YM=a8k,l=yield this[YM(0x23f)][YM(0x23d)][YM(0x2ca)][YM(0x2af)]({'parameters':{'projectId':B}});return l[YM(0x274)][YM(0x2ca)][YM(0x24f)](S=>S['id']);});return this[Yp(0x223)](Yp(0x236),X,k);}),this[g(0x21c)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Yd=g,X=yield this[Yd(0x23f)][Yd(0x201)][Yd(0x1e5)]({'parameters':{'domain':k}}),B=X['data'][Yd(0x294)][Yd(0x24f)](S=>S[Yd(0x268)]+Yd(0x207)+S[Yd(0x2d2)]+')'),l=Yd(0x20a)+k+')';return this[Yd(0x250)](Yd(0x293),B,l)[Yd(0x2b6)](S=>S[Yd(0x2a8)]('\x20')[0x0]);}),this[g(0x1ea)]=(k,X)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const YP=g,B=yield this['apiClient'][YP(0x23d)]['subdomain'][YP(0x23a)]({'parameters':{'domain':k,'subdomain':X}}),l=B[YP(0x274)][YP(0x286)]['map'](C=>''+C[YP(0x2e7)]),S=YP(0x20a)+k+YP(0x25a)+X+')';return this['askForResource'](YP(0x255),l,S);}),this[g(0x2e8)]=k=>__awaiter(this,void 0x0,void 0x0,function*(){const Yf=g;return(yield inquirer['prompt']([{'type':Yf(0x2e2),'name':Yf(0x2e9),'message':chalk_1[Yf(0x1ef)]['yellowBright'](Yf(0x20e)+(k||'a\x20Northflank\x20resource')+Yf(0x219)),'default':![]}]))[Yf(0x2e9)];}),this['loginPrompt']=(k,X)=>__awaiter(this,void 0x0,void 0x0,function*(){const YN=g;_[YN(0x218)](k[YN(0x268)])&&(X[YN(0x28e)]<=0x0?_[YN(0x2c2)](k,YN(0x268),YN(0x1ef)):yield(0x0,utils_1[YN(0x2ee)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const YK=YN,{name:B}=yield inquirer[YK(0x232)]([{'type':YK(0x2b5),'name':'name','message':YK(0x297),'default':'main-context'}]);if(!k['override']&&X[YK(0x239)](l=>l[YK(0x268)]===B)){const {c:l}=yield inquirer['prompt']([{'type':'confirm','name':'c','message':YK(0x28b)+B+YK(0x22f),'default':![]}]);if(l===![])throw new Error('Context\x20name\x20already\x20exists.');_[YK(0x2c2)](k,YK(0x25d),!![]);}_[YK(0x2c2)](k,YK(0x268),B);})));if(_[YN(0x218)](k[YN(0x2b4)])){const B=yield this[YN(0x208)]();_[YN(0x2c2)](k,'token',B);}return k;}),this[g(0x208)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Yr=g,{token:k}=yield inquirer['prompt']([{'type':Yr(0x1fd),'name':Yr(0x2b4),'mask':'*','message':Yr(0x222)}]);return k;}),inquirer[g(0x251)](g(0x2a5),inquirerSearchList),inquirer[g(0x251)](g(0x2b9),inquirer_pagination_prompt_1[g(0x238)]);}[a8n(0x28d)](Y,k){return __awaiter(this,void 0x0,void 0x0,function*(){const Yw=a8k,X=yaml[Yw(0x252)](Y),B=_['max'](X['split']('\x0a')[Yw(0x24f)](C=>C[Yw(0x28e)])),l=chalk_1[Yw(0x1ef)][Yw(0x26a)]('-'['repeat'](B)+'\x0a'),{confirm:S}=yield inquirer[Yw(0x232)]([{'type':Yw(0x23d),'name':Yw(0x2e2),'message':''+chalk_1[Yw(0x1ef)][Yw(0x298)][Yw(0x2d6)]('Please\x20confirm\x20following\x20configuration:\x0a')+l+chalk_1[Yw(0x1ef)]['blueBright'](X)+l,'choices':Object[Yw(0x225)](ConfirmChoices)}]);switch(S){case ConfirmChoices['YES']:return Y;case ConfirmChoices['ABORT']:throw new Error(Yw(0x1f0));case ConfirmChoices[Yw(0x26d)]:return this[Yw(0x1e1)](k);case ConfirmChoices[Yw(0x273)]:return this[Yw(0x28d)](yield this[Yw(0x288)](Y),k);case ConfirmChoices['SAVE']:yield this[Yw(0x23e)](Y);return this['confirmationPrompt'](Y,k);default:throw new Error(Yw(0x2ed));}});}['retrievePayloadViaInteractiveCli'](Y,k){return __awaiter(this,void 0x0,void 0x0,function*(){const Yh=a8k;if((k===null||k===void 0x0?void 0x0:k[Yh(0x2d8)])!==undefined)this[Yh(0x2d8)]=k===null||k===void 0x0?void 0x0:k['resultCache'];this[Yh(0x2cf)]=k===null||k===void 0x0?void 0x0:k[Yh(0x1fc)],this[Yh(0x2ce)]=k===null||k===void 0x0?void 0x0:k[Yh(0x2ce)];const X={};return yield this[Yh(0x299)]([],Y[Yh(0x2bc)]['body'],X),this[Yh(0x2d8)]=X,yield this[Yh(0x28d)](X,Y);});}[a8n(0x299)](Y,k,X,B){return __awaiter(this,void 0x0,void 0x0,function*(){const Yg=a8k;let l;if(k[Yg(0x2dc)]&&!_[Yg(0x27e)](k,'properties')){if(k['oneOf'][Yg(0x28e)]>0x1){const {choice:S}=yield inquirer['prompt']([{'type':Yg(0x23d),'name':'choice','message':Yg(0x1ec)+(Y[Y[Yg(0x28e)]-0x1]||'')+Yg(0x245),'choices':k[Yg(0x2dc)]['map'](C=>{var j;return(j=C['description'])!==null&&j!==void 0x0?j:'??';})}]);l=yield this[Yg(0x254)](Y,k['oneOf'][Yg(0x239)](C=>C[Yg(0x277)]===S),X,B);}else{const C=k[Yg(0x2dc)][0x0];_[Yg(0x2c2)](C,Yg(0x277),k[Yg(0x277)]),l=yield this[Yg(0x254)](Y,C,X,B);}l={};}else{if(k[Yg(0x284)]&&!_[Yg(0x27e)](k,Yg(0x21b))){if(k[Yg(0x284)][Yg(0x28e)]>0x1){const {choice:j}=yield inquirer[Yg(0x232)]([{'type':'list','name':'choice','message':Yg(0x1ec)+(Y[Y[Yg(0x28e)]-0x1]||'')+Yg(0x245),'choices':[...k[Yg(0x284)][Yg(0x24f)](o=>{var e;return(e=o['description'])!==null&&e!==void 0x0?e:'??';}),Yg(0x27f)]}]);j!==Yg(0x27f)&&(l=yield this[Yg(0x254)](Y,k[Yg(0x284)][Yg(0x239)](o=>o[Yg(0x277)]===j),X,B));}else{const o=k['anyOf'][0x0];_['set'](o,'description',k[Yg(0x277)]),l=yield this[Yg(0x254)](Y,o,X,B);}l={};}else l=yield this[Yg(0x254)](Y,k,X,B);}return l;});}[a8n(0x2c8)](Y,k,X,B){var l;return __awaiter(this,void 0x0,void 0x0,function*(){const Yy=a8k;if(B===![]){const {addEntry:j}=yield inquirer[Yy(0x232)]([{'type':Yy(0x2e2),'name':Yy(0x267),'message':this[Yy(0x1ee)](k,Yy(0x279),Y===null||Y===void 0x0?void 0x0:Y[Yy(0x277)]),'default':![]}]);if(!j)return X;}const S=Object['keys']((l=Y===null||Y===void 0x0?void 0x0:Y[Yy(0x21b)])!==null&&l!==void 0x0?l:[]),C=Y['required']||[];if(S[Yy(0x28e)]>0x0)for(const o of S){const e=k[Yy(0x2ef)](o);if(k[Yy(0x28e)]>0x0&&!_[Yy(0x27e)](X,k[Yy(0x205)]('.')))_['set'](X,k[Yy(0x205)]('.'),{});yield this['propToType'](e,Y[Yy(0x21b)][o],X,C[Yy(0x263)](o));}else yield this[Yy(0x254)](k,Object[Yy(0x26c)](Object[Yy(0x26c)]({},Y),{'type':Yy(0x29c)}),X,B);return X;});}[a8n(0x2cd)](Y,k,X,B){return __awaiter(this,void 0x0,void 0x0,function*(){const YR=a8k;if(k&&X)return!![];const l=k?YR(0x279):'Do\x20you\x20want\x20to\x20add\x20more',{addEntry:S}=yield inquirer[YR(0x232)]([{'type':YR(0x2e2),'name':YR(0x267),'message':this['getPathString'](Y,l,k?B:undefined),'default':![]}]);return S;});}[a8n(0x254)](Y,k,X,B){return __awaiter(this,void 0x0,void 0x0,function*(){const Yq=a8k;let l;const S=Y[Yq(0x205)]('.');switch(k===null||k===void 0x0?void 0x0:k[Yq(0x23b)]){case Yq(0x237):{let C=!![];while(yield this['askArrayEntry'](Y,C,B,k===null||k===void 0x0?void 0x0:k[Yq(0x277)])){const j=_[Yq(0x201)](X,S);_[Yq(0x249)](X,S),yield this[Yq(0x254)](Y,k['items'],X);const o=_[Yq(0x201)](X,S);!_[Yq(0x269)](j)?_[Yq(0x2c2)](X,S,[o]):(j['push'](o),_['set'](X,S,j)),C=![];}return l||[];}case Yq(0x282):{return l=yield this[Yq(0x2c8)](k,Y,X,B),l;}case Yq(0x29c):l=(0x0,utils_1['isValidJSON'])(yield this[Yq(0x1fe)](Y,k,B))||undefined;break;case Yq(0x212):case Yq(0x2b1):case Yq(0x248):default:l=yield this[Yq(0x1fe)](Y,k,B,X);break;}return!_[Yq(0x218)](l)&&_[Yq(0x2c2)](X,S,l),l;});}[a8n(0x1fe)](Y,k,X,B){var l;return __awaiter(this,void 0x0,void 0x0,function*(){const YU=a8k,S=Y[Y[YU(0x28e)]-0x1],{defaultValue:defaultValue=(l=k===null||k===void 0x0?void 0x0:k[YU(0x2f0)])!==null&&l!==void 0x0?l:k===null||k===void 0x0?void 0x0:k[YU(0x1ef)],choices:choices=k===null||k===void 0x0?void 0x0:k[YU(0x200)],pagination:C}=yield(0x0,api_helpers_1['fetchResourceList'])(S,this[YU(0x23f)],this[YU(0x2cf)],B,this['pathVars'],Y);let j=YU(0x2b5);if(!_[YU(0x218)](choices)&&choices[YU(0x28e)]>0x0){if(C!==undefined&&C[YU(0x29f)]!==undefined)j=YU(0x2b9);else choices['length']>0x4&&typeof choices[0x0]==='string'?j=YU(0x2a5):j=YU(0x23d);}else{if((k===null||k===void 0x0?void 0x0:k[YU(0x23b)])===YU(0x2b1))j='confirm';else{if((k===null||k===void 0x0?void 0x0:k[YU(0x23b)])===YU(0x248))j=YU(0x2b5);else(k===null||k===void 0x0?void 0x0:k[YU(0x23b)])===YU(0x29c)&&(j=YU(0x1f5));}}let o=X!==![]?!_[YU(0x24b)](defaultValue)?defaultValue:JSON[YU(0x266)](defaultValue):_[YU(0x247)](defaultValue)?defaultValue:YU(0x27f);if(choices)o=o[YU(0x25f)]();_[YU(0x27e)](this[YU(0x2d8)],Y[YU(0x205)]('.'))&&(o=this[YU(0x2d8)][Y[YU(0x205)]('.')]);const e=choices&&X===![]?[YU(0x27f),...choices]:choices,O=(k===null||k===void 0x0?void 0x0:k[YU(0x23b)])===YU(0x248),T=Object[YU(0x26c)]({'type':j,'name':'id','message':this[YU(0x29b)](Y,k),'choices':e,'default':o,'filter':this[YU(0x2a0)](j,X),'validate':this[YU(0x22d)](k,X,O)},C),v=(yield inquirer['prompt']([T]))['id'];if(v===YU(0x27f)||v==='')return undefined;if(O)return parseInt(v,0xa);return v;});}[a8n(0x29b)](Y,k){const YL=a8n,X=(k===null||k===void 0x0?void 0x0:k[YL(0x23b)])!=='boolean'?'What\x20do\x20you\x20want\x20to\x20use\x20as':YL(0x256);return this['getPathString'](Y,X,k===null||k===void 0x0?void 0x0:k[YL(0x277)]);}[a8n(0x283)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Yz=a8k,Y=yield this[Yz(0x23f)][Yz(0x23d)]['projects'][Yz(0x2af)]({})[Yz(0x2b6)](k=>k['data'][Yz(0x276)][Yz(0x24f)](X=>X['id']));return yield this['askForResource'](Yz(0x213),Y);});}[a8n(0x223)](Y,k,X,B){return __awaiter(this,void 0x0,void 0x0,function*(){const YA=a8k,l=X||this[YA(0x23f)]['contextProvider'][YA(0x2e1)]();if(_[YA(0x218)](l))throw new Error(YA(0x292));const S=yield k(l);return yield this[YA(0x250)](Y,S,(B?B+'\x20in\x20':'')+YA(0x214)+l+'\x27');});}[a8n(0x2ec)](Y,k,X,B){return __awaiter(this,void 0x0,void 0x0,function*(){const YD=a8k,l=X||this[YD(0x23f)][YD(0x1e8)][YD(0x2e1)]();if(_[YD(0x218)](l))throw new Error(YD(0x292));const S=yield k(l);return yield this[YD(0x22a)](Y,S,(B?B+YD(0x2aa):'')+YD(0x214)+l+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const YE=a8k,Y=yield this[YE(0x23f)][YE(0x23d)][YE(0x25b)][YE(0x2af)]({}),k=Y[YE(0x274)][YE(0x25b)]['map'](X=>X[YE(0x268)]);return this['askForResource'](YE(0x1e5),k);});}[a8n(0x2a2)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Yb=a8k,Y=yield this[Yb(0x23f)][Yb(0x23d)][Yb(0x1e9)]['all']({}),k=Y[Yb(0x274)][Yb(0x2d9)]['map'](X=>X['id']);return this['askForResource'](Yb(0x2d9),k);});}[a8n(0x1ff)](Y){const Ya=a8n;this[Ya(0x234)]=Y;}}exports[a8n(0x2a4)]=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';const
|
|
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 a10u=a10k;(function(Y,k){const I=a10k,X=Y();while(!![]){try{const B=-parseInt(I(0x217))/0x1+parseInt(I(0x261))/0x2+parseInt(I(0x224))/0x3+-parseInt(I(0x252))/0x4*(-parseInt(I(0x228))/0x5)+-parseInt(I(0x262))/0x6+parseInt(I(0x275))/0x7*(parseInt(I(0x1f4))/0x8)+parseInt(I(0x1df))/0x9;if(B===k)break;else X['push'](X['shift']());}catch(l){X['push'](X['shift']());}}}(a10Y,0x54005));function a10k(Y,k){const X=a10Y();return a10k=function(B,l){B=B-0x1d7;let S=X[B];return S;},a10k(Y,k);}function a10Y(){const YS=['__awaiter','280nqSAVg','Id]','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','yaml','--startTime\x20<timestamp>','--restore\x20--restoreId\x20[restoreId]',',\x20backup\x20id\x20','textIncludes','regexIncludes','stringify','deploymentId','--regexNotIncludes\x20<regex>','askForAddon','--regexIncludes\x20<regex>','done','next','getFormatter','printResponse','data','askForService','length','forward','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','regexNotIncludes','../formatting/console-format-helpers','containerId','askForContainer','--duration\x20[duration]','\x20of\x20','-t,\x20--types\x20<types...>','../inquirer-helper','job','value','bold','167418OGIBTn','addon','apiClient','backward','CliLogs','yml','getSeconds','backupId','apply','runId','serviceId','slice','addonBackup','865485nmjvzP','LogType','alias','start','415kmjnaA','restoreId','--project\x20--projectId\x20[projectId]','toUpperCase','default','getLogsCommand','--textIncludes\x20<text>','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','getCommand','getCurrentServiceName','toISOString','logs-received','valueOf','pagination','apiContext','Number\x20of\x20lines\x20to\x20return.','json','\x20(exit\x20with\x20','noDefaults','message','tail','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','--run\x20--runId\x20[runId]','hasNextPage','service','askForBuild','customUserAgent','\x20for\x20container\x20','\x20seconds','forEach','buildId','Error\x20while\x20tailing\x20log\x20lines:\x20','logs','getCurrentJobName','askForAddonRestore','getStandardLogCommand','--container\x20--containerId\x20[containerId]','values','-l,\x20--lineLimit\x20[limit]','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','Option','Build\x20to\x20get\x20logs\x20from','15788aCgtAD','>\x20Container\x20logs','getCurrentProjectName','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','conflicts',',\x20from:\x20','details','throw','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','defineProperty','argParser','log','__importDefault','logTail','defaultDurationSeconds','21952uRSWJX','3594342cCWxTF','--backup\x20--backupId\x20[backupId]','build-','charAt','--noDefaults','Log\x20session\x20ended','addonId','\x20--','../utils','Backup\x20to\x20get\x20logs\x20from','--build\x20--buildId\x20[buildId]','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','./log-formatter','printInitInfo','askForAddonBackup','description','\x0aDetails:\x20','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','tsHint','65044HSNavt','textNotIncludes','Deployment\x20id,\x20example:\x20my-service-54785f4','-d,\x20--direction\x20<order>',',\x20to:\x20','chalk','InquirerHelper','format','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','askForJob','1424268dXhKjf','choices','error','Project\x20for\x20logs','setSeconds','\x20for\x20all\x20containers','inquirerHelper','parseDateInput','__esModule','addOption','warning','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','\x20with\x20live-tailing','askForJobRun','formatLogLine','assign','action','option','-o,\x20--output\x20[output]','Id\x20['];a10Y=function(){return YS;};return a10Y();}var __awaiter=this&&this[a10u(0x1f3)]||function(Y,k,X,B){function l(S){return S instanceof X?S:new X(function(C){C(S);});}return new(X||(X=Promise))(function(S,C){const Y1=a10k;function j(O){const i=a10k;try{e(B[i(0x203)](O));}catch(T){C(T);}}function o(O){const W=a10k;try{e(B[W(0x259)](O));}catch(T){C(T);}}function e(O){const Y0=a10k;O[Y0(0x202)]?S(O['value']):l(O[Y0(0x215)])['then'](j,o);}e((B=B[Y1(0x21f)](Y,k||[]))[Y1(0x203)]());});},__importDefault=this&&this[a10u(0x25e)]||function(Y){return Y&&Y['__esModule']?Y:{'default':Y};};Object[a10u(0x25b)](exports,a10u(0x1e7),{'value':!![]}),exports[a10u(0x21b)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a10u(0x1da))),utils_1=require(a10u(0x26a)),inquirer_helper_1=require(a10u(0x213)),commander_1=require('commander'),console_format_helpers_1=require(a10u(0x20d)),log_formatter_1=require(a10u(0x26e));class CliLogs{constructor(Y,k){const Y2=a10u;this[Y2(0x236)]=Y,this[Y2(0x260)]=0x708,this[Y2(0x24b)]=(X,B,l,S)=>{const Y3=Y2,C=(0x0,utils_1[Y3(0x230)])(!![])['name']((B?'build-':'')+Y3(0x248))[Y3(0x226)]((B?Y3(0x264):'')+Y3(0x25d))[Y3(0x271)]('Get\x20log\x20for\x20the\x20specified\x20'+X)[Y3(0x1f0)](Y3(0x22a),Y3(0x1e2))[Y3(0x1f0)]('--'+X+Y3(0x269)+X+Y3(0x1f2)+X+Y3(0x1f5),X[Y3(0x265)](0x0)[Y3(0x22b)]()+X[Y3(0x222)](0x1)+'\x20to\x20get\x20logs\x20from')[Y3(0x1f0)](Y3(0x24c),Y3(0x273));if(B)C[Y3(0x1f0)](Y3(0x26c),Y3(0x251));if(X===Y3(0x214))C[Y3(0x1f0)](Y3(0x23e),Y3(0x1ea));if(X===Y3(0x240))C['option']('--deployment\x20--deploymentId\x20[deploymentId]',Y3(0x1d7));if(l)C[Y3(0x1f0)](Y3(0x263),Y3(0x26b));if(S)C[Y3(0x1f0)](Y3(0x1f9),'Restore\x20to\x20get\x20logs\x20from');return!B&&!l&&!S&&C['addOption'](new commander_1['Option'](Y3(0x212),'Which\x20log\x20types\x20to\x20fetch')[Y3(0x1e0)](Object['values'](js_client_1[Y3(0x225)]))),C['option']('-f,\x20--tail','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.')[Y3(0x1f0)](Y3(0x24e),Y3(0x237))[Y3(0x1f0)](Y3(0x1f8),'Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1['tsHint'],utils_1[Y3(0x1e6)])[Y3(0x1e8)](new commander_1[(Y3(0x250))]('--endTime\x20<timestamp>',Y3(0x20a)+utils_1[Y3(0x274)])[Y3(0x25c)](utils_1[Y3(0x1e6)])['conflicts'](['tail']))[Y3(0x1f0)](Y3(0x210),Y3(0x255))[Y3(0x1e8)](new commander_1[(Y3(0x250))](Y3(0x1d8),Y3(0x20b))[Y3(0x1e0)]([Y3(0x21a),Y3(0x209)])[Y3(0x256)]([Y3(0x23c)]))['addOption'](new commander_1[(Y3(0x250))](Y3(0x22e),Y3(0x23d))[Y3(0x256)]([Y3(0x276),'regexIncludes',Y3(0x20c)]))[Y3(0x1e8)](new commander_1['Option']('--textNotIncludes\x20<text>',Y3(0x1f6))['conflicts']([Y3(0x1fb),Y3(0x1fc),Y3(0x20c)]))[Y3(0x1e8)](new commander_1[(Y3(0x250))](Y3(0x201),Y3(0x24f))[Y3(0x256)](['textNotIncludes',Y3(0x1fb),Y3(0x20c)]))['addOption'](new commander_1[(Y3(0x250))](Y3(0x1ff),Y3(0x1dd))['conflicts']([Y3(0x276),'regexIncludes',Y3(0x1fb)]))[Y3(0x1f0)](Y3(0x266),Y3(0x25a),![])['addOption'](new commander_1[(Y3(0x250))](Y3(0x1f1),Y3(0x26d))['choices'](Object[Y3(0x24d)]([Y3(0x1dc),Y3(0x238),Y3(0x1f7)]))),C;},this[Y2(0x26f)]=(X,B,l,S)=>{const Y4=Y2,{containerName:C,restoreId:j,backupId:o,quiet:e,tail:O,startTime:T,endTime:v,duration:F}=S;if(e===!![])return;const x=O?Y4(0x239)+chalk_1[Y4(0x22c)][Y4(0x216)]('\x27Ctrl+C\x27')+')':'',t=O?Y4(0x1eb):'',Q=new Date(),n=T!==null&&T!==void 0x0?T:new Date(new Date((v!==null&&v!==void 0x0?v:Q)[Y4(0x234)]())[Y4(0x1e3)]((v!==null&&v!==void 0x0?v:Q)[Y4(0x21d)]()-(F!==null&&F!==void 0x0?F:this[Y4(0x260)]))),M=(v!==null&&v!==void 0x0?v:T!==undefined)?new Date(new Date(T[Y4(0x234)]())[Y4(0x1e3)](T[Y4(0x21d)]()+(F!==null&&F!==void 0x0?F:this['defaultDurationSeconds']))):Q,p=o!==undefined,d=n&&!p?Y4(0x257)+chalk_1[Y4(0x22c)]['bold'](n['toISOString']()):'',P=M&&!p?Y4(0x1d9)+chalk_1['default']['bold'](M[Y4(0x232)]()):'',f=F?',\x20duration:\x20'+F+Y4(0x244):'',N=C?Y4(0x243)+chalk_1['default'][Y4(0x216)](C):p?'':Y4(0x1e4),K=o?Y4(0x1fa)+o:'',r=j?',\x20restore\x20id\x20'+j:'',w=X+'\x20'+chalk_1[Y4(0x22c)]['bold'](B)+K+r+'\x20in\x20project\x20'+chalk_1['default'][Y4(0x216)](l),h=''+d+P+f;console[Y4(0x25d)](Y4(0x253)+t+N+Y4(0x211)+w+h+x+':');},this[Y2(0x204)]=(X,B)=>(l,S)=>{const Y5=Y2;if(!X){if(l[Y5(0x208)]===0x0)console['log']('No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.');l[Y5(0x245)](C=>(0x0,log_formatter_1[Y5(0x1ed)])(C,B));}else(0x0,console_format_helpers_1[Y5(0x205)])(X,l);(S===null||S===void 0x0?void 0x0:S[Y5(0x23f)])&&(0x0,utils_1[Y5(0x1e9)])(Y5(0x22f)+S['cursor']);},this[Y2(0x219)]=new js_client_1['ApiClient'](Y,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Y2(0x242)],'agent':k}),this['logsApiClient']=this[Y2(0x219)],this[Y2(0x1e5)]=new inquirer_helper_1[(Y2(0x1db))](this[Y2(0x219)]);}[a10u(0x22d)](Y,k=![],X=![],B=![]){const YB=a10u,l=(T,v)=>__awaiter(this,void 0x0,void 0x0,function*(){const Y6=a10k,F=v[Y6(0x23a)],{apiContext:x,inquirerHelper:t}=this;switch(Y){case Y6(0x240):{const Q=F?undefined:x[Y6(0x231)]();return v[Y6(0x221)]||Q||(yield t[Y6(0x207)](T)());}case Y6(0x214):{const n=F?undefined:x[Y6(0x249)]();return v['jobId']||n||(yield t[Y6(0x1de)](T)());}case Y6(0x218):{return v[Y6(0x268)]||(yield t[Y6(0x200)](T)());}}}),S=(T,v,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const Y7=a10k;if(k)return F[Y7(0x246)]||(yield this[Y7(0x1e5)][Y7(0x241)](T,Y===Y7(0x240)?v:undefined,Y===Y7(0x214)?v:undefined,!![])());return undefined;}),C=(T,v,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const Y8=a10k;if(X||B)return F[Y8(0x21e)]||(yield this[Y8(0x1e5)][Y8(0x270)](T,v)());return undefined;}),j=(T,v,F,x)=>__awaiter(this,void 0x0,void 0x0,function*(){const Y9=a10k;if(B)return x[Y9(0x229)]||(yield this['inquirerHelper'][Y9(0x24a)](T,v,F)());return undefined;}),o=(T,v,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const YY=a10k;if(!k&&F['containerId']!==undefined){if(F['containerId']!==!![])return F[YY(0x20e)];return yield this[YY(0x1e5)][YY(0x20f)](T,Y==='service'?v:undefined,Y===YY(0x214)?v:undefined,!![])();}return undefined;}),e=(T,v,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const Yk=a10k;if(Y===Yk(0x214))return F[Yk(0x220)]||(yield this[Yk(0x1e5)][Yk(0x1ec)](v,T,!![])());return undefined;}),O=(T,v,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const YX=a10k;if(Y===YX(0x240)){if(F['deploymentId']!==!![])return F['deploymentId'];return F[YX(0x1fe)];}return undefined;});return this['getStandardLogCommand'](Y,k,X,B)[YB(0x1ef)](T=>__awaiter(this,void 0x0,void 0x0,function*(){const Yl=YB,{noDefaults:v,projectId:F,quiet:x,tail:t,types:Q,textIncludes:n,textNotIncludes:M,regexIncludes:p,regexNotIncludes:d,direction:P,lineLimit:f,startTime:N,endTime:K,duration:r,output:w}=T;(0x0,utils_1['assertContextExisting'])(this[Yl(0x219)]);const {apiContext:h,inquirerHelper:g,logsApiClient:y}=this,R=v?undefined:h[Yl(0x254)](),q=F||R||(yield g['askForProject']()),U=yield l(q,T),L=yield S(q,U,T),z=yield C(q,U,T),A=yield j(q,U,z,T),D=yield e(q,U,T),E=yield O(q,U,T),b=yield o(q,U,T);if(N&&K&&r)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const a={'projectId':q,'entityId':U},Z={'containerName':b,'types':Q,'textIncludes':n,'textNotIncludes':M,'regexIncludes':p,'regexNotIncludes':d,'lineLimit':f,'startTime':N,'duration':r,'runId':D,'buildId':L,'backupId':z,'restoreId':A,'deploymentId':E,'isBuild':k!==null&&k!==void 0x0?k:![]},c=B?'addonRestore':X?Yl(0x223):Y,V=Object[Yl(0x1ee)](Object[Yl(0x1ee)]({},Z),{'endTime':K,'direction':P});if(!x&&w!==Yl(0x1f7)&&w!==Yl(0x21c)&&w!=='json')this[Yl(0x26f)](Y,U,q,Object[Yl(0x1ee)](Object[Yl(0x1ee)]({},V),T));const m=this['getFormatter'](w,n!==null&&n!==void 0x0?n:p);if(t){const J=yield y[Yl(0x248)][Yl(0x25f)](a,Z,c);J['on'](Yl(0x233),m),J['on'](Yl(0x1e1),H=>(0x0,utils_1[Yl(0x1e1)])(Yl(0x247)+H[Yl(0x23b)])),J['on']('close',()=>console[Yl(0x25d)](Yl(0x267))),yield J[Yl(0x227)]();}else{const H=yield y[Yl(0x248)]['logRange'](a,V,c);if(H[Yl(0x1e1)]){const G=H['error'][Yl(0x258)],s=G?Yl(0x272)+JSON[Yl(0x1fd)](G,null,'\x20'):'';(0x0,utils_1['error'])('Error\x20while\x20fetching\x20log\x20lines:\x20'+H['error'][Yl(0x23b)]+s);}else m(H[Yl(0x206)],H[Yl(0x235)]);}}));}}exports[a10u(0x21b)]=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';const
|
|
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;
|