@northflank/cli 0.9.13 → 0.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-helpers.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/contextCommands.js +1 -1
- package/dist/defaults.js +1 -1
- package/dist/exec/index.js +1 -1
- package/dist/formatting/command-overview.js +1 -1
- package/dist/formatting/console-format-helpers.js +1 -1
- package/dist/formatting/terminal-chart.js +1 -1
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/logs/index.js +1 -1
- package/dist/logs/log-formatter.js +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/pagination/inquirer-pagination-prompt.js +1 -1
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +3 -3
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a4N=a4L;function a4L(Q,L){const z=a4Q();return a4L=function(A,b){A=A-0x11b;let M=z[A];return M;},a4L(Q,L);}(function(Q,L){const E=a4L,z=Q();while(!![]){try{const A=-parseInt(E(0x143))/0x1*(parseInt(E(0x138))/0x2)+-parseInt(E(0x139))/0x3+-parseInt(E(0x180))/0x4+parseInt(E(0x15d))/0x5+parseInt(E(0x167))/0x6+-parseInt(E(0x125))/0x7*(parseInt(E(0x13c))/0x8)+-parseInt(E(0x170))/0x9*(-parseInt(E(0x144))/0xa);if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a4Q,0x9e0ec));var __awaiter=this&&this[a4N(0x133)]||function(Q,L,z,A){function b(M){return M instanceof z?M:new z(function(S){S(M);});}return new(z||(z=Promise))(function(M,S){const C=a4L;function k(Z){const T=a4L;try{q(A[T(0x156)](Z));}catch(V){S(V);}}function i(Z){const v=a4L;try{q(A[v(0x142)](Z));}catch(V){S(V);}}function q(Z){const h=a4L;Z[h(0x132)]?M(Z['value']):b(Z[h(0x15e)])['then'](k,i);}q((A=A['apply'](Q,L||[]))[C(0x156)]());});},__importDefault=this&&this['__importDefault']||function(Q){const W=a4N;return Q&&Q[W(0x141)]?Q:{'default':Q};};Object[a4N(0x16b)](exports,a4N(0x141),{'value':!![]}),exports['CliExec']=void 0x0;function a4Q(){const F=['--project\x20--projectId\x20[NAME]','../utils','getCurrentServiceName','stdOut','16407bqMVfo','error','pipe','service','CliExec','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','askForJob','Success','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','Project\x20for\x20exec','assertContextExisting','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.','stderr','Run\x20command\x20with\x20this\x20group','alias','default','1756960TmFNIm','addCommand','Command\x20completed\x20successfully,\x20exit\x20code:\x20','stdout','option','--cmd\x20--command\x20[COMMAND]','warning','resize','bold','readline','getStandardExecCommand','handleShellSession','log','28ywRSiC','emitKeypressEvents','stdErr','apiClient','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','description','columns','action','stdin','exec','\x20in\x20project\x20','name','\x20--','done','__awaiter','status','--container\x20--containerId\x20[NAME]','Error\x20occured\x20during\x20','../inquirer-helper','146oSksKo','895950grhiWj','--group\x20[GROUP]','\x20--shell-cmd\x20\x27sh\x27','2009512snXsdX','ApiClient','charAt','message','command-exec','__esModule','throw','15055XtDAPd','12740ALHBiI','execStartLog','shell\x20command\x20','greenBright','rows','Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.','\x20command\x20exec:\x20','getCurrentProjectName','toUpperCase','execJobSession','\x20to\x20exec\x20into','exitCode','chalk','filter','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','setRawMode','--shell-cmd\x20[SHELL-CMD]','getTerminalSize','next','askForProject','Run\x20command\x20with\x20this\x20user','stdIn','execCmd','@northflank/js-client','none','4037495vjLQZp','value',',\x20exit\x20code:\x20','Command\x20to\x20execute.\x0aIf\x20--shell-cmd\x20option\x20such\x20as\x20\x27bash\x20-c\x27\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell.\x20Otherwise\x20the\x20command\x20will\x20run\x20without\x20a\x20shell.\x20If\x20no\x20command\x20is\x20provided,\x20an\x20interactive\x20session\x20with\x20stdin\x20and\x20tty\x20is\x20opened.','isTTY','\x0a\x20\x20Single\x20command,\x20no\x20shell:\x20\x20\x20\x20\x20northflank\x20exec\x20','getCommand','keypress','exit','customUserAgent','2154384FATPxv','job','askForService',',\x20details:\x20','defineProperty'];a4Q=function(){return F;};return a4Q();}const js_client_1=require(a4N(0x15b)),chalk_1=__importDefault(require(a4N(0x150))),utils_1=require(a4N(0x16d)),inquirer_helper_1=require(a4N(0x137));class CliExec{constructor(Q){const w=a4N;this[w(0x122)]=b=>(0x0,utils_1['getCommand'])(!![])[w(0x130)](b)[w(0x12a)]('Command\x20exec\x20for\x20the\x20specified\x20'+b+'.\x0aExamples:\x0a\x20\x20Shell\x20session:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20northflank\x20exec\x20'+b+w(0x162)+b+'\x20--cmd\x20\x27date\x27\x0a\x20\x20Single\x20command,\x20custom\x20shell:\x20northflank\x20exec\x20'+b+'\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'+b+w(0x13b))[w(0x11c)](w(0x16c),w(0x179))['option']('--'+b+w(0x131)+b+'Id\x20[NAME]',b[w(0x13e)](0x0)[w(0x14c)]()+b['slice'](0x1)+w(0x14e))['option'](w(0x135),w(0x129))[w(0x11c)](w(0x154),w(0x17b))[w(0x11c)]('--user\x20[USER]',w(0x158))[w(0x11c)](w(0x13a),w(0x17d))['option']('--noDefaults',w(0x178),![])[w(0x11c)](w(0x11d),w(0x160)),this[w(0x155)]=()=>({'columns':process[w(0x11b)][w(0x12b)],'rows':process['stdout'][w(0x148)]}),this[w(0x145)]=(b,M,S,k,i,q,Z,V)=>{const H=w;if(V===!![])return;const d=k===H(0x15c),a=d?'without\x20shell':k===undefined?'with\x20shell\x20session':H(0x146)+chalk_1[H(0x17f)][H(0x147)](k),G=i!==undefined?'with\x20user:'+i:'',I=q!==undefined?'with\x20group:'+q:'',g=Z!==undefined?'with\x20command\x20\x27'+chalk_1['default'][H(0x147)](Z)+'\x27':'',O=[g,a,G,I][H(0x151)](j=>j!=='')['join']('\x20'),Y='(exit\x20with\x20two\x20quick\x20'+chalk_1[H(0x17f)][H(0x120)]('\x27Ctrl+D\x27')+')';console[H(0x124)]('Exec\x20'+b+'\x20'+chalk_1[H(0x17f)][H(0x120)](M)+H(0x12f)+chalk_1['default'][H(0x120)](S)+'\x20'+O+'\x20'+Y);},this[w(0x123)]=(b,M,S=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const x=w;var k,i;let q=![];try{if(process[x(0x12d)][x(0x161)]){const V=require(x(0x121));V[x(0x126)](process[x(0x12d)]),process['stdin'][x(0x153)](!![]),process['stdout']['on'](x(0x11f),()=>{const J=x;b['resizeTerminal'](this[J(0x155)]());}),process[x(0x12d)]['on'](x(0x164),(d,a)=>{const u=x;a['sequence']==='\x04'&&(q?(process[u(0x12d)][u(0x153)](![]),(0x0,utils_1[u(0x11e)])(u(0x149)),process[u(0x165)]()):(q=!![],setTimeout(()=>q=![],0x190)));});}process['stdin'][x(0x172)](b[x(0x159)]),b[x(0x127)][x(0x172)](process[x(0x17c)]),b[x(0x16f)][x(0x172)](process[x(0x11b)]),b['on'](x(0x171),d=>{const n=x;var a;(0x0,utils_1[n(0x171)])(n(0x136)+M+n(0x14a)+((a=d['message'])!==null&&a!==void 0x0?a:d)),process[n(0x12d)][n(0x161)]&&process['stdin'][n(0x153)](![]),process[n(0x165)](-0x1);});const Z=yield b['waitForCommandResult']();if(S!==!![]){const d=(k=Z===null||Z===void 0x0?void 0x0:Z[x(0x134)])!==null&&k!==void 0x0?k:'Unknown',a=(i=Z===null||Z===void 0x0?void 0x0:Z[x(0x14f)])!==null&&i!==void 0x0?i:-0x1,G=(Z===null||Z===void 0x0?void 0x0:Z[x(0x13f)])?x(0x16a)+Z[x(0x13f)]:'';d===x(0x177)?(0x0,utils_1['success'])(x(0x182)+a):(0x0,utils_1[x(0x11e)])(x(0x152)+d+x(0x15f)+a+G);}return Z;}finally{process[x(0x12d)][x(0x161)]&&process['stdin'][x(0x153)](![]);}}),this[w(0x128)]=new js_client_1[(w(0x13d))](Q,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[w(0x166)]});const L=new inquirer_helper_1['InquirerHelper'](this['apiClient']);this[w(0x15a)]=(0x0,utils_1[w(0x163)])()['name'](w(0x140))[w(0x17e)](w(0x12e))[w(0x12a)](w(0x175));const z=this['getStandardExecCommand'](w(0x173))[w(0x12c)](b=>__awaiter(this,void 0x0,void 0x0,function*(){const R=w,{noDefaults:M,projectId:S,serviceId:k,containerId:i,shellCmd:q,user:Z,group:V,command:d,quiet:a}=b;(0x0,utils_1[R(0x17a)])(this[R(0x128)]);try{const G=M?undefined:Q[R(0x14b)](),I=S||G||(yield L[R(0x157)]()),g=M?undefined:Q[R(0x16e)](),O=k||g||(yield L[R(0x169)](I)()),Y=q!==null&&q!==void 0x0?q:d!==undefined?'none':undefined;this[R(0x145)](R(0x173),O,I,Y,Z,V,d,a);const j=process['stdout']['columns'],B=process[R(0x11b)]['rows'],l={'projectId':I,'serviceId':O},o=yield this[R(0x128)][R(0x12e)]['execServiceSession'](l,{'containerName':i,'command':d,'shell':Y,'user':Z,'group':V,'ttyColumns':j,'ttyRows':B});yield this['handleShellSession'](o,R(0x173),a);}catch(r){(0x0,utils_1[R(0x171)])(''+r[R(0x13f)]);}finally{process[R(0x165)]();}})),A=this[w(0x122)](w(0x168))[w(0x12c)](b=>__awaiter(this,void 0x0,void 0x0,function*(){const m=w,{projectId:M,jobId:S,containerId:k,noDefaults:i,shellCmd:q,user:Z,group:V,command:d,quiet:a}=b;(0x0,utils_1['assertContextExisting'])(this[m(0x128)]);try{const G=i?undefined:Q[m(0x14b)](),I=M||G||(yield L['askForProject']()),g=S||(yield L[m(0x176)](I)());this['execStartLog'](m(0x168),g,I,q,a);const {rows:O,columns:Y}=this['getTerminalSize'](),j={'projectId':I,'jobId':g},B=yield this['apiClient'][m(0x12e)][m(0x14d)](j,{'containerName':k,'command':d,'shell':q,'user':Z,'group':V,'ttyColumns':Y,'ttyRows':O});yield this[m(0x123)](B,m(0x168),a);}catch(l){(0x0,utils_1['error'])(''+l[m(0x13f)]);}finally{process['exit']();}}));this[w(0x15a)][w(0x181)](z),this[w(0x15a)][w(0x181)](A);}}exports[a4N(0x174)]=CliExec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function a5L(Q,L){const z=a5Q();return a5L=function(A,b){A=A-0x194;let M=z[A];return M;},a5L(Q,L);}const a5o=a5L;function a5Q(){const w=['description','__esModule','then','3077796NxCMyp','next','throw','9zJvLTh','option','defineProperty','bold','1NTJtil','every','17149KOMagl','log','green','3087252zEwOxS','action','1374ppztTu','__awaiter','7427704pDLzhY','keys','commands','command-overview','7370DVYpLT','length','__importDefault','slice','Print\x20command\x20descriptions','value','getCommandOverview','--verbose','getCommand','1623236TYQeSe','4050030eGbwKQ','name','chalk','6188gYhSrO','join','map','done'];a5Q=function(){return w;};return a5Q();}(function(Q,L){const l=a5L,z=Q();while(!![]){try{const A=parseInt(l(0x1ab))/0x1*(parseInt(l(0x199))/0x2)+parseInt(l(0x1b2))/0x3*(-parseInt(l(0x19d))/0x4)+-parseInt(l(0x19a))/0x5+parseInt(l(0x1a4))/0x6+parseInt(l(0x1b0))/0x7+-parseInt(l(0x1b4))/0x8*(parseInt(l(0x1a7))/0x9)+-parseInt(l(0x1b8))/0xa*(-parseInt(l(0x1ad))/0xb);if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a5Q,0x72298));var __awaiter=this&&this[a5o(0x1b3)]||function(Q,L,z,A){function b(M){return M instanceof z?M:new z(function(S){S(M);});}return new(z||(z=Promise))(function(M,S){const T=a5L;function k(Z){const r=a5L;try{q(A[r(0x1a5)](Z));}catch(V){S(V);}}function i(Z){const E=a5L;try{q(A[E(0x1a6)](Z));}catch(V){S(V);}}function q(Z){const N=a5L;Z[N(0x1a0)]?M(Z[N(0x195)]):b(Z[N(0x195)])[N(0x1a3)](k,i);}q((A=A['apply'](Q,L||[]))[T(0x1a5)]());});},__importDefault=this&&this[a5o(0x1ba)]||function(Q){const v=a5o;return Q&&Q[v(0x1a2)]?Q:{'default':Q};};Object[a5o(0x1a9)](exports,a5o(0x1a2),{'value':!![]}),exports[a5o(0x196)]=void 0x0;const chalk_1=__importDefault(require(a5o(0x19c))),utils_1=require('../utils');function getCommandOverview(Q){const h=a5o;return(0x0,utils_1[h(0x198)])()[h(0x19b)](h(0x1b7))[h(0x1a1)]('Prints\x20a\x20tree\x20view\x20of\x20all\x20available\x20commands')[h(0x1a8)](h(0x197),h(0x194))[h(0x1b1)](L=>__awaiter(this,void 0x0,void 0x0,function*(){const {verbose:z}=L;function A(b,M){const C=a5L;var S;const k=(Y,j=!![])=>j?chalk_1['default'][C(0x1aa)][C(0x1af)](Y[C(0x19b)]()):Y[C(0x19b)](),i=M[C(0x1b9)]===0x0,q=b[C(0x1b6)];let Z='';const V=q[C(0x1b9)]===0x0,d=V||((S=Object[C(0x1b5)](b===null||b===void 0x0?void 0x0:b['opts']()))===null||S===void 0x0?void 0x0:S[C(0x1b9)])>0x0;!i&&(Z=q&&!V?'┬\x20':'─\x20');const a=z&&d&&b['description']()?':\x20'+b[C(0x1a1)]():'';console[C(0x1ae)](''+M+Z+k(b,d)+a);let G=M;if(!i){const Y=M[C(0x1bb)](-0x2)==='└─';G=M[C(0x1bb)](0x0,-0x2)+(Y?'\x20\x20':'│\x20');}const I=G+'├─',g=G+'└─',O=q[C(0x1ac)](j=>j[C(0x1b6)][C(0x1b9)]===0x0);O&&!V&&!z?console[C(0x1ae)](g+'\x20'+q[C(0x19f)](j=>k(j))[C(0x19e)](',\x20')):q['forEach']((j,B)=>{const W=C;A(j,q[W(0x1b9)]-0x1===B?g:I);});}A(Q,'');}));}exports['getCommandOverview']=getCommandOverview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a6g=a6L;(function(Q,L){const I=a6L,z=Q();while(!![]){try{const A=parseInt(I(0x9d))/0x1+-parseInt(I(0xb2))/0x2+-parseInt(I(0x7c))/0x3+parseInt(I(0x76))/0x4+-parseInt(I(0xaf))/0x5+-parseInt(I(0xb5))/0x6+parseInt(I(0x7d))/0x7*(parseInt(I(0x81))/0x8);if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a6Q,0xcc226));var __createBinding=this&&this[a6g(0x94)]||(Object[a6g(0xad)]?function(Q,L,z,A){const O=a6g;if(A===undefined)A=z;var b=Object[O(0x90)](L,z);(!b||(O(0xac)in b?!L[O(0x8e)]:b[O(0x7b)]||b[O(0xa2)]))&&(b={'enumerable':!![],'get':function(){return L[z];}}),Object[O(0x8f)](Q,A,b);}:function(Q,L,z,A){if(A===undefined)A=z;Q[A]=L[z];}),__setModuleDefault=this&&this[a6g(0x75)]||(Object[a6g(0xad)]?function(Q,L){const Y=a6g;Object[Y(0x8f)](Q,Y(0x82),{'enumerable':!![],'value':L});}:function(Q,L){Q['default']=L;}),__importStar=this&&this[a6g(0x91)]||function(Q){const j=a6g;if(Q&&Q[j(0x8e)])return Q;var L={};if(Q!=null){for(var z in Q)if(z!=='default'&&Object['prototype'][j(0x80)][j(0x85)](Q,z))__createBinding(L,Q,z);}return __setModuleDefault(L,Q),L;},__importDefault=this&&this[a6g(0x87)]||function(Q){return Q&&Q['__esModule']?Q:{'default':Q};};Object[a6g(0x8f)](exports,a6g(0x8e),{'value':!![]}),exports[a6g(0x9a)]=exports[a6g(0x86)]=exports[a6g(0xb1)]=exports[a6g(0xb3)]=exports[a6g(0x83)]=exports['printAsTable']=void 0x0;const chalk_1=__importDefault(require(a6g(0x8d))),_=__importStar(require(a6g(0xb4))),util=__importStar(require(a6g(0x9b))),yaml=require(a6g(0x77)),columnify=require(a6g(0xa6));function printAsTable(Q,L,z,A=![],b=0x0){const B=a6g;!A&&console[B(0x7f)](''+chalk_1[B(0x82)]['bold'](L));function M(k){const l=B;return k===l(0x7a)?k:k['replace']('disabled','');}function S(k,i){const r=B;function q(V){const o=a6L,a=new Date(V);return a[o(0xa8)]()+'/'+a['getMonth']()+'/'+a[o(0xa9)]()+'\x0a'+a[o(0xa5)]()+':'+a[o(0x79)]()+':'+a[o(0x9f)]();}const Z=[r(0x89),r(0x97)];if(Z[r(0x8a)](i[r(0x78)]())&&_[r(0x9e)](k)&&k[r(0xa1)]()[r(0x88)]===0xd)return q(Number(k));if(_['isBoolean'](k)){if(i!==r(0x7a)&&i[r(0x8a)](r(0x7a)))return k?'x':'✔';return k?'✔':'x';}if(_[r(0xae)](k))return util[r(0x8c)](k,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});return k;}if(_[B(0x9c)](Q)){Q[B(0x88)]===0x0&&console[B(0x7f)](B(0xa7)+L[B(0x78)]()+'\x20found');const k=Q[B(0x84)]((Z,V)=>{const E=B,d={'i':V+b};return Object['keys'](Z)[E(0x93)](a=>{const N=E;(_[N(0xaa)](z)||z['includes'](a[N(0x78)]()))&&_[N(0x95)](d,M(a),S(Z[a],a));}),d;}),i=_[B(0x96)](Object['keys']((k===null||k===void 0x0?void 0x0:k[0x0])||[]))[B(0x92)]((Z,V)=>{const T=B,d=G=>G!=='i'?G!==T(0x7e)?0x0:0x1:0x2;return d(V)-d(Z);}),q={'maxWidth':0x1e,'preserveNewLines':!![],'showHeaders':!A,'config':{'_id':{'maxWidth':0x5,'truncate':!![]},'i':{'showHeaders':![]}},'columns':i};console[B(0x7f)](columnify(k,q));}else console['log'](Q);}exports[a6g(0xb0)]=printAsTable;function consoleFormat(Q,L){const v=a6g;if(_[v(0xa3)](Q)){const z=L?'\x20(HTTP\x20status:\x20'+L+')':'';return chalk_1[v(0x82)]['green'](v(0xa0))+z;}if(!_['isObjectLike'](Q))return Q===null||Q===void 0x0?void 0x0:Q['toString']();return util[v(0x8c)](Q,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});}exports[a6g(0x83)]=consoleFormat;const handleJsonOutput=(Q,L)=>{const h=a6g,z=Q===h(0xab);if(z)console[h(0x7f)](JSON[h(0x8b)](L,null,'\x20'));};function a6L(Q,L){const z=a6Q();return a6L=function(A,b){A=A-0x75;let M=z[A];return M;},a6L(Q,L);}exports[a6g(0xb3)]=handleJsonOutput;const handleYamlOutput=(Q,L)=>{const C=a6g,z=Q===C(0x98)||Q==='yml';if(z)console[C(0x7f)](yaml[C(0x99)](L));};exports[a6g(0xb1)]=handleYamlOutput;const handleFormattedOutput=(Q,L)=>{const W=a6g,z=Q===W(0xa4);if(z)console[W(0x7f)](consoleFormat(L));};exports[a6g(0x86)]=handleFormattedOutput;function a6Q(){const H=['isEmpty','format','getHours','columnify','No\x20','getDate','getFullYear','isUndefined','json','get','create','isObjectLike','6528575VKGubs','printAsTable','handleYamlOutput','672772oLnTPq','handleJsonOutput','lodash','8025420cUCGTQ','__setModuleDefault','2422540HbebRa','js-yaml','toLowerCase','getMinutes','disabled','writable','1223448GqYpyY','7pFXRsX','internalId','log','hasOwnProperty','23197352xKvInm','default','consoleFormat','map','call','handleFormattedOutput','__importDefault','length','createdat','includes','stringify','inspect','chalk','__esModule','defineProperty','getOwnPropertyDescriptor','__importStar','sort','forEach','__createBinding','set','clone','updatedat','yaml','safeDump','printResponse','util','isArrayLike','718317NwlOXw','isFinite','getSeconds','The\x20request\x20was\x20completed\x20successfully','toString','configurable'];a6Q=function(){return H;};return a6Q();}const printResponse=(Q,L)=>{const w=a6g;(0x0,exports[w(0xb3)])(Q,L),(0x0,exports[w(0xb1)])(Q,L),(0x0,exports[w(0x86)])(Q,L);};exports[a6g(0x9a)]=printResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a7X=a7L;(function(Q,L){const s=a7L,z=Q();while(!![]){try{const A=-parseInt(s(0x192))/0x1+parseInt(s(0x195))/0x2*(-parseInt(s(0x1b5))/0x3)+parseInt(s(0x199))/0x4+parseInt(s(0x1a2))/0x5*(parseInt(s(0x1a6))/0x6)+-parseInt(s(0x191))/0x7+parseInt(s(0x19e))/0x8*(parseInt(s(0x1ae))/0x9)+parseInt(s(0x18d))/0xa*(parseInt(s(0x1ab))/0xb);if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a7Q,0x305bb));var __importDefault=this&&this[a7X(0x1b6)]||function(Q){const P=a7X;return Q&&Q[P(0x19b)]?Q:{'default':Q};};Object[a7X(0x198)](exports,a7X(0x19b),{'value':!![]}),exports[a7X(0x1a8)]=exports[a7X(0x193)]=void 0x0;const chalk_1=__importDefault(require(a7X(0x1aa))),colored=(Q,L)=>{return L===undefined?Q:chalk_1['default'][L](Q);},getAsciiChart=(Q,L={})=>{const y=a7X,z=Array['isArray'](Q[0x0])?Q:[Q];let A=typeof L['min']!==y(0x1a1)?L[y(0x1a9)]:z[0x0][0x0],b=typeof L['max']!==y(0x1a1)?L[y(0x1ad)]:z[0x0][0x0];for(let r=0x0;r<z[y(0x1b3)];r++){for(let E=0x0;E<z[r][y(0x1b3)];E++){A=Math['min'](A,z[r][E]),b=Math[y(0x1ad)](b,z[r][E]);}}let M=['┼','┤','╶','╴','─','╰','╭','╮','╯','│'],S=Math[y(0x1a0)](b-A),k=typeof L[y(0x19d)]!==y(0x1a1)?L[y(0x19d)]:0x3,q=typeof L[y(0x1a7)]!==y(0x1a1)?L[y(0x1a7)]:y(0x197),Z=typeof L[y(0x1a5)]!==y(0x1a1)?L[y(0x1a5)]:S,V=typeof L[y(0x190)]!=='undefined'?L[y(0x190)]:[y(0x18c),y(0x1a4),'green',y(0x196),y(0x18e)],d=S!==0x0?Z/S:0x1,a=Math['round'](A*d),G=Math[y(0x194)](b*d),I=Math[y(0x1a0)](G-a),g=0x0;for(let N=0x0;N<z[y(0x1b3)];N++){g=Math[y(0x1ad)](g,z[N][y(0x1b3)]);}g=g+k;let O=typeof L[y(0x1ac)]!=='undefined'?L[y(0x1ac)]:M,Y=L[y(0x1af)]!==undefined?L[y(0x1af)]:function(T){const Q0=y;return(q+T[Q0(0x1a3)](0x2)+L['unit'])['slice'](-q[Q0(0x1b3)]);},B=new Array(I+0x1);for(let T=0x0;T<=I;T++){B[T]=new Array(g);for(let v=0x0;v<g;v++){B[T][v]='\x20';}}for(let h=a;h<=G;++h){const C=Y(I>0x0?b-(h-a)*S/I:h,h-a);B[h-a][Math[y(0x1ad)](k-C[y(0x1b3)],0x0)]=C,B[h-a][k-0x1]=h==0x0?O[0x0]:O[0x1];}for(let W=0x0;W<z['length'];W++){let w=V[W%V[y(0x1b3)]],H=Math[y(0x194)](z[W][0x0]*d)-a;B[I-H][k-0x1]=colored(O[0x0],w);for(let J=0x0;J<z[W][y(0x1b3)]-0x1;J++){let u=Math[y(0x194)](z[W][J+0x0]*d)-a,n=Math[y(0x194)](z[W][J+0x1]*d)-a;if(u==n)B[I-u][J+k]=colored(O[0x4],w);else{B[I-n][J+k]=colored(u>n?O[0x5]:O[0x6],w),B[I-u][J+k]=colored(u>n?O[0x7]:O[0x8],w);let R=Math[y(0x1a9)](u,n),m=Math[y(0x1ad)](u,n);for(let F=R+0x1;F<m;F++){B[I-F][J+k]=colored(O[0x9],w);}}}}const {startTs:l,endTs:o}=L;if(l||o){const t=U=>{const Q1=y;if(!U)return'\x20\x20\x20';const p=U[Q1(0x18f)](undefined,{'day':'2-digit','month':Q1(0x1b1),'year':Q1(0x1b1)}),e=U['toLocaleTimeString'](undefined,{'hourCycle':Q1(0x19a)});return p+'\x20'+e;},f=t(o),K=t(l),D=q[y(0x1b0)](0x0,Math[y(0x1ad)](0x2,q[y(0x1b3)]-K['length']/0x2+0x1)),c='\x20'['repeat'](Math[y(0x1ad)](g-(q[y(0x1b3)]+f[y(0x1b3)]/0x2),0x1));B[y(0x1b4)]([''+D+K+c+f]),B['push']([]);}return B[y(0x19c)](U=>U[y(0x1b2)](''))[y(0x1b2)]('\x0a');};exports['getAsciiChart']=getAsciiChart;function a7L(Q,L){const z=a7Q();return a7L=function(A,b){A=A-0x18c;let M=z[A];return M;},a7L(Q,L);}const downSampleData=(Q,L)=>{const Q2=a7X,z=Q[Q2(0x1b3)];if(L>=z||L===0x0)return Q;const A=[];let b=0x0;const M=(z-0x2)/(L-0x2);let S=0x0,k,q,Z,V;A[b++]=Q[S];for(var d=0x0;d<L-0x2;d++){let j=0x0,B=0x0,l=Math[Q2(0x19f)]((d+0x1)*M)+0x1,o=Math[Q2(0x19f)]((d+0x2)*M)+0x1;o=o<z?o:z;var G=o-l;for(;l<o;l++){j+=Q[l][0x0],B+=Q[l][0x1];}j/=G,B/=G;var I=Math['floor'](d*M)+0x1,g=Math['floor']((d+0x1)*M)+0x1,O=Q[S][0x0],Y=Q[S][0x1];q=Z=-0x1;for(;I<g;I++){Z=Math[Q2(0x1a0)]((O-j)*(Q[I][0x1]-Y)-(O-Q[I][0x0])*(B-Y))*0.5,Z>q&&(q=Z,k=Q[I],V=I);}A[b++]=k,S=V;}return A[b++]=Q[z-0x1],A;};exports[a7X(0x1a8)]=downSampleData;function a7Q(){const Q3=['slice','2-digit','join','length','push','531027yQmJDL','__importDefault','blue','2100ukYwwh','black','toLocaleDateString','colors','2680839iZePDY','278310TYRoQl','getAsciiChart','round','2QhmeYD','grey','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','defineProperty','600336XpqUWa','h24','__esModule','map','offset','22480jTjbnm','floor','abs','undefined','7465ipOcfu','toFixed','red','height','834ADOzJB','padding','downSampleData','min','chalk','27753vwqdpY','symbols','max','477SMADMe','format'];a7Q=function(){return Q3;};return a7Q();}
|
package/dist/inquirer-helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a8x=a8I;(function(A,I){const e=a8I,a=A();while(!![]){try{const d=-parseInt(e(0x129))/0x1*(parseInt(e(0x1bf))/0x2)+-parseInt(e(0x14b))/0x3*(-parseInt(e(0x179))/0x4)+parseInt(e(0x187))/0x5*(parseInt(e(0x130))/0x6)+-parseInt(e(0x138))/0x7*(parseInt(e(0xd6))/0x8)+parseInt(e(0x1a6))/0x9*(parseInt(e(0x19b))/0xa)+parseInt(e(0x134))/0xb*(-parseInt(e(0xe4))/0xc)+parseInt(e(0x1b5))/0xd;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a8A,0x22b39));var __createBinding=this&&this[a8x(0x12e)]||(Object[a8x(0x141)]?function(A,I,a,d){const o=a8x;if(d===undefined)d=a;var s=Object[o(0x128)](I,a);(!s||(o(0x183)in s?!I[o(0x190)]:s[o(0x19c)]||s['configurable']))&&(s={'enumerable':!![],'get':function(){return I[a];}}),Object[o(0x155)](A,d,s);}:function(A,I,a,d){if(d===undefined)d=a;A[d]=I[a];}),__setModuleDefault=this&&this[a8x(0x111)]||(Object['create']?function(A,I){const M=a8x;Object[M(0x155)](A,M(0x14a),{'enumerable':!![],'value':I});}:function(A,I){const N=a8x;A[N(0x14a)]=I;}),__importStar=this&&this[a8x(0x13d)]||function(A){const q=a8x;if(A&&A[q(0x190)])return A;var I={};if(A!=null){for(var a in A)if(a!==q(0x14a)&&Object['prototype'][q(0x17f)][q(0x1c4)](A,a))__createBinding(I,A,a);}return __setModuleDefault(I,A),I;},__awaiter=this&&this[a8x(0x102)]||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const l=a8I;function g(f){const K=a8I;try{L(d[K(0x15a)](f));}catch(t){V(t);}}function u(f){const y=a8I;try{L(d[y(0x11b)](f));}catch(t){V(t);}}function L(f){const D=a8I;f[D(0x1ce)]?T(f['value']):s(f[D(0x11d)])['then'](g,u);}L((d=d[l(0xe3)](A,I||[]))[l(0x15a)]());});},__importDefault=this&&this[a8x(0xd1)]||function(A){const n=a8x;return A&&A[n(0x190)]?A:{'default':A};};function a8I(A,I){const a=a8A();return a8I=function(d,s){d=d-0xd1;let T=a[d];return T;},a8I(A,I);}Object[a8x(0x155)](exports,a8x(0x190),{'value':!![]}),exports[a8x(0x114)]=void 0x0;function a8A(){const AZ=['must\x20be\x20a\x20number,\x20is\x20','object','token','apply','750660yEEIqr','unshift','length','required','maxLength','input','retrievePayloadViaInteractiveCli','\x20and\x20it\x20','secrets','./pagination/inquirer-pagination-prompt','askForTemplate','isEmpty','pagination-prompt','domains','elements','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','pop','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','log\x20sink','contextProvider','name','split','confirm','prompt','Do\x20you\x20want\x20to\x20add\x20more','startedAt','lodash','addon:\x20\x27','service','tokenPrompt','__awaiter','credentials','projects','stringify','fullName','domain','Context\x20name\x20already\x20exists.','confirmationPrompt','green','maximum','map','pathVars','jobs','blueBright','not\x20completed','__setModuleDefault','max','this\x20option\x20is\x20required,\x20please\x20answer','InquirerHelper','containers','\x20in\x20','Go\x20to\x20editor','includes','templateRuns','isValidJSON','throw','bold','value','minimum','yml','writeFileSync','No\x20builds\x20found','askForProjectScopedResourcePaginated','all-builds','registryCredentials','editPayload','cursor','values','getOwnPropertyDescriptor','79lPquIf','editor','filter','safeDump','getInnerType','__createBinding','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','636jWVsBT','restores','password','askForContainer','33QODDdB','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','No,\x20repeat','subdomain','476LaciIe','\x20characters,\x20is\x20','isObject','boolean','don\x27t\x20change','__importStar','template\x20run','addEntry','main-context','create','assign','safeLoad','registerPrompt','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','whiteBright','a\x20Northflank\x20resource','What\x20do\x20you\x20want\x20to\x20use\x20as','No,\x20but\x20save\x20as\x20file','default','19941WIJEsR','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','askForProjectScopedResource','charAt','tmpCmdPath','No,\x20edit','SAVE','body','message','templates','defineProperty','fileName','pagination','underline','reset','next','then','list','set','setPathVars','choice','integer','data',',\x20supported\x20types:\x20[json|yaml|yml]','override','pattern','Please\x20confirm\x20following\x20configuration:\x0a','askGeneric','askConfirm','nextCursor','getType','\x20(completedAt:\x20','description','service:\x20\x27','askForSubdomain','askForVolume','properties','string','service\x20containers','builds','isArray','propToType','askForPipeline','yaml','EDIT','blue','60wyqVhw','job\x20runs','yellowBright','array','YES','completedAt','hasOwnProperty','items','saveFile','search-list','get','addons','red','apiClient','3415qSrdRt','json','cmdPath','getCurrentProjectName','volume','Do\x20you\x20want\x20to\x20add','askForTemplateRun','example','toUpperCase','__esModule','askForProject','inquirer-search-list','type','defaultPaginationPageSize','Aborted.','Choose\x20the\x20login\x20token:','addon','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','getQuestionString','join','7690jGERVG','writable','restore','rawObject','askForService','ask','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','\x20type?','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','job\x20builds','askForResource','2538TJoYDc','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','greenBright','push','Should\x20it\x20be','unset','all-containers','template','REPEAT','job:\x20\x27','fetchResourceList','enum','retry','warning','keys','5130619HTGHTM','oneOf','\x20characters','\x20Example:\x20','Configuration\x20file\x20written\x20to\x20','resultCache','askArrayEntry','./utils','slice','isNaN','6044fzuXjc','to\x20use:','pipelines','find','js-yaml','call','confirmation','getPathString','ABORT','project','What\x27s\x20the\x20','askForAddonBackup','isBoolean','success','trim','done','has','secret','\x20(startedAt:\x20','__importDefault','services','Enter\x20the\x20','isUndefined','editedResult','25304RVNppI','createdAt','backups','deleteWarningPrompt','volumes','toString','askForResourcePaginated','repeat','minLength','job'];a8A=function(){return AZ;};return a8A();}const _=__importStar(require(a8x(0xfe))),chalk_1=__importDefault(require('chalk')),fs=__importStar(require('fs')),utils_1=require(a8x(0x1bc)),api_helpers_1=require('./api-helpers'),inquirer_pagination_prompt_1=require(a8x(0xed)),inquirer=require('inquirer'),inquirerSearchList=require(a8x(0x192)),yaml=require(a8x(0x1c3));var ConfirmChoices;(function(A){const v=a8x;A[v(0x17d)]='Yes,\x20send',A[v(0x1ae)]=v(0x136),A[v(0x177)]=v(0x150),A[v(0x151)]=v(0x149),A[v(0x1c7)]='No,\x20abort';}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(A){const X=a8x;this[X(0x186)]=A,this[X(0x194)]=0x32,this[X(0x125)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=X,{editedResult:a}=yield inquirer[Q(0xfb)]([{'type':Q(0x12a),'name':Q(0xd5),'message':Q(0x117),'default':yaml[Q(0x12c)](I)}]);return yaml[Q(0x143)](a);}),this[X(0x181)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const O=X,a=V=>'Unexpected\x20file\x20type:\x20'+V+O(0x162);function d(){return __awaiter(this,void 0x0,void 0x0,function*(){const p=a8I;return inquirer['prompt']([{'type':p(0xe9),'name':p(0x156),'message':p(0xf5),'validate':V=>new RegExp('.*\x5c.(json|yaml|yml)$')['test'](V)?!![]:a(V)}]);});}const {fileName:s}=yield d(),T=s[O(0xdb)]()[O(0xf9)]('.')[O(0xf4)]();try{switch(T){case O(0x188):(0x0,utils_1[O(0x1cc)])(O(0x1b9)+s);return fs[O(0x120)](s,JSON[O(0x105)](I,null,'\x20\x20'));case O(0x176):case O(0x11f):(0x0,utils_1[O(0x1cc)])(O(0x1b9)+s);return fs['writeFileSync'](s,yaml['safeDump'](I));default:(0x0,utils_1['warning'])(a(T));}}catch(V){(0x0,utils_1[O(0x1b3)])('Writing\x20configuration\x20failed:\x20'+V[O(0x153)]);}return undefined;}),this[X(0x12b)]=(I,a)=>d=>{const r=X,s=typeof d===r(0x170)?d[r(0x1cd)]():d;return a===![]&&s==='don\x27t\x20change'?'':s;},this['validate']=(I,a,d)=>s=>{const H=X,T=[];if(s===''||s===H(0x13c)){if(a!==![])T[H(0x1a9)](H(0x113));else return!![];}I[H(0x193)]===H(0x170)&&!_[H(0xd4)](I[H(0x164)])&&T[H(0x1a9)](new RegExp(I[H(0x164)])['test'](s)?!![]:'doesn\x27t\x20match\x20pattern\x20\x27'+I[H(0x164)]+'\x27');I[H(0x193)]===H(0x170)&&!_[H(0xd4)](I[H(0xde)])&&T[H(0x1a9)](s[H(0xe6)]>=I[H(0xde)]?!![]:H(0x145)+I[H(0xde)]+H(0x139)+s[H(0xe6)]+H(0x1b7));I[H(0x193)]===H(0x170)&&!_['isUndefined'](I['maxLength'])&&T[H(0x1a9)](s[H(0xe6)]<=I[H(0xe8)]?!![]:H(0x1a1)+I[H(0xe8)]+H(0x139)+s[H(0xe6)]+H(0x1b7));d&&Number[H(0x1be)](parseInt(s,0xa))&&T['push'](H(0xe0)+s);I[H(0x193)]===H(0x160)&&!_['isUndefined'](I['minimum'])&&T[H(0x1a9)](s>=I[H(0x11e)]?!![]:H(0x198)+I[H(0x11e)]);I[H(0x193)]===H(0x160)&&!_['isUndefined'](I['maximum'])&&T[H(0x1a9)](s<=I[H(0x10b)]?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+I[H(0x10b)]);if(I[H(0x193)]===H(0x19e)){const u=(0x0,utils_1[H(0x11a)])(s);T['push'](u===![]||_[H(0xef)](u)?H(0x135):!![]);}const V=T[H(0x12b)](L=>L!==!![]),g=(I===null||I===void 0x0?void 0x0:I['example'])?'\x0a'+chalk_1['default'][H(0x185)]('>>')+H(0x1b8)+chalk_1[H(0x14a)][H(0x146)](JSON[H(0x105)](I[H(0x18e)])):'';return V[H(0xe6)]>0x0?V['join'](chalk_1[H(0x14a)][H(0x158)](H(0xeb)))+g:!![];},this[X(0x1c6)]=(I,a,d)=>{const R=X,s=I[I['length']-0x1];function T(){const P=a8I;return I['slice'](0x0,-0x1)['map'](u=>u[P(0x14e)](0x0)[P(0x18f)]()+u[P(0x1bd)](0x1))[P(0x19a)]('>');}const V=I[R(0xe6)]>0x1?chalk_1['default']['bgGrey']['whiteBright'](T())+':\x20':'',g=d?'\x20('+chalk_1[R(0x14a)][R(0x178)](d)+')':'';return chalk_1[R(0x14a)][R(0x159)](''+V+a+'\x20'+chalk_1[R(0x14a)]['bold'][R(0x1a8)](s)+g+'?');},this[X(0x1a5)]=(I,a,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=X;if(a[Z(0xe6)]<0x1){const V=d?'for\x20this\x20'+d:'found';throw new Error('No\x20'+I+'\x20'+V+'.');}const s='Choose\x20the\x20'+I+'\x20to\x20use:',T=a[Z(0xe6)]>0x4?'search-list':'list';return(yield inquirer[Z(0xfb)]([{'type':T,'name':Z(0xf8),'message':s,'choices':a}]))[Z(0xf8)];}),this[X(0xdc)]=(I,a,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const B=X,{elements:s,nextCursor:T}=yield a();if(s[B(0xe6)]<0x1){const u=d?'for\x20this\x20'+d:'found';throw new Error('No\x20'+I+'\x20'+u+'.');}const V='Choose\x20the\x20'+I+'\x20to\x20use:';if(T!==undefined){const L=({nextPageCursor:f})=>__awaiter(this,void 0x0,void 0x0,function*(){const E=B,t=yield a(f);return{'elements':t[E(0xf2)],'nextPageCursor':t[E(0x168)]};});return(yield inquirer['prompt']([{'type':B(0xf0),'name':B(0xf8),'message':V,'choices':s,'nextPageCursor':T,'loadMore':L}]))[B(0xf8)];}const g=s[B(0xe6)]>0x4?B(0x182):'list';return(yield inquirer['prompt']([{'type':g,'name':B(0xf8),'message':V,'choices':s}]))[B(0xf8)];}),this[X(0x166)]=(I,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=X,d=''+(a?'('+chalk_1[J(0x14a)][J(0x178)](a)+')\x20':''),s=J(0xd3)+chalk_1[J(0x14a)]['green'](I)+'\x20'+d+J(0x1c0),T=this['validate']({'type':J(0x170),'required':!![]});return(yield inquirer[J(0xfb)]([{'type':J(0xe9),'name':J(0xf8),'message':s,'validate':T}]))['name'];}),this[X(0x167)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const b=X;return(yield inquirer['prompt']([{'type':b(0xfa),'name':b(0xf8),'message':I,'default':!![]}]))[b(0xf8)];}),this[X(0x19f)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a8I;var T;const V=yield this['apiClient'][Y(0x15c)][Y(0xd2)]({'parameters':{'projectId':d},'options':{'per_page':this[Y(0x194)],'cursor':s}}),g=V['data'][Y(0xd2)][Y(0x10c)](u=>u['id']);return{'elements':g,'nextCursor':(T=V[Y(0x157)])===null||T===void 0x0?void 0x0:T[Y(0x126)]};});return this[F(0x122)](F(0x100),a,I);}),this[X(0xee)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const C=X,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const W=a8I;var d;const s=yield this[W(0x186)][W(0x15c)][W(0x154)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':a}}),T=s[W(0x161)][W(0x154)]['map'](V=>V['id']);return{'elements':T,'nextCursor':(d=s[W(0x157)])===null||d===void 0x0?void 0x0:d[W(0x126)]};});return this['askForResourcePaginated'](C(0x1ad),I);}),this[X(0x18d)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=X;if(_[G(0xd4)](I))throw new Error('Template\x20id\x20not\x20provided.');const a=d=>__awaiter(this,void 0x0,void 0x0,function*(){const j=G;var s;let T=this[j(0x194)];const V=yield this[j(0x186)][j(0x15c)][j(0x119)]({'parameters':{'templateId':I},'options':{'per_page':T,'cursor':d}}),g=V[j(0x161)][j(0x119)][j(0x10c)](u=>u['id']+'\x20(startedAt:\x20'+u['createdAt']+')');return{'elements':g,'nextCursor':(s=V[j(0x157)])===null||s===void 0x0?void 0x0:s['cursor']};});return this[G(0xdc)](G(0x13e),a)[G(0x15b)](d=>d[G(0xf9)]('\x20')[0x0]);}),this['askForLogSink']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const h=X,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const z=a8I;var d;let s=this['defaultPaginationPageSize'];const T=yield this[z(0x186)][z(0x15c)]['logSinks']({'options':{'per_page':s,'cursor':a}}),V=T['data']['logSinks'][z(0x10c)](g=>g['id']);return{'elements':V,'nextCursor':(d=T[z(0x157)])===null||d===void 0x0?void 0x0:d[z(0x126)]};});return this[h(0xdc)](h(0xf6),I);}),this[X(0x175)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const i=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const w=a8I;var T;const V=yield this[w(0x186)][w(0x15c)][w(0x1c1)]({'parameters':{'projectId':d},'options':{'per_page':this[w(0x194)],'cursor':s}}),g=V['data'][w(0x1c1)][w(0x10c)](u=>u['id']);return{'elements':g,'nextCursor':(T=V[w(0x157)])===null||T===void 0x0?void 0x0:T['cursor']};});return this[i(0x122)]('pipeline',a,I);}),this['askForJob']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A1=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const A0=a8I;var T;const V=yield this[A0(0x186)][A0(0x15c)][A0(0x10e)]({'parameters':{'projectId':d},'options':{'per_page':this[A0(0x194)],'cursor':s}}),g=V['data'][A0(0x10e)]['map'](u=>u['id']);return{'elements':g,'nextCursor':(T=V['pagination'])===null||T===void 0x0?void 0x0:T[A0(0x126)]};});return this[A1(0x122)]('job',a,I);}),this['askForJobRun']=(I,a,d=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A3=X,s='all-job-runs',T=V=>g=>__awaiter(this,void 0x0,void 0x0,function*(){const A2=a8I;var u;const L=yield this[A2(0x186)][A2(0x183)][A2(0xdf)]['runs']({'parameters':{'projectId':V,'jobId':I},'options':{'per_page':this[A2(0x194)],'cursor':g}}),f=L['data']['runs'][A2(0x10c)](t=>t['id']+A2(0x1d1)+t[A2(0xfd)]+')');return d&&f[A2(0xe5)](s),{'elements':f,'nextCursor':(u=L['pagination'])===null||u===void 0x0?void 0x0:u[A2(0x126)]};});return this[A3(0x122)](A3(0x17a),T,a,A3(0x1af)+I+'\x27')[A3(0x15b)](V=>{const A4=A3,g=V[A4(0xf9)]('\x20')[0x0];if(g===s)return undefined;return g;});}),this['askForBuild']=(I,a,d,s=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A5=X,T=A5(0x123);if(d!==undefined){const V=g=>u=>__awaiter(this,void 0x0,void 0x0,function*(){const A6=A5;var L;const f=yield this[A6(0x186)][A6(0x183)][A6(0xdf)]['builds']({'parameters':{'projectId':g,'jobId':d},'options':{'per_page':this[A6(0x194)],'cursor':u}}),t=f['data'][A6(0x172)][A6(0x10c)](m=>m['id']+A6(0x1d1)+m[A6(0xd7)]+')');return s&&t[A6(0xe5)](T),{'elements':t,'nextCursor':(L=f[A6(0x157)])===null||L===void 0x0?void 0x0:L[A6(0x126)]};});return this[A5(0x122)](A5(0x1a4),V,I,'job:\x20\x27'+d+'\x27')[A5(0x15b)](g=>{const A7=A5,u=g[A7(0xf9)]('\x20')[0x0];if(u===T)return undefined;return u;});}if(a!==undefined){const g=u=>L=>__awaiter(this,void 0x0,void 0x0,function*(){const A8=A5;var f;const t=yield this[A8(0x186)][A8(0x183)][A8(0x100)]['builds']({'parameters':{'projectId':u,'serviceId':a},'options':{'per_page':this[A8(0x194)],'cursor':L}}),m=t[A8(0x161)]['builds'][A8(0x10c)](U=>U['id']+A8(0x1d1)+U[A8(0xd7)]+')');if(s)m[A8(0xe5)](T);return{'elements':m,'nextCursor':(f=t[A8(0x157)])===null||f===void 0x0?void 0x0:f[A8(0x126)]};});return this[A5(0x122)]('service\x20build',g,I,A5(0x16c)+d+'\x27')[A5(0x15b)](u=>{const L=u['split']('\x20')[0x0];if(L===T)return undefined;return L;});}throw new Error(A5(0x121));}),this[X(0x133)]=(I,a,d,s=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A9=X,T=A9(0x1ac);if(d!==undefined){const V=g=>u=>__awaiter(this,void 0x0,void 0x0,function*(){const AA=A9;var L,f;const t=yield this[AA(0x186)][AA(0x183)][AA(0xdf)][AA(0x115)]({'parameters':{'projectId':g,'jobId':d},'options':{'per_page':this[AA(0x194)],'cursor':u}}),m=(L=t[AA(0x161)]['containers'])!==null&&L!==void 0x0?L:[],U=m===null||m===void 0x0?void 0x0:m[AA(0x10c)](S=>S[AA(0xf8)]+AA(0x1d1)+S[AA(0xd7)]+')');return s&&U[AA(0xe5)](T),{'elements':U,'nextCursor':(f=t['pagination'])===null||f===void 0x0?void 0x0:f[AA(0x126)]};});return this['askForProjectScopedResourcePaginated']('job\x20containers',V,I,'job:\x20\x27'+d+'\x27')[A9(0x15b)](g=>{const u=g['split']('\x20')[0x0];if(u===T)return undefined;return u;});}if(a!==undefined){const g=u=>L=>__awaiter(this,void 0x0,void 0x0,function*(){const AI=A9;var f,t;const m=yield this[AI(0x186)]['get']['service'][AI(0x115)]({'parameters':{'projectId':u,'serviceId':a},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':L}}),U=(f=m['data'][AI(0x115)])!==null&&f!==void 0x0?f:[],S=U[AI(0x10c)](k=>k[AI(0xf8)]+AI(0x1d1)+k[AI(0xd7)]+')');if(s)S===null||S===void 0x0?void 0x0:S['unshift'](T);return{'elements':S,'nextCursor':(t=m[AI(0x157)])===null||t===void 0x0?void 0x0:t[AI(0x126)]};});return this['askForProjectScopedResourcePaginated'](A9(0x171),g,I,A9(0x16c)+d+'\x27')[A9(0x15b)](u=>{const Aa=A9,L=u[Aa(0xf9)]('\x20')[0x0];if(L===T)return undefined;return L;});}throw new Error('No\x20containers\x20found');}),this['askForAddon']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const As=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const Ad=a8I;var T;const V=yield this[Ad(0x186)][Ad(0x15c)][Ad(0x184)]({'parameters':{'projectId':d},'options':{'per_page':this[Ad(0x194)],'cursor':s}});return{'elements':V[Ad(0x161)][Ad(0x184)]['map'](g=>g['id']),'nextCursor':(T=V[Ad(0x157)])===null||T===void 0x0?void 0x0:T[Ad(0x126)]};});return this[As(0x122)](As(0x197),a,I);}),this[X(0x1ca)]=(I,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const AV=X,d=s=>T=>__awaiter(this,void 0x0,void 0x0,function*(){const AT=a8I;var V;const g=yield this['apiClient'][AT(0x183)][AT(0x197)][AT(0xd8)]({'parameters':{'projectId':s,'addonId':a},'options':{'per_page':this[AT(0x194)],'cursor':T}});return{'elements':g[AT(0x161)][AT(0xd8)][AT(0x10c)](u=>u['id']+AT(0x16a)+(u[AT(0x17e)]||AT(0x110))+')'),'nextCursor':(V=g[AT(0x157)])===null||V===void 0x0?void 0x0:V[AT(0x126)]};});return this[AV(0x122)]('backups',d,I,AV(0xff)+a+'\x27')[AV(0x15b)](s=>s[AV(0xf9)]('\x20')[0x0]);}),this['askForAddonRestore']=(I,a,d)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Au=X,s=T=>V=>__awaiter(this,void 0x0,void 0x0,function*(){const Ag=a8I;var g;const u=yield this[Ag(0x186)][Ag(0x183)][Ag(0x197)]['restores']({'parameters':{'projectId':T,'addonId':a,'backupId':d},'options':{'per_page':this[Ag(0x194)],'cursor':V}});return{'elements':u['data'][Ag(0x131)][Ag(0x10c)](L=>L['id']+Ag(0x16a)+(L[Ag(0x17e)]||Ag(0x110))+')'),'nextCursor':(g=u[Ag(0x157)])===null||g===void 0x0?void 0x0:g['cursor']};});return this['askForProjectScopedResourcePaginated'](Au(0x19d),s,I,Au(0xff)+a+'\x27')[Au(0x15b)](T=>T[Au(0xf9)]('\x20')[0x0]);}),this[X(0x16e)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Af=X,a=d=>__awaiter(this,void 0x0,void 0x0,function*(){const AL=a8I;return(yield this['apiClient'][AL(0x15c)][AL(0xda)]({'parameters':{'projectId':d}}))[AL(0x161)]['map'](s=>s['id']);});return this['askForProjectScopedResource'](Af(0x18b),a,I);}),this['askForSecret']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Am=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const At=a8I;var T;const V=yield this[At(0x186)][At(0x15c)][At(0xec)]({'parameters':{'projectId':d},'options':{'per_page':this[At(0x194)],'cursor':s}});return{'elements':V['data'][At(0xec)][At(0x10c)](g=>g['id']),'nextCursor':(T=V[At(0x157)])===null||T===void 0x0?void 0x0:T[At(0x126)]};});return this[Am(0x122)](Am(0x1d0),a,I);}),this[X(0x16d)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const AU=X,a=yield this[AU(0x186)][AU(0x183)][AU(0x107)]({'parameters':{'domain':I}}),d=a[AU(0x161)]['subdomains'][AU(0x10c)](T=>T[AU(0xf8)]+'\x20(full\x20domain:\x20'+T[AU(0x106)]+')'),s='domain\x20('+I+')';return this[AU(0x1a5)](AU(0x137),d,s)[AU(0x15b)](T=>T[AU(0xf9)]('\x20')[0x0]);}),this[X(0xd9)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const AS=X;return(yield inquirer[AS(0xfb)]([{'type':AS(0xfa),'name':AS(0x1c5),'message':chalk_1[AS(0x14a)][AS(0x17b)](AS(0x1a3)+(I||AS(0x147))+AS(0x14c)),'default':![]}]))['confirmation'];}),this['loginPrompt']=(I,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const Ak=X;_['isUndefined'](I['name'])&&(a[Ak(0xe6)]<=0x0?_[Ak(0x15d)](I,Ak(0xf8),Ak(0x14a)):yield(0x0,utils_1[Ak(0x1b2)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const Ae=Ak,{name:d}=yield inquirer[Ae(0xfb)]([{'type':Ae(0xe9),'name':Ae(0xf8),'message':Ae(0xf3),'default':Ae(0x140)}]);if(!I['override']&&a[Ae(0x1c2)](s=>s[Ae(0xf8)]===d)){const {c:s}=yield inquirer[Ae(0xfb)]([{'type':'confirm','name':'c','message':'Context\x20with\x20name\x20\x27'+d+Ae(0x12f),'default':![]}]);if(s===![])throw new Error(Ae(0x108));_[Ae(0x15d)](I,Ae(0x163),!![]);}_[Ae(0x15d)](I,'name',d);})));if(_[Ak(0xd4)](I['token'])){const d=yield this[Ak(0x101)]();_[Ak(0x15d)](I,Ak(0xe2),d);}return I;}),this[X(0x101)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Ax=X,{token:I}=yield inquirer['prompt']([{'type':Ax(0x132),'name':'token','mask':'*','message':Ax(0x196)}]);return I;}),inquirer[X(0x144)](X(0x182),inquirerSearchList),inquirer['registerPrompt'](X(0xf0),inquirer_pagination_prompt_1['DynamicReloadPaginationPrompt']);}[a8x(0x109)](A,I){return __awaiter(this,void 0x0,void 0x0,function*(){const Ao=a8I,a=yaml[Ao(0x12c)](A),d=_[Ao(0x112)](a[Ao(0xf9)]('\x0a')[Ao(0x10c)](V=>V['length'])),s=chalk_1['default']['grey']('-'[Ao(0xdd)](d)+'\x0a'),{confirm:T}=yield inquirer[Ao(0xfb)]([{'type':Ao(0x15c),'name':Ao(0xfa),'message':''+chalk_1['default'][Ao(0x11c)][Ao(0x10a)](Ao(0x165))+s+chalk_1[Ao(0x14a)][Ao(0x10f)](a)+s,'choices':Object[Ao(0x127)](ConfirmChoices)}]);switch(T){case ConfirmChoices[Ao(0x17d)]:return A;case ConfirmChoices[Ao(0x1c7)]:throw new Error(Ao(0x195));case ConfirmChoices[Ao(0x1ae)]:return this[Ao(0xea)](I);case ConfirmChoices[Ao(0x177)]:return this[Ao(0x109)](yield this[Ao(0x125)](A),I);case ConfirmChoices[Ao(0x151)]:yield this[Ao(0x181)](A);return this['confirmationPrompt'](A,I);default:throw new Error('Something\x20unexpected\x20happened.');}});}['retrievePayloadViaInteractiveCli'](A,I){return __awaiter(this,void 0x0,void 0x0,function*(){const AM=a8I;if((I===null||I===void 0x0?void 0x0:I[AM(0x1ba)])!==undefined)this[AM(0x1ba)]=I===null||I===void 0x0?void 0x0:I[AM(0x1ba)];this[AM(0x14f)]=I===null||I===void 0x0?void 0x0:I[AM(0x189)];const a={};return yield this[AM(0x174)]([],A['opt'][AM(0x152)],a),this[AM(0x1ba)]=a,yield this[AM(0x109)](a,A);});}[a8x(0x174)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AN=a8I;let s;if(I[AN(0x1b6)]&&!_[AN(0x1cf)](I,AN(0x16f))){if(I[AN(0x1b6)][AN(0xe6)]>0x1){const {choice:T}=yield inquirer[AN(0xfb)]([{'type':AN(0x15c),'name':AN(0x15f),'message':AN(0x1c9)+(A[A[AN(0xe6)]-0x1]||'')+AN(0x1a2),'choices':I[AN(0x1b6)][AN(0x10c)](V=>{const Aq=AN;var g;return(g=V[Aq(0x16b)])!==null&&g!==void 0x0?g:'??';})}]);s=yield this[AN(0x169)](A,I[AN(0x1b6)][AN(0x1c2)](V=>V[AN(0x16b)]===T),a,d);}else{const V=I[AN(0x1b6)][0x0];_[AN(0x15d)](V,AN(0x16b),I[AN(0x16b)]),s=yield this[AN(0x169)](A,V,a,d);}s={};}else s=yield this['getType'](A,I,a,d);return s;});}['getInnerType'](A,I,a,d){var s;return __awaiter(this,void 0x0,void 0x0,function*(){const AK=a8I;if(d===![]){const {addEntry:g}=yield inquirer[AK(0xfb)]([{'type':AK(0xfa),'name':AK(0x13f),'message':this[AK(0x1c6)](I,AK(0x18c),A===null||A===void 0x0?void 0x0:A['description']),'default':![]}]);if(!g)return a;}const T=Object[AK(0x1b4)]((s=A===null||A===void 0x0?void 0x0:A[AK(0x16f)])!==null&&s!==void 0x0?s:[]),V=A[AK(0xe7)]||[];if(T[AK(0xe6)]>0x0)for(const u of T){const L=I['concat'](u);if(I['length']>0x0&&!_[AK(0x1cf)](a,I['join']('.')))_[AK(0x15d)](a,I[AK(0x19a)]('.'),{});yield this['propToType'](L,A[AK(0x16f)][u],a,V[AK(0x118)](u));}else yield this[AK(0x169)](I,Object[AK(0x142)](Object[AK(0x142)]({},A),{'type':AK(0x19e)}),a,d);return a;});}['askArrayEntry'](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const Ay=a8I;if(I&&a)return!![];const s=I?Ay(0x18c):Ay(0xfc),{addEntry:T}=yield inquirer[Ay(0xfb)]([{'type':Ay(0xfa),'name':Ay(0x13f),'message':this[Ay(0x1c6)](A,s,I?d:undefined),'default':![]}]);return T;});}[a8x(0x169)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AD=a8I;let s;const T=A[AD(0x19a)]('.');switch(I===null||I===void 0x0?void 0x0:I[AD(0x193)]){case AD(0x17c):{let V=!![];while(yield this[AD(0x1bb)](A,V,d,I===null||I===void 0x0?void 0x0:I[AD(0x16b)])){const g=_[AD(0x183)](a,T);_[AD(0x1ab)](a,T),yield this[AD(0x169)](A,I[AD(0x180)],a);const u=_['get'](a,T);!_[AD(0x173)](g)?_['set'](a,T,[u]):(g[AD(0x1a9)](u),_[AD(0x15d)](a,T,g)),V=![];}return s||[];}case AD(0xe1):{return s=yield this[AD(0x12d)](I,A,a,d),s;}case AD(0x19e):s=(0x0,utils_1['isValidJSON'])(yield this[AD(0x1a0)](A,I,d))||undefined;break;case AD(0x170):case AD(0x13b):case AD(0x160):default:s=yield this[AD(0x1a0)](A,I,d,a);break;}return!_[AD(0xd4)](s)&&_['set'](a,T,s),s;});}[a8x(0x1a0)](A,I,a,d){var s;return __awaiter(this,void 0x0,void 0x0,function*(){const Al=a8I,T=A[A[Al(0xe6)]-0x1],{defaultValue:defaultValue=(s=I===null||I===void 0x0?void 0x0:I['example'])!==null&&s!==void 0x0?s:I===null||I===void 0x0?void 0x0:I[Al(0x14a)],choices:choices=I===null||I===void 0x0?void 0x0:I[Al(0x1b1)],pagination:V}=yield(0x0,api_helpers_1[Al(0x1b0)])(T,this[Al(0x186)],this['tmpCmdPath'],d,this[Al(0x10d)],A);let g=Al(0xe9);if(!_[Al(0xd4)](choices)&&choices['length']>0x0){if(V!==undefined&&V['nextPageCursor']!==undefined)g=Al(0xf0);else choices[Al(0xe6)]>0x4&&typeof choices[0x0]===Al(0x170)?g=Al(0x182):g=Al(0x15c);}else{if((I===null||I===void 0x0?void 0x0:I[Al(0x193)])===Al(0x13b))g=Al(0xfa);else{if((I===null||I===void 0x0?void 0x0:I[Al(0x193)])==='integer')g=Al(0xe9);else(I===null||I===void 0x0?void 0x0:I[Al(0x193)])===Al(0x19e)&&(g=Al(0x12a));}}let u=a!==![]?!_[Al(0x13a)](defaultValue)?defaultValue:JSON[Al(0x105)](defaultValue):_[Al(0x1cb)](defaultValue)?defaultValue:Al(0x13c);if(choices)u=u[Al(0xdb)]();_[Al(0x1cf)](this[Al(0x1ba)],A[Al(0x19a)]('.'))&&(u=this[Al(0x1ba)][A[Al(0x19a)]('.')]);const L=choices&&a===![]?[Al(0x13c),...choices]:choices,f=(I===null||I===void 0x0?void 0x0:I[Al(0x193)])===Al(0x160),t=Object[Al(0x142)]({'type':g,'name':'id','message':this[Al(0x199)](A,I),'choices':L,'default':u,'filter':this[Al(0x12b)](g,a),'validate':this['validate'](I,a,f)},V),m=(yield inquirer[Al(0xfb)]([t]))['id'];if(m===Al(0x13c)||m==='')return undefined;if(f)return parseInt(m,0xa);return m;});}[a8x(0x199)](A,I){const An=a8x,a=(I===null||I===void 0x0?void 0x0:I[An(0x193)])!=='boolean'?An(0x148):An(0x1aa);return this[An(0x1c6)](A,a,I===null||I===void 0x0?void 0x0:I['description']);}[a8x(0x191)](){return __awaiter(this,void 0x0,void 0x0,function*(){const AX=a8I,A=I=>__awaiter(this,void 0x0,void 0x0,function*(){const Av=a8I;var a;const d=yield this[Av(0x186)][Av(0x15c)][Av(0x104)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}}),s=d[Av(0x161)][Av(0x104)]['map'](T=>T['id']);return{'elements':s,'nextCursor':(a=d[Av(0x157)])===null||a===void 0x0?void 0x0:a[Av(0x126)]};});return yield this[AX(0xdc)](AX(0x1c8),A);});}[a8x(0x14d)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AQ=a8I,s=a||this['apiClient'][AQ(0xf7)][AQ(0x18a)]();if(_['isUndefined'](s))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const T=yield I(s);return yield this[AQ(0x1a5)](A,T,(d?d+AQ(0x116):'')+'project:\x20\x27'+s+'\x27');});}[a8x(0x122)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AO=a8I,s=a||this['apiClient']['contextProvider'][AO(0x18a)]();if(_[AO(0xd4)](s))throw new Error(AO(0x1a7));const T=yield I(s);return yield this[AO(0xdc)](A,T,(d?d+'\x20in\x20':'')+'project:\x20\x27'+s+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Ar=a8I,A=I=>__awaiter(this,void 0x0,void 0x0,function*(){const Ap=a8I;var a;const d=yield this[Ap(0x186)][Ap(0x15c)][Ap(0xf1)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}});return{'elements':d[Ap(0x161)][Ap(0xf1)][Ap(0x10c)](s=>s[Ap(0xf8)]),'nextCursor':(a=d[Ap(0x157)])===null||a===void 0x0?void 0x0:a[Ap(0x126)]};});return this[Ar(0xdc)](Ar(0x107),A);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const AP=a8I,A=I=>__awaiter(this,void 0x0,void 0x0,function*(){const AH=a8I;var a;const d=yield this['apiClient'][AH(0x15c)][AH(0x124)]({'options':{'per_page':this[AH(0x194)],'cursor':I}});return{'elements':d[AH(0x161)][AH(0x103)][AH(0x10c)](s=>s['id']),'nextCursor':(a=d[AH(0x157)])===null||a===void 0x0?void 0x0:a[AH(0x126)]};});return this[AP(0xdc)]('credentials',A);});}[a8x(0x15e)](A){const AR=a8x;this[AR(0x10d)]=A;}}exports[a8x(0x114)]=InquirerHelper;
|
|
1
|
+
'use strict';function a8Q(){const Qu=['pagination-prompt','isObject','getPathString','join','1012449LNTQqH','token','domains','job:\x20\x27','./utils','split','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','startedAt','setPathVars','No,\x20but\x20save\x20as\x20file','template\x20run','registryCredentials','tmpCmdPath','No,\x20repeat','max','services','backups','\x20(startedAt:\x20','volumes','logSinks','isBoolean','\x20characters,\x20is\x20','success','Writing\x20configuration\x20failed:\x20','blue','then','yaml','apiClient','projects','stringify','inquirer-search-list','safeLoad','domain\x20(','confirmationPrompt','isValidJSON','ask','askForService','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','6698590YGSuSu','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','__awaiter','anyOf','defineProperty','getOwnPropertyDescriptor','boolean','create','isUndefined','SAVE','askArrayEntry','Go\x20to\x20editor','InquirerHelper','job\x20runs','list','askConfirm','Template\x20id\x20not\x20provided.','templates','askForLogSink','builds','yellowBright','don\x27t\x20change','No\x20containers\x20found','unshift','main-context','override','all-builds','value','getQuestionString','Please\x20confirm\x20following\x20configuration:\x0a','\x20type?','minimum','Choose\x20the\x20','uri','pathVars','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','configurable','\x20(completedAt:\x20','askForSubdomainPath','askForProjectScopedResource','Configuration\x20file\x20written\x20to\x20','\x20and\x20it\x20','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','volume','doesn\x27t\x20match\x20pattern\x20\x27','properties','__esModule','js-yaml','password','containers','__importDefault','__createBinding','map','validate','charAt','log\x20sink','filter','subdomain','What\x27s\x20the\x20','bgGrey','isNaN','runs','Do\x20you\x20want\x20to\x20add','default','askForSecret','job\x20builds','yml','greenBright','No,\x20edit','pattern','./api-helpers','chalk','example','credentials','askForJob','confirm','path','service\x20containers','Yes,\x20send','trim','69114KhzRfe','test','Should\x20it\x20be','find','for\x20this\x20','Aborted.','not\x20completed','No\x20','613112Eqotay','askForVolume','getType','73773QcgtIl','6GaZWER','askGeneric','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','safeDump','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','askForAddonRestore','\x20characters','prototype','REPEAT','askForSubdomain','nextPageCursor','warning','items','toUpperCase','all-containers','askForPipeline','service:\x20\x27','bold','confirmation','propToType','subdomains','must\x20be\x20a\x20number,\x20is\x20','createdAt','contextProvider','registerPrompt','isEmpty','templateRuns','533715OGkaUF','\x20to\x20use:','has','subdomainPath','YES','service','keys','askForJobRun','job','push','body','askForTemplateRun','addon','oneOf','retrievePayloadViaInteractiveCli','askForResource','181215hcrEPy','maximum','values','done','paths','all-job-runs','length','message','found','assign','isArray','slice','resultCache','project:\x20\x27','),\x20subdomain\x20(','log','Context\x20name\x20already\x20exists.','Do\x20you\x20want\x20to\x20add\x20more','string','apply','pipelines','repeat','hasOwnProperty','toString','askForProjectScopedResourcePaginated','cmdPath','blueBright','choice','restores','askForContainer','integer','get','addons','pagination','description','cursor','underline','call','throw','fileName','DynamicReloadPaginationPrompt','input','editPayload','176ZjgVpY','rawObject','minLength','jobs','red','editedResult','data','getInnerType','Enter\x20the\x20','a\x20Northflank\x20resource','80mXMaVu','getCurrentProjectName','__setModuleDefault','pipeline','concat','Unexpected\x20file\x20type:\x20','askForResourcePaginated','deleteWarningPrompt','secrets','maxLength','tokenPrompt','writeFileSync','inquirer','\x20in\x20',',\x20supported\x20types:\x20[json|yaml|yml]','No,\x20abort','type','askForProject','prompt','object','search-list','whiteBright','set','ABORT','addEntry','No\x20builds\x20found','defaultPaginationPageSize','name','__importStar'];a8Q=function(){return Qu;};return a8Q();}const a8O=a8L;(function(Q,L){const g=a8L,z=Q();while(!![]){try{const A=-parseInt(g(0x270))/0x1*(-parseInt(g(0x271))/0x2)+parseInt(g(0x1ef))/0x3+-parseInt(g(0x26d))/0x4+parseInt(g(0x1ce))/0x5*(parseInt(g(0x265))/0x6)+-parseInt(g(0x189))/0x7+-parseInt(g(0x1c4))/0x8*(-parseInt(g(0x199))/0x9)+-parseInt(g(0x215))/0xa;if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a8Q,0x45fe6));var __createBinding=this&&this[a8O(0x248)]||(Object[a8O(0x21c)]?function(Q,L,z,A){const Y=a8O;if(A===undefined)A=z;var b=Object[Y(0x21a)](L,z);(!b||('get'in b?!L[Y(0x243)]:b['writable']||b[Y(0x239)]))&&(b={'enumerable':!![],'get':function(){return L[z];}}),Object[Y(0x219)](Q,A,b);}:function(Q,L,z,A){if(A===undefined)A=z;Q[A]=L[z];}),__setModuleDefault=this&&this[a8O(0x1d0)]||(Object['create']?function(Q,L){const j=a8O;Object[j(0x219)](Q,'default',{'enumerable':!![],'value':L});}:function(Q,L){const B=a8O;Q[B(0x254)]=L;}),__importStar=this&&this[a8O(0x1ea)]||function(Q){const l=a8O;if(Q&&Q[l(0x243)])return Q;var L={};if(Q!=null){for(var z in Q)if(z!==l(0x254)&&Object[l(0x278)][l(0x1af)][l(0x1be)](Q,z))__createBinding(L,Q,z);}return __setModuleDefault(L,Q),L;},__awaiter=this&&this[a8O(0x217)]||function(Q,L,z,A){function b(M){return M instanceof z?M:new z(function(S){S(M);});}return new(z||(z=Promise))(function(M,S){const E=a8L;function k(Z){try{q(A['next'](Z));}catch(V){S(V);}}function i(Z){const o=a8L;try{q(A[o(0x1bf)](Z));}catch(V){S(V);}}function q(Z){const r=a8L;Z[r(0x19c)]?M(Z['value']):b(Z[r(0x230)])[r(0x208)](k,i);}q((A=A[E(0x1ac)](Q,L||[]))['next']());});},__importDefault=this&&this[a8O(0x247)]||function(Q){return Q&&Q['__esModule']?Q:{'default':Q};};Object[a8O(0x219)](exports,a8O(0x243),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require('lodash')),chalk_1=__importDefault(require(a8O(0x25c))),fs=__importStar(require('fs')),utils_1=require(a8O(0x1f3)),api_helpers_1=require(a8O(0x25b)),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require(a8O(0x1da)),inquirerSearchList=require(a8O(0x20d)),yaml=require(a8O(0x244));var ConfirmChoices;(function(Q){const N=a8O;Q[N(0x18d)]=N(0x263),Q[N(0x279)]=N(0x1fc),Q['EDIT']=N(0x259),Q['SAVE']=N(0x1f8),Q['ABORT']=N(0x1dd);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(Q){const T=a8O;this[T(0x20a)]=Q,this[T(0x1e8)]=0x32,this[T(0x1c3)]=L=>__awaiter(this,void 0x0,void 0x0,function*(){const v=T,{editedResult:z}=yield inquirer[v(0x1e0)]([{'type':'editor','name':v(0x1c9),'message':v(0x220),'default':yaml[v(0x274)](L)}]);return yaml[v(0x20e)](z);}),this['saveFile']=L=>__awaiter(this,void 0x0,void 0x0,function*(){const h=T,z=S=>h(0x1d3)+S+h(0x1dc);function A(){return __awaiter(this,void 0x0,void 0x0,function*(){const C=a8L;return inquirer[C(0x1e0)]([{'type':'input','name':C(0x1c0),'message':C(0x238),'validate':S=>new RegExp('.*\x5c.(json|yaml|yml)$')[C(0x266)](S)?!![]:z(S)}]);});}const {fileName:b}=yield A(),M=b['toString']()[h(0x1f4)]('.')['pop']();try{switch(M){case'json':(0x0,utils_1[h(0x205)])(h(0x23d)+b);return fs[h(0x1d9)](b,JSON[h(0x20c)](L,null,'\x20\x20'));case h(0x209):case h(0x257):(0x0,utils_1['success'])(h(0x23d)+b);return fs[h(0x1d9)](b,yaml['safeDump'](L));default:(0x0,utils_1[h(0x27c)])(z(M));}}catch(S){(0x0,utils_1[h(0x27c)])(h(0x206)+S[h(0x1a0)]);}return undefined;}),this[T(0x24d)]=(L,z)=>A=>{const W=T,b=typeof A===W(0x1ab)?A[W(0x264)]():A;return z===![]&&b==='don\x27t\x20change'?'':b;},this['validate']=(L,z,A)=>b=>{const w=T,M=[];if(b===''||b===w(0x22a)){if(z!==![])M[w(0x192)]('this\x20option\x20is\x20required,\x20please\x20answer');else return!![];}L[w(0x1de)]===w(0x1ab)&&!_[w(0x21d)](L[w(0x25a)])&&(console[w(0x1a8)](L[w(0x25a)]),console['log'](b),M[w(0x192)](new RegExp(L[w(0x25a)])[w(0x266)](b)?!![]:w(0x241)+L[w(0x25a)]+'\x27'));L['type']===w(0x1ab)&&!_['isUndefined'](L[w(0x1c6)])&&M[w(0x192)](b[w(0x19f)]>=L['minLength']?!![]:w(0x216)+L[w(0x1c6)]+w(0x204)+b['length']+w(0x277));L[w(0x1de)]===w(0x1ab)&&!_[w(0x21d)](L['maxLength'])&&M[w(0x192)](b[w(0x19f)]<=L[w(0x1d7)]?!![]:w(0x275)+L[w(0x1d7)]+w(0x204)+b[w(0x19f)]+w(0x277));A&&Number[w(0x251)](parseInt(b,0xa))&&M[w(0x192)](w(0x286)+b);L[w(0x1de)]===w(0x1b7)&&!_[w(0x21d)](L[w(0x234)])&&M[w(0x192)](b>=L[w(0x234)]?!![]:w(0x1f5)+L[w(0x234)]);L['type']===w(0x1b7)&&!_['isUndefined'](L[w(0x19a)])&&M[w(0x192)](b<=L[w(0x19a)]?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+L[w(0x19a)]);if(L[w(0x1de)]===w(0x1c5)){const i=(0x0,utils_1[w(0x211)])(b);M['push'](i===![]||_[w(0x187)](i)?w(0x23f):!![]);}const S=M['filter'](q=>q!==!![]),k=(L===null||L===void 0x0?void 0x0:L[w(0x25d)])?'\x0a'+chalk_1[w(0x254)][w(0x1c8)]('>>')+'\x20Example:\x20'+chalk_1[w(0x254)][w(0x1e3)](JSON[w(0x20c)](L[w(0x25d)])):'';return S[w(0x19f)]>0x0?S[w(0x1ee)](chalk_1[w(0x254)][w(0x1bd)](w(0x23e)))+k:!![];},this[T(0x1ed)]=(L,z,A)=>{const H=T,b=L[L[H(0x19f)]-0x1];function M(){const x=H;return L[x(0x1a4)](0x0,-0x1)['map'](i=>i[x(0x24b)](0x0)[x(0x27e)]()+i[x(0x1a4)](0x1))['join']('>');}const S=L[H(0x19f)]>0x1?chalk_1[H(0x254)][H(0x250)][H(0x1e3)](M())+':\x20':'',k=A?'\x20('+chalk_1[H(0x254)][H(0x207)](A)+')':'';return chalk_1[H(0x254)]['reset'](''+S+z+'\x20'+chalk_1[H(0x254)][H(0x282)][H(0x258)](b)+k+'?');},this[T(0x198)]=(L,z,A)=>__awaiter(this,void 0x0,void 0x0,function*(){const J=T;if(z[J(0x19f)]<0x1){const S=A?J(0x269)+A:J(0x1a1);throw new Error(J(0x26c)+L+'\x20'+S+'.');}const b=J(0x235)+L+J(0x18a),M=z[J(0x19f)]>0x4?J(0x1e2):'list';return(yield inquirer[J(0x1e0)]([{'type':M,'name':'name','message':b,'choices':z}]))[J(0x1e9)];}),this[T(0x1d4)]=(L,z,A)=>__awaiter(this,void 0x0,void 0x0,function*(){const u=T,{elements:b,nextCursor:M}=yield z();if(b[u(0x19f)]<0x1){const i=A?'for\x20this\x20'+A:u(0x1a1);throw new Error(u(0x26c)+L+'\x20'+i+'.');}const S=u(0x235)+L+u(0x18a);if(M!==undefined){const q=({nextPageCursor:Z})=>__awaiter(this,void 0x0,void 0x0,function*(){const V=yield z(Z);return{'elements':V['elements'],'nextPageCursor':V['nextCursor']};});return(yield inquirer[u(0x1e0)]([{'type':'pagination-prompt','name':'name','message':S,'choices':b,'nextPageCursor':M,'loadMore':q}]))['name'];}const k=b[u(0x19f)]>0x4?'search-list':'list';return(yield inquirer[u(0x1e0)]([{'type':k,'name':u(0x1e9),'message':S,'choices':b}]))[u(0x1e9)];}),this[T(0x272)]=(L,z)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n=T,A=''+(z?'('+chalk_1[n(0x254)][n(0x207)](z)+')\x20':''),b=n(0x1cc)+chalk_1[n(0x254)]['green'](L)+'\x20'+A+'to\x20use:',M=this['validate']({'type':n(0x1ab),'required':!![]});return(yield inquirer[n(0x1e0)]([{'type':n(0x1c2),'name':'name','message':b,'validate':M}]))['name'];}),this[T(0x224)]=L=>__awaiter(this,void 0x0,void 0x0,function*(){const R=T;return(yield inquirer[R(0x1e0)]([{'type':R(0x260),'name':R(0x1e9),'message':L,'default':!![]}]))[R(0x1e9)];}),this[T(0x213)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const m=a8L;var M;const S=yield this['apiClient'][m(0x223)][m(0x1fe)]({'parameters':{'projectId':A},'options':{'per_page':this[m(0x1e8)],'cursor':b}}),k=S[m(0x1ca)]['services'][m(0x249)](i=>i['id']);return{'elements':k,'nextCursor':(M=S[m(0x1ba)])===null||M===void 0x0?void 0x0:M['cursor']};});return this[F(0x1b1)](F(0x18e),z,L);}),this['askForTemplate']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const f=T,L=z=>__awaiter(this,void 0x0,void 0x0,function*(){const t=a8L;var A;const b=yield this[t(0x20a)][t(0x223)][t(0x226)]({'options':{'per_page':this[t(0x1e8)],'cursor':z}}),M=b[t(0x1ca)][t(0x226)]['map'](S=>S['id']);return{'elements':M,'nextCursor':(A=b['pagination'])===null||A===void 0x0?void 0x0:A['cursor']};});return this[f(0x1d4)]('template',L);}),this[T(0x194)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=T;if(_['isUndefined'](L))throw new Error(K(0x225));const z=A=>__awaiter(this,void 0x0,void 0x0,function*(){const D=K;var b;let M=this[D(0x1e8)];const S=yield this[D(0x20a)][D(0x223)][D(0x188)]({'parameters':{'templateId':L},'options':{'per_page':M,'cursor':A}}),k=S[D(0x1ca)][D(0x188)][D(0x249)](i=>i['id']+D(0x200)+i[D(0x287)]+')');return{'elements':k,'nextCursor':(b=S[D(0x1ba)])===null||b===void 0x0?void 0x0:b['cursor']};});return this[K(0x1d4)](K(0x1f9),z)['then'](A=>A[K(0x1f4)]('\x20')[0x0]);}),this[T(0x227)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const p=T,L=z=>__awaiter(this,void 0x0,void 0x0,function*(){const U=a8L;var A;let b=this[U(0x1e8)];const M=yield this[U(0x20a)][U(0x223)][U(0x202)]({'options':{'per_page':b,'cursor':z}}),S=M['data'][U(0x202)][U(0x249)](k=>k['id']);return{'elements':S,'nextCursor':(A=M[U(0x1ba)])===null||A===void 0x0?void 0x0:A[U(0x1bc)]};});return this[p(0x1d4)](p(0x24c),L);}),this[T(0x280)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const s=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const e=a8L;var M;const S=yield this['apiClient'][e(0x223)][e(0x1ad)]({'parameters':{'projectId':A},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':b}}),k=S[e(0x1ca)][e(0x1ad)]['map'](i=>i['id']);return{'elements':k,'nextCursor':(M=S[e(0x1ba)])===null||M===void 0x0?void 0x0:M[e(0x1bc)]};});return this[s(0x1b1)](s(0x1d1),z,L);}),this[T(0x25f)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const X=a8L;var M;const S=yield this['apiClient'][X(0x223)][X(0x1c7)]({'parameters':{'projectId':A},'options':{'per_page':this[X(0x1e8)],'cursor':b}}),k=S[X(0x1ca)]['jobs']['map'](i=>i['id']);return{'elements':k,'nextCursor':(M=S[X(0x1ba)])===null||M===void 0x0?void 0x0:M[X(0x1bc)]};});return this['askForProjectScopedResourcePaginated'](P(0x191),z,L);}),this[T(0x190)]=(L,z,A=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=T,b=y(0x19e),M=S=>k=>__awaiter(this,void 0x0,void 0x0,function*(){const Q0=y;var i;const q=yield this[Q0(0x20a)][Q0(0x1b8)]['job']['runs']({'parameters':{'projectId':S,'jobId':L},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':k}}),Z=q[Q0(0x1ca)][Q0(0x252)]['map'](V=>V['id']+'\x20(startedAt:\x20'+V[Q0(0x1f6)]+')');return A&&Z[Q0(0x22c)](b),{'elements':Z,'nextCursor':(i=q[Q0(0x1ba)])===null||i===void 0x0?void 0x0:i[Q0(0x1bc)]};});return this[y(0x1b1)](y(0x222),M,z,y(0x1f2)+L+'\x27')['then'](S=>{const k=S['split']('\x20')[0x0];if(k===b)return undefined;return k;});}),this['askForBuild']=(L,z,A,b=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Q1=T,M=Q1(0x22f);if(A!==undefined){const S=k=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const Q2=Q1;var q;const Z=yield this[Q2(0x20a)][Q2(0x1b8)][Q2(0x191)][Q2(0x228)]({'parameters':{'projectId':k,'jobId':A},'options':{'per_page':this[Q2(0x1e8)],'cursor':i}}),V=Z[Q2(0x1ca)]['builds']['map'](d=>d['id']+Q2(0x200)+d[Q2(0x287)]+')');return b&&V[Q2(0x22c)](M),{'elements':V,'nextCursor':(q=Z[Q2(0x1ba)])===null||q===void 0x0?void 0x0:q['cursor']};});return this[Q1(0x1b1)](Q1(0x256),S,L,'job:\x20\x27'+A+'\x27')[Q1(0x208)](k=>{const Q3=Q1,i=k[Q3(0x1f4)]('\x20')[0x0];if(i===M)return undefined;return i;});}if(z!==undefined){const k=i=>q=>__awaiter(this,void 0x0,void 0x0,function*(){const Q4=Q1;var Z;const V=yield this[Q4(0x20a)][Q4(0x1b8)][Q4(0x18e)][Q4(0x228)]({'parameters':{'projectId':i,'serviceId':z},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':q}}),d=V[Q4(0x1ca)][Q4(0x228)][Q4(0x249)](a=>a['id']+Q4(0x200)+a[Q4(0x287)]+')');if(b)d[Q4(0x22c)](M);return{'elements':d,'nextCursor':(Z=V[Q4(0x1ba)])===null||Z===void 0x0?void 0x0:Z['cursor']};});return this[Q1(0x1b1)]('service\x20build',k,L,Q1(0x281)+A+'\x27')[Q1(0x208)](i=>{const Q5=Q1,q=i[Q5(0x1f4)]('\x20')[0x0];if(q===M)return undefined;return q;});}throw new Error(Q1(0x1e7));}),this[T(0x1b6)]=(L,z,A,b=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Q6=T,M=Q6(0x27f);if(A!==undefined){const S=k=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const Q7=Q6;var q,Z;const V=yield this[Q7(0x20a)][Q7(0x1b8)][Q7(0x191)][Q7(0x246)]({'parameters':{'projectId':k,'jobId':A},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':i}}),d=(q=V[Q7(0x1ca)][Q7(0x246)])!==null&&q!==void 0x0?q:[],a=d===null||d===void 0x0?void 0x0:d[Q7(0x249)](G=>G['name']+Q7(0x200)+G[Q7(0x287)]+')');return b&&a[Q7(0x22c)](M),{'elements':a,'nextCursor':(Z=V[Q7(0x1ba)])===null||Z===void 0x0?void 0x0:Z[Q7(0x1bc)]};});return this[Q6(0x1b1)]('job\x20containers',S,L,Q6(0x1f2)+A+'\x27')[Q6(0x208)](k=>{const Q8=Q6,i=k[Q8(0x1f4)]('\x20')[0x0];if(i===M)return undefined;return i;});}if(z!==undefined){const k=i=>q=>__awaiter(this,void 0x0,void 0x0,function*(){const Q9=Q6;var Z,V;const d=yield this[Q9(0x20a)][Q9(0x1b8)][Q9(0x18e)][Q9(0x246)]({'parameters':{'projectId':i,'serviceId':z},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':q}}),a=(Z=d[Q9(0x1ca)][Q9(0x246)])!==null&&Z!==void 0x0?Z:[],G=a[Q9(0x249)](I=>I[Q9(0x1e9)]+'\x20(startedAt:\x20'+I[Q9(0x287)]+')');if(b)G===null||G===void 0x0?void 0x0:G[Q9(0x22c)](M);return{'elements':G,'nextCursor':(V=d[Q9(0x1ba)])===null||V===void 0x0?void 0x0:V['cursor']};});return this['askForProjectScopedResourcePaginated'](Q6(0x262),k,L,Q6(0x281)+A+'\x27')[Q6(0x208)](i=>{const QQ=Q6,q=i[QQ(0x1f4)]('\x20')[0x0];if(q===M)return undefined;return q;});}throw new Error(Q6(0x22b));}),this['askForAddon']=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qz=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const QL=a8L;var M;const S=yield this['apiClient'][QL(0x223)][QL(0x1b9)]({'parameters':{'projectId':A},'options':{'per_page':this[QL(0x1e8)],'cursor':b}});return{'elements':S['data']['addons']['map'](k=>k['id']),'nextCursor':(M=S[QL(0x1ba)])===null||M===void 0x0?void 0x0:M['cursor']};});return this[Qz(0x1b1)]('addon',z,L);}),this['askForAddonBackup']=(L,z)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qb=T,A=b=>M=>__awaiter(this,void 0x0,void 0x0,function*(){const QA=a8L;var S;const k=yield this[QA(0x20a)][QA(0x1b8)][QA(0x195)][QA(0x1ff)]({'parameters':{'projectId':b,'addonId':z},'options':{'per_page':this[QA(0x1e8)],'cursor':M}});return{'elements':k['data']['backups']['map'](i=>i['id']+QA(0x23a)+(i['completedAt']||QA(0x26b))+')'),'nextCursor':(S=k[QA(0x1ba)])===null||S===void 0x0?void 0x0:S[QA(0x1bc)]};});return this['askForProjectScopedResourcePaginated'](Qb(0x1ff),A,L,'addon:\x20\x27'+z+'\x27')[Qb(0x208)](b=>b[Qb(0x1f4)]('\x20')[0x0]);}),this[T(0x276)]=(L,z,A)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const QS=T,b=M=>S=>__awaiter(this,void 0x0,void 0x0,function*(){const QM=a8L;var k;const i=yield this['apiClient']['get'][QM(0x195)][QM(0x1b5)]({'parameters':{'projectId':M,'addonId':z,'backupId':A},'options':{'per_page':this[QM(0x1e8)],'cursor':S}});return{'elements':i['data'][QM(0x1b5)][QM(0x249)](q=>q['id']+QM(0x23a)+(q['completedAt']||QM(0x26b))+')'),'nextCursor':(k=i['pagination'])===null||k===void 0x0?void 0x0:k['cursor']};});return this[QS(0x1b1)]('restore',b,L,'addon:\x20\x27'+z+'\x27')[QS(0x208)](M=>M[QS(0x1f4)]('\x20')[0x0]);}),this[T(0x26e)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qi=T,z=A=>__awaiter(this,void 0x0,void 0x0,function*(){const Qk=a8L;return(yield this[Qk(0x20a)][Qk(0x223)][Qk(0x201)]({'parameters':{'projectId':A}}))[Qk(0x1ca)]['map'](b=>b['id']);});return this['askForProjectScopedResource'](Qi(0x240),z,L);}),this[T(0x255)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const QZ=T,z=A=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const Qq=a8L;var M;const S=yield this[Qq(0x20a)][Qq(0x223)][Qq(0x1d6)]({'parameters':{'projectId':A},'options':{'per_page':this[Qq(0x1e8)],'cursor':b}});return{'elements':S[Qq(0x1ca)]['secrets']['map'](k=>k['id']),'nextCursor':(M=S['pagination'])===null||M===void 0x0?void 0x0:M[Qq(0x1bc)]};});return this[QZ(0x1b1)]('secret',z,L);}),this[T(0x27a)]=L=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const QV=T,z=yield this['apiClient']['get']['domain']({'parameters':{'domain':L}}),A=z['data'][QV(0x285)][QV(0x249)](M=>M[QV(0x1e9)]+'\x20(full\x20domain:\x20'+M['fullName']+')'),b=QV(0x20f)+L+')';return this[QV(0x198)](QV(0x24e),A,b)[QV(0x208)](M=>M[QV(0x1f4)]('\x20')[0x0]);}),this[T(0x23b)]=(L,z)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qd=T,A=yield this['apiClient'][Qd(0x223)][Qd(0x24e)][Qd(0x261)]({'parameters':{'domain':L,'subdomain':z}}),b=A['data'][Qd(0x19d)][Qd(0x249)](S=>''+S[Qd(0x236)]),M=Qd(0x20f)+L+Qd(0x1a7)+z+')';return this[Qd(0x198)](Qd(0x18c),b,M);}),this[T(0x1d5)]=L=>__awaiter(this,void 0x0,void 0x0,function*(){const Qa=T;return(yield inquirer['prompt']([{'type':Qa(0x260),'name':Qa(0x283),'message':chalk_1[Qa(0x254)][Qa(0x229)]('WARNING:\x20You\x20are\x20about\x20to\x20delete\x20'+(L||Qa(0x1cd))+Qa(0x214)),'default':![]}]))['confirmation'];}),this['loginPrompt']=(L,z)=>__awaiter(this,void 0x0,void 0x0,function*(){const QG=T;_[QG(0x21d)](L['name'])&&(z[QG(0x19f)]<=0x0?_['set'](L,'name',QG(0x254)):yield(0x0,utils_1['retry'])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const QI=QG,{name:A}=yield inquirer[QI(0x1e0)]([{'type':QI(0x1c2),'name':QI(0x1e9),'message':QI(0x273),'default':QI(0x22d)}]);if(!L['override']&&z[QI(0x268)](b=>b[QI(0x1e9)]===A)){const {c:b}=yield inquirer[QI(0x1e0)]([{'type':'confirm','name':'c','message':'Context\x20with\x20name\x20\x27'+A+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(b===![])throw new Error(QI(0x1a9));_[QI(0x1e4)](L,QI(0x22e),!![]);}_[QI(0x1e4)](L,'name',A);})));if(_[QG(0x21d)](L['token'])){const A=yield this['tokenPrompt']();_[QG(0x1e4)](L,QG(0x1f0),A);}return L;}),this[T(0x1d8)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Qg=T,{token:L}=yield inquirer['prompt']([{'type':Qg(0x245),'name':Qg(0x1f0),'mask':'*','message':'Choose\x20the\x20login\x20token:'}]);return L;}),inquirer[T(0x186)](T(0x1e2),inquirerSearchList),inquirer[T(0x186)](T(0x1eb),inquirer_pagination_prompt_1[T(0x1c1)]);}[a8O(0x210)](Q,L){return __awaiter(this,void 0x0,void 0x0,function*(){const QO=a8L,z=yaml['safeDump'](Q),A=_[QO(0x1fd)](z[QO(0x1f4)]('\x0a')[QO(0x249)](S=>S[QO(0x19f)])),b=chalk_1[QO(0x254)]['grey']('-'[QO(0x1ae)](A)+'\x0a'),{confirm:M}=yield inquirer[QO(0x1e0)]([{'type':QO(0x223),'name':QO(0x260),'message':''+chalk_1[QO(0x254)][QO(0x282)]['green'](QO(0x232))+b+chalk_1[QO(0x254)][QO(0x1b3)](z)+b,'choices':Object[QO(0x19b)](ConfirmChoices)}]);switch(M){case ConfirmChoices[QO(0x18d)]:return Q;case ConfirmChoices[QO(0x1e5)]:throw new Error(QO(0x26a));case ConfirmChoices[QO(0x279)]:return this['retrievePayloadViaInteractiveCli'](L);case ConfirmChoices['EDIT']:return this[QO(0x210)](yield this['editPayload'](Q),L);case ConfirmChoices[QO(0x21e)]:yield this['saveFile'](Q);return this[QO(0x210)](Q,L);default:throw new Error('Something\x20unexpected\x20happened.');}});}[a8O(0x197)](Q,L){return __awaiter(this,void 0x0,void 0x0,function*(){const QY=a8L;if((L===null||L===void 0x0?void 0x0:L['resultCache'])!==undefined)this['resultCache']=L===null||L===void 0x0?void 0x0:L[QY(0x1a5)];this[QY(0x1fb)]=L===null||L===void 0x0?void 0x0:L[QY(0x1b2)];const z={};return yield this[QY(0x284)]([],Q['opt'][QY(0x193)],z),this[QY(0x1a5)]=z,yield this[QY(0x210)](z,Q);});}[a8O(0x284)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const Qj=a8L;let b;if(L[Qj(0x196)]&&!_[Qj(0x18b)](L,Qj(0x242))){if(L[Qj(0x196)]['length']>0x1){const {choice:M}=yield inquirer[Qj(0x1e0)]([{'type':'list','name':Qj(0x1b4),'message':Qj(0x24f)+(Q[Q['length']-0x1]||'')+Qj(0x233),'choices':L['oneOf']['map'](S=>{const QB=Qj;var k;return(k=S[QB(0x1bb)])!==null&&k!==void 0x0?k:'??';})}]);b=yield this[Qj(0x26f)](Q,L[Qj(0x196)][Qj(0x268)](S=>S['description']===M),z,A);}else{const S=L[Qj(0x196)][0x0];_[Qj(0x1e4)](S,Qj(0x1bb),L[Qj(0x1bb)]),b=yield this[Qj(0x26f)](Q,S,z,A);}b={};}else{if(L[Qj(0x218)]&&!_[Qj(0x18b)](L,'properties')){if(L[Qj(0x218)][Qj(0x19f)]>0x1){const {choice:k}=yield inquirer[Qj(0x1e0)]([{'type':'list','name':'choice','message':Qj(0x24f)+(Q[Q[Qj(0x19f)]-0x1]||'')+Qj(0x233),'choices':[...L['anyOf'][Qj(0x249)](i=>{const Ql=Qj;var q;return(q=i[Ql(0x1bb)])!==null&&q!==void 0x0?q:'??';}),'don\x27t\x20change']}]);k!==Qj(0x22a)&&(b=yield this[Qj(0x26f)](Q,L[Qj(0x218)][Qj(0x268)](i=>i[Qj(0x1bb)]===k),z,A));}else{const i=L['anyOf'][0x0];_[Qj(0x1e4)](i,Qj(0x1bb),L[Qj(0x1bb)]),b=yield this['getType'](Q,i,z,A);}b={};}else b=yield this[Qj(0x26f)](Q,L,z,A);}return b;});}[a8O(0x1cb)](Q,L,z,A){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const Qo=a8L;if(A===![]){const {addEntry:k}=yield inquirer[Qo(0x1e0)]([{'type':Qo(0x260),'name':Qo(0x1e6),'message':this['getPathString'](L,Qo(0x253),Q===null||Q===void 0x0?void 0x0:Q[Qo(0x1bb)]),'default':![]}]);if(!k)return z;}const M=Object[Qo(0x18f)]((b=Q===null||Q===void 0x0?void 0x0:Q['properties'])!==null&&b!==void 0x0?b:[]),S=Q['required']||[];if(M['length']>0x0)for(const i of M){const q=L[Qo(0x1d2)](i);if(L[Qo(0x19f)]>0x0&&!_['has'](z,L[Qo(0x1ee)]('.')))_[Qo(0x1e4)](z,L[Qo(0x1ee)]('.'),{});yield this[Qo(0x284)](q,Q['properties'][i],z,S['includes'](i));}else yield this[Qo(0x26f)](L,Object[Qo(0x1a2)](Object[Qo(0x1a2)]({},Q),{'type':Qo(0x1c5)}),z,A);return z;});}[a8O(0x21f)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const Qr=a8L;if(L&&z)return!![];const b=L?Qr(0x253):Qr(0x1aa),{addEntry:M}=yield inquirer['prompt']([{'type':'confirm','name':Qr(0x1e6),'message':this[Qr(0x1ed)](Q,b,L?A:undefined),'default':![]}]);return M;});}[a8O(0x26f)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const QE=a8L;let b;const M=Q['join']('.');switch(L===null||L===void 0x0?void 0x0:L[QE(0x1de)]){case'array':{let S=!![];while(yield this['askArrayEntry'](Q,S,A,L===null||L===void 0x0?void 0x0:L[QE(0x1bb)])){const k=_[QE(0x1b8)](z,M);_['unset'](z,M),yield this['getType'](Q,L[QE(0x27d)],z);const i=_[QE(0x1b8)](z,M);!_[QE(0x1a3)](k)?_[QE(0x1e4)](z,M,[i]):(k[QE(0x192)](i),_[QE(0x1e4)](z,M,k)),S=![];}return b||[];}case QE(0x1e1):{return b=yield this[QE(0x1cb)](L,Q,z,A),b;}case QE(0x1c5):b=(0x0,utils_1[QE(0x211)])(yield this[QE(0x212)](Q,L,A))||undefined;break;case'string':case QE(0x21b):case QE(0x1b7):default:b=yield this[QE(0x212)](Q,L,A,z);break;}return!_['isUndefined'](b)&&_['set'](z,M,b),b;});}['ask'](Q,L,z,A){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const QN=a8L,M=Q[Q[QN(0x19f)]-0x1],{defaultValue:defaultValue=(b=L===null||L===void 0x0?void 0x0:L[QN(0x25d)])!==null&&b!==void 0x0?b:L===null||L===void 0x0?void 0x0:L['default'],choices:choices=L===null||L===void 0x0?void 0x0:L['enum'],pagination:S}=yield(0x0,api_helpers_1['fetchResourceList'])(M,this['apiClient'],this['tmpCmdPath'],A,this[QN(0x237)],Q);let k='input';if(!_[QN(0x21d)](choices)&&choices[QN(0x19f)]>0x0){if(S!==undefined&&S[QN(0x27b)]!==undefined)k=QN(0x1eb);else choices[QN(0x19f)]>0x4&&typeof choices[0x0]===QN(0x1ab)?k=QN(0x1e2):k=QN(0x223);}else{if((L===null||L===void 0x0?void 0x0:L[QN(0x1de)])===QN(0x21b))k=QN(0x260);else{if((L===null||L===void 0x0?void 0x0:L[QN(0x1de)])===QN(0x1b7))k='input';else(L===null||L===void 0x0?void 0x0:L[QN(0x1de)])==='rawObject'&&(k='editor');}}let i=z!==![]?!_[QN(0x1ec)](defaultValue)?defaultValue:JSON[QN(0x20c)](defaultValue):_[QN(0x203)](defaultValue)?defaultValue:'don\x27t\x20change';if(choices)i=i[QN(0x1b0)]();_[QN(0x18b)](this[QN(0x1a5)],Q[QN(0x1ee)]('.'))&&(i=this[QN(0x1a5)][Q['join']('.')]);const q=choices&&z===![]?[QN(0x22a),...choices]:choices,Z=(L===null||L===void 0x0?void 0x0:L['type'])===QN(0x1b7),V=Object[QN(0x1a2)]({'type':k,'name':'id','message':this[QN(0x231)](Q,L),'choices':q,'default':i,'filter':this[QN(0x24d)](k,z),'validate':this[QN(0x24a)](L,z,Z)},S),d=(yield inquirer[QN(0x1e0)]([V]))['id'];if(d===QN(0x22a)||d==='')return undefined;if(Z)return parseInt(d,0xa);return d;});}[a8O(0x231)](Q,L){const QT=a8O,z=(L===null||L===void 0x0?void 0x0:L['type'])!==QT(0x21b)?'What\x20do\x20you\x20want\x20to\x20use\x20as':QT(0x267);return this[QT(0x1ed)](Q,z,L===null||L===void 0x0?void 0x0:L['description']);}[a8O(0x1df)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Qh=a8L,Q=L=>__awaiter(this,void 0x0,void 0x0,function*(){const Qv=a8L;var z;const A=yield this[Qv(0x20a)][Qv(0x223)][Qv(0x20b)]({'options':{'per_page':this[Qv(0x1e8)],'cursor':L}}),b=A['data'][Qv(0x20b)]['map'](M=>M['id']);return{'elements':b,'nextCursor':(z=A['pagination'])===null||z===void 0x0?void 0x0:z['cursor']};});return yield this[Qh(0x1d4)]('project',Q);});}[a8O(0x23c)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const QC=a8L,b=z||this[QC(0x20a)][QC(0x288)][QC(0x1cf)]();if(_['isUndefined'](b))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const M=yield L(b);return yield this['askForResource'](Q,M,(A?A+QC(0x1db):'')+QC(0x1a6)+b+'\x27');});}[a8O(0x1b1)](Q,L,z,A){return __awaiter(this,void 0x0,void 0x0,function*(){const QW=a8L,b=z||this[QW(0x20a)][QW(0x288)][QW(0x1cf)]();if(_[QW(0x21d)](b))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const M=yield L(b);return yield this['askForResourcePaginated'](Q,M,(A?A+QW(0x1db):'')+QW(0x1a6)+b+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Q=L=>__awaiter(this,void 0x0,void 0x0,function*(){const Qw=a8L;var z;const A=yield this[Qw(0x20a)][Qw(0x223)][Qw(0x1f1)]({'options':{'per_page':this[Qw(0x1e8)],'cursor':L}});return{'elements':A[Qw(0x1ca)][Qw(0x1f1)]['map'](b=>b[Qw(0x1e9)]),'nextCursor':(z=A[Qw(0x1ba)])===null||z===void 0x0?void 0x0:z[Qw(0x1bc)]};});return this['askForResourcePaginated']('domain',Q);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Qx=a8L,Q=L=>__awaiter(this,void 0x0,void 0x0,function*(){const QH=a8L;var z;const A=yield this[QH(0x20a)]['list'][QH(0x1fa)]({'options':{'per_page':this[QH(0x1e8)],'cursor':L}});return{'elements':A[QH(0x1ca)][QH(0x25e)]['map'](b=>b['id']),'nextCursor':(z=A[QH(0x1ba)])===null||z===void 0x0?void 0x0:z[QH(0x1bc)]};});return this[Qx(0x1d4)]('credentials',Q);});}[a8O(0x1f7)](Q){const QJ=a8O;this[QJ(0x237)]=Q;}}function a8L(Q,L){const z=a8Q();return a8L=function(A,b){A=A-0x186;let M=z[A];return M;},a8L(Q,L);}exports[a8O(0x221)]=InquirerHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a9L(Q,L){const z=a9Q();return a9L=function(A,b){A=A-0x1de;let M=z[A];return M;},a9L(Q,L);}const a9l=a9L;(function(Q,L){const B=a9L,z=Q();while(!![]){try{const A=-parseInt(B(0x208))/0x1+parseInt(B(0x1e5))/0x2*(parseInt(B(0x219))/0x3)+parseInt(B(0x210))/0x4+-parseInt(B(0x1e6))/0x5+-parseInt(B(0x1e8))/0x6+parseInt(B(0x1ec))/0x7+-parseInt(B(0x1ed))/0x8;if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a9Q,0xec549));var __createBinding=this&&this[a9l(0x1ee)]||(Object[a9l(0x21c)]?function(Q,L,z,A){const o=a9l;if(A===undefined)A=z;var b=Object['getOwnPropertyDescriptor'](L,z);(!b||(o(0x214)in b?!L[o(0x21b)]:b[o(0x204)]||b['configurable']))&&(b={'enumerable':!![],'get':function(){return L[z];}}),Object[o(0x1f8)](Q,A,b);}:function(Q,L,z,A){if(A===undefined)A=z;Q[A]=L[z];}),__setModuleDefault=this&&this[a9l(0x20a)]||(Object[a9l(0x21c)]?function(Q,L){const r=a9l;Object['defineProperty'](Q,r(0x1e7),{'enumerable':!![],'value':L});}:function(Q,L){Q['default']=L;}),__importStar=this&&this['__importStar']||function(Q){const E=a9l;if(Q&&Q[E(0x21b)])return Q;var L={};if(Q!=null){for(var z in Q)if(z!=='default'&&Object[E(0x202)][E(0x20b)][E(0x1ea)](Q,z))__createBinding(L,Q,z);}return __setModuleDefault(L,Q),L;},__awaiter=this&&this['__awaiter']||function(Q,L,z,A){function b(M){return M instanceof z?M:new z(function(S){S(M);});}return new(z||(z=Promise))(function(M,S){const h=a9L;function k(Z){const N=a9L;try{q(A[N(0x212)](Z));}catch(V){S(V);}}function i(Z){const T=a9L;try{q(A[T(0x209)](Z));}catch(V){S(V);}}function q(Z){const v=a9L;Z[v(0x1f0)]?M(Z[v(0x1e9)]):b(Z[v(0x1e9)])[v(0x207)](k,i);}q((A=A[h(0x1e2)](Q,L||[]))[h(0x212)]());});},__importDefault=this&&this['__importDefault']||function(Q){return Q&&Q['__esModule']?Q:{'default':Q};};Object[a9l(0x1f8)](exports,a9l(0x21b),{'value':!![]}),exports[a9l(0x1fe)]=void 0x0;function a9Q(){const t=['removeListener','prototype','startLogin','writable','ws:','write','then','24419BjlmZW','throw','__setModuleDefault','hasOwnProperty','finally','catch','initPackage','unable\x20to\x20parse\x20message:\x20','4162296gprnQH','login-failure','next','replace','get','status','success','init','handleError','6537TGAHZw','type','__esModule','create','data','exit','login-success','Failure\x20during\x20login:\x20','http:','apply','Login\x20process\x20stopped\x20before\x20completed','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','1430vBHAAa','5196885fGAIfm','default','7102620zlGbfN','value','call','toString','8676150gGYDZl','4979472FNwORE','__createBinding','aborted','done','init-ack','events','wss:','SIGINT','duplex','baseUrl','end','defineProperty','emit','Unexpected\x20response,\x20api\x20token\x20missing','stringify','parse','message','NorthflankApiBrowserLogin','Unexpected\x20response','openBrowser'];a9Q=function(){return t;};return a9Q();}const ws_1=__importStar(require('ws')),open_1=__importDefault(require('open')),events_1=require(a9l(0x1f2));class NorthflankApiBrowserLogin extends events_1['EventEmitter']{constructor(Q,L=!![]){const C=a9l;super(),this[C(0x1f6)]=Q,this[C(0x200)]=L,this[C(0x215)]='idle',this[C(0x20e)]=()=>JSON[C(0x1fb)]({'type':'init'});}[a9l(0x203)](){const W=a9l;var Q;const L=this['baseUrl']['replace']('https:',W(0x1f3))[W(0x213)](W(0x1e1),W(0x205)),z=L+'/v1/cli-login',A=new ws_1[(W(0x1e7))](z),b=()=>__awaiter(this,void 0x0,void 0x0,function*(){const H=W;yield new Promise(S=>{const w=a9L;var k;(k=this[w(0x1f5)])===null||k===void 0x0?void 0x0:k[w(0x1f7)](JSON[w(0x1fb)]({'type':w(0x1ef)}),()=>S());}),process[H(0x1de)]();}),M=new Promise((S,k)=>{const x=W;var i,q,Z;try{this[x(0x1f5)]=(0x0,ws_1['createWebSocketStream'])(A),process['on'](x(0x1f4),b);}catch(V){k(new Error(x(0x1e4)+V[x(0x1fd)]));}(i=this['duplex'])===null||i===void 0x0?void 0x0:i['on'](x(0x21d),d=>{const J=x;var a;const G=JSON[J(0x1fc)](d[J(0x1eb)]());switch(G===null||G===void 0x0?void 0x0:G[J(0x21a)]){case J(0x1f1):{const {loginPage:I}=G;if(I===undefined){this[J(0x218)](J(0x1ff),k);return;}this[J(0x200)]&&(0x0,open_1[J(0x1e7)])(I)[J(0x20d)](g=>{const u=J,O='Unable\x20to\x20open\x20browser:\x20'+g['message'];this[u(0x218)](O,k);});this[J(0x1f9)]('browser-opened',{'url':I});break;}case J(0x1df):{const {apiToken:g,contextName:O}=G;if(g===undefined){this[J(0x218)](J(0x1fa),k);return;}(a=this[J(0x1f5)])===null||a===void 0x0?void 0x0:a[J(0x1f7)](),S({'token':g,'contextName':O}),this[J(0x215)]=J(0x216);break;}case J(0x211):{const Y=J(0x1e0)+(G===null||G===void 0x0?void 0x0:G[J(0x1fd)]);this['handleError'](Y,k);break;}default:{const j=J(0x20f)+JSON['stringify'](G);this['handleError'](j,k);}}}),(q=this[x(0x1f5)])===null||q===void 0x0?void 0x0:q['on']('error',d=>{const n=x;this[n(0x218)]('error\x20happened\x20during\x20browser\x20login:\x20'+d[n(0x1fd)],k);}),(Z=this[x(0x1f5)])===null||Z===void 0x0?void 0x0:Z['on'](x(0x1f7),()=>{const R=x;if(this[R(0x215)]==='success'){}else this[R(0x218)](R(0x1e3),k);});});return(Q=this[W(0x1f5)])===null||Q===void 0x0?void 0x0:Q[W(0x206)](this[W(0x20e)]()),this[W(0x215)]=W(0x217),M[W(0x20c)](()=>{const m=W;process[m(0x201)](m(0x1f4),b);});}[a9l(0x218)](Q,L){const F=a9l;var z,A;L?(z=this[F(0x1f5)])===null||z===void 0x0?void 0x0:z[F(0x1f7)](()=>L(new Error(Q))):(A=this['duplex'])===null||A===void 0x0?void 0x0:A[F(0x1f7)](),this['status']='error';}}exports[a9l(0x1fe)]=NorthflankApiBrowserLogin;
|
package/dist/logs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a10j=a10I;(function(A,I){const G=a10I,a=A();while(!![]){try{const d=-parseInt(G(0x122))/0x1+-parseInt(G(0xfa))/0x2+parseInt(G(0x179))/0x3+parseInt(G(0x100))/0x4*(-parseInt(G(0x124))/0x5)+-parseInt(G(0x108))/0x6+-parseInt(G(0xfb))/0x7+parseInt(G(0x12a))/0x8;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a10A,0xe89e1));var __awaiter=this&&this[a10j(0x109)]||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const w=a10I;function g(f){const z=a10I;try{L(d[z(0x151)](f));}catch(t){V(t);}}function u(f){try{L(d['throw'](f));}catch(t){V(t);}}function L(f){const h=a10I;f['done']?T(f[h(0x102)]):s(f[h(0x102)])[h(0xf7)](g,u);}L((d=d[w(0x155)](A,I||[]))[w(0x151)]());});},__importDefault=this&&this[a10j(0x117)]||function(A){return A&&A['__esModule']?A:{'default':A};};function a10I(A,I){const a=a10A();return a10I=function(d,s){d=d-0xf2;let T=a[d];return T;},a10I(A,I);}Object[a10j(0x13d)](exports,'__esModule',{'value':!![]}),exports['CliLogs']=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a10j(0xfd))),utils_1=require(a10j(0x126)),inquirer_helper_1=require(a10j(0x16f)),commander_1=require(a10j(0x105)),console_format_helpers_1=require('../formatting/console-format-helpers'),log_formatter_1=require(a10j(0x14c));function a10A(){const AI=['\x20with\x20live-tailing',',\x20from:\x20','./log-formatter','textNotIncludes','runId','LogType','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','next','\x20--','InquirerHelper','Backup\x20to\x20get\x20logs\x20from','apply','askForProject','askForJob','Get\x20log\x20for\x20the\x20specified\x20','\x20seconds','alias','\x20for\x20all\x20containers','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','getCommand','pagination','formatLogLine','getCurrentProjectName','values','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','parseDateInput','getStandardLogCommand','serviceId','--noDefaults','argParser','action','format','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','addonRestore','defaultDurationSeconds','getFormatter',',\x20restore\x20id\x20','../inquirer-helper','--textNotIncludes\x20<text>','length','getLogsCommand','noDefaults','--backup\x20--backupId\x20[backupId]','CliLogs','Build\x20to\x20get\x20logs\x20from','description','--restore\x20--restoreId\x20[restoreId]','5015037WKLNYp','Error\x20while\x20fetching\x20log\x20lines:\x20','toUpperCase','stringify','data','customUserAgent','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','logTail','-d,\x20--direction\x20<order>','slice','--duration\x20[duration]','getCurrentServiceName','option','warning','then','yml','getCurrentJobName','2923374fspQwk','8532706RVsuuU','log','chalk','-t,\x20--types\x20<types...>','job','163288XgKmOl','tsHint','value','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','\x20of\x20','commander','askForAddon','printInitInfo','10981050PoVJUG','__awaiter','yaml','inquirerHelper','--regexIncludes\x20<regex>','error','printResponse','askForBuild','containerId','assign','apiContext','Project\x20for\x20logs','askForAddonRestore','--endTime\x20<timestamp>','message','__importDefault','getSeconds','\x20to\x20get\x20logs\x20from','apiClient','--textIncludes\x20<text>','assertContextExisting','service',',\x20to:\x20','addon','charAt','close','1641285SDZVLV','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','185OeOTHQ','regexNotIncludes','../utils','choices','conflicts','addonId','55549128AidLoI','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','name','Option','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','tail','setSeconds','Number\x20of\x20lines\x20to\x20return.','Error\x20while\x20tailing\x20log\x20lines:\x20','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','json','build-','regexIncludes',',\x20duration:\x20','--build\x20--buildId\x20[buildId]','hasNextPage','Id]','forEach','logRange','defineProperty','default','bold','textIncludes','\x20(exit\x20with\x20','logs','addOption','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','askForContainer','valueOf','>\x20Container\x20logs','-o,\x20--output\x20[output]','--run\x20--runId\x20[runId]'];a10A=function(){return AI;};return a10A();}class CliLogs{constructor(A){const i=a10j;this[i(0x112)]=A,this['defaultDurationSeconds']=0x708,this[i(0x164)]=(I,a,d,s)=>{const A0=i,T=(0x0,utils_1[A0(0x15d)])(!![])[A0(0x12c)]((a?A0(0x135):'')+A0(0x142))[A0(0x15a)]((a?A0(0x135):'')+A0(0xfc))[A0(0x177)](A0(0x158)+I)[A0(0xf5)]('--project\x20--projectId\x20[projectId]',A0(0x113))['option']('--'+I+A0(0x152)+I+'Id\x20['+I+A0(0x13a),I[A0(0x120)](0x0)[A0(0x17b)]()+I[A0(0xf2)](0x1)+A0(0x119))[A0(0xf5)]('--container\x20--containerId\x20[containerId]',A0(0x12b));if(a)T[A0(0xf5)](A0(0x138),A0(0x176));if(I===A0(0xff))T[A0(0xf5)](A0(0x149),'Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0');if(d)T[A0(0xf5)](A0(0x174),A0(0x154));if(s)T[A0(0xf5)](A0(0x178),'Restore\x20to\x20get\x20logs\x20from');return!a&&!d&&!s&&T[A0(0x143)](new commander_1[(A0(0x12d))](A0(0xfe),'Which\x20log\x20types\x20to\x20fetch')[A0(0x127)](Object[A0(0x161)](js_client_1[A0(0x14f)]))),T[A0(0xf5)]('-f,\x20--tail','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.')[A0(0xf5)]('-l,\x20--lineLimit\x20[limit]',A0(0x131))['option']('--startTime\x20<timestamp>','Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1[A0(0x101)],utils_1[A0(0x163)])[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x115),'Get\x20logs\x20generated\x20before\x20this\x20time,\x20'+utils_1[A0(0x101)])[A0(0x167)](utils_1[A0(0x163)])[A0(0x128)]([A0(0x12f)]))['option'](A0(0xf3),A0(0x17f))[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x181),A0(0x133))[A0(0x127)](['backward','forward'])[A0(0x128)]([A0(0x12f)]))[A0(0x143)](new commander_1['Option'](A0(0x11b),A0(0x16a))[A0(0x128)]([A0(0x14d),'regexIncludes','regexNotIncludes']))[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x170),'Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text')[A0(0x128)]([A0(0x140),A0(0x136),A0(0x125)]))[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x10c),A0(0x123))[A0(0x128)]([A0(0x14d),'textIncludes',A0(0x125)]))[A0(0x143)](new commander_1[(A0(0x12d))]('--regexNotIncludes\x20<regex>',A0(0x162))[A0(0x128)](['textNotIncludes',A0(0x136),A0(0x140)]))[A0(0xf5)](A0(0x166),A0(0x144),![])[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x148),A0(0x12e))[A0(0x127)](Object['values']([A0(0x169),A0(0x134),A0(0x10a)]))),T;},this[i(0x107)]=(I,a,d,s)=>{const A1=i,{containerName:T,restoreId:V,backupId:g,quiet:u,tail:L,startTime:f,endTime:t,duration:m}=s;if(u===!![])return;const U=L?A1(0x141)+chalk_1[A1(0x13e)][A1(0x13f)]('\x27Ctrl+C\x27')+')':'',S=L?A1(0x14a):'',k=new Date(),e=f!==null&&f!==void 0x0?f:new Date(new Date((t!==null&&t!==void 0x0?t:k)[A1(0x146)]())[A1(0x130)]((t!==null&&t!==void 0x0?t:k)[A1(0x118)]()-(m!==null&&m!==void 0x0?m:this['defaultDurationSeconds']))),x=(t!==null&&t!==void 0x0?t:f!==undefined)?new Date(new Date(f[A1(0x146)]())[A1(0x130)](f['getSeconds']()+(m!==null&&m!==void 0x0?m:this[A1(0x16c)]))):k,o=g!==undefined,M=e&&!o?A1(0x14b)+chalk_1[A1(0x13e)]['bold'](e['toISOString']()):'',N=x&&!o?A1(0x11e)+chalk_1[A1(0x13e)][A1(0x13f)](x['toISOString']()):'',q=m?A1(0x137)+m+A1(0x159):'',K=T?'\x20for\x20container\x20'+chalk_1[A1(0x13e)][A1(0x13f)](T):o?'':A1(0x15b),y=g?',\x20backup\x20id\x20'+g:'',D=V?A1(0x16e)+V:'',l=I+'\x20'+chalk_1[A1(0x13e)][A1(0x13f)](a)+y+D+'\x20in\x20project\x20'+chalk_1[A1(0x13e)]['bold'](d),n=''+M+N+q;console['log'](A1(0x147)+S+K+A1(0x104)+l+n+U+':');},this[i(0x16d)]=(I,a)=>(d,s)=>{const A2=i;if(!I){if(d[A2(0x171)]===0x0)console[A2(0xfc)](A2(0x15c));d[A2(0x13b)](T=>(0x0,log_formatter_1[A2(0x15f)])(T,a));}else(0x0,console_format_helpers_1[A2(0x10e)])(I,d);(s===null||s===void 0x0?void 0x0:s[A2(0x139)])&&(0x0,utils_1[A2(0xf6)])(A2(0x103)+s['cursor']);},this[i(0x11a)]=new js_client_1['ApiClient'](A,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[i(0x17e)]}),this['logsApiClient']=this[i(0x11a)],this[i(0x10b)]=new inquirer_helper_1[(i(0x153))](this[i(0x11a)]);}[a10j(0x172)](A,I=![],a=![],d=![]){const A9=a10j,s=(f,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const A3=a10I,m=t[A3(0x173)],{apiContext:U,inquirerHelper:S}=this;switch(A){case A3(0x11d):{const k=m?undefined:U[A3(0xf4)]();return t[A3(0x165)]||k||(yield S['askForService'](f)());}case A3(0xff):{const e=m?undefined:U[A3(0xf9)]();return t['jobId']||e||(yield S[A3(0x157)](f)());}case A3(0x11f):{return t[A3(0x129)]||(yield S[A3(0x106)](f)());}}}),T=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A4=a10I;if(I)return m['buildId']||(yield this['inquirerHelper'][A4(0x10f)](f,A===A4(0x11d)?t:undefined,A===A4(0xff)?t:undefined,!![])());return undefined;}),V=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A5=a10I;if(a||d)return m['backupId']||(yield this[A5(0x10b)]['askForAddonBackup'](f,t)());return undefined;}),g=(f,t,m,U)=>__awaiter(this,void 0x0,void 0x0,function*(){const A6=a10I;if(d)return U['restoreId']||(yield this[A6(0x10b)][A6(0x114)](f,t,m)());return undefined;}),u=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A7=a10I;if(!I&&m[A7(0x110)]!==undefined){if(m[A7(0x110)]!==!![])return m[A7(0x110)];return yield this[A7(0x10b)][A7(0x145)](f,A==='service'?t:undefined,A==='job'?t:undefined,!![])();}return undefined;}),L=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A8=a10I;if(A===A8(0xff))return m[A8(0x14e)]||(yield this[A8(0x10b)]['askForJobRun'](t,f,!![])());return undefined;});return this[A9(0x164)](A,I,a,d)[A9(0x168)](f=>__awaiter(this,void 0x0,void 0x0,function*(){const AA=A9,{noDefaults:t,projectId:m,quiet:U,tail:S,types:k,textIncludes:e,textNotIncludes:x,regexIncludes:o,regexNotIncludes:M,direction:N,lineLimit:q,startTime:K,endTime:y,duration:D,output:l}=f;(0x0,utils_1[AA(0x11c)])(this[AA(0x11a)]);const {apiContext:n,inquirerHelper:v,logsApiClient:X}=this,Q=t?undefined:n[AA(0x160)](),O=m||Q||(yield v[AA(0x156)]()),p=yield s(O,f),r=yield T(O,p,f),H=yield V(O,p,f),P=yield g(O,p,H,f),R=yield L(O,p,f),Z=yield u(O,p,f);if(K&&y&&D)throw new Error(AA(0x150));const B={'projectId':O,'entityId':p},E={'containerName':Z,'types':k,'textIncludes':e,'textNotIncludes':x,'regexIncludes':o,'regexNotIncludes':M,'lineLimit':q,'startTime':K,'duration':D,'runId':R,'buildId':r,'backupId':H,'restoreId':P,'isBuild':I!==null&&I!==void 0x0?I:![]},J=d?AA(0x16b):a?'addonBackup':A,b=Object['assign'](Object[AA(0x111)]({},E),{'endTime':y,'direction':N});if(!U&&l!==AA(0x10a)&&l!==AA(0xf8)&&l!==AA(0x134))this['printInitInfo'](A,p,O,Object[AA(0x111)](Object['assign']({},b),f));const Y=this['getFormatter'](l,e!==null&&e!==void 0x0?e:o);if(S){const F=yield X[AA(0x142)][AA(0x180)](B,E,J);F['on']('logs-received',Y),F['on'](AA(0x10d),c=>(0x0,utils_1[AA(0x10d)])(AA(0x132)+c[AA(0x116)])),F['on'](AA(0x121),()=>console[AA(0xfc)]('Log\x20session\x20ended')),yield F['start']();}else{const c=yield X['logs'][AA(0x13c)](B,b,J);if(c[AA(0x10d)]){const W=c[AA(0x10d)]['details'],C=W?'\x0aDetails:\x20'+JSON[AA(0x17c)](W,null,'\x20'):'';(0x0,utils_1[AA(0x10d)])(AA(0x17a)+c[AA(0x10d)][AA(0x116)]+C);}else Y(c[AA(0x17d)],c[AA(0x15e)]);}}));}}exports[a10j(0x175)]=CliLogs;
|
|
1
|
+
'use strict';const a10y=a10L;(function(Q,L){const p=a10L,z=Q();while(!![]){try{const A=parseInt(p(0x154))/0x1+parseInt(p(0x14f))/0x2*(-parseInt(p(0x177))/0x3)+-parseInt(p(0x168))/0x4+parseInt(p(0x198))/0x5*(-parseInt(p(0x18a))/0x6)+-parseInt(p(0x189))/0x7+-parseInt(p(0x157))/0x8*(-parseInt(p(0x17b))/0x9)+parseInt(p(0x193))/0xa;if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a10Q,0xed210));function a10L(Q,L){const z=a10Q();return a10L=function(A,b){A=A-0x11d;let M=z[A];return M;},a10L(Q,L);}var __awaiter=this&&this['__awaiter']||function(Q,L,z,A){function b(M){return M instanceof z?M:new z(function(S){S(M);});}return new(z||(z=Promise))(function(M,S){const P=a10L;function k(Z){const e=a10L;try{q(A[e(0x173)](Z));}catch(V){S(V);}}function i(Z){const s=a10L;try{q(A[s(0x141)](Z));}catch(V){S(V);}}function q(Z){const X=a10L;Z[X(0x1ad)]?M(Z['value']):b(Z[X(0x196)])[X(0x16e)](k,i);}q((A=A[P(0x181)](Q,L||[]))['next']());});},__importDefault=this&&this[a10y(0x191)]||function(Q){const Q0=a10y;return Q&&Q[Q0(0x158)]?Q:{'default':Q};};Object[a10y(0x122)](exports,'__esModule',{'value':!![]}),exports['CliLogs']=void 0x0;const js_client_1=require(a10y(0x133)),chalk_1=__importDefault(require(a10y(0x18c))),utils_1=require(a10y(0x123)),inquirer_helper_1=require(a10y(0x145)),commander_1=require(a10y(0x169)),console_format_helpers_1=require(a10y(0x1b5)),log_formatter_1=require('./log-formatter');function a10Q(){const QA=['getCommand','\x20for\x20container\x20','runId','apply','printInitInfo','ApiClient','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','getSeconds','--noDefaults','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','Option','4696888gBSCVU','375678ZfSVrt','close','chalk','CliLogs','Restore\x20to\x20get\x20logs\x20from','\x20(exit\x20with\x20','--restore\x20--restoreId\x20[restoreId]','__importDefault','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','18031460TslMiM','regexNotIncludes','defaultDurationSeconds','value','getCurrentProjectName','95BXizwT','--build\x20--buildId\x20[buildId]','Build\x20to\x20get\x20logs\x20from','pagination','jobId','textNotIncludes','assign','askForAddonBackup','LogType','setSeconds','default','yml','logsApiClient','logRange','buildId','formatLogLine','Error\x20while\x20fetching\x20log\x20lines:\x20','\x20with\x20live-tailing','>\x20Container\x20logs','addonId','length','done','Get\x20logs\x20generated\x20after\x20this\x20time,\x20','getCurrentServiceName','backward','Id]','InquirerHelper',',\x20to:\x20','--regexIncludes\x20<regex>','../formatting/console-format-helpers',',\x20restore\x20id\x20','tsHint','details','serviceId','apiClient','choices','tail','addon','\x20to\x20get\x20logs\x20from','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','start','-d,\x20--direction\x20<order>','defineProperty','../utils','name','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','containerId','askForJob','toISOString','stringify','noDefaults','Get\x20log\x20for\x20the\x20specified\x20','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','askForAddonRestore','addonBackup','\x20in\x20project\x20','format','values','cursor','@northflank/js-client','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','--backup\x20--backupId\x20[backupId]','slice','askForProject','--regexNotIncludes\x20<regex>','backupId','Number\x20of\x20lines\x20to\x20return.','toUpperCase','build-','alias','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.',',\x20duration:\x20','--textIncludes\x20<text>','throw','error','warning','parseDateInput','../inquirer-helper','askForContainer','service','textIncludes','inquirerHelper','conflicts','assertContextExisting',',\x20backup\x20id\x20','getStandardLogCommand','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','2FlMuSx','\x20seconds','description','Log\x20session\x20ended','--run\x20--runId\x20[runId]','1716367DqgXxP','log','hasNextPage','56XTsYjv','__esModule','logs','apiContext','bold','Id\x20[','askForService','argParser','-t,\x20--types\x20<types...>','customUserAgent','addonRestore','job','yaml','--duration\x20[duration]','logTail','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','--startTime\x20<timestamp>','7204580zapxOI','commander','data','regexIncludes','message','getFormatter','then','--container\x20--containerId\x20[containerId]','printResponse','--project\x20--projectId\x20[projectId]','--endTime\x20<timestamp>','next','json','askForJobRun','-f,\x20--tail','1605228vWTCeb','\x0aDetails:\x20','option','addOption','2119653wudeWo','action','forEach'];a10Q=function(){return QA;};return a10Q();}class CliLogs{constructor(Q){const Q1=a10y;this[Q1(0x15a)]=Q,this[Q1(0x195)]=0x708,this[Q1(0x14d)]=(L,z,A,b)=>{const Q2=Q1,M=(0x0,utils_1[Q2(0x17e)])(!![])[Q2(0x124)]((z?'build-':'')+Q2(0x159))[Q2(0x13d)]((z?Q2(0x13c):'')+Q2(0x155))[Q2(0x151)](Q2(0x12b)+L)['option'](Q2(0x171),'Project\x20for\x20logs')['option']('--'+L+'\x20--'+L+Q2(0x15c)+L+Q2(0x1b1),L['charAt'](0x0)[Q2(0x13b)]()+L[Q2(0x136)](0x1)+Q2(0x11e))['option'](Q2(0x16f),Q2(0x14e));if(z)M['option'](Q2(0x199),Q2(0x19a));if(L===Q2(0x162))M['option'](Q2(0x153),Q2(0x12c));if(A)M['option'](Q2(0x135),'Backup\x20to\x20get\x20logs\x20from');if(b)M['option'](Q2(0x190),Q2(0x18e));return!z&&!A&&!b&&M[Q2(0x17a)](new commander_1[(Q2(0x188))](Q2(0x15f),'Which\x20log\x20types\x20to\x20fetch')[Q2(0x1bb)](Object[Q2(0x131)](js_client_1[Q2(0x1a0)]))),M['option'](Q2(0x176),Q2(0x13e))[Q2(0x179)]('-l,\x20--lineLimit\x20[limit]',Q2(0x13a))[Q2(0x179)](Q2(0x167),Q2(0x1ae)+utils_1[Q2(0x1b7)],utils_1[Q2(0x144)])[Q2(0x17a)](new commander_1[(Q2(0x188))](Q2(0x172),'Get\x20logs\x20generated\x20before\x20this\x20time,\x20'+utils_1[Q2(0x1b7)])[Q2(0x15e)](utils_1[Q2(0x144)])[Q2(0x14a)]([Q2(0x1bc)]))[Q2(0x179)](Q2(0x164),Q2(0x187))['addOption'](new commander_1[(Q2(0x188))](Q2(0x121),Q2(0x166))[Q2(0x1bb)]([Q2(0x1b0),'forward'])['conflicts']([Q2(0x1bc)]))[Q2(0x17a)](new commander_1['Option'](Q2(0x140),'Filter\x20log\x20lines\x20to\x20include\x20this\x20text')[Q2(0x14a)]([Q2(0x19d),Q2(0x16b),Q2(0x194)]))[Q2(0x17a)](new commander_1['Option']('--textNotIncludes\x20<text>','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text')[Q2(0x14a)]([Q2(0x148),'regexIncludes',Q2(0x194)]))['addOption'](new commander_1['Option'](Q2(0x1b4),'Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression')[Q2(0x14a)]([Q2(0x19d),Q2(0x148),Q2(0x194)]))[Q2(0x17a)](new commander_1[(Q2(0x188))](Q2(0x138),Q2(0x192))['conflicts']([Q2(0x19d),Q2(0x16b),Q2(0x148)]))[Q2(0x179)](Q2(0x186),Q2(0x11f),![])[Q2(0x17a)](new commander_1[(Q2(0x188))]('-o,\x20--output\x20[output]',Q2(0x125))['choices'](Object[Q2(0x131)]([Q2(0x130),Q2(0x174),Q2(0x163)]))),M;},this[Q1(0x182)]=(L,z,A,b)=>{const Q3=Q1,{containerName:M,restoreId:S,backupId:k,quiet:i,tail:q,startTime:Z,endTime:V,duration:d}=b;if(i===!![])return;const a=q?Q3(0x18f)+chalk_1['default'][Q3(0x15b)]('\x27Ctrl+C\x27')+')':'',G=q?Q3(0x1a9):'',I=new Date(),g=Z!==null&&Z!==void 0x0?Z:new Date(new Date((V!==null&&V!==void 0x0?V:I)['valueOf']())[Q3(0x1a1)]((V!==null&&V!==void 0x0?V:I)[Q3(0x185)]()-(d!==null&&d!==void 0x0?d:this[Q3(0x195)]))),O=(V!==null&&V!==void 0x0?V:Z!==undefined)?new Date(new Date(Z['valueOf']())[Q3(0x1a1)](Z[Q3(0x185)]()+(d!==null&&d!==void 0x0?d:this[Q3(0x195)]))):I,Y=k!==undefined,j=g&&!Y?',\x20from:\x20'+chalk_1[Q3(0x1a2)][Q3(0x15b)](g[Q3(0x128)]()):'',B=O&&!Y?Q3(0x1b3)+chalk_1['default'][Q3(0x15b)](O['toISOString']()):'',l=d?Q3(0x13f)+d+Q3(0x150):'',o=M?Q3(0x17f)+chalk_1[Q3(0x1a2)][Q3(0x15b)](M):Y?'':'\x20for\x20all\x20containers',r=k?Q3(0x14c)+k:'',E=S?Q3(0x1b6)+S:'',N=L+'\x20'+chalk_1[Q3(0x1a2)]['bold'](z)+r+E+Q3(0x12f)+chalk_1[Q3(0x1a2)][Q3(0x15b)](A),T=''+j+B+l;console[Q3(0x155)](Q3(0x1aa)+G+o+'\x20of\x20'+N+T+a+':');},this[Q1(0x16d)]=(L,z)=>(A,b)=>{const Q4=Q1;if(!L){if(A[Q4(0x1ac)]===0x0)console[Q4(0x155)](Q4(0x134));A[Q4(0x17d)](M=>(0x0,log_formatter_1[Q4(0x1a7)])(M,z));}else(0x0,console_format_helpers_1[Q4(0x170)])(L,A);(b===null||b===void 0x0?void 0x0:b[Q4(0x156)])&&(0x0,utils_1[Q4(0x143)])(Q4(0x184)+b[Q4(0x132)]);},this[Q1(0x1ba)]=new js_client_1[(Q1(0x183))](Q,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Q1(0x160)]}),this[Q1(0x1a4)]=this['apiClient'],this[Q1(0x149)]=new inquirer_helper_1[(Q1(0x1b2))](this[Q1(0x1ba)]);}['getLogsCommand'](Q,L=![],z=![],A=![]){const QL=a10y,b=(Z,V)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q5=a10L,d=V[Q5(0x12a)],{apiContext:a,inquirerHelper:G}=this;switch(Q){case Q5(0x147):{const I=d?undefined:a[Q5(0x1af)]();return V[Q5(0x1b9)]||I||(yield G[Q5(0x15d)](Z)());}case Q5(0x162):{const g=d?undefined:a['getCurrentJobName']();return V[Q5(0x19c)]||g||(yield G[Q5(0x127)](Z)());}case Q5(0x11d):{return V[Q5(0x1ab)]||(yield G['askForAddon'](Z)());}}}),M=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q6=a10L;if(L)return d[Q6(0x1a6)]||(yield this[Q6(0x149)]['askForBuild'](Z,Q==='service'?V:undefined,Q===Q6(0x162)?V:undefined,!![])());return undefined;}),S=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q7=a10L;if(z||A)return d[Q7(0x139)]||(yield this[Q7(0x149)][Q7(0x19f)](Z,V)());return undefined;}),k=(Z,V,d,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q8=a10L;if(A)return a['restoreId']||(yield this[Q8(0x149)][Q8(0x12d)](Z,V,d)());return undefined;}),i=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Q9=a10L;if(!L&&d[Q9(0x126)]!==undefined){if(d[Q9(0x126)]!==!![])return d[Q9(0x126)];return yield this[Q9(0x149)][Q9(0x146)](Z,Q===Q9(0x147)?V:undefined,Q===Q9(0x162)?V:undefined,!![])();}return undefined;}),q=(Z,V,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const QQ=a10L;if(Q===QQ(0x162))return d[QQ(0x180)]||(yield this[QQ(0x149)][QQ(0x175)](V,Z,!![])());return undefined;});return this[QL(0x14d)](Q,L,z,A)[QL(0x17c)](Z=>__awaiter(this,void 0x0,void 0x0,function*(){const Qz=QL,{noDefaults:V,projectId:d,quiet:a,tail:G,types:I,textIncludes:g,textNotIncludes:O,regexIncludes:Y,regexNotIncludes:j,direction:B,lineLimit:l,startTime:o,endTime:r,duration:E,output:N}=Z;(0x0,utils_1[Qz(0x14b)])(this[Qz(0x1ba)]);const {apiContext:T,inquirerHelper:v,logsApiClient:h}=this,C=V?undefined:T[Qz(0x197)](),W=d||C||(yield v[Qz(0x137)]()),w=yield b(W,Z),H=yield M(W,w,Z),x=yield S(W,w,Z),J=yield k(W,w,x,Z),u=yield q(W,w,Z),n=yield i(W,w,Z);if(o&&r&&E)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const R={'projectId':W,'entityId':w},m={'containerName':n,'types':I,'textIncludes':g,'textNotIncludes':O,'regexIncludes':Y,'regexNotIncludes':j,'lineLimit':l,'startTime':o,'duration':E,'runId':u,'buildId':H,'backupId':x,'restoreId':J,'isBuild':L!==null&&L!==void 0x0?L:![]},F=A?Qz(0x161):z?Qz(0x12e):Q,t=Object[Qz(0x19e)](Object[Qz(0x19e)]({},m),{'endTime':r,'direction':B});if(!a&&N!==Qz(0x163)&&N!==Qz(0x1a3)&&N!==Qz(0x174))this[Qz(0x182)](Q,w,W,Object[Qz(0x19e)](Object['assign']({},t),Z));const f=this[Qz(0x16d)](N,g!==null&&g!==void 0x0?g:Y);if(G){const K=yield h[Qz(0x159)][Qz(0x165)](R,m,F);K['on']('logs-received',f),K['on'](Qz(0x142),D=>(0x0,utils_1[Qz(0x142)])('Error\x20while\x20tailing\x20log\x20lines:\x20'+D[Qz(0x16c)])),K['on'](Qz(0x18b),()=>console[Qz(0x155)](Qz(0x152))),yield K[Qz(0x120)]();}else{const D=yield h[Qz(0x159)][Qz(0x1a5)](R,t,F);if(D[Qz(0x142)]){const c=D['error'][Qz(0x1b8)],U=c?Qz(0x178)+JSON[Qz(0x129)](c,null,'\x20'):'';(0x0,utils_1[Qz(0x142)])(Qz(0x1a8)+D[Qz(0x142)][Qz(0x16c)]+U);}else f(D[Qz(0x16a)],D[Qz(0x19b)]);}}));}}exports[a10y(0x18d)]=CliLogs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a11Z=a11L;(function(Q,L){const q=a11L,z=Q();while(!![]){try{const A=parseInt(q(0x7f))/0x1*(-parseInt(q(0x79))/0x2)+parseInt(q(0x98))/0x3+-parseInt(q(0x83))/0x4+parseInt(q(0x8c))/0x5*(-parseInt(q(0x91))/0x6)+parseInt(q(0x77))/0x7*(-parseInt(q(0x85))/0x8)+parseInt(q(0x7a))/0x9*(-parseInt(q(0x93))/0xa)+parseInt(q(0x88))/0xb*(parseInt(q(0x80))/0xc);if(A===L)break;else z['push'](z['shift']());}catch(b){z['push'](z['shift']());}}}(a11Q,0xc8fb8));var __importDefault=this&&this[a11Z(0x7c)]||function(Q){const V=a11Z;return Q&&Q[V(0x84)]?Q:{'default':Q};};Object[a11Z(0x97)](exports,a11Z(0x84),{'value':!![]}),exports[a11Z(0x8d)]=exports['defaultLogSyntax']=void 0x0;const chalk_1=__importDefault(require(a11Z(0x92)));exports[a11Z(0x87)]=[{'color':a11Z(0x86),'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':a11Z(0x86),'pattern':/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]+)?Z/i},{'color':'grey','pattern':/[0-9]{4}\/[0-9]{2}\/[0-9]{2}/i},{'color':'grey','pattern':/\s\b([0-9]{2}:){1,2}[0-9]{2}\b\s/i},{'color':a11Z(0x94),'pattern':new RegExp(a11Z(0x95),'i')},{'color':a11Z(0x8e),'pattern':/(?:\d{1,3}\.){3}\d{1,3}/i},{'color':'green','pattern':/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/},{'color':'blue','pattern':/\b(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH)\b/},{'color':a11Z(0x96),'pattern':/\b(successful|success|completed|complete|done)\b/i},{'color':a11Z(0x82),'pattern':/\b(failed|fail|stderr|error|err)\b/i},{'color':a11Z(0x81),'pattern':/\b(information|info|debug)\b/i},{'color':'yellow','pattern':/\b(warning|warn)\b/i},{'color':'blue','pattern':/[0-9a-f]{64}/i},{'color':a11Z(0x8a),'pattern':/[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}/i}];const formatLogLine=(Q,L)=>{const d=a11Z,z=chalk_1[d(0x78)][d(0x7b)](Q['ts'][d(0x89)]()),A=chalk_1[d(0x78)][d(0x8f)](Q[d(0x8b)]),b=exports[d(0x87)]['reduce']((S,k)=>{const a=d;return S[a(0x7d)](k['pattern'],i=>k[a(0x90)]?chalk_1[a(0x78)][k[a(0x90)]](i):chalk_1['default']['grey'](i));},Q[d(0x7e)]),M=L?b[d(0x7d)](new RegExp(L,'g'),S=>chalk_1['default'][d(0x94)](S)):b;console[d(0x7e)](z+'\x20'+A+'\x20--\x20'+M);};exports[a11Z(0x8d)]=formatLogLine;function a11L(Q,L){const z=a11Q();return a11L=function(A,b){A=A-0x77;let M=z[A];return M;},a11L(Q,L);}function a11Q(){const G=['22293744oSYAnQ','gray','red','1287952ahVzFE','__esModule','41848YZBWBz','grey','defaultLogSyntax','33hiIERb','toISOString','blue','containerId','40cvAxYE','formatLogLine','green','cyan','color','947082BkbUAX','chalk','9564050ptDmei','bold','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','greenBright','defineProperty','1477854hqcjAJ','1785mdDAtM','default','754Brdnsw','9HMjGeI','dim','__importDefault','replace','log','3628EPEcpC'];a11Q=function(){return G;};return a11Q();}
|