@northflank/cli 0.9.19 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-helpers.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/contextCommands.js +1 -1
- package/dist/defaults.js +1 -1
- package/dist/exec/index.js +1 -1
- package/dist/formatting/command-overview.js +1 -1
- package/dist/formatting/console-format-helpers.js +1 -1
- package/dist/formatting/terminal-chart.js +1 -1
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/logs/index.js +1 -1
- package/dist/logs/log-formatter.js +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/pagination/inquirer-pagination-prompt.js +1 -1
- package/dist/pagination/pagination-helper.js +1 -1
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a4o
|
|
1
|
+
'use strict';const a4P=a4o;(function(e,o){const H=a4o,h=e();while(!![]){try{const p=-parseInt(H(0x1a4))/0x1*(parseInt(H(0x196))/0x2)+parseInt(H(0x155))/0x3*(-parseInt(H(0x1ac))/0x4)+parseInt(H(0x198))/0x5*(-parseInt(H(0x169))/0x6)+-parseInt(H(0x177))/0x7+parseInt(H(0x18c))/0x8*(-parseInt(H(0x162))/0x9)+parseInt(H(0x1aa))/0xa+parseInt(H(0x1a9))/0xb*(parseInt(H(0x1b6))/0xc);if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a4e,0xd8cab));function a4o(e,o){const h=a4e();return a4o=function(p,Y){p=p-0x14b;let q=h[p];return q;},a4o(e,o);}var __awaiter=this&&this[a4P(0x1b7)]||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const c=a4o;function v(Z){const V=a4o;try{I(p[V(0x19d)](Z));}catch(k){J(k);}}function s(Z){try{I(p['throw'](Z));}catch(k){J(k);}}function I(Z){const u=a4o;Z[u(0x190)]?q(Z[u(0x1b1)]):Y(Z[u(0x1b1)])[u(0x1b4)](v,s);}I((p=p['apply'](e,o||[]))[c(0x19d)]());});},__importDefault=this&&this[a4P(0x16f)]||function(e){const n=a4P;return e&&e[n(0x178)]?e:{'default':e};};Object[a4P(0x197)](exports,'__esModule',{'value':!![]}),exports[a4P(0x171)]=void 0x0;const js_client_1=require(a4P(0x158)),chalk_1=__importDefault(require('chalk')),utils_1=require(a4P(0x1ae)),inquirer_helper_1=require(a4P(0x17d));class CliExec{constructor(e){const d=a4P;this[d(0x174)]=Y=>(0x0,utils_1[d(0x15e)])(!![])[d(0x159)](Y)['description'](d(0x153)+Y+d(0x18e)+Y+d(0x165)+Y+d(0x1b0)+Y+d(0x16d)+Y+d(0x14d))['option'](d(0x1a0),'Project\x20for\x20exec')['option']('--'+Y+d(0x15c)+Y+d(0x16a),Y[d(0x195)](0x0)[d(0x1a1)]()+Y[d(0x188)](0x1)+d(0x172))[d(0x163)]('--container\x20--containerId\x20[NAME]',d(0x17b))['option'](d(0x19f),d(0x186))[d(0x163)](d(0x166),'Run\x20command\x20with\x20this\x20user')[d(0x163)](d(0x176),d(0x192))[d(0x163)]('--noDefaults','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])[d(0x163)](d(0x181),'Command\x20to\x20execute.\x0aIf\x20--shell-cmd\x20option\x20such\x20as\x20\x27bash\x20-c\x27\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell.\x20Otherwise\x20the\x20command\x20will\x20run\x20without\x20a\x20shell.\x20If\x20no\x20command\x20is\x20provided,\x20an\x20interactive\x20session\x20with\x20stdin\x20and\x20tty\x20is\x20opened.'),this[d(0x160)]=()=>({'columns':process[d(0x179)][d(0x17c)],'rows':process[d(0x179)][d(0x14f)]}),this[d(0x1b5)]=(Y,q,J,v,s,I,Z,k)=>{const j=d;if(k===!![])return;const L=v===j(0x1ab),F=L?j(0x1af):v===undefined?'with\x20shell\x20session':j(0x18d)+chalk_1[j(0x182)][j(0x1ad)](v),W=s!==undefined?j(0x189)+s:'',N=I!==undefined?j(0x151)+I:'',g=Z!==undefined?'with\x20command\x20\x27'+chalk_1[j(0x182)][j(0x1ad)](Z)+'\x27':'',w=[g,F,W,N][j(0x161)](x=>x!=='')[j(0x1b9)]('\x20'),C='(exit\x20with\x20two\x20quick\x20'+chalk_1[j(0x182)][j(0x19a)](j(0x15a))+')';console[j(0x1a7)]('Exec\x20'+Y+'\x20'+chalk_1[j(0x182)][j(0x19a)](q)+j(0x17f)+chalk_1[j(0x182)][j(0x19a)](J)+'\x20'+w+'\x20'+C);},this[d(0x1b3)]=(Y,q,J=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=d;var v,s;let I=![];try{if(process[Q(0x1ba)][Q(0x184)]){const k=require(Q(0x157));k[Q(0x15f)](process['stdin']),process['stdin']['setRawMode'](!![]),process['stdout']['on']('resize',()=>{const D=Q;Y[D(0x191)](this['getTerminalSize']());}),process[Q(0x1ba)]['on'](Q(0x170),(L,F)=>{const f=Q;F[f(0x187)]==='\x04'&&(I?(process[f(0x1ba)][f(0x183)](![]),(0x0,utils_1['warning'])(f(0x19b)),process[f(0x18f)]()):(I=!![],setTimeout(()=>I=![],0x190)));});}process[Q(0x1ba)][Q(0x14c)](Y[Q(0x1a3)]),Y[Q(0x16b)][Q(0x14c)](process['stderr']),Y[Q(0x19e)][Q(0x14c)](process['stdout']),Y['on']('error',L=>{const i=Q;var F;(0x0,utils_1[i(0x173)])(i(0x1a5)+q+i(0x1bb)+((F=L['message'])!==null&&F!==void 0x0?F:L)),process['stdin'][i(0x184)]&&process[i(0x1ba)][i(0x183)](![]),process['exit'](-0x1);});const Z=yield Y[Q(0x14b)]();if(J!==!![]){const L=(v=Z===null||Z===void 0x0?void 0x0:Z[Q(0x1b2)])!==null&&v!==void 0x0?v:Q(0x168),F=(s=Z===null||Z===void 0x0?void 0x0:Z['exitCode'])!==null&&s!==void 0x0?s:-0x1,W=(Z===null||Z===void 0x0?void 0x0:Z['message'])?Q(0x194)+Z[Q(0x199)]:'';L===Q(0x17a)?(0x0,utils_1[Q(0x152)])(Q(0x156)+F):(0x0,utils_1[Q(0x1a6)])(Q(0x14e)+L+Q(0x1a8)+F+W);}return Z;}finally{process[Q(0x1ba)]['isTTY']&&process['stdin'][Q(0x183)](![]);}}),this[d(0x16c)]=new js_client_1['ApiClient'](e,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']});const o=new inquirer_helper_1[(d(0x185))](this[d(0x16c)]);this['execCmd']=(0x0,utils_1[d(0x15e)])()[d(0x159)](d(0x193))[d(0x150)](d(0x180))[d(0x17e)](d(0x154));const h=this['getStandardExecCommand']('service')[d(0x164)](Y=>__awaiter(this,void 0x0,void 0x0,function*(){const R=d,{noDefaults:q,projectId:J,serviceId:v,containerId:s,shellCmd:I,user:Z,group:k,command:L,quiet:F}=Y;(0x0,utils_1[R(0x18b)])(this[R(0x16c)]);try{const W=q?undefined:e[R(0x15b)](),N=J||W||(yield o[R(0x15d)]()),g=q?undefined:e[R(0x1a2)](),w=v||g||(yield o[R(0x16e)](N)()),C=I!==null&&I!==void 0x0?I:L!==undefined?R(0x1ab):undefined;this[R(0x1b5)]('service',w,N,C,Z,k,L,F);const x=process[R(0x179)][R(0x17c)],l=process[R(0x179)]['rows'],b={'projectId':N,'serviceId':w},a=yield this[R(0x16c)]['exec']['execServiceSession'](b,{'containerName':s,'command':L,'shell':C,'user':Z,'group':k,'ttyColumns':x,'ttyRows':l});yield this[R(0x1b3)](a,'service',F);}catch(z){(0x0,utils_1[R(0x173)])(''+z[R(0x199)]);}finally{process[R(0x18f)]();}})),p=this[d(0x174)](d(0x175))['action'](Y=>__awaiter(this,void 0x0,void 0x0,function*(){const t=d,{projectId:q,jobId:J,containerId:v,noDefaults:s,shellCmd:I,user:Z,group:k,command:L,quiet:F}=Y;(0x0,utils_1[t(0x18b)])(this['apiClient']);try{const W=s?undefined:e[t(0x15b)](),N=q||W||(yield o['askForProject']()),g=J||(yield o[t(0x18a)](N)());this[t(0x1b5)](t(0x175),g,N,I,F);const {rows:w,columns:C}=this[t(0x160)](),x={'projectId':N,'jobId':g},l=yield this['apiClient']['exec'][t(0x19c)](x,{'containerName':v,'command':L,'shell':I,'user':Z,'group':k,'ttyColumns':C,'ttyRows':w});yield this[t(0x1b3)](l,t(0x175),F);}catch(b){(0x0,utils_1[t(0x173)])(''+b[t(0x199)]);}finally{process[t(0x18f)]();}}));this['execCmd']['addCommand'](h),this[d(0x1b8)][d(0x167)](p);}}function a4e(){const G=['keypress','CliExec','\x20to\x20exec\x20into','error','getStandardExecCommand','job','--group\x20[GROUP]','80528xKHSPT','__esModule','stdout','Success','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','columns','../inquirer-helper','description','\x20in\x20project\x20','exec','--cmd\x20--command\x20[COMMAND]','default','setRawMode','isTTY','InquirerHelper','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.','sequence','slice','with\x20user:','askForJob','assertContextExisting','24zunfcV','shell\x20command\x20','.\x0aExamples:\x0a\x20\x20Shell\x20session:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20northflank\x20exec\x20','exit','done','resizeTerminal','Run\x20command\x20with\x20this\x20group','command-exec',',\x20details:\x20','charAt','2061418PJVtTM','defineProperty','110XQqiFw','message','bold','Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.','execJobSession','next','stdOut','--shell-cmd\x20[SHELL-CMD]','--project\x20--projectId\x20[NAME]','toUpperCase','getCurrentServiceName','stdIn','1vkSzcE','Error\x20occured\x20during\x20','warning','log',',\x20exit\x20code:\x20','32886271nLarif','570350pMjgIn','none','1140xSVPpy','greenBright','../utils','without\x20shell','\x20--cmd\x20\x27date\x27\x0a\x20\x20Single\x20command,\x20custom\x20shell:\x20northflank\x20exec\x20','value','status','handleShellSession','then','execStartLog','12NGKYqW','__awaiter','execCmd','join','stdin','\x20command\x20exec:\x20','waitForCommandResult','pipe','\x20--shell-cmd\x20\x27sh\x27','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','rows','alias','with\x20group:','success','Command\x20exec\x20for\x20the\x20specified\x20','Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.','1263ErkRih','Command\x20completed\x20successfully,\x20exit\x20code:\x20','readline','@northflank/js-client','name','\x27Ctrl+D\x27','getCurrentProjectName','\x20--','askForProject','getCommand','emitKeypressEvents','getTerminalSize','filter','1520595IIssKi','option','action','\x0a\x20\x20Single\x20command,\x20no\x20shell:\x20\x20\x20\x20\x20northflank\x20exec\x20','--user\x20[USER]','addCommand','Unknown','133542YRDcXB','Id\x20[NAME]','stdErr','apiClient','\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','askForService','__importDefault'];a4e=function(){return G;};return a4e();}exports['CliExec']=CliExec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a5a=a5o;(function(e,o){const b=a5o,h=e();while(!![]){try{const p=parseInt(b(0x1a0))/0x1*(-parseInt(b(0x1b0))/0x2)+-parseInt(b(0x1ad))/0x3*(parseInt(b(0x196))/0x4)+-parseInt(b(0x1a9))/0x5+parseInt(b(0x19b))/0x6*(-parseInt(b(0x19d))/0x7)+-parseInt(b(0x1ae))/0x8+-parseInt(b(0x195))/0x9*(parseInt(b(0x1ba))/0xa)+parseInt(b(0x199))/0xb;if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a5e,0x6df7f));function a5e(){const j=['slice','2015154qFrELW','12fuqhcS','Prints\x20a\x20tree\x20view\x20of\x20all\x20available\x20commands','green','34918048Sqdxag','value','4687500CFBwEo','__awaiter','7MhiOHA','__esModule','description','507644xVirJz','default','throw','getCommandOverview','getCommand','commands','../utils','apply','join','748415zxHgkI','command-overview','forEach','then','899163uzqRoZ','1298328esCtMd','next','2VMOZYY','length','every','name','map','log','--verbose','action','chalk','done','10ByqJuh'];a5e=function(){return j;};return a5e();}var __awaiter=this&&this[a5a(0x19c)]||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const V=a5o;function v(Z){const z=a5o;try{I(p[z(0x1af)](Z));}catch(k){J(k);}}function s(Z){const H=a5o;try{I(p[H(0x1a2)](Z));}catch(k){J(k);}}function I(Z){const P=a5o;Z[P(0x1b9)]?q(Z[P(0x19a)]):Y(Z[P(0x19a)])[P(0x1ac)](v,s);}I((p=p[V(0x1a7)](e,o||[]))[V(0x1af)]());});},__importDefault=this&&this['__importDefault']||function(e){const u=a5a;return e&&e[u(0x19e)]?e:{'default':e};};Object['defineProperty'](exports,a5a(0x19e),{'value':!![]}),exports[a5a(0x1a3)]=void 0x0;const chalk_1=__importDefault(require(a5a(0x1b8))),utils_1=require(a5a(0x1a6));function a5o(e,o){const h=a5e();return a5o=function(p,Y){p=p-0x194;let q=h[p];return q;},a5o(e,o);}function getCommandOverview(e){const c=a5a;return(0x0,utils_1[c(0x1a4)])()['name'](c(0x1aa))[c(0x19f)](c(0x197))['option'](c(0x1b6),'Print\x20command\x20descriptions')[c(0x1b7)](o=>__awaiter(this,void 0x0,void 0x0,function*(){const {verbose:h}=o;function p(Y,q){const n=a5o;var J;const v=(C,x=!![])=>x?chalk_1[n(0x1a1)]['bold'][n(0x198)](C[n(0x1b3)]()):C['name'](),s=q[n(0x1b1)]===0x0,I=Y[n(0x1a5)];let Z='';const k=I[n(0x1b1)]===0x0,L=k||((J=Object['keys'](Y===null||Y===void 0x0?void 0x0:Y['opts']()))===null||J===void 0x0?void 0x0:J[n(0x1b1)])>0x0;!s&&(Z=I&&!k?'┬\x20':'─\x20');const F=h&&L&&Y[n(0x19f)]()?':\x20'+Y[n(0x19f)]():'';console[n(0x1b5)](''+q+Z+v(Y,L)+F);let W=q;if(!s){const C=q[n(0x194)](-0x2)==='└─';W=q['slice'](0x0,-0x2)+(C?'\x20\x20':'│\x20');}const N=W+'├─',g=W+'└─',w=I[n(0x1b2)](x=>x[n(0x1a5)]['length']===0x0);w&&!k&&!h?console['log'](g+'\x20'+I[n(0x1b4)](x=>v(x))[n(0x1a8)](',\x20')):I[n(0x1ab)]((x,l)=>{const d=n;p(x,I[d(0x1b1)]-0x1===l?g:N);});}p(e,'');}));}exports[a5a(0x1a3)]=getCommandOverview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a6o(e,o){const h=a6e();return a6o=function(p,Y){p=p-0x73;let q=h[p];return q;},a6o(e,o);}const a6N=a6o;(function(e,o){const W=a6o,h=e();while(!![]){try{const p=parseInt(W(0x75))/0x1+parseInt(W(0x77))/0x2+-parseInt(W(0x8c))/0x3+parseInt(W(0x9a))/0x4*(-parseInt(W(0x94))/0x5)+-parseInt(W(0x9c))/0x6+-parseInt(W(0x99))/0x7*(parseInt(W(0xa0))/0x8)+parseInt(W(0xa6))/0x9*(parseInt(W(0x86))/0xa);if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a6e,0xa3de9));var __createBinding=this&&this[a6N(0x76)]||(Object[a6N(0x84)]?function(e,h,p,Y){const g=a6N;if(Y===undefined)Y=p;var q=Object[g(0x7d)](h,p);(!q||(g(0x85)in q?!h[g(0xa9)]:q[g(0xa3)]||q[g(0x80)]))&&(q={'enumerable':!![],'get':function(){return h[p];}}),Object['defineProperty'](e,Y,q);}:function(e,h,p,Y){if(Y===undefined)Y=p;e[Y]=h[p];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a6N(0x84)]?function(e,h){const w=a6N;Object[w(0x8d)](e,w(0x88),{'enumerable':!![],'value':h});}:function(e,h){const C=a6N;e[C(0x88)]=h;}),__importStar=this&&this[a6N(0x7f)]||function(e){const x=a6N;if(e&&e[x(0xa9)])return e;var o={};if(e!=null){for(var h in e)if(h!==x(0x88)&&Object['prototype']['hasOwnProperty'][x(0x7b)](e,h))__createBinding(o,e,h);}return __setModuleDefault(o,e),o;},__importDefault=this&&this[a6N(0xb2)]||function(e){const l=a6N;return e&&e[l(0xa9)]?e:{'default':e};};Object[a6N(0x8d)](exports,'__esModule',{'value':!![]}),exports['printResponse']=exports[a6N(0xa4)]=exports['handleYamlOutput']=exports[a6N(0x8a)]=exports['consoleFormat']=exports[a6N(0x83)]=void 0x0;const chalk_1=__importDefault(require(a6N(0xa1))),_=__importStar(require('lodash')),util=__importStar(require(a6N(0xae))),yaml=require('js-yaml'),columnify=require(a6N(0xad));function printAsTable(e,o,h,p=![],Y=0x0){const b=a6N;!p&&console[b(0xb4)](''+chalk_1[b(0x88)][b(0xa2)](o));function q(v){const a=b;return v===a(0xab)?v:v[a(0xa5)]('disabled','');}function J(v,s){const H=b;function I(k){const z=a6o,L=new Date(k);return L[z(0x9d)]()+'/'+L[z(0x7a)]()+'/'+L[z(0x8b)]()+'\x0a'+L[z(0xa8)]()+':'+L['getMinutes']()+':'+L['getSeconds']();}const Z=[H(0x89),'updatedat'];if(Z[H(0xaf)](s[H(0x7c)]())&&_['isFinite'](v)&&v['toString']()[H(0x8e)]===0xd)return I(Number(v));if(_[H(0x8f)](v)){if(s!==H(0xab)&&s['includes'](H(0xab)))return v?'x':'✔';return v?'✔':'x';}if(_[H(0x7e)](v))return util[H(0x87)](v,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});return v;}if(_[b(0x9e)](e)){e[b(0x8e)]===0x0&&console[b(0xb4)](b(0x81)+o[b(0x7c)]()+b(0xaa));const v=e[b(0x9f)]((Z,k)=>{const P=b,L={'i':k+Y};return Object[P(0x78)](Z)[P(0xa7)](F=>{const V=P;(_[V(0xac)](h)||h[V(0xaf)](F[V(0x7c)]()))&&_[V(0x9b)](L,q(F),J(Z[F],F));}),L;}),s=_[b(0x82)](Object[b(0x78)]((v===null||v===void 0x0?void 0x0:v[0x0])||[]))[b(0xb3)]((Z,k)=>{const u=b,L=F=>F!=='i'?F!==u(0xb0)?0x0:0x1:0x2;return L(k)-L(Z);}),I={'maxWidth':0x1e,'preserveNewLines':!![],'showHeaders':!p,'config':{'_id':{'maxWidth':0x5,'truncate':!![]},'i':{'showHeaders':![]}},'columns':s};console['log'](columnify(v,I));}else console[b(0xb4)](e);}exports[a6N(0x83)]=printAsTable;function consoleFormat(e,o){const c=a6N;if(_[c(0x98)](e)){const h=o?c(0x95)+o+')':'';return chalk_1[c(0x88)][c(0x93)]('The\x20request\x20was\x20completed\x20successfully')+h;}if(!_[c(0x7e)](e))return e===null||e===void 0x0?void 0x0:e[c(0x91)]();return util[c(0x87)](e,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});}exports[a6N(0xb1)]=consoleFormat;const handleJsonOutput=(e,o)=>{const n=a6N,h=e===n(0x97);if(h)console[n(0xb4)](JSON[n(0x73)](o,null,'\x20'));};exports[a6N(0x8a)]=handleJsonOutput;const handleYamlOutput=(e,o)=>{const d=a6N,h=e===d(0x74)||e===d(0x96);if(h)console[d(0xb4)](yaml['safeDump'](o));};exports[a6N(0x79)]=handleYamlOutput;const handleFormattedOutput=(e,o)=>{const j=a6N,h=e===j(0x90);if(h)console[j(0xb4)](consoleFormat(o));};exports[a6N(0xa4)]=handleFormattedOutput;const printResponse=(e,o)=>{const Q=a6N;(0x0,exports[Q(0x8a)])(e,o),(0x0,exports[Q(0x79)])(e,o),(0x0,exports['handleFormattedOutput'])(e,o);};exports[a6N(0x92)]=printResponse;function a6e(){const D=['includes','internalId','consoleFormat','__importDefault','sort','log','stringify','yaml','1297238nSXLmd','__createBinding','964036BwSNnq','keys','handleYamlOutput','getMonth','call','toLowerCase','getOwnPropertyDescriptor','isObjectLike','__importStar','configurable','No\x20','clone','printAsTable','create','get','18940180TMFfGF','inspect','default','createdat','handleJsonOutput','getFullYear','2695857uoGWbf','defineProperty','length','isBoolean','format','toString','printResponse','green','1405bpwRRP','\x20(HTTP\x20status:\x20','yml','json','isEmpty','436919EdJFqV','4692eCjfHp','set','6523476UvJDLm','getDate','isArrayLike','map','88YevAmt','chalk','bold','writable','handleFormattedOutput','replace','9tktuDw','forEach','getHours','__esModule','\x20found','disabled','isUndefined','columnify','util'];a6e=function(){return D;};return a6e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a7e(){const e5=['format','toLocaleDateString','length','getAsciiChart','green','repeat','2-digit','\x20\x20\x20','round','offset','defineProperty','map','push','floor','grey','6vcjuTg','8DJnQNG','__esModule','56994wzLvRb','h24','8579774jqCXtU','min','red','undefined','abs','join','padding','3307974sPVXCs','458245XaksXA','2598036xAZkcC','height','__importDefault','1402792AyCRmL','slice','chalk','default','isArray','unit','max','9374508xELfpl','colors','downSampleData'];a7e=function(){return e5;};return a7e();}const a7r=a7o;(function(e,o){const K=a7o,h=e();while(!![]){try{const p=parseInt(K(0x1c0))/0x1*(parseInt(K(0x1bd))/0x2)+parseInt(K(0x1cb))/0x3+-parseInt(K(0x1be))/0x4*(parseInt(K(0x1ca))/0x5)+-parseInt(K(0x1c9))/0x6+parseInt(K(0x1c2))/0x7+parseInt(K(0x1ce))/0x8+-parseInt(K(0x1d5))/0x9;if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a7e,0xa191a));var __importDefault=this&&this[a7r(0x1cd)]||function(e){const B=a7r;return e&&e[B(0x1bf)]?e:{'default':e};};Object[a7r(0x1b8)](exports,a7r(0x1bf),{'value':!![]}),exports[a7r(0x1d7)]=exports[a7r(0x1db)]=void 0x0;const chalk_1=__importDefault(require(a7r(0x1d0))),colored=(e,o)=>{const e0=a7r;return o===undefined?e:chalk_1[e0(0x1d1)][o](e);},getAsciiChart=(e,o={})=>{const e1=a7r,h=Array[e1(0x1d2)](e[0x0])?e:[e];let p=typeof o[e1(0x1c3)]!=='undefined'?o[e1(0x1c3)]:h[0x0][0x0],Y=typeof o[e1(0x1d4)]!=='undefined'?o[e1(0x1d4)]:h[0x0][0x0];for(let a=0x0;a<h[e1(0x1da)];a++){for(let z=0x0;z<h[a][e1(0x1da)];z++){p=Math['min'](p,h[a][z]),Y=Math[e1(0x1d4)](Y,h[a][z]);}}let q=['┼','┤','╶','╴','─','╰','╭','╮','╯','│'],J=Math['abs'](Y-p),v=typeof o[e1(0x1b7)]!==e1(0x1c5)?o[e1(0x1b7)]:0x3,s=typeof o['padding']!==e1(0x1c5)?o[e1(0x1c8)]:'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',I=typeof o['height']!==e1(0x1c5)?o[e1(0x1cc)]:J,Z=typeof o['colors']!==e1(0x1c5)?o[e1(0x1d6)]:['blue',e1(0x1c4),e1(0x1b2),e1(0x1bc),'black'],k=J!==0x0?I/J:0x1,L=Math['round'](p*k),F=Math[e1(0x1b6)](Y*k),W=Math[e1(0x1c6)](F-L),N=0x0;for(let H=0x0;H<h[e1(0x1da)];H++){N=Math['max'](N,h[H][e1(0x1da)]);}N=N+v;let g=typeof o['symbols']!==e1(0x1c5)?o['symbols']:q,w=o['format']!==undefined?o[e1(0x1d8)]:function(P){const e2=e1;return(s+P['toFixed'](0x2)+o[e2(0x1d3)])[e2(0x1cf)](-s[e2(0x1da)]);},C=new Array(W+0x1);for(let P=0x0;P<=W;P++){C[P]=new Array(N);for(let V=0x0;V<N;V++){C[P][V]='\x20';}}for(let u=L;u<=F;++u){const c=w(W>0x0?Y-(u-L)*J/W:u,u-L);C[u-L][Math[e1(0x1d4)](v-c[e1(0x1da)],0x0)]=c,C[u-L][v-0x1]=u==0x0?g[0x0]:g[0x1];}for(let n=0x0;n<h[e1(0x1da)];n++){let d=Z[n%Z['length']],Q=Math[e1(0x1b6)](h[n][0x0]*k)-L;C[W-Q][v-0x1]=colored(g[0x0],d);for(let D=0x0;D<h[n][e1(0x1da)]-0x1;D++){let f=Math[e1(0x1b6)](h[n][D+0x0]*k)-L,R=Math['round'](h[n][D+0x1]*k)-L;if(f==R)C[W-f][D+v]=colored(g[0x4],d);else{C[W-R][D+v]=colored(f>R?g[0x5]:g[0x6],d),C[W-f][D+v]=colored(f>R?g[0x7]:g[0x8],d);let t=Math[e1(0x1c3)](f,R),G=Math[e1(0x1d4)](f,R);for(let S=t+0x1;S<G;S++){C[W-S][D+v]=colored(g[0x9],d);}}}}const {startTs:l,endTs:b}=o;if(l||b){const X=E=>{const e3=e1;if(!E)return e3(0x1b5);const A=E[e3(0x1d9)](undefined,{'day':'2-digit','month':'2-digit','year':e3(0x1b4)}),M=E['toLocaleTimeString'](undefined,{'hourCycle':e3(0x1c1)});return A+'\x20'+M;},m=X(b),U=X(l),T=s[e1(0x1cf)](0x0,Math[e1(0x1d4)](0x2,s['length']-U[e1(0x1da)]/0x2+0x1)),O='\x20'[e1(0x1b3)](Math[e1(0x1d4)](N-(s[e1(0x1da)]+m['length']/0x2),0x1));C['push']([''+T+U+O+m]),C[e1(0x1ba)]([]);}return C[e1(0x1b9)](E=>E[e1(0x1c7)](''))[e1(0x1c7)]('\x0a');};exports[a7r(0x1db)]=getAsciiChart;const downSampleData=(e,o)=>{const e4=a7r,h=e[e4(0x1da)];if(o>=h||o===0x0)return e;const p=[];let Y=0x0;const q=(h-0x2)/(o-0x2);let J=0x0,v,s,I,Z;p[Y++]=e[J];for(var k=0x0;k<o-0x2;k++){let w=0x0,C=0x0,x=Math['floor']((k+0x1)*q)+0x1,l=Math[e4(0x1bb)]((k+0x2)*q)+0x1;l=l<h?l:h;var L=l-x;for(;x<l;x++){w+=e[x][0x0],C+=e[x][0x1];}w/=L,C/=L;var F=Math['floor'](k*q)+0x1,W=Math['floor']((k+0x1)*q)+0x1,N=e[J][0x0],g=e[J][0x1];s=I=-0x1;for(;F<W;F++){I=Math['abs']((N-w)*(e[F][0x1]-g)-(N-e[F][0x0])*(C-g))*0.5,I>s&&(s=I,v=e[F],Z=F);}p[Y++]=v,J=Z;}return p[Y++]=e[h-0x1],p;};function a7o(e,o){const h=a7e();return a7o=function(p,Y){p=p-0x1b2;let q=h[p];return q;},a7o(e,o);}exports[a7r(0x1d7)]=downSampleData;
|
package/dist/inquirer-helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a8T=a8I;function a8u(){const uy=['list','deleteWarningPrompt','for\x20this\x20','defaultPaginationPageSize','loginPrompt','secrets','secret','builds','oneOf','askForTag','isUndefined','cmdPath','512353rXZWEF','tmpCmdPath','tokenPrompt','121012BXbrVa','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','logSinks','addon','askForPipeline','askForResourcePaginated','No,\x20abort','paths','services','restore','confirmationPrompt','getQuestionString','call','registerPrompt','push','credentials','isObject','grey','askForCredentials','isValidJSON','service:\x20\x27','warning','includes','14KCIMWs','YES','search-list','__esModule','pattern','greenBright','filter','Do\x20you\x20want\x20to\x20add','askArrayEntry','ask','__awaiter','940VEBASs','askForTemplateRun','override','uri','yellowBright','confirmation','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','tag','type','apiClient','getType','Enter\x20the\x20','pop','password','cursor','to\x20use:','found','784DIaumk','\x20(full\x20domain:\x20','skipValidation','templates','./utils','subdomain','\x20(completedAt:\x20','isArray','runs','red','done','string','don\x27t\x20change','./api-helpers','getPathString','integer','subdomains','value','isBoolean','success','No,\x20edit','throw','containers','project','hasOwnProperty','chalk','length','No\x20','data','REPEAT','doesn\x27t\x20match\x20pattern\x20\x27','170RgqcDr','editor','askForProjectScopedResourcePaginated','askForJobRun','find','createdAt','Something\x20unexpected\x20happened.','Please\x20confirm\x20following\x20configuration:\x0a','choice','volumes','contextProvider','name','./pagination/inquirer-pagination-prompt','elements','retrievePayloadViaInteractiveCli','),\x20subdomain\x20(','this\x20option\x20is\x20required,\x20please\x20answer','SAVE','resultCache','service\x20build','not\x20completed','all-job-runs','No,\x20but\x20save\x20as\x20file','properties','toString','pipelines','repeat','.*\x5c.(json|yaml|yml)$','map','minLength','pagination-prompt','confirm','\x20type?','addon:\x20\x27','bgGrey','askGeneric','completedAt','get','maximum','example','default','configurable','isNaN','startedAt','blueBright','max','job:\x20\x27','safeLoad','Configuration\x20file\x20written\x20to\x20','askForContainer','token','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','jobs','enum','pathVars','values','input','__importDefault','2352456GJPLBE','__setModuleDefault','create','\x20and\x20it\x20','prompt','domain','domain\x20(','boolean','validate','charAt','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','lodash','Context\x20with\x20name\x20\x27','main-context','askForClusterId','all-builds','backup','backups','Should\x20it\x20be',',\x20supported\x20types:\x20[json|yaml|yml]','path','whiteBright','set','propToType','assign','InquirerHelper','test','description','inquirer','split','has','domains','askForProject','job','1556376hJRCqa','\x20characters,\x20is\x20','No\x20builds\x20found','restores','saveFile','minimum','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','templateRuns','askForTemplate','setPathVars','defineProperty','531bvDEvq','\x20to\x20use:','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','blue','maxLength','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','getOwnPropertyDescriptor','unset','json','reset','then','anyOf','bold','unshift','a\x20Northflank\x20resource','askForService','clusters','__importStar','askForResource','Do\x20you\x20want\x20to\x20add\x20more','Go\x20to\x20editor','\x20characters','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','pipeline','apply','service','stringify','concat','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','projects','askForSecret','green','askForAddonRestore','required','Choose\x20the\x20','\x20in\x20','writable','join','askForDomain','yaml','object','\x20Example:\x20','next','getInnerType','pagination','service\x20containers','underline','writeFileSync','ABORT','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','prototype','No\x20containers\x20found','EDIT','editPayload','message','tags','1019510NklUuZ','addEntry','job\x20builds','\x20(startedAt:\x20','Template\x20id\x20not\x20provided.','js-yaml','Yes,\x20send','fileName','22715VUyfut'];a8u=function(){return uy;};return a8u();}(function(u,I){const X=a8I,a=u();while(!![]){try{const x=-parseInt(X(0x23c))/0x1+parseInt(X(0x227))/0x2+-parseInt(X(0x1c2))/0x3+-parseInt(X(0x23f))/0x4*(-parseInt(X(0x291))/0x5)+parseInt(X(0x1e4))/0x6*(parseInt(X(0x256))/0x7)+parseInt(X(0x272))/0x8*(-parseInt(X(0x1ef))/0x9)+parseInt(X(0x261))/0xa*(-parseInt(X(0x22f))/0xb);if(x===I)break;else a['push'](a['shift']());}catch(D){a['push'](a['shift']());}}}(a8u,0x88e70));var __createBinding=this&&this['__createBinding']||(Object[a8T(0x1c4)]?function(u,I,a,x){const E=a8T;if(x===undefined)x=a;var D=Object[E(0x1f5)](I,a);(!D||('get'in D?!I[E(0x259)]:D[E(0x213)]||D[E(0x1b1)]))&&(D={'enumerable':!![],'get':function(){return I[a];}}),Object[E(0x1ee)](u,x,D);}:function(u,I,a,x){if(x===undefined)x=a;u[x]=I[a];}),__setModuleDefault=this&&this[a8T(0x1c3)]||(Object[a8T(0x1c4)]?function(u,I){const f=a8T;Object['defineProperty'](u,f(0x1b0),{'enumerable':!![],'value':I});}:function(u,I){u['default']=I;}),__importStar=this&&this[a8T(0x200)]||function(u){const N=a8T;if(u&&u['__esModule'])return u;var I={};if(u!=null){for(var a in u)if(a!==N(0x1b0)&&Object[N(0x221)][N(0x28a)][N(0x24b)](u,a))__createBinding(I,u,a);}return __setModuleDefault(I,u),I;},__awaiter=this&&this[a8T(0x260)]||function(u,I,a,x){function D(K){return K instanceof a?K:new a(function(z){z(K);});}return new(a||(a=Promise))(function(K,z){const R=a8I;function H(p){const P=a8I;try{C(x[P(0x219)](p));}catch(b){z(b);}}function s(p){const m=a8I;try{C(x[m(0x287)](p));}catch(b){z(b);}}function C(p){const k=a8I;p[k(0x27c)]?K(p['value']):D(p[k(0x283)])[k(0x1f9)](H,s);}C((x=x[R(0x207)](u,I||[]))['next']());});},__importDefault=this&&this[a8T(0x1c1)]||function(u){const q=a8T;return u&&u[q(0x259)]?u:{'default':u};};function a8I(u,I){const a=a8u();return a8I=function(x,D){x=x-0x1a0;let K=a[x];return K;},a8I(u,I);}Object[a8T(0x1ee)](exports,'__esModule',{'value':!![]}),exports[a8T(0x1db)]=void 0x0;const _=__importStar(require(a8T(0x1cd))),chalk_1=__importDefault(require(a8T(0x28b))),fs=__importStar(require('fs')),utils_1=require(a8T(0x276)),api_helpers_1=require(a8T(0x27f)),inquirer_pagination_prompt_1=require(a8T(0x29d)),inquirer=require(a8T(0x1de)),inquirerSearchList=require('inquirer-search-list'),yaml=require(a8T(0x22c));var ConfirmChoices;(function(u){const M=a8T;u[M(0x257)]=M(0x22d),u[M(0x28f)]='No,\x20repeat',u[M(0x223)]=M(0x286),u[M(0x2a2)]=M(0x2a7),u[M(0x21f)]=M(0x245);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(u){const r=a8T;this[r(0x26a)]=u,this[r(0x233)]=0x32,this[r(0x224)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const o=r,{editedResult:a}=yield inquirer[o(0x1c6)]([{'type':'editor','name':'editedResult','message':o(0x203),'default':yaml['safeDump'](I)}]);return yaml[o(0x1b7)](a);}),this[r(0x1e8)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const w=r,a=z=>'Unexpected\x20file\x20type:\x20'+z+w(0x1d5);function x(){return __awaiter(this,void 0x0,void 0x0,function*(){const h=a8I;return inquirer[h(0x1c6)]([{'type':h(0x1c0),'name':h(0x22e),'message':h(0x1ea),'validate':z=>new RegExp(h(0x1a3))[h(0x1dc)](z)?!![]:a(z)}]);});}const {fileName:D}=yield x(),K=D[w(0x1a0)]()['split']('.')[w(0x26d)]();try{switch(K){case w(0x1f7):(0x0,utils_1[w(0x285)])(w(0x1b8)+D);return fs[w(0x21e)](D,JSON[w(0x209)](I,null,'\x20\x20'));case w(0x216):case'yml':(0x0,utils_1[w(0x285)])(w(0x1b8)+D);return fs[w(0x21e)](D,yaml['safeDump'](I));default:(0x0,utils_1[w(0x254)])(a(K));}}catch(z){(0x0,utils_1[w(0x254)])('Writing\x20configuration\x20failed:\x20'+z[w(0x225)]);}return undefined;}),this[r(0x25c)]=(I,a)=>x=>{const D=typeof x==='string'?x['trim']():x;return a===![]&&D==='don\x27t\x20change'?'':D;},this[r(0x1ca)]=(I,a,x)=>D=>{const W=r;if(this[W(0x274)]===!![])return!![];const K=[];if(D===''||D===W(0x27e)){if(a!==![])K[W(0x24d)](W(0x2a1));else return!![];}I[W(0x269)]===W(0x27d)&&!_[W(0x23a)](I[W(0x25a)])&&K['push'](new RegExp(I['pattern'])[W(0x1dc)](D)?!![]:W(0x290)+I[W(0x25a)]+'\x27');I[W(0x269)]===W(0x27d)&&!_[W(0x23a)](I['minLength'])&&K[W(0x24d)](D[W(0x28c)]>=I[W(0x1a5)]?!![]:W(0x1f1)+I[W(0x1a5)]+'\x20characters,\x20is\x20'+D[W(0x28c)]+W(0x204));I[W(0x269)]===W(0x27d)&&!_[W(0x23a)](I[W(0x1f3)])&&K['push'](D['length']<=I['maxLength']?!![]:W(0x205)+I[W(0x1f3)]+W(0x1e5)+D['length']+W(0x204));x&&Number[W(0x1b2)](parseInt(D,0xa))&&K[W(0x24d)]('must\x20be\x20a\x20number,\x20is\x20'+D);I[W(0x269)]===W(0x281)&&!_['isUndefined'](I[W(0x1e9)])&&K[W(0x24d)](D>=I[W(0x1e9)]?!![]:W(0x267)+I[W(0x1e9)]);I[W(0x269)]===W(0x281)&&!_[W(0x23a)](I['maximum'])&&K[W(0x24d)](D<=I[W(0x1ae)]?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+I[W(0x1ae)]);if(I['type']==='rawObject'){const s=(0x0,utils_1[W(0x252)])(D);K[W(0x24d)](s===![]||_['isEmpty'](s)?W(0x1f4):!![]);}const z=K[W(0x25c)](C=>C!==!![]),H=(I===null||I===void 0x0?void 0x0:I['example'])?'\x0a'+chalk_1['default'][W(0x27b)]('>>')+W(0x218)+chalk_1['default'][W(0x1d7)](JSON[W(0x209)](I[W(0x1af)])):'';return z[W(0x28c)]>0x0?z[W(0x214)](chalk_1[W(0x1b0)][W(0x21d)](W(0x1c5)))+H:!![];},this['getPathString']=(I,a,x)=>{const B=r,D=I[I[B(0x28c)]-0x1];function K(){const J=B;return I['slice'](0x0,-0x1)[J(0x1a4)](s=>s[J(0x1cb)](0x0)['toUpperCase']()+s['slice'](0x1))[J(0x214)]('>');}const z=I['length']>0x1?chalk_1[B(0x1b0)][B(0x1aa)][B(0x1d7)](K())+':\x20':'',H=x?'\x20('+chalk_1[B(0x1b0)][B(0x1f2)](x)+')':'';return chalk_1['default'][B(0x1f8)](''+z+a+'\x20'+chalk_1[B(0x1b0)][B(0x1fb)][B(0x25b)](D)+H+'?');},this['askForResource']=(I,a,x)=>__awaiter(this,void 0x0,void 0x0,function*(){const V=r;if(a['length']<0x1){const z=x?V(0x232)+x:V(0x271);throw new Error(V(0x28d)+I+'\x20'+z+'.');}const D=V(0x211)+I+'\x20to\x20use:',K=a[V(0x28c)]>0x4?V(0x258):V(0x230);return(yield inquirer['prompt']([{'type':K,'name':V(0x29c),'message':D,'choices':a}]))[V(0x29c)];}),this['askForResourcePaginated']=(I,a,x)=>__awaiter(this,void 0x0,void 0x0,function*(){const y=r,{elements:D,nextCursor:K}=yield a();if(D[y(0x28c)]<0x1){const s=x?y(0x232)+x:'found';throw new Error(y(0x28d)+I+'\x20'+s+'.');}const z=y(0x211)+I+y(0x1f0);if(K!==undefined){const C=({nextPageCursor:p})=>__awaiter(this,void 0x0,void 0x0,function*(){const e=y,b=yield a(p);return{'elements':b[e(0x29e)],'nextPageCursor':b['nextCursor']};});return(yield inquirer[y(0x1c6)]([{'type':y(0x1a6),'name':y(0x29c),'message':z,'choices':D,'nextPageCursor':K,'loadMore':C}]))[y(0x29c)];}const H=D[y(0x28c)]>0x4?y(0x258):y(0x230);return(yield inquirer[y(0x1c6)]([{'type':H,'name':y(0x29c),'message':z,'choices':D}]))[y(0x29c)];}),this[r(0x1ab)]=(I,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const U=r,x=''+(a?'('+chalk_1[U(0x1b0)][U(0x1f2)](a)+')\x20':''),D=U(0x26c)+chalk_1[U(0x1b0)]['green'](I)+'\x20'+x+U(0x270),K=this[U(0x1ca)]({'type':'string','required':!![]});return(yield inquirer['prompt']([{'type':'input','name':U(0x29c),'message':D,'validate':K}]))['name'];}),this['askConfirm']=I=>__awaiter(this,void 0x0,void 0x0,function*(){const S=r;return(yield inquirer[S(0x1c6)]([{'type':'confirm','name':'name','message':I,'default':!![]}]))[S(0x29c)];}),this[r(0x1fe)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const L=r,a=x=>D=>__awaiter(this,void 0x0,void 0x0,function*(){const n=a8I;var K;const z=yield this[n(0x26a)][n(0x230)][n(0x247)]({'parameters':{'projectId':x},'options':{'per_page':this[n(0x233)],'cursor':D}}),H=z[n(0x28e)]['services'][n(0x1a4)](s=>s['id']);return{'elements':H,'nextCursor':(K=z['pagination'])===null||K===void 0x0?void 0x0:K['cursor']};});return this[L(0x293)](L(0x208),a,I);}),this[r(0x1ec)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l=r,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const g=a8I;var x;const D=yield this[g(0x26a)]['list'][g(0x275)]({'options':{'per_page':this[g(0x233)],'cursor':a}}),K=D[g(0x28e)][g(0x275)][g(0x1a4)](z=>z['id']);return{'elements':K,'nextCursor':(x=D[g(0x21b)])===null||x===void 0x0?void 0x0:x[g(0x26f)]};});return this[l(0x244)]('template',I);}),this[r(0x239)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=r,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=a8I;var x,D,K;const z=yield this['apiClient'][Z(0x230)][Z(0x226)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':a}}),H=(D=(x=z[Z(0x28e)][Z(0x226)])===null||x===void 0x0?void 0x0:x['map'](s=>s['id']))!==null&&D!==void 0x0?D:[];return{'elements':H,'nextCursor':(K=z[Z(0x21b)])===null||K===void 0x0?void 0x0:K[Z(0x26f)]};});return this[G(0x244)](G(0x268),I);}),this[r(0x1d0)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=r,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const O=a8I;var x,D,K;const z=yield this['apiClient'][O(0x230)]['cloud'][O(0x1ff)]({'options':{'per_page':this[O(0x233)],'cursor':a}}),H=(D=(x=z[O(0x28e)][O(0x1ff)])===null||x===void 0x0?void 0x0:x['map'](s=>s[O(0x29c)]))!==null&&D!==void 0x0?D:[];return{'elements':H,'nextCursor':(K=z[O(0x21b)])===null||K===void 0x0?void 0x0:K['cursor']};});return this[Q(0x244)]('cluster\x20id',I);}),this[r(0x262)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const d=r;if(_[d(0x23a)](I))throw new Error(d(0x22b));const a=x=>__awaiter(this,void 0x0,void 0x0,function*(){const v=d;var D;let K=this[v(0x233)];const z=yield this[v(0x26a)][v(0x230)]['templateRuns']({'parameters':{'templateId':I},'options':{'per_page':K,'cursor':x}}),H=z[v(0x28e)][v(0x1eb)][v(0x1a4)](s=>s['id']+v(0x22a)+s[v(0x296)]+')');return{'elements':H,'nextCursor':(D=z['pagination'])===null||D===void 0x0?void 0x0:D[v(0x26f)]};});return this[d(0x244)]('template\x20run',a)[d(0x1f9)](x=>x[d(0x1df)]('\x20')[0x0]);}),this['askForLogSink']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=r,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const t=a8I;var x;let D=this['defaultPaginationPageSize'];const K=yield this[t(0x26a)][t(0x230)][t(0x241)]({'options':{'per_page':D,'cursor':a}}),z=K[t(0x28e)]['logSinks'][t(0x1a4)](H=>H['id']);return{'elements':z,'nextCursor':(x=K['pagination'])===null||x===void 0x0?void 0x0:x[t(0x26f)]};});return this[Y(0x244)]('log\x20sink',I);}),this[r(0x243)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u1=r,a=x=>D=>__awaiter(this,void 0x0,void 0x0,function*(){const u0=a8I;var K;const z=yield this['apiClient']['list'][u0(0x1a1)]({'parameters':{'projectId':x},'options':{'per_page':this[u0(0x233)],'cursor':D}}),H=z[u0(0x28e)][u0(0x1a1)][u0(0x1a4)](s=>s['id']);return{'elements':H,'nextCursor':(K=z[u0(0x21b)])===null||K===void 0x0?void 0x0:K[u0(0x26f)]};});return this['askForProjectScopedResourcePaginated'](u1(0x206),a,I);}),this['askForJob']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u3=r,a=x=>D=>__awaiter(this,void 0x0,void 0x0,function*(){const u2=a8I;var K;const z=yield this[u2(0x26a)][u2(0x230)][u2(0x1bc)]({'parameters':{'projectId':x},'options':{'per_page':this[u2(0x233)],'cursor':D}}),H=z[u2(0x28e)][u2(0x1bc)][u2(0x1a4)](s=>s['id']);return{'elements':H,'nextCursor':(K=z[u2(0x21b)])===null||K===void 0x0?void 0x0:K['cursor']};});return this[u3(0x293)]('job',a,I);}),this[r(0x294)]=(I,a,x=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u4=r,D=u4(0x2a6),K=z=>H=>__awaiter(this,void 0x0,void 0x0,function*(){const u5=u4;var s;const C=yield this[u5(0x26a)][u5(0x1ad)][u5(0x1e3)][u5(0x27a)]({'parameters':{'projectId':z,'jobId':I},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':H}}),p=C['data'][u5(0x27a)]['map'](b=>b['id']+u5(0x22a)+b[u5(0x1b3)]+')');return x&&p[u5(0x1fc)](D),{'elements':p,'nextCursor':(s=C[u5(0x21b)])===null||s===void 0x0?void 0x0:s[u5(0x26f)]};});return this[u4(0x293)]('job\x20runs',K,a,'job:\x20\x27'+I+'\x27')['then'](z=>{const u6=u4,H=z[u6(0x1df)]('\x20')[0x0];if(H===D)return undefined;return H;});}),this['askForBuild']=(I,a,x,D=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u7=r,K=u7(0x1d1);if(x!==undefined){const z=H=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const u8=u7;var C;const p=yield this[u8(0x26a)][u8(0x1ad)]['job'][u8(0x237)]({'parameters':{'projectId':H,'jobId':x},'options':{'per_page':this[u8(0x233)],'cursor':s}}),b=p['data']['builds'][u8(0x1a4)](i=>i['id']+u8(0x22a)+i[u8(0x296)]+')');return D&&b[u8(0x1fc)](K),{'elements':b,'nextCursor':(C=p['pagination'])===null||C===void 0x0?void 0x0:C['cursor']};});return this[u7(0x293)](u7(0x229),z,I,u7(0x1b6)+x+'\x27')['then'](H=>{const s=H['split']('\x20')[0x0];if(s===K)return undefined;return s;});}if(a!==undefined){const H=s=>C=>__awaiter(this,void 0x0,void 0x0,function*(){const u9=u7;var p;const b=yield this[u9(0x26a)][u9(0x1ad)][u9(0x208)]['builds']({'parameters':{'projectId':s,'serviceId':a},'options':{'per_page':this[u9(0x233)],'cursor':C}}),i=b[u9(0x28e)]['builds'][u9(0x1a4)](j=>j['id']+'\x20(startedAt:\x20'+j[u9(0x296)]+')');if(D)i[u9(0x1fc)](K);return{'elements':i,'nextCursor':(p=b[u9(0x21b)])===null||p===void 0x0?void 0x0:p['cursor']};});return this[u7(0x293)](u7(0x2a4),H,I,u7(0x253)+x+'\x27')[u7(0x1f9)](s=>{const C=s['split']('\x20')[0x0];if(C===K)return undefined;return C;});}throw new Error(u7(0x1e6));}),this[r(0x1b9)]=(I,a,x,D=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const uI=r,K='all-containers';if(x!==undefined){const z=H=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const uu=a8I;var C,p;const b=yield this[uu(0x26a)]['get'][uu(0x1e3)]['containers']({'parameters':{'projectId':H,'jobId':x},'options':{'per_page':this[uu(0x233)],'cursor':s}}),i=(C=b[uu(0x28e)]['containers'])!==null&&C!==void 0x0?C:[],j=i===null||i===void 0x0?void 0x0:i['map'](A=>A[uu(0x29c)]+'\x20(startedAt:\x20'+A['createdAt']+')');return D&&j[uu(0x1fc)](K),{'elements':j,'nextCursor':(p=b[uu(0x21b)])===null||p===void 0x0?void 0x0:p[uu(0x26f)]};});return this[uI(0x293)]('job\x20containers',z,I,uI(0x1b6)+x+'\x27')['then'](H=>{const ua=uI,s=H[ua(0x1df)]('\x20')[0x0];if(s===K)return undefined;return s;});}if(a!==undefined){const H=s=>C=>__awaiter(this,void 0x0,void 0x0,function*(){const ux=uI;var p,b;const i=yield this[ux(0x26a)][ux(0x1ad)][ux(0x208)][ux(0x288)]({'parameters':{'projectId':s,'serviceId':a},'options':{'per_page':this[ux(0x233)],'cursor':C}}),j=(p=i[ux(0x28e)][ux(0x288)])!==null&&p!==void 0x0?p:[],A=j[ux(0x1a4)](F=>F[ux(0x29c)]+ux(0x22a)+F[ux(0x296)]+')');if(D)A===null||A===void 0x0?void 0x0:A[ux(0x1fc)](K);return{'elements':A,'nextCursor':(b=i[ux(0x21b)])===null||b===void 0x0?void 0x0:b[ux(0x26f)]};});return this[uI(0x293)](uI(0x21c),H,I,uI(0x253)+x+'\x27')['then'](s=>{const C=s['split']('\x20')[0x0];if(C===K)return undefined;return C;});}throw new Error(uI(0x222));}),this['askForAddon']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const uK=r,a=x=>D=>__awaiter(this,void 0x0,void 0x0,function*(){const uD=a8I;var K;const z=yield this[uD(0x26a)][uD(0x230)]['addons']({'parameters':{'projectId':x},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':D}});return{'elements':z[uD(0x28e)]['addons'][uD(0x1a4)](H=>H['id']),'nextCursor':(K=z['pagination'])===null||K===void 0x0?void 0x0:K[uD(0x26f)]};});return this[uK(0x293)](uK(0x242),a,I);}),this['askForAddonBackup']=(I,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const uH=r,x=D=>K=>__awaiter(this,void 0x0,void 0x0,function*(){const uz=a8I;var z;const H=yield this[uz(0x26a)][uz(0x1ad)]['addon'][uz(0x1d3)]({'parameters':{'projectId':D,'addonId':a},'options':{'per_page':this[uz(0x233)],'cursor':K}});return{'elements':H[uz(0x28e)][uz(0x1d3)][uz(0x1a4)](s=>s['id']+uz(0x278)+(s[uz(0x1ac)]||uz(0x2a5))+')'),'nextCursor':(z=H[uz(0x21b)])===null||z===void 0x0?void 0x0:z[uz(0x26f)]};});return this[uH(0x293)]('backups',x,I,uH(0x1a9)+a+'\x27')['then'](D=>D[uH(0x1df)]('\x20')[0x0]);}),this[r(0x20f)]=(I,a,x)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const uC=r,D=K=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const us=a8I;var H;const s=yield this[us(0x26a)][us(0x1ad)][us(0x242)][us(0x1d2)][us(0x1e7)]({'parameters':{'projectId':K,'addonId':a,'backupId':x},'options':{'per_page':this[us(0x233)],'cursor':z}});return{'elements':s[us(0x28e)][us(0x1e7)]['map'](C=>C['id']+us(0x278)+(C[us(0x1ac)]||'not\x20completed')+')'),'nextCursor':(H=s[us(0x21b)])===null||H===void 0x0?void 0x0:H[us(0x26f)]};});return this[uC(0x293)](uC(0x248),D,I,uC(0x1a9)+a+'\x27')[uC(0x1f9)](K=>K['split']('\x20')[0x0]);}),this['askForVolume']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const a=x=>__awaiter(this,void 0x0,void 0x0,function*(){const up=a8I;return(yield this['apiClient'][up(0x230)][up(0x29a)]({'parameters':{'projectId':x}}))[up(0x28e)][up(0x1a4)](D=>D['id']);});return this['askForProjectScopedResource']('volume',a,I);}),this[r(0x20d)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const ui=r,a=x=>D=>__awaiter(this,void 0x0,void 0x0,function*(){const ub=a8I;var K;const z=yield this['apiClient'][ub(0x230)][ub(0x235)]({'parameters':{'projectId':x},'options':{'per_page':this[ub(0x233)],'cursor':D}});return{'elements':z[ub(0x28e)]['secrets'][ub(0x1a4)](H=>H['id']),'nextCursor':(K=z[ub(0x21b)])===null||K===void 0x0?void 0x0:K['cursor']};});return this[ui(0x293)](ui(0x236),a,I);}),this['askForSubdomain']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const uj=r,a=yield this[uj(0x26a)]['get'][uj(0x1c7)]({'parameters':{'domain':I}}),x=a['data'][uj(0x282)][uj(0x1a4)](K=>K[uj(0x29c)]+uj(0x273)+K['fullName']+')'),D=uj(0x1c8)+I+')';return this['askForResource'](uj(0x277),x,D)[uj(0x1f9)](K=>K['split']('\x20')[0x0]);}),this['askForSubdomainPath']=(I,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const uA=r,x=yield this[uA(0x26a)][uA(0x230)][uA(0x277)][uA(0x1d6)]({'parameters':{'domain':I,'subdomain':a}}),D=x[uA(0x28e)][uA(0x246)][uA(0x1a4)](z=>''+z[uA(0x264)]),K=uA(0x1c8)+I+uA(0x2a0)+a+')';return this[uA(0x201)]('subdomainPath',D,K);}),this[r(0x231)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const uF=r;return(yield inquirer[uF(0x1c6)]([{'type':uF(0x1a7),'name':uF(0x266),'message':chalk_1[uF(0x1b0)][uF(0x265)](uF(0x1cc)+(I||uF(0x1fd))+uF(0x1bb)),'default':![]}]))[uF(0x266)];}),this[r(0x234)]=(I,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const uX=r;_['isUndefined'](I[uX(0x29c)])&&(a[uX(0x28c)]<=0x0?_[uX(0x1d8)](I,'name',uX(0x1b0)):yield(0x0,utils_1['retry'])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const uT=uX,{name:x}=yield inquirer[uT(0x1c6)]([{'type':'input','name':'name','message':uT(0x220),'default':uT(0x1cf)}]);if(!I[uT(0x263)]&&a[uT(0x295)](D=>D[uT(0x29c)]===x)){const {c:D}=yield inquirer['prompt']([{'type':uT(0x1a7),'name':'c','message':uT(0x1ce)+x+uT(0x20b),'default':![]}]);if(D===![])throw new Error('Context\x20name\x20already\x20exists.');_['set'](I,uT(0x263),!![]);}_[uT(0x1d8)](I,uT(0x29c),x);})));if(_['isUndefined'](I[uX(0x1ba)])){const x=yield this[uX(0x23e)]();_['set'](I,'token',x);}return I;}),this[r(0x23e)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const uE=r,{token:I}=yield inquirer[uE(0x1c6)]([{'type':uE(0x26e),'name':uE(0x1ba),'mask':'*','message':'Choose\x20the\x20login\x20token:'}]);return I;}),inquirer['registerPrompt'](r(0x258),inquirerSearchList),inquirer[r(0x24c)]('pagination-prompt',inquirer_pagination_prompt_1['DynamicReloadPaginationPrompt']);}[a8T(0x249)](u,I){return __awaiter(this,void 0x0,void 0x0,function*(){const uf=a8I,a=yaml['safeDump'](u),x=_[uf(0x1b5)](a['split']('\x0a')[uf(0x1a4)](z=>z[uf(0x28c)])),D=chalk_1[uf(0x1b0)][uf(0x250)]('-'[uf(0x1a2)](x)+'\x0a'),{confirm:K}=yield inquirer['prompt']([{'type':uf(0x230),'name':uf(0x1a7),'message':''+chalk_1[uf(0x1b0)][uf(0x1fb)][uf(0x20e)](uf(0x298))+D+chalk_1[uf(0x1b0)][uf(0x1b4)](a)+D,'choices':Object[uf(0x1bf)](ConfirmChoices)}]);switch(K){case ConfirmChoices[uf(0x257)]:return u;case ConfirmChoices['ABORT']:throw new Error('Aborted.');case ConfirmChoices[uf(0x28f)]:return this[uf(0x29f)](I);case ConfirmChoices[uf(0x223)]:return this[uf(0x249)](yield this['editPayload'](u),I);case ConfirmChoices[uf(0x2a2)]:yield this[uf(0x1e8)](u);return this[uf(0x249)](u,I);default:throw new Error(uf(0x297));}});}[a8T(0x29f)](u,I){return __awaiter(this,void 0x0,void 0x0,function*(){const uN=a8I;if((I===null||I===void 0x0?void 0x0:I['resultCache'])!==undefined)this[uN(0x2a3)]=I===null||I===void 0x0?void 0x0:I[uN(0x2a3)];this[uN(0x23d)]=I===null||I===void 0x0?void 0x0:I[uN(0x23b)],this[uN(0x274)]=I===null||I===void 0x0?void 0x0:I[uN(0x274)];const a={};return yield this[uN(0x1d9)]([],u['opt']['body'],a),this['resultCache']=a,yield this['confirmationPrompt'](a,u);});}[a8T(0x1d9)](u,I,a,x){return __awaiter(this,void 0x0,void 0x0,function*(){const uP=a8I;let D;if(I['oneOf']&&!_['has'](I,'properties')){if(I[uP(0x238)]['length']>0x1){const {choice:K}=yield inquirer[uP(0x1c6)]([{'type':uP(0x230),'name':uP(0x299),'message':'What\x27s\x20the\x20'+(u[u[uP(0x28c)]-0x1]||'')+uP(0x1a8),'choices':I['oneOf'][uP(0x1a4)](z=>{const um=uP;var H;return(H=z[um(0x1dd)])!==null&&H!==void 0x0?H:'??';})}]);D=yield this['getType'](u,I['oneOf'][uP(0x295)](z=>z['description']===K),a,x);}else{const z=I[uP(0x238)][0x0];_[uP(0x1d8)](z,'description',I['description']),D=yield this[uP(0x26b)](u,z,a,x);}D={};}else{if(I[uP(0x1fa)]&&!_[uP(0x1e0)](I,uP(0x2a8))){if(I[uP(0x1fa)][uP(0x28c)]>0x1){const {choice:H}=yield inquirer[uP(0x1c6)]([{'type':'list','name':'choice','message':'What\x27s\x20the\x20'+(u[u[uP(0x28c)]-0x1]||'')+uP(0x1a8),'choices':[...I['anyOf']['map'](s=>{var C;return(C=s['description'])!==null&&C!==void 0x0?C:'??';}),uP(0x27e)]}]);H!==uP(0x27e)&&(D=yield this[uP(0x26b)](u,I[uP(0x1fa)][uP(0x295)](s=>s['description']===H),a,x));}else{const s=I['anyOf'][0x0];_['set'](s,'description',I['description']),D=yield this[uP(0x26b)](u,s,a,x);}D={};}else D=yield this[uP(0x26b)](u,I,a,x);}return D;});}[a8T(0x21a)](u,I,a,x){var D;return __awaiter(this,void 0x0,void 0x0,function*(){const uk=a8I;if(x===![]){const {addEntry:H}=yield inquirer[uk(0x1c6)]([{'type':uk(0x1a7),'name':uk(0x228),'message':this[uk(0x280)](I,uk(0x25d),u===null||u===void 0x0?void 0x0:u[uk(0x1dd)]),'default':![]}]);if(!H)return a;}const K=Object['keys']((D=u===null||u===void 0x0?void 0x0:u['properties'])!==null&&D!==void 0x0?D:[]),z=u[uk(0x210)]||[];if(K[uk(0x28c)]>0x0)for(const s of K){const C=I[uk(0x20a)](s);if(I['length']>0x0&&!_['has'](a,I[uk(0x214)]('.')))_[uk(0x1d8)](a,I[uk(0x214)]('.'),{});yield this[uk(0x1d9)](C,u[uk(0x2a8)][s],a,z[uk(0x255)](s));}else yield this['getType'](I,Object[uk(0x1da)](Object['assign']({},u),{'type':'rawObject'}),a,x);return a;});}[a8T(0x25e)](u,I,a,x){return __awaiter(this,void 0x0,void 0x0,function*(){const uR=a8I;if(I&&a)return!![];const D=I?'Do\x20you\x20want\x20to\x20add':uR(0x202),{addEntry:K}=yield inquirer[uR(0x1c6)]([{'type':'confirm','name':uR(0x228),'message':this['getPathString'](u,D,I?x:undefined),'default':![]}]);return K;});}[a8T(0x26b)](u,I,a,x){return __awaiter(this,void 0x0,void 0x0,function*(){const uq=a8I;let D;const K=u[uq(0x214)]('.');switch(I===null||I===void 0x0?void 0x0:I[uq(0x269)]){case'array':{let z=!![];while(yield this['askArrayEntry'](u,z,x,I===null||I===void 0x0?void 0x0:I[uq(0x1dd)])){const H=_[uq(0x1ad)](a,K);_[uq(0x1f6)](a,K),yield this[uq(0x26b)](u,I['items'],a);const s=_[uq(0x1ad)](a,K);!_[uq(0x279)](H)?_['set'](a,K,[s]):(H['push'](s),_[uq(0x1d8)](a,K,H)),z=![];}return D||[];}case uq(0x217):{return D=yield this[uq(0x21a)](I,u,a,x),D;}case'rawObject':D=(0x0,utils_1[uq(0x252)])(yield this[uq(0x25f)](u,I,x))||undefined;break;case uq(0x27d):case'boolean':case'integer':default:D=yield this[uq(0x25f)](u,I,x,a);break;}return!_['isUndefined'](D)&&_[uq(0x1d8)](a,K,D),D;});}[a8T(0x25f)](u,I,a,x){var D;return __awaiter(this,void 0x0,void 0x0,function*(){const uc=a8I,K=u[u[uc(0x28c)]-0x1],{defaultValue:defaultValue=(D=I===null||I===void 0x0?void 0x0:I[uc(0x1af)])!==null&&D!==void 0x0?D:I===null||I===void 0x0?void 0x0:I[uc(0x1b0)],choices:choices=I===null||I===void 0x0?void 0x0:I[uc(0x1bd)],pagination:z}=yield(0x0,api_helpers_1['fetchResourceList'])(K,this['apiClient'],this[uc(0x23d)],x,this[uc(0x1be)],u);let H=uc(0x1c0);if(!_[uc(0x23a)](choices)&&choices[uc(0x28c)]>0x0){if(z!==undefined&&z['nextPageCursor']!==undefined)H=uc(0x1a6);else choices['length']>0x4&&typeof choices[0x0]===uc(0x27d)?H='search-list':H=uc(0x230);}else{if((I===null||I===void 0x0?void 0x0:I[uc(0x269)])===uc(0x1c9))H=uc(0x1a7);else{if((I===null||I===void 0x0?void 0x0:I[uc(0x269)])===uc(0x281))H=uc(0x1c0);else(I===null||I===void 0x0?void 0x0:I[uc(0x269)])==='rawObject'&&(H=uc(0x292));}}let s=a!==![]?!_[uc(0x24f)](defaultValue)?defaultValue:JSON[uc(0x209)](defaultValue):_[uc(0x284)](defaultValue)?defaultValue:uc(0x27e);if(choices)s=s[uc(0x1a0)]();_[uc(0x1e0)](this[uc(0x2a3)],u[uc(0x214)]('.'))&&(s=this['resultCache'][u[uc(0x214)]('.')]);const C=choices&&a===![]?[uc(0x27e),...choices]:choices,p=(I===null||I===void 0x0?void 0x0:I[uc(0x269)])===uc(0x281),b=Object['assign']({'type':H,'name':'id','message':this[uc(0x24a)](u,I),'choices':C,'default':s,'filter':this[uc(0x25c)](H,a),'validate':this[uc(0x1ca)](I,a,p)},z),i=(yield inquirer[uc(0x1c6)]([b]))['id'];if(i==='don\x27t\x20change'||i==='')return undefined;if(p)return parseInt(i,0xa);return i;});}['getQuestionString'](u,I){const uM=a8T,a=(I===null||I===void 0x0?void 0x0:I['type'])!==uM(0x1c9)?'What\x20do\x20you\x20want\x20to\x20use\x20as':uM(0x1d4);return this[uM(0x280)](u,a,I===null||I===void 0x0?void 0x0:I['description']);}[a8T(0x1e2)](){return __awaiter(this,void 0x0,void 0x0,function*(){const uo=a8I,u=I=>__awaiter(this,void 0x0,void 0x0,function*(){const ur=a8I;var a;const x=yield this['apiClient'][ur(0x230)]['projects']({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}}),D=x[ur(0x28e)][ur(0x20c)]['map'](K=>K['id']);return{'elements':D,'nextCursor':(a=x[ur(0x21b)])===null||a===void 0x0?void 0x0:a[ur(0x26f)]};});return yield this[uo(0x244)](uo(0x289),u);});}['askForProjectScopedResource'](u,I,a,x){return __awaiter(this,void 0x0,void 0x0,function*(){const uw=a8I,D=a||this[uw(0x26a)][uw(0x29b)]['getCurrentProjectName']();if(_['isUndefined'](D))throw new Error(uw(0x240));const K=yield I(D);return yield this[uw(0x201)](u,K,(x?x+uw(0x212):'')+'project:\x20\x27'+D+'\x27');});}[a8T(0x293)](u,I,a,x){return __awaiter(this,void 0x0,void 0x0,function*(){const uh=a8I,D=a||this[uh(0x26a)]['contextProvider']['getCurrentProjectName']();if(_[uh(0x23a)](D))throw new Error(uh(0x240));const K=yield I(D);return yield this[uh(0x244)](u,K,(x?x+uh(0x212):'')+'project:\x20\x27'+D+'\x27');});}[a8T(0x215)](){return __awaiter(this,void 0x0,void 0x0,function*(){const uB=a8I,u=I=>__awaiter(this,void 0x0,void 0x0,function*(){const uW=a8I;var a;const x=yield this[uW(0x26a)]['list'][uW(0x1e1)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}});return{'elements':x['data']['domains'][uW(0x1a4)](D=>D[uW(0x29c)]),'nextCursor':(a=x[uW(0x21b)])===null||a===void 0x0?void 0x0:a[uW(0x26f)]};});return this[uB(0x244)](uB(0x1c7),u);});}[a8T(0x251)](){return __awaiter(this,void 0x0,void 0x0,function*(){const uV=a8I,u=I=>__awaiter(this,void 0x0,void 0x0,function*(){const uJ=a8I;var a;const x=yield this[uJ(0x26a)][uJ(0x230)]['registryCredentials']({'options':{'per_page':this[uJ(0x233)],'cursor':I}});return{'elements':x[uJ(0x28e)][uJ(0x24e)][uJ(0x1a4)](D=>D['id']),'nextCursor':(a=x[uJ(0x21b)])===null||a===void 0x0?void 0x0:a[uJ(0x26f)]};});return this[uV(0x244)](uV(0x24e),u);});}[a8T(0x1ed)](u){this['pathVars']=u;}}exports['InquirerHelper']=InquirerHelper;
|
|
1
|
+
'use strict';const a8w=a8o;(function(e,o){const g=a8o,h=e();while(!![]){try{const p=-parseInt(g(0x13c))/0x1+-parseInt(g(0x9d))/0x2+parseInt(g(0xf9))/0x3+parseInt(g(0x16b))/0x4*(parseInt(g(0xac))/0x5)+parseInt(g(0x161))/0x6*(-parseInt(g(0x129))/0x7)+parseInt(g(0x65))/0x8+-parseInt(g(0xdc))/0x9*(-parseInt(g(0x12a))/0xa);if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a8e,0x57cb5));var __createBinding=this&&this[a8w(0x8d)]||(Object[a8w(0xb3)]?function(e,h,p,Y){const C=a8w;if(Y===undefined)Y=p;var q=Object[C(0xe8)](h,p);(!q||('get'in q?!h[C(0xf3)]:q[C(0xef)]||q[C(0xb9)]))&&(q={'enumerable':!![],'get':function(){return h[p];}}),Object[C(0x77)](e,Y,q);}:function(e,h,p,Y){if(Y===undefined)Y=p;e[Y]=h[p];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a8w(0xb3)]?function(e,h){Object['defineProperty'](e,'default',{'enumerable':!![],'value':h});}:function(e,h){const x=a8w;e[x(0x120)]=h;}),__importStar=this&&this[a8w(0x69)]||function(e){const l=a8w;if(e&&e[l(0xf3)])return e;var o={};if(e!=null){for(var h in e)if(h!==l(0x120)&&Object[l(0xc0)][l(0x138)][l(0xcd)](e,h))__createBinding(o,e,h);}return __setModuleDefault(o,e),o;},__awaiter=this&&this[a8w(0x13e)]||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const H=a8o;function v(Z){const b=a8o;try{I(p[b(0xbb)](Z));}catch(k){J(k);}}function s(Z){const a=a8o;try{I(p[a(0xe4)](Z));}catch(k){J(k);}}function I(Z){const z=a8o;Z[z(0x102)]?q(Z[z(0x16a)]):Y(Z['value'])[z(0x101)](v,s);}I((p=p[H(0x7e)](e,o||[]))['next']());});},__importDefault=this&&this[a8w(0x14b)]||function(e){const P=a8w;return e&&e[P(0xf3)]?e:{'default':e};};function a8o(e,o){const h=a8e();return a8o=function(p,Y){p=p-0x64;let q=h[p];return q;},a8o(e,o);}Object[a8w(0x77)](exports,a8w(0xf3),{'value':!![]}),exports[a8w(0x82)]=void 0x0;const _=__importStar(require(a8w(0xd2))),chalk_1=__importDefault(require('chalk')),fs=__importStar(require('fs')),utils_1=require(a8w(0xcc)),api_helpers_1=require(a8w(0x15d)),inquirer_pagination_prompt_1=require('./pagination/inquirer-pagination-prompt'),inquirer=require(a8w(0x81)),inquirerSearchList=require(a8w(0x64)),yaml=require(a8w(0x130));var ConfirmChoices;(function(e){const V=a8w;e[V(0x90)]='Yes,\x20send',e[V(0xa5)]='No,\x20repeat',e['EDIT']=V(0xea),e['SAVE']='No,\x20but\x20save\x20as\x20file',e[V(0x16e)]=V(0x148);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(e){const u=a8w;this[u(0x8c)]=e,this[u(0x168)]=0x32,this['editPayload']=o=>__awaiter(this,void 0x0,void 0x0,function*(){const n=u,{editedResult:h}=yield inquirer['prompt']([{'type':n(0xaa),'name':n(0xa8),'message':n(0x150),'default':yaml[n(0xd9)](o)}]);return yaml['safeLoad'](h);}),this[u(0x9b)]=o=>__awaiter(this,void 0x0,void 0x0,function*(){const d=u,h=J=>d(0x15e)+J+d(0x87);function p(){return __awaiter(this,void 0x0,void 0x0,function*(){const j=a8o;return inquirer['prompt']([{'type':j(0x9e),'name':j(0xab),'message':j(0x118),'validate':J=>new RegExp(j(0x134))[j(0x71)](J)?!![]:h(J)}]);});}const {fileName:Y}=yield p(),q=Y['toString']()[d(0x11a)]('.')['pop']();try{switch(q){case d(0x145):(0x0,utils_1[d(0x103)])('Configuration\x20file\x20written\x20to\x20'+Y);return fs['writeFileSync'](Y,JSON[d(0x67)](o,null,'\x20\x20'));case d(0xa6):case'yml':(0x0,utils_1[d(0x103)])(d(0x16d)+Y);return fs[d(0xf6)](Y,yaml['safeDump'](o));default:(0x0,utils_1[d(0xfa)])(h(q));}}catch(J){(0x0,utils_1[d(0xfa)])(d(0x8f)+J['message']);}return undefined;}),this[u(0x12c)]=(o,h)=>p=>{const Q=u,Y=typeof p==='string'?p[Q(0x106)]():p;return h===![]&&Y===Q(0x94)?'':Y;},this['validate']=(o,h,p)=>Y=>{const D=u;if(this[D(0xec)]===!![])return!![];const q=[];if(Y===''||Y===D(0x94)){if(h!==![])q[D(0xda)](D(0x76));else return!![];}o['type']===D(0x79)&&!_[D(0xa0)](o[D(0xd8)])&&q[D(0xda)](new RegExp(o[D(0xd8)])['test'](Y)?!![]:'doesn\x27t\x20match\x20pattern\x20\x27'+o['pattern']+'\x27');o[D(0xb5)]===D(0x79)&&!_[D(0xa0)](o[D(0x13a)])&&q[D(0xda)](Y['length']>=o[D(0x13a)]?!![]:'must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20'+o[D(0x13a)]+D(0xe2)+Y[D(0x167)]+D(0x72));o[D(0xb5)]===D(0x79)&&!_[D(0xa0)](o[D(0x11e)])&&q[D(0xda)](Y['length']<=o['maxLength']?!![]:D(0x128)+o[D(0x11e)]+D(0xe2)+Y['length']+D(0x72));p&&Number[D(0xb1)](parseInt(Y,0xa))&&q[D(0xda)](D(0xc4)+Y);o[D(0xb5)]===D(0x109)&&!_[D(0xa0)](o['minimum'])&&q['push'](Y>=o[D(0x155)]?!![]:D(0x139)+o[D(0x155)]);o[D(0xb5)]===D(0x109)&&!_['isUndefined'](o['maximum'])&&q[D(0xda)](Y<=o[D(0x15c)]?!![]:D(0x12b)+o[D(0x15c)]);if(o['type']===D(0x14f)){const s=(0x0,utils_1[D(0x10b)])(Y);q[D(0xda)](s===![]||_[D(0xcb)](s)?D(0x166):!![]);}const J=q['filter'](I=>I!==!![]),v=(o===null||o===void 0x0?void 0x0:o[D(0x15f)])?'\x0a'+chalk_1[D(0x120)]['red']('>>')+D(0x6a)+chalk_1['default'][D(0x104)](JSON['stringify'](o[D(0x15f)])):'';return J[D(0x167)]>0x0?J[D(0xde)](chalk_1[D(0x120)][D(0x117)](D(0xb0)))+v:!![];},this[u(0xc3)]=(o,h,p)=>{const f=u,Y=o[o[f(0x167)]-0x1];function q(){const i=f;return o['slice'](0x0,-0x1)['map'](s=>s['charAt'](0x0)[i(0xad)]()+s['slice'](0x1))['join']('>');}const J=o[f(0x167)]>0x1?chalk_1['default'][f(0x14a)][f(0x104)](q())+':\x20':'',v=p?'\x20('+chalk_1[f(0x120)][f(0x100)](p)+')':'';return chalk_1[f(0x120)][f(0xc9)](''+J+h+'\x20'+chalk_1[f(0x120)][f(0xf0)]['greenBright'](Y)+v+'?');},this[u(0xcf)]=(o,h,p)=>__awaiter(this,void 0x0,void 0x0,function*(){const R=u;if(h['length']<0x1){const J=p?R(0x154)+p:'found';throw new Error(R(0x84)+o+'\x20'+J+'.');}const Y=R(0xb6)+o+R(0x153),q=h[R(0x167)]>0x4?R(0x10c):R(0xf8);return(yield inquirer[R(0x135)]([{'type':q,'name':'name','message':Y,'choices':h}]))[R(0x158)];}),this[u(0x14c)]=(o,h,p)=>__awaiter(this,void 0x0,void 0x0,function*(){const t=u,{elements:Y,nextCursor:q}=yield h();if(Y[t(0x167)]<0x1){const s=p?t(0x154)+p:'found';throw new Error('No\x20'+o+'\x20'+s+'.');}const J=t(0xb6)+o+t(0x153);if(q!==undefined){const I=({nextPageCursor:Z})=>__awaiter(this,void 0x0,void 0x0,function*(){const G=t,k=yield h(Z);return{'elements':k[G(0xff)],'nextPageCursor':k['nextCursor']};});return(yield inquirer['prompt']([{'type':'pagination-prompt','name':t(0x158),'message':J,'choices':Y,'nextPageCursor':q,'loadMore':I}]))[t(0x158)];}const v=Y[t(0x167)]>0x4?t(0x10c):t(0xf8);return(yield inquirer[t(0x135)]([{'type':v,'name':t(0x158),'message':J,'choices':Y}]))[t(0x158)];}),this[u(0x6b)]=(o,h)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=u,p=''+(h?'('+chalk_1[y(0x120)][y(0x100)](h)+')\x20':''),Y=y(0x137)+chalk_1[y(0x120)][y(0x132)](o)+'\x20'+p+y(0xae),q=this[y(0x126)]({'type':y(0x79),'required':!![]});return(yield inquirer['prompt']([{'type':y(0x9e),'name':y(0x158),'message':Y,'validate':q}]))[y(0x158)];}),this[u(0xd6)]=o=>__awaiter(this,void 0x0,void 0x0,function*(){const S=u;return(yield inquirer[S(0x135)]([{'type':'confirm','name':S(0x158),'message':o,'default':!![]}]))['name'];}),this['askForService']=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const m=u,h=p=>Y=>__awaiter(this,void 0x0,void 0x0,function*(){const X=a8o;var q;const J=yield this[X(0x8c)][X(0xf8)]['services']({'parameters':{'projectId':p},'options':{'per_page':this[X(0x168)],'cursor':Y}}),v=J['data'][X(0x75)][X(0x9c)](s=>s['id']);return{'elements':v,'nextCursor':(q=J[X(0x80)])===null||q===void 0x0?void 0x0:q['cursor']};});return this[m(0x122)](m(0x133),h,o);}),this['askForTemplate']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const T=u,o=h=>__awaiter(this,void 0x0,void 0x0,function*(){const U=a8o;var p;const Y=yield this[U(0x8c)][U(0xf8)][U(0x169)]({'options':{'per_page':this[U(0x168)],'cursor':h}}),q=Y[U(0x6c)]['templates']['map'](J=>J['id']);return{'elements':q,'nextCursor':(p=Y[U(0x80)])===null||p===void 0x0?void 0x0:p['cursor']};});return this[T(0x14c)](T(0xeb),o);}),this[u(0x163)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const E=u,o=h=>__awaiter(this,void 0x0,void 0x0,function*(){const O=a8o;var p,Y,q;const J=yield this[O(0x8c)]['list'][O(0x123)]({'options':{'per_page':this[O(0x168)],'cursor':h}}),v=(Y=(p=J[O(0x6c)]['tags'])===null||p===void 0x0?void 0x0:p[O(0x9c)](s=>s['id']))!==null&&Y!==void 0x0?Y:[];return{'elements':v,'nextCursor':(q=J[O(0x80)])===null||q===void 0x0?void 0x0:q[O(0x152)]};});return this[E(0x14c)](E(0x171),o);}),this[u(0x170)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const M=u,o=h=>__awaiter(this,void 0x0,void 0x0,function*(){const A=a8o;var p,Y,q;const J=yield this['apiClient'][A(0xf8)][A(0xb8)][A(0xdb)]({'options':{'per_page':this[A(0x168)],'cursor':h}}),v=(Y=(p=J[A(0x6c)][A(0xdb)])===null||p===void 0x0?void 0x0:p['map'](s=>s[A(0x158)]))!==null&&Y!==void 0x0?Y:[];return{'elements':v,'nextCursor':(q=J['pagination'])===null||q===void 0x0?void 0x0:q[A(0x152)]};});return this['askForResourcePaginated'](M(0x96),o);}),this[u(0xce)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=u;if(_[K(0xa0)](o))throw new Error(K(0x107));const h=p=>__awaiter(this,void 0x0,void 0x0,function*(){const r=K;var Y;let q=this[r(0x168)];const J=yield this[r(0x8c)][r(0xf8)][r(0x113)]({'parameters':{'templateId':o},'options':{'per_page':q,'cursor':p}}),v=J[r(0x6c)]['templateRuns'][r(0x9c)](s=>s['id']+r(0xca)+s[r(0x7d)]+')');return{'elements':v,'nextCursor':(Y=J[r(0x80)])===null||Y===void 0x0?void 0x0:Y[r(0x152)]};});return this[K(0x14c)](K(0x10d),h)['then'](p=>p[K(0x11a)]('\x20')[0x0]);}),this['askForLogSink']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const e0=u,o=h=>__awaiter(this,void 0x0,void 0x0,function*(){const B=a8o;var p;let Y=this[B(0x168)];const q=yield this[B(0x8c)]['list'][B(0x7a)]({'options':{'per_page':Y,'cursor':h}}),J=q[B(0x6c)]['logSinks']['map'](v=>v['id']);return{'elements':J,'nextCursor':(p=q[B(0x80)])===null||p===void 0x0?void 0x0:p[B(0x152)]};});return this['askForResourcePaginated'](e0(0x74),o);}),this[u(0xe9)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const e2=u,h=p=>Y=>__awaiter(this,void 0x0,void 0x0,function*(){const e1=a8o;var q;const J=yield this[e1(0x8c)]['list'][e1(0x95)]({'parameters':{'projectId':p},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':Y}}),v=J[e1(0x6c)][e1(0x95)][e1(0x9c)](s=>s['id']);return{'elements':v,'nextCursor':(q=J[e1(0x80)])===null||q===void 0x0?void 0x0:q[e1(0x152)]};});return this['askForProjectScopedResourcePaginated'](e2(0x157),h,o);}),this[u(0xf4)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const e4=u,h=p=>Y=>__awaiter(this,void 0x0,void 0x0,function*(){const e3=a8o;var q;const J=yield this[e3(0x8c)][e3(0xf8)][e3(0xa1)]({'parameters':{'projectId':p},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':Y}}),v=J[e3(0x6c)]['jobs'][e3(0x9c)](s=>s['id']);return{'elements':v,'nextCursor':(q=J[e3(0x80)])===null||q===void 0x0?void 0x0:q['cursor']};});return this[e4(0x122)]('job',h,o);}),this[u(0x143)]=(o,h,p=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const e5=u,Y=e5(0x121),q=J=>v=>__awaiter(this,void 0x0,void 0x0,function*(){const e6=e5;var s;const I=yield this[e6(0x8c)]['get'][e6(0x7c)][e6(0x172)]({'parameters':{'projectId':J,'jobId':o},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':v}}),Z=I[e6(0x6c)][e6(0x172)][e6(0x9c)](k=>k['id']+e6(0xca)+k[e6(0xe1)]+')');return p&&Z[e6(0xa7)](Y),{'elements':Z,'nextCursor':(s=I[e6(0x80)])===null||s===void 0x0?void 0x0:s['cursor']};});return this[e5(0x122)](e5(0x8a),q,h,e5(0x108)+o+'\x27')[e5(0x101)](J=>{const e7=e5,v=J[e7(0x11a)]('\x20')[0x0];if(v===Y)return undefined;return v;});}),this[u(0x13b)]=(o,h,p,Y=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const e9=u,q='all-builds';if(p!==undefined){const J=v=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const e8=a8o;var I;const Z=yield this[e8(0x8c)][e8(0x11d)]['job'][e8(0x9a)]({'parameters':{'projectId':v,'jobId':p},'options':{'per_page':this[e8(0x168)],'cursor':s}}),k=Z[e8(0x6c)][e8(0x9a)][e8(0x9c)](L=>L['id']+'\x20(startedAt:\x20'+L[e8(0x7d)]+')');return Y&&k[e8(0xa7)](q),{'elements':k,'nextCursor':(I=Z[e8(0x80)])===null||I===void 0x0?void 0x0:I[e8(0x152)]};});return this[e9(0x122)]('job\x20builds',J,o,e9(0x108)+p+'\x27')[e9(0x101)](v=>{const ee=e9,s=v[ee(0x11a)]('\x20')[0x0];if(s===q)return undefined;return s;});}if(h!==undefined){const v=s=>I=>__awaiter(this,void 0x0,void 0x0,function*(){const eo=e9;var Z;const k=yield this[eo(0x8c)][eo(0x11d)][eo(0x133)][eo(0x9a)]({'parameters':{'projectId':s,'serviceId':h},'options':{'per_page':this[eo(0x168)],'cursor':I}}),L=k[eo(0x6c)]['builds']['map'](F=>F['id']+eo(0xca)+F[eo(0x7d)]+')');if(Y)L[eo(0xa7)](q);return{'elements':L,'nextCursor':(Z=k[eo(0x80)])===null||Z===void 0x0?void 0x0:Z[eo(0x152)]};});return this['askForProjectScopedResourcePaginated'](e9(0x66),v,o,e9(0x149)+p+'\x27')[e9(0x101)](s=>{const eh=e9,I=s[eh(0x11a)]('\x20')[0x0];if(I===q)return undefined;return I;});}throw new Error('No\x20builds\x20found');}),this[u(0xd1)]=(o,h,p,Y=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const ep=u,q=ep(0x12d);if(p!==undefined){const J=v=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const eY=ep;var I,Z;const k=yield this[eY(0x8c)][eY(0x11d)][eY(0x7c)][eY(0xc5)]({'parameters':{'projectId':v,'jobId':p},'options':{'per_page':this[eY(0x168)],'cursor':s}}),L=(I=k[eY(0x6c)][eY(0xc5)])!==null&&I!==void 0x0?I:[],F=L===null||L===void 0x0?void 0x0:L[eY(0x9c)](W=>W[eY(0x158)]+eY(0xca)+W[eY(0x7d)]+')');return Y&&F[eY(0xa7)](q),{'elements':F,'nextCursor':(Z=k[eY(0x80)])===null||Z===void 0x0?void 0x0:Z[eY(0x152)]};});return this['askForProjectScopedResourcePaginated']('job\x20containers',J,o,'job:\x20\x27'+p+'\x27')[ep(0x101)](v=>{const eq=ep,s=v[eq(0x11a)]('\x20')[0x0];if(s===q)return undefined;return s;});}if(h!==undefined){const v=s=>I=>__awaiter(this,void 0x0,void 0x0,function*(){const eJ=ep;var Z,k;const L=yield this[eJ(0x8c)][eJ(0x11d)]['service'][eJ(0xc5)]({'parameters':{'projectId':s,'serviceId':h},'options':{'per_page':this[eJ(0x168)],'cursor':I}}),F=(Z=L['data'][eJ(0xc5)])!==null&&Z!==void 0x0?Z:[],W=F['map'](N=>N[eJ(0x158)]+eJ(0xca)+N[eJ(0x7d)]+')');if(Y)W===null||W===void 0x0?void 0x0:W['unshift'](q);return{'elements':W,'nextCursor':(k=L[eJ(0x80)])===null||k===void 0x0?void 0x0:k[eJ(0x152)]};});return this[ep(0x122)]('service\x20containers',v,o,ep(0x149)+p+'\x27')[ep(0x101)](s=>{const I=s['split']('\x20')[0x0];if(I===q)return undefined;return I;});}throw new Error(ep(0x93));}),this['askForAddon']=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const es=u,h=p=>Y=>__awaiter(this,void 0x0,void 0x0,function*(){const ev=a8o;var q;const J=yield this[ev(0x8c)]['list'][ev(0x125)]({'parameters':{'projectId':p},'options':{'per_page':this[ev(0x168)],'cursor':Y}});return{'elements':J[ev(0x6c)]['addons']['map'](v=>v['id']),'nextCursor':(q=J[ev(0x80)])===null||q===void 0x0?void 0x0:q['cursor']};});return this[es(0x122)](es(0x119),h,o);}),this[u(0xf2)]=(o,h)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const eZ=u,p=Y=>q=>__awaiter(this,void 0x0,void 0x0,function*(){const eI=a8o;var J;const v=yield this[eI(0x8c)]['get'][eI(0x119)][eI(0xd0)]({'parameters':{'projectId':Y,'addonId':h},'options':{'per_page':this[eI(0x168)],'cursor':q}});return{'elements':v[eI(0x6c)]['backups']['map'](s=>s['id']+'\x20(completedAt:\x20'+(s[eI(0x89)]||'not\x20completed')+')'),'nextCursor':(J=v['pagination'])===null||J===void 0x0?void 0x0:J[eI(0x152)]};});return this[eZ(0x122)](eZ(0xd0),p,o,eZ(0x173)+h+'\x27')[eZ(0x101)](Y=>Y[eZ(0x11a)]('\x20')[0x0]);}),this[u(0x10a)]=(o,h,p)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const eL=u,Y=q=>J=>__awaiter(this,void 0x0,void 0x0,function*(){const ek=a8o;var v;const s=yield this['apiClient']['get']['addon'][ek(0x142)][ek(0x97)]({'parameters':{'projectId':q,'addonId':h,'backupId':p},'options':{'per_page':this[ek(0x168)],'cursor':J}});return{'elements':s['data']['restores'][ek(0x9c)](I=>I['id']+'\x20(completedAt:\x20'+(I['completedAt']||ek(0xb7))+')'),'nextCursor':(v=s[ek(0x80)])===null||v===void 0x0?void 0x0:v['cursor']};});return this[eL(0x122)](eL(0x91),Y,o,eL(0x173)+h+'\x27')[eL(0x101)](q=>q[eL(0x11a)]('\x20')[0x0]);}),this[u(0x111)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const eW=u,h=p=>__awaiter(this,void 0x0,void 0x0,function*(){const eF=a8o;return(yield this[eF(0x8c)][eF(0xf8)][eF(0x70)]({'parameters':{'projectId':p}}))[eF(0x6c)][eF(0x9c)](Y=>Y['id']);});return this[eW(0xe6)](eW(0x9f),h,o);}),this[u(0x10f)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const eg=u,h=p=>Y=>__awaiter(this,void 0x0,void 0x0,function*(){const eN=a8o;var q;const J=yield this[eN(0x8c)][eN(0xf8)][eN(0x88)]({'parameters':{'projectId':p},'options':{'per_page':this[eN(0x168)],'cursor':Y}});return{'elements':J[eN(0x6c)][eN(0x88)]['map'](v=>v['id']),'nextCursor':(q=J[eN(0x80)])===null||q===void 0x0?void 0x0:q[eN(0x152)]};});return this[eg(0x122)](eg(0xf5),h,o);}),this[u(0xf1)]=o=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const ew=u,h=yield this[ew(0x8c)]['get']['domain']({'parameters':{'domain':o}}),p=h['data'][ew(0x6e)][ew(0x9c)](q=>q[ew(0x158)]+'\x20(full\x20domain:\x20'+q[ew(0xaf)]+')'),Y=ew(0x11b)+o+')';return this[ew(0xcf)]('subdomain',p,Y)[ew(0x101)](q=>q[ew(0x11a)]('\x20')[0x0]);}),this[u(0x105)]=(o,h)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const eC=u,p=yield this[eC(0x8c)][eC(0xf8)][eC(0x114)][eC(0x16f)]({'parameters':{'domain':o,'subdomain':h}}),Y=p[eC(0x6c)][eC(0x14d)][eC(0x9c)](J=>''+J['uri']),q='domain\x20('+o+'),\x20subdomain\x20('+h+')';return this[eC(0xcf)](eC(0x68),Y,q);}),this['deleteWarningPrompt']=o=>__awaiter(this,void 0x0,void 0x0,function*(){const ex=u;return(yield inquirer[ex(0x135)]([{'type':'confirm','name':'confirmation','message':chalk_1['default'][ex(0x85)](ex(0x124)+(o||'a\x20Northflank\x20resource')+'.\x20This\x20is\x20irreversible.\x20Please\x20confirm!'),'default':![]}]))[ex(0xb4)];}),this[u(0xc8)]=(o,h)=>__awaiter(this,void 0x0,void 0x0,function*(){const el=u;_[el(0xa0)](o['name'])&&(h[el(0x167)]<=0x0?_[el(0x159)](o,el(0x158),el(0x120)):yield(0x0,utils_1[el(0x15b)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const eb=el,{name:p}=yield inquirer['prompt']([{'type':'input','name':eb(0x158),'message':eb(0x83),'default':eb(0x115)}]);if(!o[eb(0xc1)]&&h[eb(0x12f)](Y=>Y[eb(0x158)]===p)){const {c:Y}=yield inquirer['prompt']([{'type':'confirm','name':'c','message':eb(0x112)+p+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(Y===![])throw new Error('Context\x20name\x20already\x20exists.');_[eb(0x159)](o,'override',!![]);}_[eb(0x159)](o,eb(0x158),p);})));if(_[el(0xa0)](o[el(0x15a)])){const p=yield this['tokenPrompt']();_[el(0x159)](o,el(0x15a),p);}return o;}),this['tokenPrompt']=()=>__awaiter(this,void 0x0,void 0x0,function*(){const ea=u,{token:o}=yield inquirer['prompt']([{'type':'password','name':ea(0x15a),'mask':'*','message':ea(0xfd)}]);return o;}),inquirer[u(0x140)]('search-list',inquirerSearchList),inquirer[u(0x140)](u(0x7b),inquirer_pagination_prompt_1[u(0xbc)]);}[a8w(0x13f)](e,o){return __awaiter(this,void 0x0,void 0x0,function*(){const ez=a8o,h=yaml['safeDump'](e),p=_[ez(0xa3)](h[ez(0x11a)]('\x0a')[ez(0x9c)](J=>J['length'])),Y=chalk_1['default'][ez(0x147)]('-'[ez(0x11c)](p)+'\x0a'),{confirm:q}=yield inquirer[ez(0x135)]([{'type':'list','name':'confirm','message':''+chalk_1['default'][ez(0xf0)][ez(0x132)](ez(0x98))+Y+chalk_1[ez(0x120)][ez(0xed)](h)+Y,'choices':Object[ez(0x11f)](ConfirmChoices)}]);switch(q){case ConfirmChoices[ez(0x90)]:return e;case ConfirmChoices['ABORT']:throw new Error(ez(0x16c));case ConfirmChoices[ez(0xa5)]:return this['retrievePayloadViaInteractiveCli'](o);case ConfirmChoices[ez(0x116)]:return this['confirmationPrompt'](yield this[ez(0x12e)](e),o);case ConfirmChoices[ez(0xe3)]:yield this[ez(0x9b)](e);return this[ez(0x13f)](e,o);default:throw new Error(ez(0xfb));}});}['retrievePayloadViaInteractiveCli'](e,o){return __awaiter(this,void 0x0,void 0x0,function*(){const eH=a8o;if((o===null||o===void 0x0?void 0x0:o[eH(0x156)])!==undefined)this[eH(0x156)]=o===null||o===void 0x0?void 0x0:o['resultCache'];this[eH(0x165)]=o===null||o===void 0x0?void 0x0:o[eH(0x146)],this['skipValidation']=o===null||o===void 0x0?void 0x0:o[eH(0xec)];const h={};return yield this['propToType']([],e[eH(0x162)][eH(0xee)],h),this[eH(0x156)]=h,yield this[eH(0x13f)](h,e);});}[a8w(0xbf)](e,o,h,p){return __awaiter(this,void 0x0,void 0x0,function*(){const eP=a8o;let Y;if(o['oneOf']&&!_[eP(0x92)](o,'properties')){if(o['oneOf'][eP(0x167)]>0x1){const {choice:q}=yield inquirer['prompt']([{'type':eP(0xf8),'name':eP(0xa9),'message':'What\x27s\x20the\x20'+(e[e['length']-0x1]||'')+eP(0x86),'choices':o[eP(0xbe)][eP(0x9c)](J=>{const eV=eP;var v;return(v=J[eV(0x14e)])!==null&&v!==void 0x0?v:'??';})}]);Y=yield this[eP(0x8b)](e,o[eP(0xbe)][eP(0x12f)](J=>J[eP(0x14e)]===q),h,p);}else{const J=o['oneOf'][0x0];_[eP(0x159)](J,eP(0x14e),o[eP(0x14e)]),Y=yield this[eP(0x8b)](e,J,h,p);}Y={};}else{if(o[eP(0x131)]&&!_[eP(0x92)](o,eP(0xba))){if(o[eP(0x131)][eP(0x167)]>0x1){const {choice:v}=yield inquirer[eP(0x135)]([{'type':eP(0xf8),'name':eP(0xa9),'message':eP(0x110)+(e[e[eP(0x167)]-0x1]||'')+eP(0x86),'choices':[...o[eP(0x131)][eP(0x9c)](s=>{const eu=eP;var I;return(I=s[eu(0x14e)])!==null&&I!==void 0x0?I:'??';}),eP(0x94)]}]);v!=='don\x27t\x20change'&&(Y=yield this[eP(0x8b)](e,o['anyOf'][eP(0x12f)](s=>s[eP(0x14e)]===v),h,p));}else{const s=o[eP(0x131)][0x0];_[eP(0x159)](s,eP(0x14e),o[eP(0x14e)]),Y=yield this[eP(0x8b)](e,s,h,p);}Y={};}else Y=yield this[eP(0x8b)](e,o,h,p);}return Y;});}[a8w(0x99)](e,o,h,p){var Y;return __awaiter(this,void 0x0,void 0x0,function*(){const ec=a8o;if(p===![]){const {addEntry:v}=yield inquirer[ec(0x135)]([{'type':ec(0x144),'name':ec(0xd5),'message':this[ec(0xc3)](o,ec(0xd3),e===null||e===void 0x0?void 0x0:e[ec(0x14e)]),'default':![]}]);if(!v)return h;}const q=Object[ec(0xa4)]((Y=e===null||e===void 0x0?void 0x0:e[ec(0xba)])!==null&&Y!==void 0x0?Y:[]),J=e['required']||[];if(q[ec(0x167)]>0x0)for(const s of q){const I=o[ec(0x73)](s);if(o['length']>0x0&&!_[ec(0x92)](h,o[ec(0xde)]('.')))_[ec(0x159)](h,o[ec(0xde)]('.'),{});yield this[ec(0xbf)](I,e['properties'][s],h,J[ec(0xe0)](s));}else yield this[ec(0x8b)](o,Object[ec(0x10e)](Object[ec(0x10e)]({},e),{'type':ec(0x14f)}),h,p);return h;});}[a8w(0xb2)](e,o,h,p){return __awaiter(this,void 0x0,void 0x0,function*(){const en=a8o;if(o&&h)return!![];const Y=o?en(0xd3):en(0x6f),{addEntry:q}=yield inquirer['prompt']([{'type':'confirm','name':en(0xd5),'message':this[en(0xc3)](e,Y,o?p:undefined),'default':![]}]);return q;});}[a8w(0x8b)](e,o,h,p){return __awaiter(this,void 0x0,void 0x0,function*(){const ed=a8o;let Y;const q=e[ed(0xde)]('.');switch(o===null||o===void 0x0?void 0x0:o['type']){case ed(0x141):{let J=!![];while(yield this['askArrayEntry'](e,J,p,o===null||o===void 0x0?void 0x0:o['description'])){const v=_[ed(0x11d)](h,q);_[ed(0x151)](h,q),yield this[ed(0x8b)](e,o[ed(0xc7)],h);const s=_['get'](h,q);!_[ed(0xe5)](v)?_[ed(0x159)](h,q,[s]):(v[ed(0xda)](s),_[ed(0x159)](h,q,v)),J=![];}return Y||[];}case ed(0x164):{return Y=yield this[ed(0x99)](o,e,h,p),Y;}case ed(0x14f):Y=(0x0,utils_1[ed(0x10b)])(yield this[ed(0xdf)](e,o,p))||undefined;break;case'string':case ed(0xe7):case ed(0x109):default:Y=yield this[ed(0xdf)](e,o,p,h);break;}return!_[ed(0xa0)](Y)&&_[ed(0x159)](h,q,Y),Y;});}[a8w(0xdf)](e,o,h,p){var Y;return __awaiter(this,void 0x0,void 0x0,function*(){const ej=a8o,q=e[e[ej(0x167)]-0x1],{defaultValue:defaultValue=(Y=o===null||o===void 0x0?void 0x0:o['example'])!==null&&Y!==void 0x0?Y:o===null||o===void 0x0?void 0x0:o[ej(0x120)],choices:choices=o===null||o===void 0x0?void 0x0:o[ej(0xd7)],pagination:J}=yield(0x0,api_helpers_1[ej(0x160)])(q,this[ej(0x8c)],this[ej(0x165)],p,this['pathVars'],e);let v='input';if(!_[ej(0xa0)](choices)&&choices[ej(0x167)]>0x0){if(J!==undefined&&J['nextPageCursor']!==undefined)v=ej(0x7b);else choices[ej(0x167)]>0x4&&typeof choices[0x0]===ej(0x79)?v=ej(0x10c):v=ej(0xf8);}else{if((o===null||o===void 0x0?void 0x0:o[ej(0xb5)])==='boolean')v=ej(0x144);else{if((o===null||o===void 0x0?void 0x0:o[ej(0xb5)])===ej(0x109))v=ej(0x9e);else(o===null||o===void 0x0?void 0x0:o[ej(0xb5)])===ej(0x14f)&&(v=ej(0xaa));}}let s=h!==![]?!_[ej(0x8e)](defaultValue)?defaultValue:JSON[ej(0x67)](defaultValue):_[ej(0xd4)](defaultValue)?defaultValue:ej(0x94);if(choices)s=s[ej(0x136)]();_[ej(0x92)](this[ej(0x156)],e[ej(0xde)]('.'))&&(s=this[ej(0x156)][e[ej(0xde)]('.')]);const I=choices&&h===![]?[ej(0x94),...choices]:choices,Z=(o===null||o===void 0x0?void 0x0:o[ej(0xb5)])===ej(0x109),k=Object[ej(0x10e)]({'type':v,'name':'id','message':this['getQuestionString'](e,o),'choices':I,'default':s,'filter':this[ej(0x12c)](v,h),'validate':this['validate'](o,h,Z)},J),L=(yield inquirer['prompt']([k]))['id'];if(L==='don\x27t\x20change'||L==='')return undefined;if(Z)return parseInt(L,0xa);return L;});}['getQuestionString'](e,o){const eQ=a8w,h=(o===null||o===void 0x0?void 0x0:o[eQ(0xb5)])!=='boolean'?eQ(0xdd):'Should\x20it\x20be';return this[eQ(0xc3)](e,h,o===null||o===void 0x0?void 0x0:o['description']);}['askForProject'](){return __awaiter(this,void 0x0,void 0x0,function*(){const e=o=>__awaiter(this,void 0x0,void 0x0,function*(){const eD=a8o;var h;const p=yield this['apiClient'][eD(0xf8)][eD(0xa2)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':o}}),Y=p[eD(0x6c)][eD(0xa2)][eD(0x9c)](q=>q['id']);return{'elements':Y,'nextCursor':(h=p['pagination'])===null||h===void 0x0?void 0x0:h[eD(0x152)]};});return yield this['askForResourcePaginated']('project',e);});}['askForProjectScopedResource'](e,o,h,p){return __awaiter(this,void 0x0,void 0x0,function*(){const ef=a8o,Y=h||this[ef(0x8c)][ef(0x127)][ef(0xfe)]();if(_[ef(0xa0)](Y))throw new Error(ef(0x78));const q=yield o(Y);return yield this[ef(0xcf)](e,q,(p?p+ef(0x13d):'')+ef(0xc2)+Y+'\x27');});}[a8w(0x122)](e,o,h,p){return __awaiter(this,void 0x0,void 0x0,function*(){const ei=a8o,Y=h||this['apiClient'][ei(0x127)][ei(0xfe)]();if(_[ei(0xa0)](Y))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const q=yield o(Y);return yield this[ei(0x14c)](e,q,(p?p+ei(0x13d):'')+ei(0xc2)+Y+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const et=a8o,e=o=>__awaiter(this,void 0x0,void 0x0,function*(){const eR=a8o;var h;const p=yield this[eR(0x8c)]['list'][eR(0xfc)]({'options':{'per_page':this[eR(0x168)],'cursor':o}});return{'elements':p[eR(0x6c)][eR(0xfc)]['map'](Y=>Y['name']),'nextCursor':(h=p[eR(0x80)])===null||h===void 0x0?void 0x0:h['cursor']};});return this[et(0x14c)](et(0xc6),e);});}[a8w(0x6d)](){return __awaiter(this,void 0x0,void 0x0,function*(){const e=o=>__awaiter(this,void 0x0,void 0x0,function*(){const eG=a8o;var h;const p=yield this[eG(0x8c)][eG(0xf8)][eG(0xf7)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':o}});return{'elements':p[eG(0x6c)][eG(0xbd)]['map'](Y=>Y['id']),'nextCursor':(h=p[eG(0x80)])===null||h===void 0x0?void 0x0:h[eG(0x152)]};});return this['askForResourcePaginated']('credentials',e);});}[a8w(0x7f)](e){this['pathVars']=e;}}function a8e(){const ey=['configurable','properties','next','DynamicReloadPaginationPrompt','credentials','oneOf','propToType','prototype','override','project:\x20\x27','getPathString','must\x20be\x20a\x20number,\x20is\x20','containers','domain','items','loginPrompt','reset','\x20(startedAt:\x20','isEmpty','./utils','call','askForTemplateRun','askForResource','backups','askForContainer','lodash','Do\x20you\x20want\x20to\x20add','isBoolean','addEntry','askConfirm','enum','pattern','safeDump','push','clusters','4682214qVjMRk','What\x20do\x20you\x20want\x20to\x20use\x20as','join','ask','includes','startedAt','\x20characters,\x20is\x20','SAVE','throw','isArray','askForProjectScopedResource','boolean','getOwnPropertyDescriptor','askForPipeline','No,\x20edit','template','skipValidation','blueBright','body','writable','bold','askForSubdomain','askForAddonBackup','__esModule','askForJob','secret','writeFileSync','registryCredentials','list','1646814XRTgGQ','warning','Something\x20unexpected\x20happened.','domains','Choose\x20the\x20login\x20token:','getCurrentProjectName','elements','blue','then','done','success','whiteBright','askForSubdomainPath','trim','Template\x20id\x20not\x20provided.','job:\x20\x27','integer','askForAddonRestore','isValidJSON','search-list','template\x20run','assign','askForSecret','What\x27s\x20the\x20','askForVolume','Context\x20with\x20name\x20\x27','templateRuns','subdomain','main-context','EDIT','underline','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','addon','split','domain\x20(','repeat','get','maxLength','values','default','all-job-runs','askForProjectScopedResourcePaginated','tags','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','addons','validate','contextProvider','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','3738zHlWjF','20DWPVJT','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','filter','all-containers','editPayload','find','js-yaml','anyOf','green','service','.*\x5c.(json|yaml|yml)$','prompt','toString','Enter\x20the\x20','hasOwnProperty','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','minLength','askForBuild','452156FTBbai','\x20in\x20','__awaiter','confirmationPrompt','registerPrompt','array','backup','askForJobRun','confirm','json','cmdPath','grey','No,\x20abort','service:\x20\x27','bgGrey','__importDefault','askForResourcePaginated','paths','description','rawObject','Go\x20to\x20editor','unset','cursor','\x20to\x20use:','for\x20this\x20','minimum','resultCache','pipeline','name','set','token','retry','maximum','./api-helpers','Unexpected\x20file\x20type:\x20','example','fetchResourceList','5622dRMAdV','opt','askForTag','object','tmpCmdPath','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','length','defaultPaginationPageSize','templates','value','4ZokBwi','Aborted.','Configuration\x20file\x20written\x20to\x20','ABORT','path','askForClusterId','tag','runs','addon:\x20\x27','inquirer-search-list','1887264yVnDdW','service\x20build','stringify','subdomainPath','__importStar','\x20Example:\x20','askGeneric','data','askForCredentials','subdomains','Do\x20you\x20want\x20to\x20add\x20more','volumes','test','\x20characters','concat','log\x20sink','services','this\x20option\x20is\x20required,\x20please\x20answer','defineProperty','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','string','logSinks','pagination-prompt','job','createdAt','apply','setPathVars','pagination','inquirer','InquirerHelper','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','No\x20','yellowBright','\x20type?',',\x20supported\x20types:\x20[json|yaml|yml]','secrets','completedAt','job\x20runs','getType','apiClient','__createBinding','isObject','Writing\x20configuration\x20failed:\x20','YES','restore','has','No\x20containers\x20found','don\x27t\x20change','pipelines','cluster\x20id','restores','Please\x20confirm\x20following\x20configuration:\x0a','getInnerType','builds','saveFile','map','1315652vckuFK','input','volume','isUndefined','jobs','projects','max','keys','REPEAT','yaml','unshift','editedResult','choice','editor','fileName','723035UPRUZt','toUpperCase','to\x20use:','fullName','\x20and\x20it\x20','isNaN','askArrayEntry','create','confirmation','type','Choose\x20the\x20','not\x20completed','cloud'];a8e=function(){return ey;};return a8e();}exports[a8w(0x82)]=InquirerHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a9b=a9o;(function(e,o){const l=a9o,h=e();while(!![]){try{const p=parseInt(l(0x176))/0x1*(-parseInt(l(0x149))/0x2)+-parseInt(l(0x180))/0x3*(parseInt(l(0x174))/0x4)+parseInt(l(0x15e))/0x5+parseInt(l(0x16b))/0x6*(parseInt(l(0x15b))/0x7)+parseInt(l(0x182))/0x8+parseInt(l(0x147))/0x9+-parseInt(l(0x17f))/0xa*(parseInt(l(0x168))/0xb);if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a9e,0x35a2f));var __createBinding=this&&this[a9b(0x152)]||(Object['create']?function(e,h,p,Y){const a=a9b;if(Y===undefined)Y=p;var q=Object[a(0x160)](h,p);(!q||(a(0x153)in q?!h[a(0x179)]:q[a(0x145)]||q[a(0x183)]))&&(q={'enumerable':!![],'get':function(){return h[p];}}),Object[a(0x170)](e,Y,q);}:function(e,h,p,Y){if(Y===undefined)Y=p;e[Y]=h[p];}),__setModuleDefault=this&&this[a9b(0x167)]||(Object['create']?function(e,h){const z=a9b;Object['defineProperty'](e,z(0x17b),{'enumerable':!![],'value':h});}:function(e,h){const H=a9b;e[H(0x17b)]=h;}),__importStar=this&&this[a9b(0x16d)]||function(e){const P=a9b;if(e&&e['__esModule'])return e;var o={};if(e!=null){for(var h in e)if(h!==P(0x17b)&&Object[P(0x148)][P(0x158)][P(0x16e)](e,h))__createBinding(o,e,h);}return __setModuleDefault(o,e),o;},__awaiter=this&&this['__awaiter']||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){function v(Z){const V=a9o;try{I(p[V(0x169)](Z));}catch(k){J(k);}}function s(Z){const u=a9o;try{I(p[u(0x17d)](Z));}catch(k){J(k);}}function I(Z){const c=a9o;Z['done']?q(Z['value']):Y(Z[c(0x157)])[c(0x151)](v,s);}I((p=p['apply'](e,o||[]))['next']());});},__importDefault=this&&this[a9b(0x184)]||function(e){const n=a9b;return e&&e[n(0x179)]?e:{'default':e};};Object[a9b(0x170)](exports,a9b(0x179),{'value':!![]}),exports[a9b(0x156)]=void 0x0;function a9e(){const X=['5753XzNDsd','next','write','6WVYgrf','startLogin','__importStar','call','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','defineProperty','handleError','createWebSocketStream','SIGINT','52CgKDum','error','2lFbekY','browser-opened','wss:','__esModule','Login\x20process\x20stopped\x20before\x20completed','default','login-failure','throw','init-ack','290KVxyaX','43671HxTBzr','parse','1430776aWXbgr','configurable','__importDefault','replace','openBrowser','writable','duplex','1222506jkfbIS','prototype','105074TjvXPv','removeListener','Unable\x20to\x20open\x20browser:\x20','Failure\x20during\x20login:\x20','init','data','ws:','status','then','__createBinding','get','idle','exit','NorthflankApiBrowserLogin','value','hasOwnProperty','message','type','1472527YjJisZ','stringify','initPackage','20675JrkUsj','success','getOwnPropertyDescriptor','http:','error\x20happened\x20during\x20browser\x20login:\x20','open','end','baseUrl','Unexpected\x20response,\x20api\x20token\x20missing','__setModuleDefault'];a9e=function(){return X;};return a9e();}function a9o(e,o){const h=a9e();return a9o=function(p,Y){p=p-0x145;let q=h[p];return q;},a9o(e,o);}const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a9b(0x163))),events_1=require('events');class NorthflankApiBrowserLogin extends events_1['EventEmitter']{constructor(e,o=!![]){const d=a9b;super(),this[d(0x165)]=e,this[d(0x186)]=o,this[d(0x150)]=d(0x154),this[d(0x15d)]=()=>JSON[d(0x15c)]({'type':d(0x14d)});}[a9b(0x16c)](){const j=a9b;var e;const o=this[j(0x165)]['replace']('https:',j(0x178))[j(0x185)](j(0x161),j(0x14f)),h=o+'/v1/cli-login',p=new ws_1[(j(0x17b))](h),Y=()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=j;yield new Promise(J=>{const Q=a9o;var v;(v=this[Q(0x146)])===null||v===void 0x0?void 0x0:v['end'](JSON[Q(0x15c)]({'type':'aborted'}),()=>J());}),process[D(0x155)]();}),q=new Promise((J,v)=>{const f=j;var s,I,Z;try{this[f(0x146)]=(0x0,ws_1[f(0x172)])(p),process['on'](f(0x173),Y);}catch(k){v(new Error(f(0x16f)+k[f(0x159)]));}(s=this['duplex'])===null||s===void 0x0?void 0x0:s['on'](f(0x14e),L=>{const i=f;var F;const W=JSON[i(0x181)](L['toString']());switch(W===null||W===void 0x0?void 0x0:W[i(0x15a)]){case i(0x17e):{const {loginPage:N}=W;if(N===undefined){this[i(0x171)]('Unexpected\x20response',v);return;}this['openBrowser']&&(0x0,open_1[i(0x17b)])(N)['catch'](g=>{const R=i,w=R(0x14b)+g['message'];this[R(0x171)](w,v);});this['emit'](i(0x177),{'url':N});break;}case'login-success':{const {apiToken:g,contextName:w}=W;if(g===undefined){this[i(0x171)](i(0x166),v);return;}(F=this[i(0x146)])===null||F===void 0x0?void 0x0:F[i(0x164)](),J({'token':g,'contextName':w}),this[i(0x150)]=i(0x15f);break;}case i(0x17c):{const C=i(0x14c)+(W===null||W===void 0x0?void 0x0:W[i(0x159)]);this[i(0x171)](C,v);break;}default:{const x='unable\x20to\x20parse\x20message:\x20'+JSON[i(0x15c)](W);this['handleError'](x,v);}}}),(I=this[f(0x146)])===null||I===void 0x0?void 0x0:I['on']('error',L=>{const t=f;this[t(0x171)](t(0x162)+L[t(0x159)],v);}),(Z=this[f(0x146)])===null||Z===void 0x0?void 0x0:Z['on'](f(0x164),()=>{const G=f;if(this['status']==='success'){}else this[G(0x171)](G(0x17a),v);});});return(e=this[j(0x146)])===null||e===void 0x0?void 0x0:e[j(0x16a)](this[j(0x15d)]()),this[j(0x150)]=j(0x14d),q['finally'](()=>{const y=j;process[y(0x14a)](y(0x173),Y);});}[a9b(0x171)](e,o){const S=a9b;var h,p;o?(h=this['duplex'])===null||h===void 0x0?void 0x0:h[S(0x164)](()=>o(new Error(e))):(p=this[S(0x146)])===null||p===void 0x0?void 0x0:p[S(0x164)](),this['status']=S(0x175);}}exports[a9b(0x156)]=NorthflankApiBrowserLogin;
|
package/dist/logs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a10u(){const uD=['--container\x20--containerId\x20[containerId]','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','default','getCommand','Id]','Deployment\x20id,\x20example:\x20my-service-54785f4','tsHint','askForAddonBackup','Number\x20of\x20lines\x20to\x20return.','3023616kqoeHw','askForAddon','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','\x20(exit\x20with\x20','warning','-f,\x20--tail','--textNotIncludes\x20<text>','__esModule','./log-formatter','Error\x20while\x20fetching\x20log\x20lines:\x20',',\x20from:\x20','--regexNotIncludes\x20<regex>','908210haAYOZ','close',',\x20restore\x20id\x20','4iXEvDB','textIncludes','inquirerHelper','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','description','data','done','cursor','assign','Log\x20session\x20ended','--project\x20--projectId\x20[projectId]','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','ApiClient','addonRestore','defineProperty','Which\x20log\x20types\x20to\x20fetch','logs-received','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','job','chalk','5omNJqu','buildId','defaultDurationSeconds','json','commander','\x20seconds','alias','askForAddonRestore','formatLogLine','addonBackup','addOption','../inquirer-helper','Id\x20[','choices','--restore\x20--restoreId\x20[restoreId]','getCurrentJobName','error','regexNotIncludes','askForService','Backup\x20to\x20get\x20logs\x20from','yaml','767706NjmVla','logRange','7344qedBNP','parseDateInput','printInitInfo','../utils','addonId','Get\x20logs\x20generated\x20after\x20this\x20time,\x20','Option','noDefaults','getCurrentServiceName','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','restoreId','\x20--','message','textNotIncludes','1121276dECsTk','apply','stringify','conflicts','assertContextExisting','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','tail','\x20in\x20project\x20','Build\x20to\x20get\x20logs\x20from','yml','Project\x20for\x20logs','argParser','hasNextPage','-d,\x20--direction\x20<order>','getStandardLogCommand','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.','Error\x20while\x20tailing\x20log\x20lines:\x20','../formatting/console-format-helpers','action','service','value','logTail','customUserAgent','log','--duration\x20[duration]','askForBuild','2443Tilbtj','InquirerHelper','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','Restore\x20to\x20get\x20logs\x20from','-l,\x20--lineLimit\x20[limit]','__importDefault','setSeconds',',\x20duration:\x20','printResponse','backward','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','261204iNjCUR','@northflank/js-client','Get\x20log\x20for\x20the\x20specified\x20','apiClient','>\x20Container\x20logs','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','slice','9IgjatZ','--textIncludes\x20<text>','runId','bold','option','containerId','getSeconds','--endTime\x20<timestamp>','apiContext','\x20to\x20get\x20logs\x20from','317796PePKbP','build-','values','next','regexIncludes','logs','-o,\x20--output\x20[output]','then','CliLogs','getLogsCommand','\x20for\x20all\x20containers','44eiICSW','throw','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','--build\x20--buildId\x20[buildId]','backupId','deploymentId','format','valueOf','charAt','--regexIncludes\x20<regex>'];a10u=function(){return uD;};return a10u();}const a10u0=a10I;(function(u,I){const d=a10I,a=u();while(!![]){try{const x=-parseInt(d(0x15e))/0x1+parseInt(d(0x18c))/0x2*(-parseInt(d(0x1b5))/0x3)+parseInt(d(0x1c5))/0x4*(parseInt(d(0x1a0))/0x5)+parseInt(d(0x17d))/0x6+parseInt(d(0x1e0))/0x7*(parseInt(d(0x1b7))/0x8)+parseInt(d(0x154))/0x9*(parseInt(d(0x189))/0xa)+parseInt(d(0x169))/0xb*(parseInt(d(0x1eb))/0xc);if(x===I)break;else a['push'](a['shift']());}catch(D){a['push'](a['shift']());}}}(a10u,0x6e93e));var __awaiter=this&&this['__awaiter']||function(u,I,a,x){function D(K){return K instanceof a?K:new a(function(z){z(K);});}return new(a||(a=Promise))(function(K,z){const Y=a10I;function H(p){try{C(x['next'](p));}catch(b){z(b);}}function s(p){const v=a10I;try{C(x[v(0x16a)](p));}catch(b){z(b);}}function C(p){const t=a10I;p[t(0x192)]?K(p[t(0x1da)]):D(p[t(0x1da)])[t(0x165)](H,s);}C((x=x[Y(0x1c6)](u,I||[]))[Y(0x161)]());});},__importDefault=this&&this[a10u0(0x1e5)]||function(u){return u&&u['__esModule']?u:{'default':u};};Object[a10u0(0x19a)](exports,a10u0(0x184),{'value':!![]}),exports[a10u0(0x166)]=void 0x0;function a10I(u,I){const a=a10u();return a10I=function(x,D){x=x-0x150;let K=a[x];return K;},a10I(u,I);}const js_client_1=require(a10u0(0x1ec)),chalk_1=__importDefault(require(a10u0(0x19f))),utils_1=require(a10u0(0x1ba)),inquirer_helper_1=require(a10u0(0x1ab)),commander_1=require(a10u0(0x1a4)),console_format_helpers_1=require(a10u0(0x1d7)),log_formatter_1=require(a10u0(0x185));class CliLogs{constructor(u){const u1=a10u0;this[u1(0x15c)]=u,this['defaultDurationSeconds']=0x708,this[u1(0x1d3)]=(I,a,x,D)=>{const u2=u1,K=(0x0,utils_1[u2(0x177)])(!![])['name']((a?u2(0x15f):'')+u2(0x163))[u2(0x1a6)]((a?u2(0x15f):'')+u2(0x1dd))[u2(0x190)](u2(0x1ed)+I)[u2(0x158)](u2(0x196),u2(0x1cf))['option']('--'+I+u2(0x1c2)+I+u2(0x1ac)+I+u2(0x178),I[u2(0x171)](0x0)['toUpperCase']()+I[u2(0x153)](0x1)+u2(0x15d))[u2(0x158)](u2(0x173),u2(0x1ea));if(a)K[u2(0x158)](u2(0x16c),u2(0x1cd));if(I===u2(0x19e))K['option']('--run\x20--runId\x20[runId]',u2(0x1d4));if(I===u2(0x1d9))K['option']('--deployment\x20--deploymentId\x20[deploymentId]',u2(0x179));if(x)K[u2(0x158)]('--backup\x20--backupId\x20[backupId]',u2(0x1b3));if(D)K[u2(0x158)](u2(0x1ae),u2(0x1e3));return!a&&!x&&!D&&K[u2(0x1aa)](new commander_1[(u2(0x1bd))]('-t,\x20--types\x20<types...>',u2(0x19b))[u2(0x1ad)](Object[u2(0x160)](js_client_1['LogType']))),K['option'](u2(0x182),u2(0x1d5))[u2(0x158)](u2(0x1e4),u2(0x17c))[u2(0x158)]('--startTime\x20<timestamp>',u2(0x1bc)+utils_1[u2(0x17a)],utils_1[u2(0x1b8)])['addOption'](new commander_1['Option'](u2(0x15b),u2(0x175)+utils_1[u2(0x17a)])[u2(0x1d0)](utils_1[u2(0x1b8)])[u2(0x1c8)]([u2(0x1cb)]))[u2(0x158)](u2(0x1de),u2(0x18f))[u2(0x1aa)](new commander_1[(u2(0x1bd))](u2(0x1d2),u2(0x16b))[u2(0x1ad)]([u2(0x1e9),'forward'])[u2(0x1c8)](['tail']))[u2(0x1aa)](new commander_1[(u2(0x1bd))](u2(0x155),u2(0x1c0))[u2(0x1c8)]([u2(0x1c4),u2(0x162),u2(0x1b1)]))[u2(0x1aa)](new commander_1[(u2(0x1bd))](u2(0x183),u2(0x1e2))[u2(0x1c8)]([u2(0x18d),'regexIncludes',u2(0x1b1)]))['addOption'](new commander_1[(u2(0x1bd))](u2(0x172),u2(0x17f))[u2(0x1c8)]([u2(0x1c4),u2(0x18d),'regexNotIncludes']))['addOption'](new commander_1['Option'](u2(0x188),u2(0x19d))[u2(0x1c8)]([u2(0x1c4),u2(0x162),u2(0x18d)]))[u2(0x158)]('--noDefaults',u2(0x197),![])[u2(0x1aa)](new commander_1[(u2(0x1bd))](u2(0x164),u2(0x152))['choices'](Object[u2(0x160)]([u2(0x16f),u2(0x1a3),u2(0x1b4)]))),K;},this[u1(0x1b9)]=(I,a,x,D)=>{const u3=u1,{containerName:K,restoreId:z,backupId:H,quiet:s,tail:C,startTime:p,endTime:b,duration:i}=D;if(s===!![])return;const j=C?u3(0x180)+chalk_1['default'][u3(0x157)]('\x27Ctrl+C\x27')+')':'',A=C?'\x20with\x20live-tailing':'',F=new Date(),X=p!==null&&p!==void 0x0?p:new Date(new Date((b!==null&&b!==void 0x0?b:F)['valueOf']())[u3(0x1e6)]((b!==null&&b!==void 0x0?b:F)[u3(0x15a)]()-(i!==null&&i!==void 0x0?i:this[u3(0x1a2)]))),T=(b!==null&&b!==void 0x0?b:p!==undefined)?new Date(new Date(p[u3(0x170)]())['setSeconds'](p['getSeconds']()+(i!==null&&i!==void 0x0?i:this['defaultDurationSeconds']))):F,E=H!==undefined,f=X&&!E?u3(0x187)+chalk_1[u3(0x176)]['bold'](X['toISOString']()):'',N=T&&!E?',\x20to:\x20'+chalk_1[u3(0x176)][u3(0x157)](T['toISOString']()):'',P=i?u3(0x1e7)+i+u3(0x1a5):'',m=K?'\x20for\x20container\x20'+chalk_1[u3(0x176)][u3(0x157)](K):E?'':u3(0x168),k=H?',\x20backup\x20id\x20'+H:'',R=z?u3(0x18b)+z:'',q=I+'\x20'+chalk_1[u3(0x176)]['bold'](a)+k+R+u3(0x1cc)+chalk_1[u3(0x176)][u3(0x157)](x),c=''+f+N+P;console[u3(0x1dd)](u3(0x151)+A+m+'\x20of\x20'+q+c+j+':');},this['getFormatter']=(I,a)=>(x,D)=>{const u4=u1;if(!I){if(x['length']===0x0)console[u4(0x1dd)](u4(0x1ca));x['forEach'](K=>(0x0,log_formatter_1[u4(0x1a8)])(K,a));}else(0x0,console_format_helpers_1[u4(0x1e8)])(I,x);(D===null||D===void 0x0?void 0x0:D[u4(0x1d1)])&&(0x0,utils_1[u4(0x181)])(u4(0x174)+D[u4(0x193)]);},this[u1(0x150)]=new js_client_1[(u1(0x198))](u,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[u1(0x1dc)]}),this['logsApiClient']=this['apiClient'],this[u1(0x18e)]=new inquirer_helper_1[(u1(0x1e1))](this['apiClient']);}[a10u0(0x167)](u,I=![],a=![],x=![]){const ua=a10u0,D=(b,i)=>__awaiter(this,void 0x0,void 0x0,function*(){const u5=a10I,j=i[u5(0x1be)],{apiContext:A,inquirerHelper:F}=this;switch(u){case u5(0x1d9):{const X=j?undefined:A[u5(0x1bf)]();return i['serviceId']||X||(yield F[u5(0x1b2)](b)());}case u5(0x19e):{const T=j?undefined:A[u5(0x1af)]();return i['jobId']||T||(yield F['askForJob'](b)());}case'addon':{return i[u5(0x1bb)]||(yield F[u5(0x17e)](b)());}}}),K=(b,i,j)=>__awaiter(this,void 0x0,void 0x0,function*(){const u6=a10I;if(I)return j[u6(0x1a1)]||(yield this['inquirerHelper'][u6(0x1df)](b,u===u6(0x1d9)?i:undefined,u===u6(0x19e)?i:undefined,!![])());return undefined;}),z=(b,i,j)=>__awaiter(this,void 0x0,void 0x0,function*(){const u7=a10I;if(a||x)return j[u7(0x16d)]||(yield this[u7(0x18e)][u7(0x17b)](b,i)());return undefined;}),H=(b,i,j,A)=>__awaiter(this,void 0x0,void 0x0,function*(){const u8=a10I;if(x)return A[u8(0x1c1)]||(yield this[u8(0x18e)][u8(0x1a7)](b,i,j)());return undefined;}),s=(b,i,j)=>__awaiter(this,void 0x0,void 0x0,function*(){const u9=a10I;if(!I&&j[u9(0x159)]!==undefined){if(j[u9(0x159)]!==!![])return j[u9(0x159)];return yield this[u9(0x18e)]['askForContainer'](b,u===u9(0x1d9)?i:undefined,u==='job'?i:undefined,!![])();}return undefined;}),C=(b,i,j)=>__awaiter(this,void 0x0,void 0x0,function*(){const uu=a10I;if(u==='job')return j[uu(0x156)]||(yield this['inquirerHelper']['askForJobRun'](i,b,!![])());return undefined;}),p=(b,i,j)=>__awaiter(this,void 0x0,void 0x0,function*(){const uI=a10I;if(u===uI(0x1d9)){if(j[uI(0x16e)]!==!![])return j[uI(0x16e)];return j['deploymentId'];}return undefined;});return this[ua(0x1d3)](u,I,a,x)[ua(0x1d8)](b=>__awaiter(this,void 0x0,void 0x0,function*(){const ux=ua,{noDefaults:i,projectId:j,quiet:A,tail:F,types:X,textIncludes:T,textNotIncludes:E,regexIncludes:f,regexNotIncludes:N,direction:P,lineLimit:m,startTime:k,endTime:R,duration:q,output:c}=b;(0x0,utils_1[ux(0x1c9)])(this[ux(0x150)]);const {apiContext:M,inquirerHelper:r,logsApiClient:o}=this,w=i?undefined:M['getCurrentProjectName'](),h=j||w||(yield r['askForProject']()),W=yield D(h,b),B=yield K(h,W,b),J=yield z(h,W,b),V=yield H(h,W,J,b),y=yield C(h,W,b),e=yield p(h,W,b),U=yield s(h,W,b);if(k&&R&&q)throw new Error('Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.');const S={'projectId':h,'entityId':W},n={'containerName':U,'types':X,'textIncludes':T,'textNotIncludes':E,'regexIncludes':f,'regexNotIncludes':N,'lineLimit':m,'startTime':k,'duration':q,'runId':y,'buildId':B,'backupId':J,'restoreId':V,'deploymentId':e,'isBuild':I!==null&&I!==void 0x0?I:![]},L=x?ux(0x199):a?ux(0x1a9):u,g=Object[ux(0x194)](Object[ux(0x194)]({},n),{'endTime':R,'direction':P});if(!A&&c!==ux(0x1b4)&&c!==ux(0x1ce)&&c!==ux(0x1a3))this[ux(0x1b9)](u,W,h,Object[ux(0x194)](Object[ux(0x194)]({},g),b));const l=this['getFormatter'](c,T!==null&&T!==void 0x0?T:f);if(F){const Z=yield o[ux(0x163)][ux(0x1db)](S,n,L);Z['on'](ux(0x19c),l),Z['on'](ux(0x1b0),G=>(0x0,utils_1[ux(0x1b0)])(ux(0x1d6)+G[ux(0x1c3)])),Z['on'](ux(0x18a),()=>console['log'](ux(0x195))),yield Z['start']();}else{const G=yield o[ux(0x163)][ux(0x1b6)](S,g,L);if(G[ux(0x1b0)]){const O=G[ux(0x1b0)]['details'],Q=O?'\x0aDetails:\x20'+JSON[ux(0x1c7)](O,null,'\x20'):'';(0x0,utils_1['error'])(ux(0x186)+G[ux(0x1b0)][ux(0x1c3)]+Q);}else l(G[ux(0x191)],G['pagination']);}}));}}exports[a10u0(0x166)]=CliLogs;
|
|
1
|
+
'use strict';const a10K=a10o;(function(e,o){const M=a10o,h=e();while(!![]){try{const p=-parseInt(M(0x232))/0x1*(-parseInt(M(0x1e7))/0x2)+parseInt(M(0x240))/0x3+-parseInt(M(0x21b))/0x4+parseInt(M(0x209))/0x5*(-parseInt(M(0x248))/0x6)+-parseInt(M(0x206))/0x7+parseInt(M(0x243))/0x8+parseInt(M(0x23c))/0x9;if(p===o)break;else h['push'](h['shift']());}catch(Y){h['push'](h['shift']());}}}(a10e,0x6863b));var __awaiter=this&&this[a10K(0x237)]||function(e,o,h,p){function Y(q){return q instanceof h?q:new h(function(J){J(q);});}return new(h||(h=Promise))(function(q,J){const e0=a10o;function v(Z){const r=a10o;try{I(p[r(0x1f7)](Z));}catch(k){J(k);}}function s(Z){try{I(p['throw'](Z));}catch(k){J(k);}}function I(Z){const B=a10o;Z[B(0x212)]?q(Z['value']):Y(Z[B(0x234)])[B(0x1fc)](v,s);}I((p=p[e0(0x268)](e,o||[]))[e0(0x1f7)]());});},__importDefault=this&&this[a10K(0x20d)]||function(e){return e&&e['__esModule']?e:{'default':e};};function a10o(e,o){const h=a10e();return a10o=function(p,Y){p=p-0x1e1;let q=h[p];return q;},a10o(e,o);}Object['defineProperty'](exports,a10K(0x262),{'value':!![]}),exports['CliLogs']=void 0x0;function a10e(){const eY=['\x20for\x20all\x20containers','description','toUpperCase','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.','service','46bmxPsC','LogType','getStandardLogCommand','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','\x0aDetails:\x20','--textIncludes\x20<text>','job','-f,\x20--tail','Id]',',\x20to:\x20','containerId',',\x20from:\x20','addonBackup','@northflank/js-client','Restore\x20to\x20get\x20logs\x20from','start','next','assertContextExisting','tsHint','getCommand','askForAddonBackup','then','jobId','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','--run\x20--runId\x20[runId]','bold','valueOf','--project\x20--projectId\x20[projectId]','build-','-l,\x20--lineLimit\x20[limit]','\x27Ctrl+C\x27','2701468eFgnyK','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','runId','5QJIVnn','getFormatter','error','close','__importDefault','regexIncludes','--noDefaults','commander','\x20with\x20live-tailing','done','Id\x20[','printInitInfo','apiContext','conflicts','Error\x20while\x20fetching\x20log\x20lines:\x20','textNotIncludes','apiClient','askForService','1754324fxbxTM','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','getCurrentProjectName','askForJob','../inquirer-helper','buildId','--container\x20--containerId\x20[containerId]','logsApiClient','regexNotIncludes','addOption','toISOString','Build\x20to\x20get\x20logs\x20from','message','../formatting/console-format-helpers',',\x20backup\x20id\x20','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','--startTime\x20<timestamp>','Number\x20of\x20lines\x20to\x20return.','slice','choices','deploymentId','charAt','getCurrentServiceName','16319OyULdG','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','value','yaml','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','__awaiter','formatLogLine','tail','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','Option','14480604DHgOaL','getCurrentJobName','noDefaults','logRange','223320lNeWMk','stringify','logs','47000VqjUAk','./log-formatter','log','\x20to\x20get\x20logs\x20from','parseDateInput','4875144fgOLrx','Deployment\x20id,\x20example:\x20my-service-54785f4','askForProject','addonId','addonRestore','backupId','alias','argParser','Log\x20session\x20ended','details','InquirerHelper',',\x20restore\x20id\x20','--regexIncludes\x20<regex>','\x20in\x20project\x20','action','ApiClient','getLogsCommand','--backup\x20--backupId\x20[backupId]','getSeconds','defaultDurationSeconds','assign','-d,\x20--direction\x20<order>','option','length','askForJobRun','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','__esModule','cursor','yml','data','textIncludes','setSeconds','apply','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','\x20--','default','backward','json','askForAddonRestore','-t,\x20--types\x20<types...>','printResponse','--endTime\x20<timestamp>','inquirerHelper','--duration\x20[duration]','Backup\x20to\x20get\x20logs\x20from','format'];a10e=function(){return eY;};return a10e();}const js_client_1=require(a10K(0x1f4)),chalk_1=__importDefault(require('chalk')),utils_1=require('../utils'),inquirer_helper_1=require(a10K(0x21f)),commander_1=require(a10K(0x210)),console_format_helpers_1=require(a10K(0x228)),log_formatter_1=require(a10K(0x244));class CliLogs{constructor(e){const e1=a10K;this[e1(0x215)]=e,this[e1(0x25b)]=0x708,this[e1(0x1e9)]=(o,h,p,Y)=>{const e2=e1,q=(0x0,utils_1[e2(0x1fa)])(!![])['name']((h?e2(0x203):'')+e2(0x242))[e2(0x24e)]((h?e2(0x203):'')+e2(0x245))[e2(0x1e3)]('Get\x20log\x20for\x20the\x20specified\x20'+o)['option'](e2(0x202),'Project\x20for\x20logs')[e2(0x25e)]('--'+o+e2(0x26a)+o+e2(0x213)+o+e2(0x1ef),o[e2(0x230)](0x0)[e2(0x1e4)]()+o[e2(0x22d)](0x1)+e2(0x246))[e2(0x25e)](e2(0x221),e2(0x233));if(h)q['option']('--build\x20--buildId\x20[buildId]',e2(0x226));if(o===e2(0x1ed))q[e2(0x25e)](e2(0x1ff),e2(0x269));if(o===e2(0x1e6))q[e2(0x25e)]('--deployment\x20--deploymentId\x20[deploymentId]',e2(0x249));if(p)q[e2(0x25e)](e2(0x259),e2(0x274));if(Y)q[e2(0x25e)]('--restore\x20--restoreId\x20[restoreId]',e2(0x1f5));return!h&&!p&&!Y&&q['addOption'](new commander_1[(e2(0x23b))](e2(0x26f),'Which\x20log\x20types\x20to\x20fetch')['choices'](Object['values'](js_client_1[e2(0x1e8)]))),q[e2(0x25e)](e2(0x1ee),e2(0x1e5))[e2(0x25e)](e2(0x204),e2(0x22c))[e2(0x25e)](e2(0x22b),'Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1[e2(0x1f9)],utils_1['parseDateInput'])[e2(0x224)](new commander_1[(e2(0x23b))](e2(0x271),e2(0x23a)+utils_1[e2(0x1f9)])[e2(0x24f)](utils_1[e2(0x247)])['conflicts']([e2(0x239)]))[e2(0x25e)](e2(0x273),e2(0x261))[e2(0x224)](new commander_1[(e2(0x23b))](e2(0x25d),'Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.')[e2(0x22e)]([e2(0x26c),'forward'])['conflicts'](['tail']))[e2(0x224)](new commander_1[(e2(0x23b))](e2(0x1ec),e2(0x1ea))[e2(0x216)]([e2(0x218),e2(0x20e),e2(0x223)]))[e2(0x224)](new commander_1[(e2(0x23b))]('--textNotIncludes\x20<text>',e2(0x1fe))['conflicts']([e2(0x266),'regexIncludes',e2(0x223)]))['addOption'](new commander_1['Option'](e2(0x254),e2(0x236))[e2(0x216)]([e2(0x218),e2(0x266),e2(0x223)]))['addOption'](new commander_1[(e2(0x23b))]('--regexNotIncludes\x20<regex>',e2(0x22a))[e2(0x216)]([e2(0x218),'regexIncludes',e2(0x266)]))[e2(0x25e)](e2(0x20f),'Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])['addOption'](new commander_1[(e2(0x23b))]('-o,\x20--output\x20[output]','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.')[e2(0x22e)](Object['values']([e2(0x1e1),e2(0x26d),'yaml']))),q;},this[e1(0x214)]=(o,h,p,Y)=>{const e3=e1,{containerName:q,restoreId:J,backupId:v,quiet:s,tail:I,startTime:Z,endTime:k,duration:L}=Y;if(s===!![])return;const F=I?'\x20(exit\x20with\x20'+chalk_1['default'][e3(0x200)](e3(0x205))+')':'',W=I?e3(0x211):'',N=new Date(),g=Z!==null&&Z!==void 0x0?Z:new Date(new Date((k!==null&&k!==void 0x0?k:N)[e3(0x201)]())['setSeconds']((k!==null&&k!==void 0x0?k:N)[e3(0x25a)]()-(L!==null&&L!==void 0x0?L:this[e3(0x25b)]))),w=(k!==null&&k!==void 0x0?k:Z!==undefined)?new Date(new Date(Z[e3(0x201)]())[e3(0x267)](Z['getSeconds']()+(L!==null&&L!==void 0x0?L:this[e3(0x25b)]))):N,C=v!==undefined,x=g&&!C?e3(0x1f2)+chalk_1[e3(0x26b)][e3(0x200)](g[e3(0x225)]()):'',l=w&&!C?e3(0x1f0)+chalk_1['default'][e3(0x200)](w[e3(0x225)]()):'',b=L?',\x20duration:\x20'+L+'\x20seconds':'',a=q?'\x20for\x20container\x20'+chalk_1[e3(0x26b)][e3(0x200)](q):C?'':e3(0x1e2),z=v?e3(0x229)+v:'',H=J?e3(0x253)+J:'',P=o+'\x20'+chalk_1[e3(0x26b)][e3(0x200)](h)+z+H+e3(0x255)+chalk_1['default']['bold'](p),V=''+x+l+b;console[e3(0x245)]('>\x20Container\x20logs'+W+a+'\x20of\x20'+P+V+F+':');},this[e1(0x20a)]=(o,h)=>(p,Y)=>{const e4=e1;if(!o){if(p[e4(0x25f)]===0x0)console['log'](e4(0x207));p['forEach'](q=>(0x0,log_formatter_1[e4(0x238)])(q,h));}else(0x0,console_format_helpers_1[e4(0x270)])(o,p);(Y===null||Y===void 0x0?void 0x0:Y['hasNextPage'])&&(0x0,utils_1['warning'])('Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20'+Y[e4(0x263)]);},this[e1(0x219)]=new js_client_1[(e1(0x257))](e,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1['customUserAgent']}),this[e1(0x222)]=this[e1(0x219)],this[e1(0x272)]=new inquirer_helper_1[(e1(0x252))](this[e1(0x219)]);}[a10K(0x258)](e,o=![],h=![],p=![]){const eh=a10K,Y=(k,L)=>__awaiter(this,void 0x0,void 0x0,function*(){const e5=a10o,F=L[e5(0x23e)],{apiContext:W,inquirerHelper:N}=this;switch(e){case'service':{const g=F?undefined:W[e5(0x231)]();return L['serviceId']||g||(yield N[e5(0x21a)](k)());}case e5(0x1ed):{const w=F?undefined:W[e5(0x23d)]();return L[e5(0x1fd)]||w||(yield N[e5(0x21e)](k)());}case'addon':{return L[e5(0x24b)]||(yield N['askForAddon'](k)());}}}),q=(k,L,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const e6=a10o;if(o)return F[e6(0x220)]||(yield this['inquirerHelper']['askForBuild'](k,e===e6(0x1e6)?L:undefined,e===e6(0x1ed)?L:undefined,!![])());return undefined;}),J=(k,L,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const e7=a10o;if(h||p)return F[e7(0x24d)]||(yield this[e7(0x272)][e7(0x1fb)](k,L)());return undefined;}),v=(k,L,F,W)=>__awaiter(this,void 0x0,void 0x0,function*(){const e8=a10o;if(p)return W['restoreId']||(yield this[e8(0x272)][e8(0x26e)](k,L,F)());return undefined;}),s=(k,L,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const e9=a10o;if(!o&&F[e9(0x1f1)]!==undefined){if(F['containerId']!==!![])return F[e9(0x1f1)];return yield this[e9(0x272)]['askForContainer'](k,e===e9(0x1e6)?L:undefined,e===e9(0x1ed)?L:undefined,!![])();}return undefined;}),I=(k,L,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const ee=a10o;if(e===ee(0x1ed))return F[ee(0x208)]||(yield this['inquirerHelper'][ee(0x260)](L,k,!![])());return undefined;}),Z=(k,L,F)=>__awaiter(this,void 0x0,void 0x0,function*(){const eo=a10o;if(e===eo(0x1e6)){if(F['deploymentId']!==!![])return F[eo(0x22f)];return F[eo(0x22f)];}return undefined;});return this[eh(0x1e9)](e,o,h,p)[eh(0x256)](k=>__awaiter(this,void 0x0,void 0x0,function*(){const ep=eh,{noDefaults:L,projectId:F,quiet:W,tail:N,types:g,textIncludes:w,textNotIncludes:C,regexIncludes:x,regexNotIncludes:l,direction:b,lineLimit:a,startTime:z,endTime:H,duration:P,output:V}=k;(0x0,utils_1[ep(0x1f8)])(this[ep(0x219)]);const {apiContext:u,inquirerHelper:c,logsApiClient:n}=this,d=L?undefined:u[ep(0x21d)](),j=F||d||(yield c[ep(0x24a)]()),Q=yield Y(j,k),D=yield q(j,Q,k),f=yield J(j,Q,k),i=yield v(j,Q,f,k),R=yield I(j,Q,k),t=yield Z(j,Q,k),G=yield s(j,Q,k);if(z&&H&&P)throw new Error(ep(0x21c));const y={'projectId':j,'entityId':Q},S={'containerName':G,'types':g,'textIncludes':w,'textNotIncludes':C,'regexIncludes':x,'regexNotIncludes':l,'lineLimit':a,'startTime':z,'duration':P,'runId':R,'buildId':D,'backupId':f,'restoreId':i,'deploymentId':t,'isBuild':o!==null&&o!==void 0x0?o:![]},X=p?ep(0x24c):h?ep(0x1f3):e,m=Object['assign'](Object[ep(0x25c)]({},S),{'endTime':H,'direction':b});if(!W&&V!==ep(0x235)&&V!==ep(0x264)&&V!==ep(0x26d))this['printInitInfo'](e,Q,j,Object[ep(0x25c)](Object[ep(0x25c)]({},m),k));const U=this[ep(0x20a)](V,w!==null&&w!==void 0x0?w:x);if(N){const T=yield n[ep(0x242)]['logTail'](y,S,X);T['on']('logs-received',U),T['on']('error',O=>(0x0,utils_1['error'])('Error\x20while\x20tailing\x20log\x20lines:\x20'+O[ep(0x227)])),T['on'](ep(0x20c),()=>console['log'](ep(0x250))),yield T[ep(0x1f6)]();}else{const O=yield n['logs'][ep(0x23f)](y,m,X);if(O[ep(0x20b)]){const E=O[ep(0x20b)][ep(0x251)],A=E?ep(0x1eb)+JSON[ep(0x241)](E,null,'\x20'):'';(0x0,utils_1['error'])(ep(0x217)+O[ep(0x20b)][ep(0x227)]+A);}else U(O[ep(0x265)],O['pagination']);}}));}}exports['CliLogs']=CliLogs;
|