@northflank/cli 0.9.13 → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-helpers.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/contextCommands.js +1 -1
- package/dist/defaults.js +1 -1
- package/dist/exec/index.js +1 -1
- package/dist/formatting/command-overview.js +1 -1
- package/dist/formatting/console-format-helpers.js +1 -1
- package/dist/formatting/terminal-chart.js +1 -1
- package/dist/inquirer-helper.js +1 -1
- package/dist/login/browser-login.js +1 -1
- package/dist/logs/index.js +1 -1
- package/dist/logs/log-formatter.js +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/pagination/inquirer-pagination-prompt.js +1 -1
- package/dist/port-forward/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +3 -3
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a4n(x,n){const R=a4x();return a4n=function(u,V){u=u-0x15a;let P=R[u];return P;},a4n(x,n);}const a4H=a4n;(function(x,n){const T=a4n,R=x();while(!![]){try{const u=parseInt(T(0x1a8))/0x1*(parseInt(T(0x1a5))/0x2)+-parseInt(T(0x198))/0x3+-parseInt(T(0x1aa))/0x4*(-parseInt(T(0x1bb))/0x5)+parseInt(T(0x166))/0x6+parseInt(T(0x193))/0x7+-parseInt(T(0x1a4))/0x8+-parseInt(T(0x192))/0x9;if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a4x,0xa3cd4));function a4x(){const A=['Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','done','getTerminalSize','addCommand','success','greenBright','with\x20command\x20\x27','Run\x20command\x20with\x20this\x20user','Success',',\x20details:\x20','7673244FWaUZr','with\x20user:','\x20--shell-cmd\x20\x27sh\x27','--group\x20[GROUP]','--noDefaults','none','with\x20shell\x20session','stderr','next','Id\x20[NAME]','execCmd','InquirerHelper','../utils','(exit\x20with\x20two\x20quick\x20','stdout','apiClient','assertContextExisting','Run\x20command\x20with\x20this\x20group','without\x20shell','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','getCurrentProjectName','Unknown','slice','stdOut','execStartLog','throw','askForJob','value','--project\x20--projectId\x20[NAME]','\x20--','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','bold','customUserAgent','askForProject','\x20--cmd\x20\x27date\x27\x0a\x20\x20Single\x20command,\x20custom\x20shell:\x20northflank\x20exec\x20','default','Error\x20occured\x20during\x20','action','pipe','askForService','\x20command\x20exec:\x20','charAt','apply','5120595yIzJGd','3436349MhsStI','stdin','option','getStandardExecCommand','service','3547410kBWIbQ','stdErr','__awaiter','.\x0aExamples:\x0a\x20\x20Shell\x20session:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20northflank\x20exec\x20','__esModule','Project\x20for\x20exec','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.','message','\x27Ctrl+D\x27','stdIn','@northflank/js-client','setRawMode','10193960ZiChgj','2122174EddrLA','description','\x20to\x20exec\x20into','1qWeezf','resize','3462936CjLtGV','toUpperCase','waitForCommandResult','emitKeypressEvents','isTTY','rows','name','execServiceSession','keypress','columns','filter','--cmd\x20--command\x20[COMMAND]',',\x20exit\x20code:\x20','chalk','job','readline','CliExec','5BxuJFx','exec','with\x20group:','shell\x20command\x20','getCommand','handleShellSession','Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.','../inquirer-helper','command-exec','exit','__importDefault','exitCode'];a4x=function(){return A;};return a4x();}var __awaiter=this&&this[a4H(0x19a)]||function(x,n,R,u){function V(w){return w instanceof R?w:new R(function(Y){Y(w);});}return new(R||(R=Promise))(function(w,Y){const L=a4n;function N(f){const F=a4n;try{q(u[F(0x16e)](f));}catch(M){Y(M);}}function C(f){const e=a4n;try{q(u[e(0x180)](f));}catch(M){Y(M);}}function q(f){const Q=a4n;f[Q(0x15d)]?w(f[Q(0x182)]):V(f[Q(0x182)])['then'](N,C);}q((u=u[L(0x191)](x,n||[]))[L(0x16e)]());});},__importDefault=this&&this[a4H(0x15a)]||function(x){const D=a4H;return x&&x[D(0x19c)]?x:{'default':x};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['CliExec']=void 0x0;const js_client_1=require(a4H(0x1a2)),chalk_1=__importDefault(require(a4H(0x1b7))),utils_1=require(a4H(0x172)),inquirer_helper_1=require(a4H(0x1c2));class CliExec{constructor(x){const G=a4H;this['getStandardExecCommand']=V=>(0x0,utils_1[G(0x1bf)])(!![])[G(0x1b0)](V)[G(0x1a6)]('Command\x20exec\x20for\x20the\x20specified\x20'+V+G(0x19b)+V+'\x0a\x20\x20Single\x20command,\x20no\x20shell:\x20\x20\x20\x20\x20northflank\x20exec\x20'+V+G(0x189)+V+G(0x17a)+V+G(0x168))['option'](G(0x183),G(0x19d))[G(0x195)]('--'+V+G(0x184)+V+G(0x16f),V[G(0x190)](0x0)[G(0x1ab)]()+V[G(0x17d)](0x1)+G(0x1a7))[G(0x195)]('--container\x20--containerId\x20[NAME]','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)')[G(0x195)]('--shell-cmd\x20[SHELL-CMD]',G(0x19e))[G(0x195)]('--user\x20[USER]',G(0x163))[G(0x195)](G(0x169),G(0x177))[G(0x195)](G(0x16a),G(0x15c),![])['option'](G(0x1b5),'Command\x20to\x20execute.\x0aIf\x20--shell-cmd\x20option\x20such\x20as\x20\x27bash\x20-c\x27\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell.\x20Otherwise\x20the\x20command\x20will\x20run\x20without\x20a\x20shell.\x20If\x20no\x20command\x20is\x20provided,\x20an\x20interactive\x20session\x20with\x20stdin\x20and\x20tty\x20is\x20opened.'),this[G(0x15e)]=()=>({'columns':process[G(0x174)][G(0x1b3)],'rows':process[G(0x174)][G(0x1af)]}),this[G(0x17f)]=(V,P,w,Y,N,C,q,f)=>{const h=G;if(f===!![])return;const M=Y===h(0x16b),X=M?h(0x178):Y===undefined?h(0x16c):h(0x1be)+chalk_1['default'][h(0x161)](Y),S=N!==undefined?h(0x167)+N:'',W=C!==undefined?h(0x1bd)+C:'',t=q!==undefined?h(0x162)+chalk_1['default'][h(0x161)](q)+'\x27':'',i=[t,X,S,W][h(0x1b4)](O=>O!=='')['join']('\x20'),p=h(0x173)+chalk_1[h(0x18a)][h(0x186)](h(0x1a0))+')';console['log']('Exec\x20'+V+'\x20'+chalk_1[h(0x18a)][h(0x186)](P)+'\x20in\x20project\x20'+chalk_1[h(0x18a)][h(0x186)](w)+'\x20'+i+'\x20'+p);},this[G(0x1c0)]=(V,P,w=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const o=G;var Y,N;let C=![];try{if(process[o(0x194)][o(0x1ae)]){const f=require(o(0x1b9));f[o(0x1ad)](process['stdin']),process[o(0x194)]['setRawMode'](!![]),process['stdout']['on'](o(0x1a9),()=>{const d=o;V['resizeTerminal'](this[d(0x15e)]());}),process[o(0x194)]['on'](o(0x1b2),(M,X)=>{const c=o;X['sequence']==='\x04'&&(C?(process[c(0x194)]['setRawMode'](![]),(0x0,utils_1['warning'])(c(0x1c1)),process[c(0x1c4)]()):(C=!![],setTimeout(()=>C=![],0x190)));});}process[o(0x194)][o(0x18d)](V[o(0x1a1)]),V[o(0x199)][o(0x18d)](process[o(0x16d)]),V[o(0x17e)][o(0x18d)](process['stdout']),V['on']('error',M=>{const v=o;var X;(0x0,utils_1['error'])(v(0x18b)+P+v(0x18f)+((X=M[v(0x19f)])!==null&&X!==void 0x0?X:M)),process[v(0x194)][v(0x1ae)]&&process[v(0x194)][v(0x1a3)](![]),process[v(0x1c4)](-0x1);});const q=yield V[o(0x1ac)]();if(w!==!![]){const M=(Y=q===null||q===void 0x0?void 0x0:q['status'])!==null&&Y!==void 0x0?Y:o(0x17c),X=(N=q===null||q===void 0x0?void 0x0:q[o(0x15b)])!==null&&N!==void 0x0?N:-0x1,S=(q===null||q===void 0x0?void 0x0:q[o(0x19f)])?o(0x165)+q[o(0x19f)]:'';M===o(0x164)?(0x0,utils_1[o(0x160)])('Command\x20completed\x20successfully,\x20exit\x20code:\x20'+X):(0x0,utils_1['warning'])(o(0x185)+M+o(0x1b6)+X+S);}return q;}finally{process[o(0x194)][o(0x1ae)]&&process[o(0x194)][o(0x1a3)](![]);}}),this['apiClient']=new js_client_1[(G(0x179))](x,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[G(0x187)]});const n=new inquirer_helper_1[(G(0x171))](this[G(0x175)]);this[G(0x170)]=(0x0,utils_1[G(0x1bf)])()['name'](G(0x1c3))['alias'](G(0x1bc))[G(0x1a6)]('Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.');const R=this[G(0x196)](G(0x197))[G(0x18c)](V=>__awaiter(this,void 0x0,void 0x0,function*(){const s=G,{noDefaults:P,projectId:w,serviceId:Y,containerId:N,shellCmd:C,user:q,group:f,command:M,quiet:X}=V;(0x0,utils_1[s(0x176)])(this['apiClient']);try{const S=P?undefined:x[s(0x17b)](),W=w||S||(yield n['askForProject']()),t=P?undefined:x['getCurrentServiceName'](),i=Y||t||(yield n[s(0x18e)](W)()),p=C!==null&&C!==void 0x0?C:M!==undefined?s(0x16b):undefined;this[s(0x17f)]('service',i,W,p,q,f,M,X);const O=process['stdout'][s(0x1b3)],Z=process[s(0x174)][s(0x1af)],a={'projectId':W,'serviceId':i},E=yield this[s(0x175)][s(0x1bc)][s(0x1b1)](a,{'containerName':N,'command':M,'shell':p,'user':q,'group':f,'ttyColumns':O,'ttyRows':Z});yield this[s(0x1c0)](E,'service',X);}catch(z){(0x0,utils_1['error'])(''+z[s(0x19f)]);}finally{process[s(0x1c4)]();}})),u=this['getStandardExecCommand']('job')['action'](V=>__awaiter(this,void 0x0,void 0x0,function*(){const g=G,{projectId:P,jobId:w,containerId:Y,noDefaults:N,shellCmd:C,user:q,group:f,command:M,quiet:X}=V;(0x0,utils_1['assertContextExisting'])(this['apiClient']);try{const S=N?undefined:x[g(0x17b)](),W=P||S||(yield n[g(0x188)]()),t=w||(yield n[g(0x181)](W)());this[g(0x17f)]('job',t,W,C,X);const {rows:i,columns:p}=this['getTerminalSize'](),O={'projectId':W,'jobId':t},Z=yield this[g(0x175)][g(0x1bc)]['execJobSession'](O,{'containerName':Y,'command':M,'shell':C,'user':q,'group':f,'ttyColumns':p,'ttyRows':i});yield this['handleShellSession'](Z,g(0x1b8),X);}catch(a){(0x0,utils_1['error'])(''+a[g(0x19f)]);}finally{process[g(0x1c4)]();}}));this[G(0x170)][G(0x15f)](R),this[G(0x170)][G(0x15f)](u);}}exports[a4H(0x1ba)]=CliExec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a5F=a5n;(function(x,n){const a=a5n,R=x();while(!![]){try{const u=-parseInt(a(0x1fb))/0x1*(parseInt(a(0x1e0))/0x2)+-parseInt(a(0x1f9))/0x3+-parseInt(a(0x1ec))/0x4*(parseInt(a(0x1f7))/0x5)+parseInt(a(0x1fc))/0x6*(-parseInt(a(0x1fe))/0x7)+parseInt(a(0x1e9))/0x8+-parseInt(a(0x1fd))/0x9+parseInt(a(0x1fa))/0xa;if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a5x,0x92fcb));var __awaiter=this&&this['__awaiter']||function(x,n,R,u){function V(w){return w instanceof R?w:new R(function(Y){Y(w);});}return new(R||(R=Promise))(function(w,Y){const H=a5n;function N(f){const E=a5n;try{q(u[E(0x1de)](f));}catch(M){Y(M);}}function C(f){const z=a5n;try{q(u[z(0x1df)](f));}catch(M){Y(M);}}function q(f){const T=a5n;f[T(0x203)]?w(f['value']):V(f[T(0x208)])[T(0x1f4)](N,C);}q((u=u[H(0x1f3)](x,n||[]))[H(0x1de)]());});},__importDefault=this&&this[a5F(0x205)]||function(x){const e=a5F;return x&&x[e(0x1ed)]?x:{'default':x};};Object[a5F(0x207)](exports,a5F(0x1ed),{'value':!![]}),exports[a5F(0x1e5)]=void 0x0;const chalk_1=__importDefault(require(a5F(0x1ef))),utils_1=require(a5F(0x1ea));function a5x(){const G=['name','commands','getCommandOverview','getCommand','map','Print\x20command\x20descriptions','6946416iAcCNA','../utils','action','68CTaQdn','__esModule','keys','chalk','length','green','join','apply','then','every','command-overview','196455lWNLWy','default','1283904LnQjtf','26053190LchCzD','71886igwtPx','6760686ZQaXvI','2604924mOfTJB','7zctAUm','log','description','option','opts','done','--verbose','__importDefault','slice','defineProperty','value','Prints\x20a\x20tree\x20view\x20of\x20all\x20available\x20commands','next','throw','10iWcrLS','bold','forEach'];a5x=function(){return G;};return a5x();}function a5n(x,n){const R=a5x();return a5n=function(u,V){u=u-0x1de;let P=R[u];return P;},a5n(x,n);}function getCommandOverview(x){const Q=a5F;return(0x0,utils_1[Q(0x1e6)])()[Q(0x1e3)](Q(0x1f6))[Q(0x200)](Q(0x209))[Q(0x201)](Q(0x204),Q(0x1e8))[Q(0x1eb)](n=>__awaiter(this,void 0x0,void 0x0,function*(){const {verbose:R}=n;function u(V,P){const L=a5n;var w;const Y=(p,O=!![])=>O?chalk_1[L(0x1f8)][L(0x1e1)][L(0x1f1)](p['name']()):p[L(0x1e3)](),N=P[L(0x1f0)]===0x0,C=V['commands'];let q='';const f=C[L(0x1f0)]===0x0,M=f||((w=Object[L(0x1ee)](V===null||V===void 0x0?void 0x0:V[L(0x202)]()))===null||w===void 0x0?void 0x0:w[L(0x1f0)])>0x0;!N&&(q=C&&!f?'┬\x20':'─\x20');const X=R&&M&&V[L(0x200)]()?':\x20'+V['description']():'';console[L(0x1ff)](''+P+q+Y(V,M)+X);let S=P;if(!N){const p=P[L(0x206)](-0x2)==='└─';S=P['slice'](0x0,-0x2)+(p?'\x20\x20':'│\x20');}const W=S+'├─',t=S+'└─',i=C[L(0x1f5)](O=>O[L(0x1e4)]['length']===0x0);i&&!f&&!R?console[L(0x1ff)](t+'\x20'+C[L(0x1e7)](O=>Y(O))[L(0x1f2)](',\x20')):C[L(0x1e2)]((O,Z)=>{const D=L;u(O,C[D(0x1f0)]-0x1===Z?t:W);});}u(x,'');}));}exports[a5F(0x1e5)]=getCommandOverview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a6W=a6n;function a6x(){const G=['handleJsonOutput','yaml','defineProperty','json','4104485qtqybn','length','printAsTable','sort','get','2980yexOeh','green','isObjectLike','56VJEqLJ','getMonth','handleFormattedOutput','map','__setModuleDefault','getHours','32130VjVbBi','\x20found','getFullYear','internalId','updatedat','js-yaml','The\x20request\x20was\x20completed\x20successfully','getSeconds','yml','createdat','default','forEach','__esModule','call','configurable','bold','367447YyHsbX','4247748sRBaZZ','isBoolean','includes','1743426OjJYkI','getMinutes','inspect','format','hasOwnProperty','lodash','printResponse','keys','chalk','toString','stringify','disabled','isArrayLike','getDate','create','log','7143480lDRvdc','isFinite','2dnzUTQ','1364657oxccsH','No\x20','toLowerCase','handleYamlOutput','\x20(HTTP\x20status:\x20','util','set','safeDump','getOwnPropertyDescriptor'];a6x=function(){return G;};return a6x();}(function(x,n){const S=a6n,R=x();while(!![]){try{const u=-parseInt(S(0x95))/0x1*(-parseInt(S(0x69))/0x2)+-parseInt(S(0x96))/0x3+parseInt(S(0xa9))/0x4+parseInt(S(0x77))/0x5+-parseInt(S(0x99))/0x6+-parseInt(S(0x6a))/0x7*(parseInt(S(0x7f))/0x8)+-parseInt(S(0x85))/0x9*(-parseInt(S(0x7c))/0xa);if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a6x,0xec112));var __createBinding=this&&this['__createBinding']||(Object[a6W(0xa7)]?function(x,n,R,u){const t=a6W;if(u===undefined)u=R;var V=Object[t(0x72)](n,R);(!V||(t(0x7b)in V?!n[t(0x91)]:V['writable']||V[t(0x93)]))&&(V={'enumerable':!![],'get':function(){return n[R];}}),Object['defineProperty'](x,u,V);}:function(x,n,R,u){if(u===undefined)u=R;x[u]=n[R];}),__setModuleDefault=this&&this[a6W(0x83)]||(Object['create']?function(x,n){const i=a6W;Object[i(0x75)](x,i(0x8f),{'enumerable':!![],'value':n});}:function(x,n){x['default']=n;}),__importStar=this&&this['__importStar']||function(x){const p=a6W;if(x&&x['__esModule'])return x;var n={};if(x!=null){for(var R in x)if(R!==p(0x8f)&&Object['prototype'][p(0x9d)][p(0x92)](x,R))__createBinding(n,x,R);}return __setModuleDefault(n,x),n;},__importDefault=this&&this['__importDefault']||function(x){return x&&x['__esModule']?x:{'default':x};};Object[a6W(0x75)](exports,a6W(0x91),{'value':!![]}),exports[a6W(0x9f)]=exports[a6W(0x81)]=exports['handleYamlOutput']=exports[a6W(0x73)]=exports['consoleFormat']=exports['printAsTable']=void 0x0;const chalk_1=__importDefault(require(a6W(0xa1))),_=__importStar(require(a6W(0x9e))),util=__importStar(require(a6W(0x6f))),yaml=require(a6W(0x8a)),columnify=require('columnify');function printAsTable(x,n,R,u=![],V=0x0){const O=a6W;!u&&console[O(0xa8)](''+chalk_1['default'][O(0x94)](n));function P(Y){const Z=O;return Y==='disabled'?Y:Y['replace'](Z(0xa4),'');}function w(Y,N){const E=O;function C(f){const a=a6n,M=new Date(f);return M[a(0xa6)]()+'/'+M[a(0x80)]()+'/'+M[a(0x87)]()+'\x0a'+M[a(0x84)]()+':'+M[a(0x9a)]()+':'+M[a(0x8c)]();}const q=[E(0x8e),E(0x89)];if(q[E(0x98)](N[E(0x6c)]())&&_[E(0xaa)](Y)&&Y[E(0xa2)]()['length']===0xd)return C(Number(Y));if(_[E(0x97)](Y)){if(N!==E(0xa4)&&N['includes']('disabled'))return Y?'x':'✔';return Y?'✔':'x';}if(_[E(0x7e)](Y))return util[E(0x9b)](Y,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});return Y;}if(_[O(0xa5)](x)){x[O(0x78)]===0x0&&console['log'](O(0x6b)+n[O(0x6c)]()+O(0x86));const Y=x[O(0x82)]((q,f)=>{const z=O,M={'i':f+V};return Object[z(0xa0)](q)[z(0x90)](X=>{const T=z;(_['isUndefined'](R)||R[T(0x98)](X['toLowerCase']()))&&_[T(0x70)](M,P(X),w(q[X],X));}),M;}),N=_['clone'](Object['keys']((Y===null||Y===void 0x0?void 0x0:Y[0x0])||[]))[O(0x7a)]((q,f)=>{const H=O,M=X=>X!=='i'?X!==H(0x88)?0x0:0x1:0x2;return M(f)-M(q);}),C={'maxWidth':0x1e,'preserveNewLines':!![],'showHeaders':!u,'config':{'_id':{'maxWidth':0x5,'truncate':!![]},'i':{'showHeaders':![]}},'columns':N};console[O(0xa8)](columnify(Y,C));}else console['log'](x);}exports[a6W(0x79)]=printAsTable;function consoleFormat(x,n){const F=a6W;if(_['isEmpty'](x)){const R=n?F(0x6e)+n+')':'';return chalk_1['default'][F(0x7d)](F(0x8b))+R;}if(!_['isObjectLike'](x))return x===null||x===void 0x0?void 0x0:x[F(0xa2)]();return util[F(0x9b)](x,{'showHidden':![],'depth':null,'colors':!![],'compact':!![]});}function a6n(x,n){const R=a6x();return a6n=function(u,V){u=u-0x69;let P=R[u];return P;},a6n(x,n);}exports['consoleFormat']=consoleFormat;const handleJsonOutput=(x,n)=>{const e=a6W,R=x===e(0x76);if(R)console[e(0xa8)](JSON[e(0xa3)](n,null,'\x20'));};exports[a6W(0x73)]=handleJsonOutput;const handleYamlOutput=(x,n)=>{const Q=a6W,R=x===Q(0x74)||x===Q(0x8d);if(R)console['log'](yaml[Q(0x71)](n));};exports[a6W(0x6d)]=handleYamlOutput;const handleFormattedOutput=(x,n)=>{const L=a6W,R=x===L(0x9c);if(R)console[L(0xa8)](consoleFormat(n));};exports[a6W(0x81)]=handleFormattedOutput;const printResponse=(x,n)=>{const D=a6W;(0x0,exports['handleJsonOutput'])(x,n),(0x0,exports[D(0x6d)])(x,n),(0x0,exports[D(0x81)])(x,n);};exports[a6W(0x9f)]=printResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a7b=a7n;function a7n(x,n){const R=a7x();return a7n=function(u,V){u=u-0x143;let P=R[u];return P;},a7n(x,n);}(function(x,n){const U=a7n,R=x();while(!![]){try{const u=-parseInt(U(0x160))/0x1+-parseInt(U(0x156))/0x2+-parseInt(U(0x155))/0x3+-parseInt(U(0x144))/0x4+-parseInt(U(0x14a))/0x5+-parseInt(U(0x15f))/0x6*(-parseInt(U(0x168))/0x7)+parseInt(U(0x14e))/0x8;if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a7x,0xeb22f));var __importDefault=this&&this[a7b(0x15a)]||function(x){return x&&x['__esModule']?x:{'default':x};};Object[a7b(0x158)](exports,a7b(0x154),{'value':!![]}),exports[a7b(0x143)]=exports[a7b(0x145)]=void 0x0;function a7x(){const x3=['__importDefault','map','\x20\x20\x20','colors','red','3546yBmvBs','561574ZcZlQp','length','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','height','round','slice','default','black','5691gjZdYl','format','2-digit','join','green','downSampleData','1436956KRWKQR','getAsciiChart','undefined','toLocaleTimeString','min','toLocaleDateString','3020690FlEuEX','max','padding','grey','21519984zaFrWP','abs','isArray','floor','unit','offset','__esModule','1069614oqCGOM','651746cuybBQ','push','defineProperty','h24'];a7x=function(){return x3;};return a7x();}const chalk_1=__importDefault(require('chalk')),colored=(x,n)=>{const K=a7b;return n===undefined?x:chalk_1[K(0x166)][n](x);},getAsciiChart=(n,R={})=>{const j=a7b,u=Array[j(0x150)](n[0x0])?n:[n];let V=typeof R['min']!==j(0x146)?R[j(0x148)]:u[0x0][0x0],P=typeof R[j(0x14b)]!=='undefined'?R[j(0x14b)]:u[0x0][0x0];for(let z=0x0;z<u[j(0x161)];z++){for(let T=0x0;T<u[z]['length'];T++){V=Math[j(0x148)](V,u[z][T]),P=Math[j(0x14b)](P,u[z][T]);}}let w=['┼','┤','╶','╴','─','╰','╭','╮','╯','│'],Y=Math['abs'](P-V),N=typeof R[j(0x153)]!=='undefined'?R[j(0x153)]:0x3,C=typeof R[j(0x14c)]!==j(0x146)?R['padding']:j(0x162),q=typeof R[j(0x163)]!==j(0x146)?R['height']:Y,f=typeof R[j(0x15d)]!=='undefined'?R[j(0x15d)]:['blue',j(0x15e),j(0x16c),j(0x14d),j(0x167)],M=Y!==0x0?q/Y:0x1,X=Math['round'](V*M),S=Math[j(0x164)](P*M),W=Math[j(0x14f)](S-X),t=0x0;for(let H=0x0;H<u[j(0x161)];H++){t=Math['max'](t,u[H][j(0x161)]);}t=t+N;let p=typeof R['symbols']!==j(0x146)?R['symbols']:w,O=R[j(0x169)]!==undefined?R[j(0x169)]:function(F){const x0=j;return(C+F['toFixed'](0x2)+R[x0(0x152)])[x0(0x165)](-C[x0(0x161)]);},Z=new Array(W+0x1);for(let F=0x0;F<=W;F++){Z[F]=new Array(t);for(let e=0x0;e<t;e++){Z[F][e]='\x20';}}for(let Q=X;Q<=S;++Q){const L=O(W>0x0?P-(Q-X)*Y/W:Q,Q-X);Z[Q-X][Math[j(0x14b)](N-L[j(0x161)],0x0)]=L,Z[Q-X][N-0x1]=Q==0x0?p[0x0]:p[0x1];}for(let D=0x0;D<u[j(0x161)];D++){let G=f[D%f[j(0x161)]],h=Math[j(0x164)](u[D][0x0]*M)-X;Z[W-h][N-0x1]=colored(p[0x0],G);for(let o=0x0;o<u[D][j(0x161)]-0x1;o++){let d=Math['round'](u[D][o+0x0]*M)-X,c=Math[j(0x164)](u[D][o+0x1]*M)-X;if(d==c)Z[W-d][o+N]=colored(p[0x4],G);else{Z[W-c][o+N]=colored(d>c?p[0x5]:p[0x6],G),Z[W-d][o+N]=colored(d>c?p[0x7]:p[0x8],G);let v=Math[j(0x148)](d,c),s=Math['max'](d,c);for(let g=v+0x1;g<s;g++){Z[W-g][o+N]=colored(p[0x9],G);}}}}const {startTs:a,endTs:E}=R;if(a||E){const A=m=>{const x1=j;if(!m)return x1(0x15c);const k=m[x1(0x149)](undefined,{'day':x1(0x16a),'month':x1(0x16a),'year':x1(0x16a)}),B=m[x1(0x147)](undefined,{'hourCycle':x1(0x159)});return k+'\x20'+B;},J=A(E),l=A(a),I=C[j(0x165)](0x0,Math[j(0x14b)](0x2,C[j(0x161)]-l[j(0x161)]/0x2+0x1)),r='\x20'['repeat'](Math[j(0x14b)](t-(C['length']+J[j(0x161)]/0x2),0x1));Z[j(0x157)]([''+I+l+r+J]),Z[j(0x157)]([]);}return Z[j(0x15b)](m=>m[j(0x16b)](''))[j(0x16b)]('\x0a');};exports['getAsciiChart']=getAsciiChart;const downSampleData=(x,n)=>{const x2=a7b,R=x[x2(0x161)];if(n>=R||n===0x0)return x;const u=[];let V=0x0;const P=(R-0x2)/(n-0x2);let w=0x0,Y,N,C,q;u[V++]=x[w];for(var f=0x0;f<n-0x2;f++){let p=0x0,O=0x0,Z=Math[x2(0x151)]((f+0x1)*P)+0x1,E=Math['floor']((f+0x2)*P)+0x1;E=E<R?E:R;var M=E-Z;for(;Z<E;Z++){p+=x[Z][0x0],O+=x[Z][0x1];}p/=M,O/=M;var X=Math[x2(0x151)](f*P)+0x1,S=Math[x2(0x151)]((f+0x1)*P)+0x1,W=x[w][0x0],t=x[w][0x1];N=C=-0x1;for(;X<S;X++){C=Math['abs']((W-p)*(x[X][0x1]-t)-(W-x[X][0x0])*(O-t))*0.5,C>N&&(N=C,Y=x[X],q=X);}u[V++]=Y,w=q;}return u[V++]=x[R-0x1],u;};exports['downSampleData']=downSampleData;
|
package/dist/inquirer-helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a8x=a8I;(function(A,I){const e=a8I,a=A();while(!![]){try{const d=-parseInt(e(0x129))/0x1*(parseInt(e(0x1bf))/0x2)+-parseInt(e(0x14b))/0x3*(-parseInt(e(0x179))/0x4)+parseInt(e(0x187))/0x5*(parseInt(e(0x130))/0x6)+-parseInt(e(0x138))/0x7*(parseInt(e(0xd6))/0x8)+parseInt(e(0x1a6))/0x9*(parseInt(e(0x19b))/0xa)+parseInt(e(0x134))/0xb*(-parseInt(e(0xe4))/0xc)+parseInt(e(0x1b5))/0xd;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a8A,0x22b39));var __createBinding=this&&this[a8x(0x12e)]||(Object[a8x(0x141)]?function(A,I,a,d){const o=a8x;if(d===undefined)d=a;var s=Object[o(0x128)](I,a);(!s||(o(0x183)in s?!I[o(0x190)]:s[o(0x19c)]||s['configurable']))&&(s={'enumerable':!![],'get':function(){return I[a];}}),Object[o(0x155)](A,d,s);}:function(A,I,a,d){if(d===undefined)d=a;A[d]=I[a];}),__setModuleDefault=this&&this[a8x(0x111)]||(Object['create']?function(A,I){const M=a8x;Object[M(0x155)](A,M(0x14a),{'enumerable':!![],'value':I});}:function(A,I){const N=a8x;A[N(0x14a)]=I;}),__importStar=this&&this[a8x(0x13d)]||function(A){const q=a8x;if(A&&A[q(0x190)])return A;var I={};if(A!=null){for(var a in A)if(a!==q(0x14a)&&Object['prototype'][q(0x17f)][q(0x1c4)](A,a))__createBinding(I,A,a);}return __setModuleDefault(I,A),I;},__awaiter=this&&this[a8x(0x102)]||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const l=a8I;function g(f){const K=a8I;try{L(d[K(0x15a)](f));}catch(t){V(t);}}function u(f){const y=a8I;try{L(d[y(0x11b)](f));}catch(t){V(t);}}function L(f){const D=a8I;f[D(0x1ce)]?T(f['value']):s(f[D(0x11d)])['then'](g,u);}L((d=d[l(0xe3)](A,I||[]))[l(0x15a)]());});},__importDefault=this&&this[a8x(0xd1)]||function(A){const n=a8x;return A&&A[n(0x190)]?A:{'default':A};};function a8I(A,I){const a=a8A();return a8I=function(d,s){d=d-0xd1;let T=a[d];return T;},a8I(A,I);}Object[a8x(0x155)](exports,a8x(0x190),{'value':!![]}),exports[a8x(0x114)]=void 0x0;function a8A(){const AZ=['must\x20be\x20a\x20number,\x20is\x20','object','token','apply','750660yEEIqr','unshift','length','required','maxLength','input','retrievePayloadViaInteractiveCli','\x20and\x20it\x20','secrets','./pagination/inquirer-pagination-prompt','askForTemplate','isEmpty','pagination-prompt','domains','elements','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','pop','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','log\x20sink','contextProvider','name','split','confirm','prompt','Do\x20you\x20want\x20to\x20add\x20more','startedAt','lodash','addon:\x20\x27','service','tokenPrompt','__awaiter','credentials','projects','stringify','fullName','domain','Context\x20name\x20already\x20exists.','confirmationPrompt','green','maximum','map','pathVars','jobs','blueBright','not\x20completed','__setModuleDefault','max','this\x20option\x20is\x20required,\x20please\x20answer','InquirerHelper','containers','\x20in\x20','Go\x20to\x20editor','includes','templateRuns','isValidJSON','throw','bold','value','minimum','yml','writeFileSync','No\x20builds\x20found','askForProjectScopedResourcePaginated','all-builds','registryCredentials','editPayload','cursor','values','getOwnPropertyDescriptor','79lPquIf','editor','filter','safeDump','getInnerType','__createBinding','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','636jWVsBT','restores','password','askForContainer','33QODDdB','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','No,\x20repeat','subdomain','476LaciIe','\x20characters,\x20is\x20','isObject','boolean','don\x27t\x20change','__importStar','template\x20run','addEntry','main-context','create','assign','safeLoad','registerPrompt','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','whiteBright','a\x20Northflank\x20resource','What\x20do\x20you\x20want\x20to\x20use\x20as','No,\x20but\x20save\x20as\x20file','default','19941WIJEsR','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','askForProjectScopedResource','charAt','tmpCmdPath','No,\x20edit','SAVE','body','message','templates','defineProperty','fileName','pagination','underline','reset','next','then','list','set','setPathVars','choice','integer','data',',\x20supported\x20types:\x20[json|yaml|yml]','override','pattern','Please\x20confirm\x20following\x20configuration:\x0a','askGeneric','askConfirm','nextCursor','getType','\x20(completedAt:\x20','description','service:\x20\x27','askForSubdomain','askForVolume','properties','string','service\x20containers','builds','isArray','propToType','askForPipeline','yaml','EDIT','blue','60wyqVhw','job\x20runs','yellowBright','array','YES','completedAt','hasOwnProperty','items','saveFile','search-list','get','addons','red','apiClient','3415qSrdRt','json','cmdPath','getCurrentProjectName','volume','Do\x20you\x20want\x20to\x20add','askForTemplateRun','example','toUpperCase','__esModule','askForProject','inquirer-search-list','type','defaultPaginationPageSize','Aborted.','Choose\x20the\x20login\x20token:','addon','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','getQuestionString','join','7690jGERVG','writable','restore','rawObject','askForService','ask','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','\x20type?','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','job\x20builds','askForResource','2538TJoYDc','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','greenBright','push','Should\x20it\x20be','unset','all-containers','template','REPEAT','job:\x20\x27','fetchResourceList','enum','retry','warning','keys','5130619HTGHTM','oneOf','\x20characters','\x20Example:\x20','Configuration\x20file\x20written\x20to\x20','resultCache','askArrayEntry','./utils','slice','isNaN','6044fzuXjc','to\x20use:','pipelines','find','js-yaml','call','confirmation','getPathString','ABORT','project','What\x27s\x20the\x20','askForAddonBackup','isBoolean','success','trim','done','has','secret','\x20(startedAt:\x20','__importDefault','services','Enter\x20the\x20','isUndefined','editedResult','25304RVNppI','createdAt','backups','deleteWarningPrompt','volumes','toString','askForResourcePaginated','repeat','minLength','job'];a8A=function(){return AZ;};return a8A();}const _=__importStar(require(a8x(0xfe))),chalk_1=__importDefault(require('chalk')),fs=__importStar(require('fs')),utils_1=require(a8x(0x1bc)),api_helpers_1=require('./api-helpers'),inquirer_pagination_prompt_1=require(a8x(0xed)),inquirer=require('inquirer'),inquirerSearchList=require(a8x(0x192)),yaml=require(a8x(0x1c3));var ConfirmChoices;(function(A){const v=a8x;A[v(0x17d)]='Yes,\x20send',A[v(0x1ae)]=v(0x136),A[v(0x177)]=v(0x150),A[v(0x151)]=v(0x149),A[v(0x1c7)]='No,\x20abort';}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(A){const X=a8x;this[X(0x186)]=A,this[X(0x194)]=0x32,this[X(0x125)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=X,{editedResult:a}=yield inquirer[Q(0xfb)]([{'type':Q(0x12a),'name':Q(0xd5),'message':Q(0x117),'default':yaml[Q(0x12c)](I)}]);return yaml[Q(0x143)](a);}),this[X(0x181)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const O=X,a=V=>'Unexpected\x20file\x20type:\x20'+V+O(0x162);function d(){return __awaiter(this,void 0x0,void 0x0,function*(){const p=a8I;return inquirer['prompt']([{'type':p(0xe9),'name':p(0x156),'message':p(0xf5),'validate':V=>new RegExp('.*\x5c.(json|yaml|yml)$')['test'](V)?!![]:a(V)}]);});}const {fileName:s}=yield d(),T=s[O(0xdb)]()[O(0xf9)]('.')[O(0xf4)]();try{switch(T){case O(0x188):(0x0,utils_1[O(0x1cc)])(O(0x1b9)+s);return fs[O(0x120)](s,JSON[O(0x105)](I,null,'\x20\x20'));case O(0x176):case O(0x11f):(0x0,utils_1[O(0x1cc)])(O(0x1b9)+s);return fs['writeFileSync'](s,yaml['safeDump'](I));default:(0x0,utils_1['warning'])(a(T));}}catch(V){(0x0,utils_1[O(0x1b3)])('Writing\x20configuration\x20failed:\x20'+V[O(0x153)]);}return undefined;}),this[X(0x12b)]=(I,a)=>d=>{const r=X,s=typeof d===r(0x170)?d[r(0x1cd)]():d;return a===![]&&s==='don\x27t\x20change'?'':s;},this['validate']=(I,a,d)=>s=>{const H=X,T=[];if(s===''||s===H(0x13c)){if(a!==![])T[H(0x1a9)](H(0x113));else return!![];}I[H(0x193)]===H(0x170)&&!_[H(0xd4)](I[H(0x164)])&&T[H(0x1a9)](new RegExp(I[H(0x164)])['test'](s)?!![]:'doesn\x27t\x20match\x20pattern\x20\x27'+I[H(0x164)]+'\x27');I[H(0x193)]===H(0x170)&&!_[H(0xd4)](I[H(0xde)])&&T[H(0x1a9)](s[H(0xe6)]>=I[H(0xde)]?!![]:H(0x145)+I[H(0xde)]+H(0x139)+s[H(0xe6)]+H(0x1b7));I[H(0x193)]===H(0x170)&&!_['isUndefined'](I['maxLength'])&&T[H(0x1a9)](s[H(0xe6)]<=I[H(0xe8)]?!![]:H(0x1a1)+I[H(0xe8)]+H(0x139)+s[H(0xe6)]+H(0x1b7));d&&Number[H(0x1be)](parseInt(s,0xa))&&T['push'](H(0xe0)+s);I[H(0x193)]===H(0x160)&&!_['isUndefined'](I['minimum'])&&T[H(0x1a9)](s>=I[H(0x11e)]?!![]:H(0x198)+I[H(0x11e)]);I[H(0x193)]===H(0x160)&&!_['isUndefined'](I['maximum'])&&T[H(0x1a9)](s<=I[H(0x10b)]?!![]:'must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20'+I[H(0x10b)]);if(I[H(0x193)]===H(0x19e)){const u=(0x0,utils_1[H(0x11a)])(s);T['push'](u===![]||_[H(0xef)](u)?H(0x135):!![]);}const V=T[H(0x12b)](L=>L!==!![]),g=(I===null||I===void 0x0?void 0x0:I['example'])?'\x0a'+chalk_1['default'][H(0x185)]('>>')+H(0x1b8)+chalk_1[H(0x14a)][H(0x146)](JSON[H(0x105)](I[H(0x18e)])):'';return V[H(0xe6)]>0x0?V['join'](chalk_1[H(0x14a)][H(0x158)](H(0xeb)))+g:!![];},this[X(0x1c6)]=(I,a,d)=>{const R=X,s=I[I['length']-0x1];function T(){const P=a8I;return I['slice'](0x0,-0x1)['map'](u=>u[P(0x14e)](0x0)[P(0x18f)]()+u[P(0x1bd)](0x1))[P(0x19a)]('>');}const V=I[R(0xe6)]>0x1?chalk_1['default']['bgGrey']['whiteBright'](T())+':\x20':'',g=d?'\x20('+chalk_1[R(0x14a)][R(0x178)](d)+')':'';return chalk_1[R(0x14a)][R(0x159)](''+V+a+'\x20'+chalk_1[R(0x14a)]['bold'][R(0x1a8)](s)+g+'?');},this[X(0x1a5)]=(I,a,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=X;if(a[Z(0xe6)]<0x1){const V=d?'for\x20this\x20'+d:'found';throw new Error('No\x20'+I+'\x20'+V+'.');}const s='Choose\x20the\x20'+I+'\x20to\x20use:',T=a[Z(0xe6)]>0x4?'search-list':'list';return(yield inquirer[Z(0xfb)]([{'type':T,'name':Z(0xf8),'message':s,'choices':a}]))[Z(0xf8)];}),this[X(0xdc)]=(I,a,d)=>__awaiter(this,void 0x0,void 0x0,function*(){const B=X,{elements:s,nextCursor:T}=yield a();if(s[B(0xe6)]<0x1){const u=d?'for\x20this\x20'+d:'found';throw new Error('No\x20'+I+'\x20'+u+'.');}const V='Choose\x20the\x20'+I+'\x20to\x20use:';if(T!==undefined){const L=({nextPageCursor:f})=>__awaiter(this,void 0x0,void 0x0,function*(){const E=B,t=yield a(f);return{'elements':t[E(0xf2)],'nextPageCursor':t[E(0x168)]};});return(yield inquirer['prompt']([{'type':B(0xf0),'name':B(0xf8),'message':V,'choices':s,'nextPageCursor':T,'loadMore':L}]))[B(0xf8)];}const g=s[B(0xe6)]>0x4?B(0x182):'list';return(yield inquirer['prompt']([{'type':g,'name':B(0xf8),'message':V,'choices':s}]))[B(0xf8)];}),this[X(0x166)]=(I,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=X,d=''+(a?'('+chalk_1[J(0x14a)][J(0x178)](a)+')\x20':''),s=J(0xd3)+chalk_1[J(0x14a)]['green'](I)+'\x20'+d+J(0x1c0),T=this['validate']({'type':J(0x170),'required':!![]});return(yield inquirer[J(0xfb)]([{'type':J(0xe9),'name':J(0xf8),'message':s,'validate':T}]))['name'];}),this[X(0x167)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const b=X;return(yield inquirer['prompt']([{'type':b(0xfa),'name':b(0xf8),'message':I,'default':!![]}]))[b(0xf8)];}),this[X(0x19f)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=a8I;var T;const V=yield this['apiClient'][Y(0x15c)][Y(0xd2)]({'parameters':{'projectId':d},'options':{'per_page':this[Y(0x194)],'cursor':s}}),g=V['data'][Y(0xd2)][Y(0x10c)](u=>u['id']);return{'elements':g,'nextCursor':(T=V[Y(0x157)])===null||T===void 0x0?void 0x0:T[Y(0x126)]};});return this[F(0x122)](F(0x100),a,I);}),this[X(0xee)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const C=X,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const W=a8I;var d;const s=yield this[W(0x186)][W(0x15c)][W(0x154)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':a}}),T=s[W(0x161)][W(0x154)]['map'](V=>V['id']);return{'elements':T,'nextCursor':(d=s[W(0x157)])===null||d===void 0x0?void 0x0:d[W(0x126)]};});return this['askForResourcePaginated'](C(0x1ad),I);}),this[X(0x18d)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=X;if(_[G(0xd4)](I))throw new Error('Template\x20id\x20not\x20provided.');const a=d=>__awaiter(this,void 0x0,void 0x0,function*(){const j=G;var s;let T=this[j(0x194)];const V=yield this[j(0x186)][j(0x15c)][j(0x119)]({'parameters':{'templateId':I},'options':{'per_page':T,'cursor':d}}),g=V[j(0x161)][j(0x119)][j(0x10c)](u=>u['id']+'\x20(startedAt:\x20'+u['createdAt']+')');return{'elements':g,'nextCursor':(s=V[j(0x157)])===null||s===void 0x0?void 0x0:s['cursor']};});return this[G(0xdc)](G(0x13e),a)[G(0x15b)](d=>d[G(0xf9)]('\x20')[0x0]);}),this['askForLogSink']=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const h=X,I=a=>__awaiter(this,void 0x0,void 0x0,function*(){const z=a8I;var d;let s=this['defaultPaginationPageSize'];const T=yield this[z(0x186)][z(0x15c)]['logSinks']({'options':{'per_page':s,'cursor':a}}),V=T['data']['logSinks'][z(0x10c)](g=>g['id']);return{'elements':V,'nextCursor':(d=T[z(0x157)])===null||d===void 0x0?void 0x0:d[z(0x126)]};});return this[h(0xdc)](h(0xf6),I);}),this[X(0x175)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const i=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const w=a8I;var T;const V=yield this[w(0x186)][w(0x15c)][w(0x1c1)]({'parameters':{'projectId':d},'options':{'per_page':this[w(0x194)],'cursor':s}}),g=V['data'][w(0x1c1)][w(0x10c)](u=>u['id']);return{'elements':g,'nextCursor':(T=V[w(0x157)])===null||T===void 0x0?void 0x0:T['cursor']};});return this[i(0x122)]('pipeline',a,I);}),this['askForJob']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A1=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const A0=a8I;var T;const V=yield this[A0(0x186)][A0(0x15c)][A0(0x10e)]({'parameters':{'projectId':d},'options':{'per_page':this[A0(0x194)],'cursor':s}}),g=V['data'][A0(0x10e)]['map'](u=>u['id']);return{'elements':g,'nextCursor':(T=V['pagination'])===null||T===void 0x0?void 0x0:T[A0(0x126)]};});return this[A1(0x122)]('job',a,I);}),this['askForJobRun']=(I,a,d=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A3=X,s='all-job-runs',T=V=>g=>__awaiter(this,void 0x0,void 0x0,function*(){const A2=a8I;var u;const L=yield this[A2(0x186)][A2(0x183)][A2(0xdf)]['runs']({'parameters':{'projectId':V,'jobId':I},'options':{'per_page':this[A2(0x194)],'cursor':g}}),f=L['data']['runs'][A2(0x10c)](t=>t['id']+A2(0x1d1)+t[A2(0xfd)]+')');return d&&f[A2(0xe5)](s),{'elements':f,'nextCursor':(u=L['pagination'])===null||u===void 0x0?void 0x0:u[A2(0x126)]};});return this[A3(0x122)](A3(0x17a),T,a,A3(0x1af)+I+'\x27')[A3(0x15b)](V=>{const A4=A3,g=V[A4(0xf9)]('\x20')[0x0];if(g===s)return undefined;return g;});}),this['askForBuild']=(I,a,d,s=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A5=X,T=A5(0x123);if(d!==undefined){const V=g=>u=>__awaiter(this,void 0x0,void 0x0,function*(){const A6=A5;var L;const f=yield this[A6(0x186)][A6(0x183)][A6(0xdf)]['builds']({'parameters':{'projectId':g,'jobId':d},'options':{'per_page':this[A6(0x194)],'cursor':u}}),t=f['data'][A6(0x172)][A6(0x10c)](m=>m['id']+A6(0x1d1)+m[A6(0xd7)]+')');return s&&t[A6(0xe5)](T),{'elements':t,'nextCursor':(L=f[A6(0x157)])===null||L===void 0x0?void 0x0:L[A6(0x126)]};});return this[A5(0x122)](A5(0x1a4),V,I,'job:\x20\x27'+d+'\x27')[A5(0x15b)](g=>{const A7=A5,u=g[A7(0xf9)]('\x20')[0x0];if(u===T)return undefined;return u;});}if(a!==undefined){const g=u=>L=>__awaiter(this,void 0x0,void 0x0,function*(){const A8=A5;var f;const t=yield this[A8(0x186)][A8(0x183)][A8(0x100)]['builds']({'parameters':{'projectId':u,'serviceId':a},'options':{'per_page':this[A8(0x194)],'cursor':L}}),m=t[A8(0x161)]['builds'][A8(0x10c)](U=>U['id']+A8(0x1d1)+U[A8(0xd7)]+')');if(s)m[A8(0xe5)](T);return{'elements':m,'nextCursor':(f=t[A8(0x157)])===null||f===void 0x0?void 0x0:f[A8(0x126)]};});return this[A5(0x122)]('service\x20build',g,I,A5(0x16c)+d+'\x27')[A5(0x15b)](u=>{const L=u['split']('\x20')[0x0];if(L===T)return undefined;return L;});}throw new Error(A5(0x121));}),this[X(0x133)]=(I,a,d,s=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const A9=X,T=A9(0x1ac);if(d!==undefined){const V=g=>u=>__awaiter(this,void 0x0,void 0x0,function*(){const AA=A9;var L,f;const t=yield this[AA(0x186)][AA(0x183)][AA(0xdf)][AA(0x115)]({'parameters':{'projectId':g,'jobId':d},'options':{'per_page':this[AA(0x194)],'cursor':u}}),m=(L=t[AA(0x161)]['containers'])!==null&&L!==void 0x0?L:[],U=m===null||m===void 0x0?void 0x0:m[AA(0x10c)](S=>S[AA(0xf8)]+AA(0x1d1)+S[AA(0xd7)]+')');return s&&U[AA(0xe5)](T),{'elements':U,'nextCursor':(f=t['pagination'])===null||f===void 0x0?void 0x0:f[AA(0x126)]};});return this['askForProjectScopedResourcePaginated']('job\x20containers',V,I,'job:\x20\x27'+d+'\x27')[A9(0x15b)](g=>{const u=g['split']('\x20')[0x0];if(u===T)return undefined;return u;});}if(a!==undefined){const g=u=>L=>__awaiter(this,void 0x0,void 0x0,function*(){const AI=A9;var f,t;const m=yield this[AI(0x186)]['get']['service'][AI(0x115)]({'parameters':{'projectId':u,'serviceId':a},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':L}}),U=(f=m['data'][AI(0x115)])!==null&&f!==void 0x0?f:[],S=U[AI(0x10c)](k=>k[AI(0xf8)]+AI(0x1d1)+k[AI(0xd7)]+')');if(s)S===null||S===void 0x0?void 0x0:S['unshift'](T);return{'elements':S,'nextCursor':(t=m[AI(0x157)])===null||t===void 0x0?void 0x0:t[AI(0x126)]};});return this['askForProjectScopedResourcePaginated'](A9(0x171),g,I,A9(0x16c)+d+'\x27')[A9(0x15b)](u=>{const Aa=A9,L=u[Aa(0xf9)]('\x20')[0x0];if(L===T)return undefined;return L;});}throw new Error('No\x20containers\x20found');}),this['askForAddon']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const As=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const Ad=a8I;var T;const V=yield this[Ad(0x186)][Ad(0x15c)][Ad(0x184)]({'parameters':{'projectId':d},'options':{'per_page':this[Ad(0x194)],'cursor':s}});return{'elements':V[Ad(0x161)][Ad(0x184)]['map'](g=>g['id']),'nextCursor':(T=V[Ad(0x157)])===null||T===void 0x0?void 0x0:T[Ad(0x126)]};});return this[As(0x122)](As(0x197),a,I);}),this[X(0x1ca)]=(I,a)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const AV=X,d=s=>T=>__awaiter(this,void 0x0,void 0x0,function*(){const AT=a8I;var V;const g=yield this['apiClient'][AT(0x183)][AT(0x197)][AT(0xd8)]({'parameters':{'projectId':s,'addonId':a},'options':{'per_page':this[AT(0x194)],'cursor':T}});return{'elements':g[AT(0x161)][AT(0xd8)][AT(0x10c)](u=>u['id']+AT(0x16a)+(u[AT(0x17e)]||AT(0x110))+')'),'nextCursor':(V=g[AT(0x157)])===null||V===void 0x0?void 0x0:V[AT(0x126)]};});return this[AV(0x122)]('backups',d,I,AV(0xff)+a+'\x27')[AV(0x15b)](s=>s[AV(0xf9)]('\x20')[0x0]);}),this['askForAddonRestore']=(I,a,d)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Au=X,s=T=>V=>__awaiter(this,void 0x0,void 0x0,function*(){const Ag=a8I;var g;const u=yield this[Ag(0x186)][Ag(0x183)][Ag(0x197)]['restores']({'parameters':{'projectId':T,'addonId':a,'backupId':d},'options':{'per_page':this[Ag(0x194)],'cursor':V}});return{'elements':u['data'][Ag(0x131)][Ag(0x10c)](L=>L['id']+Ag(0x16a)+(L[Ag(0x17e)]||Ag(0x110))+')'),'nextCursor':(g=u[Ag(0x157)])===null||g===void 0x0?void 0x0:g['cursor']};});return this['askForProjectScopedResourcePaginated'](Au(0x19d),s,I,Au(0xff)+a+'\x27')[Au(0x15b)](T=>T[Au(0xf9)]('\x20')[0x0]);}),this[X(0x16e)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Af=X,a=d=>__awaiter(this,void 0x0,void 0x0,function*(){const AL=a8I;return(yield this['apiClient'][AL(0x15c)][AL(0xda)]({'parameters':{'projectId':d}}))[AL(0x161)]['map'](s=>s['id']);});return this['askForProjectScopedResource'](Af(0x18b),a,I);}),this['askForSecret']=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Am=X,a=d=>s=>__awaiter(this,void 0x0,void 0x0,function*(){const At=a8I;var T;const V=yield this[At(0x186)][At(0x15c)][At(0xec)]({'parameters':{'projectId':d},'options':{'per_page':this[At(0x194)],'cursor':s}});return{'elements':V['data'][At(0xec)][At(0x10c)](g=>g['id']),'nextCursor':(T=V[At(0x157)])===null||T===void 0x0?void 0x0:T[At(0x126)]};});return this[Am(0x122)](Am(0x1d0),a,I);}),this[X(0x16d)]=I=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const AU=X,a=yield this[AU(0x186)][AU(0x183)][AU(0x107)]({'parameters':{'domain':I}}),d=a[AU(0x161)]['subdomains'][AU(0x10c)](T=>T[AU(0xf8)]+'\x20(full\x20domain:\x20'+T[AU(0x106)]+')'),s='domain\x20('+I+')';return this[AU(0x1a5)](AU(0x137),d,s)[AU(0x15b)](T=>T[AU(0xf9)]('\x20')[0x0]);}),this[X(0xd9)]=I=>__awaiter(this,void 0x0,void 0x0,function*(){const AS=X;return(yield inquirer[AS(0xfb)]([{'type':AS(0xfa),'name':AS(0x1c5),'message':chalk_1[AS(0x14a)][AS(0x17b)](AS(0x1a3)+(I||AS(0x147))+AS(0x14c)),'default':![]}]))['confirmation'];}),this['loginPrompt']=(I,a)=>__awaiter(this,void 0x0,void 0x0,function*(){const Ak=X;_['isUndefined'](I['name'])&&(a[Ak(0xe6)]<=0x0?_[Ak(0x15d)](I,Ak(0xf8),Ak(0x14a)):yield(0x0,utils_1[Ak(0x1b2)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const Ae=Ak,{name:d}=yield inquirer[Ae(0xfb)]([{'type':Ae(0xe9),'name':Ae(0xf8),'message':Ae(0xf3),'default':Ae(0x140)}]);if(!I['override']&&a[Ae(0x1c2)](s=>s[Ae(0xf8)]===d)){const {c:s}=yield inquirer[Ae(0xfb)]([{'type':'confirm','name':'c','message':'Context\x20with\x20name\x20\x27'+d+Ae(0x12f),'default':![]}]);if(s===![])throw new Error(Ae(0x108));_[Ae(0x15d)](I,Ae(0x163),!![]);}_[Ae(0x15d)](I,'name',d);})));if(_[Ak(0xd4)](I['token'])){const d=yield this[Ak(0x101)]();_[Ak(0x15d)](I,Ak(0xe2),d);}return I;}),this[X(0x101)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Ax=X,{token:I}=yield inquirer['prompt']([{'type':Ax(0x132),'name':'token','mask':'*','message':Ax(0x196)}]);return I;}),inquirer[X(0x144)](X(0x182),inquirerSearchList),inquirer['registerPrompt'](X(0xf0),inquirer_pagination_prompt_1['DynamicReloadPaginationPrompt']);}[a8x(0x109)](A,I){return __awaiter(this,void 0x0,void 0x0,function*(){const Ao=a8I,a=yaml[Ao(0x12c)](A),d=_[Ao(0x112)](a[Ao(0xf9)]('\x0a')[Ao(0x10c)](V=>V['length'])),s=chalk_1['default']['grey']('-'[Ao(0xdd)](d)+'\x0a'),{confirm:T}=yield inquirer[Ao(0xfb)]([{'type':Ao(0x15c),'name':Ao(0xfa),'message':''+chalk_1['default'][Ao(0x11c)][Ao(0x10a)](Ao(0x165))+s+chalk_1[Ao(0x14a)][Ao(0x10f)](a)+s,'choices':Object[Ao(0x127)](ConfirmChoices)}]);switch(T){case ConfirmChoices[Ao(0x17d)]:return A;case ConfirmChoices[Ao(0x1c7)]:throw new Error(Ao(0x195));case ConfirmChoices[Ao(0x1ae)]:return this[Ao(0xea)](I);case ConfirmChoices[Ao(0x177)]:return this[Ao(0x109)](yield this[Ao(0x125)](A),I);case ConfirmChoices[Ao(0x151)]:yield this[Ao(0x181)](A);return this['confirmationPrompt'](A,I);default:throw new Error('Something\x20unexpected\x20happened.');}});}['retrievePayloadViaInteractiveCli'](A,I){return __awaiter(this,void 0x0,void 0x0,function*(){const AM=a8I;if((I===null||I===void 0x0?void 0x0:I[AM(0x1ba)])!==undefined)this[AM(0x1ba)]=I===null||I===void 0x0?void 0x0:I[AM(0x1ba)];this[AM(0x14f)]=I===null||I===void 0x0?void 0x0:I[AM(0x189)];const a={};return yield this[AM(0x174)]([],A['opt'][AM(0x152)],a),this[AM(0x1ba)]=a,yield this[AM(0x109)](a,A);});}[a8x(0x174)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AN=a8I;let s;if(I[AN(0x1b6)]&&!_[AN(0x1cf)](I,AN(0x16f))){if(I[AN(0x1b6)][AN(0xe6)]>0x1){const {choice:T}=yield inquirer[AN(0xfb)]([{'type':AN(0x15c),'name':AN(0x15f),'message':AN(0x1c9)+(A[A[AN(0xe6)]-0x1]||'')+AN(0x1a2),'choices':I[AN(0x1b6)][AN(0x10c)](V=>{const Aq=AN;var g;return(g=V[Aq(0x16b)])!==null&&g!==void 0x0?g:'??';})}]);s=yield this[AN(0x169)](A,I[AN(0x1b6)][AN(0x1c2)](V=>V[AN(0x16b)]===T),a,d);}else{const V=I[AN(0x1b6)][0x0];_[AN(0x15d)](V,AN(0x16b),I[AN(0x16b)]),s=yield this[AN(0x169)](A,V,a,d);}s={};}else s=yield this['getType'](A,I,a,d);return s;});}['getInnerType'](A,I,a,d){var s;return __awaiter(this,void 0x0,void 0x0,function*(){const AK=a8I;if(d===![]){const {addEntry:g}=yield inquirer[AK(0xfb)]([{'type':AK(0xfa),'name':AK(0x13f),'message':this[AK(0x1c6)](I,AK(0x18c),A===null||A===void 0x0?void 0x0:A['description']),'default':![]}]);if(!g)return a;}const T=Object[AK(0x1b4)]((s=A===null||A===void 0x0?void 0x0:A[AK(0x16f)])!==null&&s!==void 0x0?s:[]),V=A[AK(0xe7)]||[];if(T[AK(0xe6)]>0x0)for(const u of T){const L=I['concat'](u);if(I['length']>0x0&&!_[AK(0x1cf)](a,I['join']('.')))_[AK(0x15d)](a,I[AK(0x19a)]('.'),{});yield this['propToType'](L,A[AK(0x16f)][u],a,V[AK(0x118)](u));}else yield this[AK(0x169)](I,Object[AK(0x142)](Object[AK(0x142)]({},A),{'type':AK(0x19e)}),a,d);return a;});}['askArrayEntry'](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const Ay=a8I;if(I&&a)return!![];const s=I?Ay(0x18c):Ay(0xfc),{addEntry:T}=yield inquirer[Ay(0xfb)]([{'type':Ay(0xfa),'name':Ay(0x13f),'message':this[Ay(0x1c6)](A,s,I?d:undefined),'default':![]}]);return T;});}[a8x(0x169)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AD=a8I;let s;const T=A[AD(0x19a)]('.');switch(I===null||I===void 0x0?void 0x0:I[AD(0x193)]){case AD(0x17c):{let V=!![];while(yield this[AD(0x1bb)](A,V,d,I===null||I===void 0x0?void 0x0:I[AD(0x16b)])){const g=_[AD(0x183)](a,T);_[AD(0x1ab)](a,T),yield this[AD(0x169)](A,I[AD(0x180)],a);const u=_['get'](a,T);!_[AD(0x173)](g)?_['set'](a,T,[u]):(g[AD(0x1a9)](u),_[AD(0x15d)](a,T,g)),V=![];}return s||[];}case AD(0xe1):{return s=yield this[AD(0x12d)](I,A,a,d),s;}case AD(0x19e):s=(0x0,utils_1['isValidJSON'])(yield this[AD(0x1a0)](A,I,d))||undefined;break;case AD(0x170):case AD(0x13b):case AD(0x160):default:s=yield this[AD(0x1a0)](A,I,d,a);break;}return!_[AD(0xd4)](s)&&_['set'](a,T,s),s;});}[a8x(0x1a0)](A,I,a,d){var s;return __awaiter(this,void 0x0,void 0x0,function*(){const Al=a8I,T=A[A[Al(0xe6)]-0x1],{defaultValue:defaultValue=(s=I===null||I===void 0x0?void 0x0:I['example'])!==null&&s!==void 0x0?s:I===null||I===void 0x0?void 0x0:I[Al(0x14a)],choices:choices=I===null||I===void 0x0?void 0x0:I[Al(0x1b1)],pagination:V}=yield(0x0,api_helpers_1[Al(0x1b0)])(T,this[Al(0x186)],this['tmpCmdPath'],d,this[Al(0x10d)],A);let g=Al(0xe9);if(!_[Al(0xd4)](choices)&&choices['length']>0x0){if(V!==undefined&&V['nextPageCursor']!==undefined)g=Al(0xf0);else choices[Al(0xe6)]>0x4&&typeof choices[0x0]===Al(0x170)?g=Al(0x182):g=Al(0x15c);}else{if((I===null||I===void 0x0?void 0x0:I[Al(0x193)])===Al(0x13b))g=Al(0xfa);else{if((I===null||I===void 0x0?void 0x0:I[Al(0x193)])==='integer')g=Al(0xe9);else(I===null||I===void 0x0?void 0x0:I[Al(0x193)])===Al(0x19e)&&(g=Al(0x12a));}}let u=a!==![]?!_[Al(0x13a)](defaultValue)?defaultValue:JSON[Al(0x105)](defaultValue):_[Al(0x1cb)](defaultValue)?defaultValue:Al(0x13c);if(choices)u=u[Al(0xdb)]();_[Al(0x1cf)](this[Al(0x1ba)],A[Al(0x19a)]('.'))&&(u=this[Al(0x1ba)][A[Al(0x19a)]('.')]);const L=choices&&a===![]?[Al(0x13c),...choices]:choices,f=(I===null||I===void 0x0?void 0x0:I[Al(0x193)])===Al(0x160),t=Object[Al(0x142)]({'type':g,'name':'id','message':this[Al(0x199)](A,I),'choices':L,'default':u,'filter':this[Al(0x12b)](g,a),'validate':this['validate'](I,a,f)},V),m=(yield inquirer[Al(0xfb)]([t]))['id'];if(m===Al(0x13c)||m==='')return undefined;if(f)return parseInt(m,0xa);return m;});}[a8x(0x199)](A,I){const An=a8x,a=(I===null||I===void 0x0?void 0x0:I[An(0x193)])!=='boolean'?An(0x148):An(0x1aa);return this[An(0x1c6)](A,a,I===null||I===void 0x0?void 0x0:I['description']);}[a8x(0x191)](){return __awaiter(this,void 0x0,void 0x0,function*(){const AX=a8I,A=I=>__awaiter(this,void 0x0,void 0x0,function*(){const Av=a8I;var a;const d=yield this[Av(0x186)][Av(0x15c)][Av(0x104)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}}),s=d[Av(0x161)][Av(0x104)]['map'](T=>T['id']);return{'elements':s,'nextCursor':(a=d[Av(0x157)])===null||a===void 0x0?void 0x0:a[Av(0x126)]};});return yield this[AX(0xdc)](AX(0x1c8),A);});}[a8x(0x14d)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AQ=a8I,s=a||this['apiClient'][AQ(0xf7)][AQ(0x18a)]();if(_['isUndefined'](s))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const T=yield I(s);return yield this[AQ(0x1a5)](A,T,(d?d+AQ(0x116):'')+'project:\x20\x27'+s+'\x27');});}[a8x(0x122)](A,I,a,d){return __awaiter(this,void 0x0,void 0x0,function*(){const AO=a8I,s=a||this['apiClient']['contextProvider'][AO(0x18a)]();if(_[AO(0xd4)](s))throw new Error(AO(0x1a7));const T=yield I(s);return yield this[AO(0xdc)](A,T,(d?d+'\x20in\x20':'')+'project:\x20\x27'+s+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const Ar=a8I,A=I=>__awaiter(this,void 0x0,void 0x0,function*(){const Ap=a8I;var a;const d=yield this[Ap(0x186)][Ap(0x15c)][Ap(0xf1)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':I}});return{'elements':d[Ap(0x161)][Ap(0xf1)][Ap(0x10c)](s=>s[Ap(0xf8)]),'nextCursor':(a=d[Ap(0x157)])===null||a===void 0x0?void 0x0:a[Ap(0x126)]};});return this[Ar(0xdc)](Ar(0x107),A);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const AP=a8I,A=I=>__awaiter(this,void 0x0,void 0x0,function*(){const AH=a8I;var a;const d=yield this['apiClient'][AH(0x15c)][AH(0x124)]({'options':{'per_page':this[AH(0x194)],'cursor':I}});return{'elements':d[AH(0x161)][AH(0x103)][AH(0x10c)](s=>s['id']),'nextCursor':(a=d[AH(0x157)])===null||a===void 0x0?void 0x0:a[AH(0x126)]};});return this[AP(0xdc)]('credentials',A);});}[a8x(0x15e)](A){const AR=a8x;this[AR(0x10d)]=A;}}exports[a8x(0x114)]=InquirerHelper;
|
|
1
|
+
'use strict';const a8i=a8n;(function(x,n){const t=a8n,R=x();while(!![]){try{const u=parseInt(t(0x1c0))/0x1+-parseInt(t(0x1b6))/0x2+parseInt(t(0x26b))/0x3+-parseInt(t(0x289))/0x4+-parseInt(t(0x1fb))/0x5+parseInt(t(0x1a3))/0x6*(parseInt(t(0x271))/0x7)+parseInt(t(0x291))/0x8;if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a8x,0x6d8f7));function a8x(){const xd=['unshift','askForBuild','blueBright','log\x20sink','name','./utils','getCurrentProjectName','example','No,\x20edit','\x20(completedAt:\x20','templateRuns','rawObject','fileName','don\x27t\x20change','registerPrompt','editor','\x20characters,\x20is\x20','resultCache','not\x20completed','hasOwnProperty','editPayload','Do\x20you\x20want\x20to\x20add','bold','Enter\x20the\x20','Template\x20id\x20not\x20provided.','stringify','pattern','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','job:\x20\x27','trim','jobs','toString','all-job-runs','askForAddon','getOwnPropertyDescriptor','inquirer-search-list','integer','choice','./pagination/inquirer-pagination-prompt','getInnerType','description','Do\x20you\x20want\x20to\x20add\x20more','Context\x20with\x20name\x20\x27','slice','found','minimum','unset','service','2197593rNHBPf','__awaiter','addEntry','service:\x20\x27','input','warning','45185FIuwHO','addons','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','askForLogSink','token','grey','No,\x20but\x20save\x20as\x20file','job','getPathString','pagination-prompt','json','addon','getType','search-list','join','askForProjectScopedResourcePaginated','whiteBright','override','completedAt','includes','askForPipeline','__importDefault','Writing\x20configuration\x20failed:\x20','fullName','561228ZZTPtA','\x20(startedAt:\x20','askArrayEntry','secrets','defineProperty','push','No\x20builds\x20found','value','3451832oPXZAj','string','apply','blue','doesn\x27t\x20match\x20pattern\x20\x27','66mndzhr','askForResourcePaginated','create','test','\x20Example:\x20','domains','isNaN','saveFile','lodash','askForProject','What\x20do\x20you\x20want\x20to\x20use\x20as','array','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','tmpCmdPath','this\x20option\x20is\x20required,\x20please\x20answer','bgGrey','main-context','validate','./api-helpers','777692wHrbWt','prompt','Please\x20confirm\x20following\x20configuration:\x0a','keys','credentials','pagination','.*\x5c.(json|yaml|yml)$','password','type','pop','9986QGyMzx','askForDomain','projects','all-builds','domain\x20(','domain','askForService','cursor','call','askForTemplate','object','list','propToType','configurable','get','maximum','safeDump','default','set','js-yaml','oneOf','all-containers','ABORT','find','Context\x20name\x20already\x20exists.','Aborted.','confirmation','project:\x20\x27','properties','createdAt','then','askForVolume','askGeneric','filter','__setModuleDefault','What\x27s\x20the\x20','required','No\x20containers\x20found','success','restores','data','Something\x20unexpected\x20happened.','for\x20this\x20','runs','containers','DynamicReloadPaginationPrompt','map','Configuration\x20file\x20written\x20to\x20','getQuestionString','nextPageCursor','REPEAT','minLength','pipeline','split','contextProvider','project','yaml','throw','Unexpected\x20file\x20type:\x20','1335445wPFLPN','__esModule','Choose\x20the\x20','ask','job\x20runs','askConfirm','concat','green','YES','Should\x20it\x20be','secret','logSinks','deleteWarningPrompt','length','templates','confirm','tokenPrompt','boolean','Yes,\x20send','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','yml','apiClient','No\x20','pathVars','services','body','maxLength','registryCredentials','cmdPath','fetchResourceList','red','service\x20build','__importStar','askForAddonBackup','assign','defaultPaginationPageSize','askForResource','writeFileSync','\x20characters','askForJob','\x20in\x20','safeLoad','EDIT','backups','askForProjectScopedResource','has','__createBinding','repeat','nextCursor','confirmationPrompt','startedAt','builds','retrievePayloadViaInteractiveCli','toUpperCase','subdomains','isUndefined','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','isEmpty','loginPrompt','pipelines','Go\x20to\x20editor','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','chalk','volume'];a8x=function(){return xd;};return a8x();}var __createBinding=this&&this[a8i(0x229)]||(Object[a8i(0x1a5)]?function(x,n,R,u){const p=a8i;if(u===undefined)u=R;var V=Object[p(0x25d)](n,R);(!V||(p(0x1ce)in V?!n[p(0x1fc)]:V['writable']||V[p(0x1cd)]))&&(V={'enumerable':!![],'get':function(){return n[R];}}),Object[p(0x28d)](x,u,V);}:function(x,n,R,u){if(u===undefined)u=R;x[u]=n[R];}),__setModuleDefault=this&&this[a8i(0x1e2)]||(Object['create']?function(x,n){const O=a8i;Object[O(0x28d)](x,'default',{'enumerable':!![],'value':n});}:function(x,n){const Z=a8i;x[Z(0x1d1)]=n;}),__importStar=this&&this[a8i(0x21b)]||function(x){const a=a8i;if(x&&x[a(0x1fc)])return x;var n={};if(x!=null){for(var R in x)if(R!=='default'&&Object['prototype'][a(0x24e)][a(0x1c8)](x,R))__createBinding(n,x,R);}return __setModuleDefault(n,x),n;},__awaiter=this&&this[a8i(0x26c)]||function(x,n,R,u){function V(w){return w instanceof R?w:new R(function(Y){Y(w);});}return new(R||(R=Promise))(function(w,Y){const T=a8n;function N(f){try{q(u['next'](f));}catch(M){Y(M);}}function C(f){const E=a8n;try{q(u[E(0x1f9)](f));}catch(M){Y(M);}}function q(f){const z=a8n;f['done']?w(f['value']):V(f[z(0x290)])['then'](N,C);}q((u=u[T(0x293)](x,n||[]))['next']());});},__importDefault=this&&this[a8i(0x286)]||function(x){return x&&x['__esModule']?x:{'default':x};};Object[a8i(0x28d)](exports,a8i(0x1fc),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a8i(0x1ab))),chalk_1=__importDefault(require(a8i(0x239))),fs=__importStar(require('fs')),utils_1=require(a8i(0x240)),api_helpers_1=require(a8i(0x1b5)),inquirer_pagination_prompt_1=require(a8i(0x261)),inquirer=require('inquirer'),inquirerSearchList=require(a8i(0x25e)),yaml=require(a8i(0x1d3));var ConfirmChoices;(function(x){const H=a8i;x['YES']=H(0x20d),x['REPEAT']='No,\x20repeat',x[H(0x225)]=H(0x243),x['SAVE']=H(0x277),x[H(0x1d6)]='No,\x20abort';}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(x){const F=a8i;this[F(0x210)]=x,this[F(0x21e)]=0x32,this[F(0x24f)]=n=>__awaiter(this,void 0x0,void 0x0,function*(){const e=F,{editedResult:R}=yield inquirer['prompt']([{'type':e(0x24a),'name':'editedResult','message':e(0x237),'default':yaml['safeDump'](n)}]);return yaml[e(0x224)](R);}),this['saveFile']=n=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=F,R=w=>Q(0x1fa)+w+',\x20supported\x20types:\x20[json|yaml|yml]';function u(){return __awaiter(this,void 0x0,void 0x0,function*(){const L=a8n;return inquirer[L(0x1b7)]([{'type':'input','name':L(0x247),'message':'Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','validate':w=>new RegExp(L(0x1bc))[L(0x1a6)](w)?!![]:R(w)}]);});}const {fileName:V}=yield u(),P=V[Q(0x25a)]()[Q(0x1f5)]('.')[Q(0x1bf)]();try{switch(P){case Q(0x27b):(0x0,utils_1[Q(0x1e6)])(Q(0x1ef)+V);return fs['writeFileSync'](V,JSON['stringify'](n,null,'\x20\x20'));case Q(0x1f8):case Q(0x20f):(0x0,utils_1[Q(0x1e6)])(Q(0x1ef)+V);return fs[Q(0x220)](V,yaml['safeDump'](n));default:(0x0,utils_1['warning'])(R(P));}}catch(w){(0x0,utils_1[Q(0x270)])(Q(0x287)+w['message']);}return undefined;}),this[F(0x1e1)]=(n,R)=>u=>{const D=F,V=typeof u==='string'?u[D(0x258)]():u;return R===![]&&V===D(0x248)?'':V;},this[F(0x1b4)]=(n,R,u)=>V=>{const G=F,P=[];if(V===''||V==='don\x27t\x20change'){if(R!==![])P[G(0x28e)](G(0x1b1));else return!![];}n[G(0x1be)]===G(0x292)&&!_[G(0x232)](n['pattern'])&&P[G(0x28e)](new RegExp(n[G(0x255)])[G(0x1a6)](V)?!![]:G(0x1a2)+n[G(0x255)]+'\x27');n['type']===G(0x292)&&!_['isUndefined'](n['minLength'])&&P[G(0x28e)](V[G(0x208)]>=n[G(0x1f3)]?!![]:G(0x20e)+n[G(0x1f3)]+G(0x24b)+V[G(0x208)]+'\x20characters');n[G(0x1be)]===G(0x292)&&!_[G(0x232)](n[G(0x215)])&&P[G(0x28e)](V[G(0x208)]<=n[G(0x215)]?!![]:'must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20'+n[G(0x215)]+G(0x24b)+V['length']+G(0x221));u&&Number[G(0x1a9)](parseInt(V,0xa))&&P[G(0x28e)]('must\x20be\x20a\x20number,\x20is\x20'+V);n[G(0x1be)]===G(0x25f)&&!_[G(0x232)](n[G(0x268)])&&P['push'](V>=n['minimum']?!![]:'must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20'+n[G(0x268)]);n[G(0x1be)]===G(0x25f)&&!_[G(0x232)](n[G(0x1cf)])&&P['push'](V<=n[G(0x1cf)]?!![]:G(0x1af)+n[G(0x1cf)]);if(n[G(0x1be)]===G(0x246)){const N=(0x0,utils_1['isValidJSON'])(V);P[G(0x28e)](N===![]||_[G(0x234)](N)?G(0x273):!![]);}const w=P[G(0x1e1)](C=>C!==!![]),Y=(n===null||n===void 0x0?void 0x0:n[G(0x242)])?'\x0a'+chalk_1['default'][G(0x219)]('>>')+G(0x1a7)+chalk_1['default'][G(0x281)](JSON['stringify'](n[G(0x242)])):'';return w[G(0x208)]>0x0?w[G(0x27f)](chalk_1[G(0x1d1)]['underline']('\x20and\x20it\x20'))+Y:!![];},this[F(0x279)]=(n,R,u)=>{const h=F,V=n[n[h(0x208)]-0x1];function P(){const o=h;return n['slice'](0x0,-0x1)[o(0x1ee)](N=>N['charAt'](0x0)[o(0x230)]()+N[o(0x266)](0x1))[o(0x27f)]('>');}const w=n[h(0x208)]>0x1?chalk_1[h(0x1d1)][h(0x1b2)][h(0x281)](P())+':\x20':'',Y=u?'\x20('+chalk_1['default'][h(0x294)](u)+')':'';return chalk_1[h(0x1d1)]['reset'](''+w+R+'\x20'+chalk_1[h(0x1d1)][h(0x251)]['greenBright'](V)+Y+'?');},this[F(0x21f)]=(n,R,u)=>__awaiter(this,void 0x0,void 0x0,function*(){const d=F;if(R[d(0x208)]<0x1){const w=u?'for\x20this\x20'+u:d(0x267);throw new Error(d(0x211)+n+'\x20'+w+'.');}const V=d(0x1fd)+n+'\x20to\x20use:',P=R[d(0x208)]>0x4?d(0x27e):'list';return(yield inquirer[d(0x1b7)]([{'type':P,'name':d(0x23f),'message':V,'choices':R}]))[d(0x23f)];}),this[F(0x1a4)]=(n,R,u)=>__awaiter(this,void 0x0,void 0x0,function*(){const v=F,{elements:V,nextCursor:P}=yield R();if(V[v(0x208)]<0x1){const N=u?v(0x1ea)+u:v(0x267);throw new Error(v(0x211)+n+'\x20'+N+'.');}const w=v(0x1fd)+n+'\x20to\x20use:';if(P!==undefined){const C=({nextPageCursor:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const s=v,f=yield R(q);return{'elements':f['elements'],'nextPageCursor':f[s(0x22b)]};});return(yield inquirer[v(0x1b7)]([{'type':v(0x27a),'name':'name','message':w,'choices':V,'nextPageCursor':P,'loadMore':C}]))['name'];}const Y=V[v(0x208)]>0x4?'search-list':v(0x1cb);return(yield inquirer['prompt']([{'type':Y,'name':v(0x23f),'message':w,'choices':V}]))[v(0x23f)];}),this[F(0x1e0)]=(n,R)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const g=F,u=''+(R?'('+chalk_1[g(0x1d1)][g(0x294)](R)+')\x20':''),V=g(0x252)+chalk_1[g(0x1d1)][g(0x202)](n)+'\x20'+u+'to\x20use:',P=this[g(0x1b4)]({'type':g(0x292),'required':!![]});return(yield inquirer[g(0x1b7)]([{'type':g(0x26f),'name':g(0x23f),'message':V,'validate':P}]))[g(0x23f)];}),this[F(0x200)]=n=>__awaiter(this,void 0x0,void 0x0,function*(){const A=F;return(yield inquirer[A(0x1b7)]([{'type':A(0x20a),'name':A(0x23f),'message':n,'default':!![]}]))[A(0x23f)];}),this[F(0x1c6)]=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l=F,R=u=>V=>__awaiter(this,void 0x0,void 0x0,function*(){const J=a8n;var P;const w=yield this['apiClient']['list'][J(0x213)]({'parameters':{'projectId':u},'options':{'per_page':this[J(0x21e)],'cursor':V}}),Y=w[J(0x1e8)][J(0x213)][J(0x1ee)](N=>N['id']);return{'elements':Y,'nextCursor':(P=w['pagination'])===null||P===void 0x0?void 0x0:P[J(0x1c7)]};});return this[l(0x280)]('service',R,n);}),this[F(0x1c9)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const n=R=>__awaiter(this,void 0x0,void 0x0,function*(){const y=a8n;var u;const V=yield this['apiClient']['list'][y(0x209)]({'options':{'per_page':this[y(0x21e)],'cursor':R}}),P=V['data']['templates'][y(0x1ee)](w=>w['id']);return{'elements':P,'nextCursor':(u=V['pagination'])===null||u===void 0x0?void 0x0:u[y(0x1c7)]};});return this['askForResourcePaginated']('template',n);}),this['askForTemplateRun']=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const I=F;if(_[I(0x232)](n))throw new Error(I(0x253));const R=u=>__awaiter(this,void 0x0,void 0x0,function*(){const r=I;var V;let P=this['defaultPaginationPageSize'];const w=yield this[r(0x210)][r(0x1cb)][r(0x245)]({'parameters':{'templateId':n},'options':{'per_page':P,'cursor':u}}),Y=w[r(0x1e8)][r(0x245)][r(0x1ee)](N=>N['id']+r(0x28a)+N[r(0x1dd)]+')');return{'elements':Y,'nextCursor':(V=w[r(0x1bb)])===null||V===void 0x0?void 0x0:V[r(0x1c7)]};});return this[I(0x1a4)]('template\x20run',R)[I(0x1de)](u=>u[I(0x1f5)]('\x20')[0x0]);}),this[F(0x274)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const k=F,n=R=>__awaiter(this,void 0x0,void 0x0,function*(){const m=a8n;var u;let V=this['defaultPaginationPageSize'];const P=yield this[m(0x210)][m(0x1cb)][m(0x206)]({'options':{'per_page':V,'cursor':R}}),w=P[m(0x1e8)][m(0x206)][m(0x1ee)](Y=>Y['id']);return{'elements':w,'nextCursor':(u=P[m(0x1bb)])===null||u===void 0x0?void 0x0:u[m(0x1c7)]};});return this[k(0x1a4)](k(0x23e),n);}),this[F(0x285)]=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const U=F,R=u=>V=>__awaiter(this,void 0x0,void 0x0,function*(){const B=a8n;var P;const w=yield this[B(0x210)][B(0x1cb)][B(0x236)]({'parameters':{'projectId':u},'options':{'per_page':this[B(0x21e)],'cursor':V}}),Y=w['data'][B(0x236)][B(0x1ee)](N=>N['id']);return{'elements':Y,'nextCursor':(P=w[B(0x1bb)])===null||P===void 0x0?void 0x0:P['cursor']};});return this[U(0x280)](U(0x1f4),R,n);}),this[F(0x222)]=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const K=F,R=u=>V=>__awaiter(this,void 0x0,void 0x0,function*(){const b=a8n;var P;const w=yield this[b(0x210)][b(0x1cb)][b(0x259)]({'parameters':{'projectId':u},'options':{'per_page':this[b(0x21e)],'cursor':V}}),Y=w[b(0x1e8)]['jobs'][b(0x1ee)](N=>N['id']);return{'elements':Y,'nextCursor':(P=w[b(0x1bb)])===null||P===void 0x0?void 0x0:P[b(0x1c7)]};});return this[K(0x280)]('job',R,n);}),this['askForJobRun']=(n,R,u=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const j=F,V=j(0x25b),P=w=>Y=>__awaiter(this,void 0x0,void 0x0,function*(){const x0=j;var N;const C=yield this['apiClient']['get'][x0(0x278)][x0(0x1eb)]({'parameters':{'projectId':w,'jobId':n},'options':{'per_page':this[x0(0x21e)],'cursor':Y}}),q=C[x0(0x1e8)][x0(0x1eb)][x0(0x1ee)](f=>f['id']+x0(0x28a)+f[x0(0x22d)]+')');return u&&q[x0(0x23b)](V),{'elements':q,'nextCursor':(N=C[x0(0x1bb)])===null||N===void 0x0?void 0x0:N[x0(0x1c7)]};});return this[j(0x280)](j(0x1ff),P,R,j(0x257)+n+'\x27')[j(0x1de)](w=>{const x1=j,Y=w[x1(0x1f5)]('\x20')[0x0];if(Y===V)return undefined;return Y;});}),this[F(0x23c)]=(n,R,u,V=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const x2=F,P=x2(0x1c3);if(u!==undefined){const w=Y=>N=>__awaiter(this,void 0x0,void 0x0,function*(){const x3=x2;var C;const q=yield this['apiClient'][x3(0x1ce)][x3(0x278)][x3(0x22e)]({'parameters':{'projectId':Y,'jobId':u},'options':{'per_page':this[x3(0x21e)],'cursor':N}}),f=q[x3(0x1e8)][x3(0x22e)][x3(0x1ee)](M=>M['id']+'\x20(startedAt:\x20'+M[x3(0x1dd)]+')');return V&&f[x3(0x23b)](P),{'elements':f,'nextCursor':(C=q['pagination'])===null||C===void 0x0?void 0x0:C['cursor']};});return this[x2(0x280)]('job\x20builds',w,n,'job:\x20\x27'+u+'\x27')[x2(0x1de)](Y=>{const x4=x2,N=Y[x4(0x1f5)]('\x20')[0x0];if(N===P)return undefined;return N;});}if(R!==undefined){const Y=N=>C=>__awaiter(this,void 0x0,void 0x0,function*(){const x5=x2;var q;const f=yield this[x5(0x210)][x5(0x1ce)]['service'][x5(0x22e)]({'parameters':{'projectId':N,'serviceId':R},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':C}}),M=f['data']['builds'][x5(0x1ee)](X=>X['id']+x5(0x28a)+X['createdAt']+')');if(V)M['unshift'](P);return{'elements':M,'nextCursor':(q=f[x5(0x1bb)])===null||q===void 0x0?void 0x0:q['cursor']};});return this['askForProjectScopedResourcePaginated'](x2(0x21a),Y,n,'service:\x20\x27'+u+'\x27')[x2(0x1de)](N=>{const x6=x2,C=N[x6(0x1f5)]('\x20')[0x0];if(C===P)return undefined;return C;});}throw new Error(x2(0x28f));}),this['askForContainer']=(n,R,u,V=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const x7=F,P=x7(0x1d5);if(u!==undefined){const w=Y=>N=>__awaiter(this,void 0x0,void 0x0,function*(){const x8=x7;var C,q;const f=yield this[x8(0x210)][x8(0x1ce)]['job'][x8(0x1ec)]({'parameters':{'projectId':Y,'jobId':u},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':N}}),M=(C=f[x8(0x1e8)]['containers'])!==null&&C!==void 0x0?C:[],X=M===null||M===void 0x0?void 0x0:M[x8(0x1ee)](S=>S[x8(0x23f)]+x8(0x28a)+S[x8(0x1dd)]+')');return V&&X['unshift'](P),{'elements':X,'nextCursor':(q=f[x8(0x1bb)])===null||q===void 0x0?void 0x0:q['cursor']};});return this[x7(0x280)]('job\x20containers',w,n,x7(0x257)+u+'\x27')[x7(0x1de)](Y=>{const x9=x7,N=Y[x9(0x1f5)]('\x20')[0x0];if(N===P)return undefined;return N;});}if(R!==undefined){const Y=N=>C=>__awaiter(this,void 0x0,void 0x0,function*(){const xx=x7;var q,f;const M=yield this['apiClient'][xx(0x1ce)][xx(0x26a)][xx(0x1ec)]({'parameters':{'projectId':N,'serviceId':R},'options':{'per_page':this[xx(0x21e)],'cursor':C}}),X=(q=M[xx(0x1e8)][xx(0x1ec)])!==null&&q!==void 0x0?q:[],S=X[xx(0x1ee)](W=>W[xx(0x23f)]+'\x20(startedAt:\x20'+W[xx(0x1dd)]+')');if(V)S===null||S===void 0x0?void 0x0:S[xx(0x23b)](P);return{'elements':S,'nextCursor':(f=M['pagination'])===null||f===void 0x0?void 0x0:f['cursor']};});return this[x7(0x280)]('service\x20containers',Y,n,x7(0x26e)+u+'\x27')[x7(0x1de)](N=>{const xn=x7,C=N[xn(0x1f5)]('\x20')[0x0];if(C===P)return undefined;return C;});}throw new Error(x7(0x1e5));}),this[F(0x25c)]=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const xu=F,R=u=>V=>__awaiter(this,void 0x0,void 0x0,function*(){const xR=a8n;var P;const w=yield this[xR(0x210)][xR(0x1cb)][xR(0x272)]({'parameters':{'projectId':u},'options':{'per_page':this[xR(0x21e)],'cursor':V}});return{'elements':w[xR(0x1e8)][xR(0x272)][xR(0x1ee)](Y=>Y['id']),'nextCursor':(P=w[xR(0x1bb)])===null||P===void 0x0?void 0x0:P[xR(0x1c7)]};});return this[xu(0x280)](xu(0x27c),R,n);}),this[F(0x21c)]=(n,R)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const xP=F,u=V=>P=>__awaiter(this,void 0x0,void 0x0,function*(){const xV=a8n;var w;const Y=yield this[xV(0x210)][xV(0x1ce)]['addon'][xV(0x226)]({'parameters':{'projectId':V,'addonId':R},'options':{'per_page':this[xV(0x21e)],'cursor':P}});return{'elements':Y[xV(0x1e8)][xV(0x226)][xV(0x1ee)](N=>N['id']+'\x20(completedAt:\x20'+(N['completedAt']||xV(0x24d))+')'),'nextCursor':(w=Y[xV(0x1bb)])===null||w===void 0x0?void 0x0:w[xV(0x1c7)]};});return this[xP(0x280)]('backups',u,n,'addon:\x20\x27'+R+'\x27')[xP(0x1de)](V=>V[xP(0x1f5)]('\x20')[0x0]);}),this['askForAddonRestore']=(n,R,u)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const xY=F,V=P=>w=>__awaiter(this,void 0x0,void 0x0,function*(){const xw=a8n;var Y;const N=yield this['apiClient']['get'][xw(0x27c)]['restores']({'parameters':{'projectId':P,'addonId':R,'backupId':u},'options':{'per_page':this[xw(0x21e)],'cursor':w}});return{'elements':N[xw(0x1e8)][xw(0x1e7)]['map'](C=>C['id']+xw(0x244)+(C[xw(0x283)]||xw(0x24d))+')'),'nextCursor':(Y=N[xw(0x1bb)])===null||Y===void 0x0?void 0x0:Y[xw(0x1c7)]};});return this['askForProjectScopedResourcePaginated']('restore',V,n,'addon:\x20\x27'+R+'\x27')['then'](P=>P[xY(0x1f5)]('\x20')[0x0]);}),this[F(0x1df)]=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const xC=F,R=u=>__awaiter(this,void 0x0,void 0x0,function*(){const xN=a8n;return(yield this[xN(0x210)]['list']['volumes']({'parameters':{'projectId':u}}))['data']['map'](V=>V['id']);});return this['askForProjectScopedResource'](xC(0x23a),R,n);}),this['askForSecret']=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const xf=F,R=u=>V=>__awaiter(this,void 0x0,void 0x0,function*(){const xq=a8n;var P;const w=yield this[xq(0x210)][xq(0x1cb)]['secrets']({'parameters':{'projectId':u},'options':{'per_page':this[xq(0x21e)],'cursor':V}});return{'elements':w['data'][xq(0x28c)][xq(0x1ee)](Y=>Y['id']),'nextCursor':(P=w[xq(0x1bb)])===null||P===void 0x0?void 0x0:P[xq(0x1c7)]};});return this[xf(0x280)](xf(0x205),R,n);}),this['askForSubdomain']=n=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const xM=F,R=yield this[xM(0x210)][xM(0x1ce)][xM(0x1c5)]({'parameters':{'domain':n}}),u=R[xM(0x1e8)][xM(0x231)][xM(0x1ee)](P=>P[xM(0x23f)]+'\x20(full\x20domain:\x20'+P[xM(0x288)]+')'),V=xM(0x1c4)+n+')';return this[xM(0x21f)]('subdomain',u,V)['then'](P=>P[xM(0x1f5)]('\x20')[0x0]);}),this[F(0x207)]=n=>__awaiter(this,void 0x0,void 0x0,function*(){const xX=F;return(yield inquirer[xX(0x1b7)]([{'type':xX(0x20a),'name':'confirmation','message':chalk_1['default']['yellowBright'](xX(0x233)+(n||'a\x20Northflank\x20resource')+'.\x20This\x20is\x20irreversible.\x20Please\x20confirm!'),'default':![]}]))[xX(0x1da)];}),this[F(0x235)]=(n,R)=>__awaiter(this,void 0x0,void 0x0,function*(){const xS=F;_[xS(0x232)](n[xS(0x23f)])&&(R[xS(0x208)]<=0x0?_[xS(0x1d2)](n,xS(0x23f),xS(0x1d1)):yield(0x0,utils_1['retry'])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const xW=xS,{name:u}=yield inquirer['prompt']([{'type':xW(0x26f),'name':xW(0x23f),'message':xW(0x238),'default':xW(0x1b3)}]);if(!n[xW(0x282)]&&R[xW(0x1d7)](V=>V[xW(0x23f)]===u)){const {c:V}=yield inquirer['prompt']([{'type':xW(0x20a),'name':'c','message':xW(0x265)+u+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(V===![])throw new Error(xW(0x1d8));_[xW(0x1d2)](n,xW(0x282),!![]);}_['set'](n,'name',u);})));if(_[xS(0x232)](n['token'])){const u=yield this[xS(0x20b)]();_[xS(0x1d2)](n,xS(0x275),u);}return n;}),this['tokenPrompt']=()=>__awaiter(this,void 0x0,void 0x0,function*(){const xt=F,{token:n}=yield inquirer['prompt']([{'type':xt(0x1bd),'name':xt(0x275),'mask':'*','message':'Choose\x20the\x20login\x20token:'}]);return n;}),inquirer['registerPrompt']('search-list',inquirerSearchList),inquirer[F(0x249)](F(0x27a),inquirer_pagination_prompt_1[F(0x1ed)]);}[a8i(0x22c)](x,n){return __awaiter(this,void 0x0,void 0x0,function*(){const xi=a8n,R=yaml[xi(0x1d0)](x),u=_['max'](R[xi(0x1f5)]('\x0a')[xi(0x1ee)](w=>w[xi(0x208)])),V=chalk_1[xi(0x1d1)][xi(0x276)]('-'[xi(0x22a)](u)+'\x0a'),{confirm:P}=yield inquirer[xi(0x1b7)]([{'type':xi(0x1cb),'name':xi(0x20a),'message':''+chalk_1[xi(0x1d1)]['bold'][xi(0x202)](xi(0x1b8))+V+chalk_1[xi(0x1d1)][xi(0x23d)](R)+V,'choices':Object['values'](ConfirmChoices)}]);switch(P){case ConfirmChoices[xi(0x203)]:return x;case ConfirmChoices[xi(0x1d6)]:throw new Error(xi(0x1d9));case ConfirmChoices[xi(0x1f2)]:return this['retrievePayloadViaInteractiveCli'](n);case ConfirmChoices[xi(0x225)]:return this['confirmationPrompt'](yield this[xi(0x24f)](x),n);case ConfirmChoices['SAVE']:yield this[xi(0x1aa)](x);return this['confirmationPrompt'](x,n);default:throw new Error(xi(0x1e9));}});}[a8i(0x22f)](x,n){return __awaiter(this,void 0x0,void 0x0,function*(){const xp=a8n;if((n===null||n===void 0x0?void 0x0:n[xp(0x24c)])!==undefined)this['resultCache']=n===null||n===void 0x0?void 0x0:n['resultCache'];this[xp(0x1b0)]=n===null||n===void 0x0?void 0x0:n[xp(0x217)];const R={};return yield this[xp(0x1cc)]([],x['opt'][xp(0x214)],R),this[xp(0x24c)]=R,yield this[xp(0x22c)](R,x);});}['propToType'](x,n,R,u){return __awaiter(this,void 0x0,void 0x0,function*(){const xO=a8n;let V;if(n[xO(0x1d4)]&&!_[xO(0x228)](n,xO(0x1dc))){if(n[xO(0x1d4)][xO(0x208)]>0x1){const {choice:P}=yield inquirer['prompt']([{'type':xO(0x1cb),'name':xO(0x260),'message':xO(0x1e3)+(x[x[xO(0x208)]-0x1]||'')+'\x20type?','choices':n[xO(0x1d4)][xO(0x1ee)](w=>{const xZ=xO;var Y;return(Y=w[xZ(0x263)])!==null&&Y!==void 0x0?Y:'??';})}]);V=yield this[xO(0x27d)](x,n[xO(0x1d4)][xO(0x1d7)](w=>w[xO(0x263)]===P),R,u);}else{const w=n[xO(0x1d4)][0x0];_['set'](w,xO(0x263),n[xO(0x263)]),V=yield this[xO(0x27d)](x,w,R,u);}V={};}else V=yield this[xO(0x27d)](x,n,R,u);return V;});}[a8i(0x262)](x,n,R,u){var V;return __awaiter(this,void 0x0,void 0x0,function*(){const xa=a8n;if(u===![]){const {addEntry:Y}=yield inquirer[xa(0x1b7)]([{'type':xa(0x20a),'name':xa(0x26d),'message':this[xa(0x279)](n,xa(0x250),x===null||x===void 0x0?void 0x0:x[xa(0x263)]),'default':![]}]);if(!Y)return R;}const P=Object[xa(0x1b9)]((V=x===null||x===void 0x0?void 0x0:x[xa(0x1dc)])!==null&&V!==void 0x0?V:[]),w=x[xa(0x1e4)]||[];if(P['length']>0x0)for(const N of P){const C=n[xa(0x201)](N);if(n[xa(0x208)]>0x0&&!_[xa(0x228)](R,n['join']('.')))_[xa(0x1d2)](R,n[xa(0x27f)]('.'),{});yield this[xa(0x1cc)](C,x[xa(0x1dc)][N],R,w[xa(0x284)](N));}else yield this[xa(0x27d)](n,Object['assign'](Object[xa(0x21d)]({},x),{'type':xa(0x246)}),R,u);return R;});}['askArrayEntry'](x,n,R,u){return __awaiter(this,void 0x0,void 0x0,function*(){const xE=a8n;if(n&&R)return!![];const V=n?xE(0x250):xE(0x264),{addEntry:P}=yield inquirer[xE(0x1b7)]([{'type':xE(0x20a),'name':'addEntry','message':this['getPathString'](x,V,n?u:undefined),'default':![]}]);return P;});}[a8i(0x27d)](x,n,R,u){return __awaiter(this,void 0x0,void 0x0,function*(){const xz=a8n;let V;const P=x[xz(0x27f)]('.');switch(n===null||n===void 0x0?void 0x0:n[xz(0x1be)]){case xz(0x1ae):{let w=!![];while(yield this[xz(0x28b)](x,w,u,n===null||n===void 0x0?void 0x0:n[xz(0x263)])){const Y=_[xz(0x1ce)](R,P);_[xz(0x269)](R,P),yield this['getType'](x,n['items'],R);const N=_[xz(0x1ce)](R,P);!_['isArray'](Y)?_['set'](R,P,[N]):(Y[xz(0x28e)](N),_[xz(0x1d2)](R,P,Y)),w=![];}return V||[];}case xz(0x1ca):{return V=yield this[xz(0x262)](n,x,R,u),V;}case xz(0x246):V=(0x0,utils_1['isValidJSON'])(yield this[xz(0x1fe)](x,n,u))||undefined;break;case xz(0x292):case xz(0x20c):case xz(0x25f):default:V=yield this[xz(0x1fe)](x,n,u,R);break;}return!_['isUndefined'](V)&&_[xz(0x1d2)](R,P,V),V;});}[a8i(0x1fe)](x,n,R,u){var V;return __awaiter(this,void 0x0,void 0x0,function*(){const xT=a8n,P=x[x[xT(0x208)]-0x1],{defaultValue:defaultValue=(V=n===null||n===void 0x0?void 0x0:n[xT(0x242)])!==null&&V!==void 0x0?V:n===null||n===void 0x0?void 0x0:n[xT(0x1d1)],choices:choices=n===null||n===void 0x0?void 0x0:n['enum'],pagination:w}=yield(0x0,api_helpers_1[xT(0x218)])(P,this[xT(0x210)],this[xT(0x1b0)],u,this[xT(0x212)],x);let Y='input';if(!_['isUndefined'](choices)&&choices[xT(0x208)]>0x0){if(w!==undefined&&w[xT(0x1f1)]!==undefined)Y='pagination-prompt';else choices[xT(0x208)]>0x4&&typeof choices[0x0]==='string'?Y=xT(0x27e):Y=xT(0x1cb);}else{if((n===null||n===void 0x0?void 0x0:n[xT(0x1be)])===xT(0x20c))Y=xT(0x20a);else{if((n===null||n===void 0x0?void 0x0:n['type'])===xT(0x25f))Y=xT(0x26f);else(n===null||n===void 0x0?void 0x0:n[xT(0x1be)])==='rawObject'&&(Y=xT(0x24a));}}let N=R!==![]?!_['isObject'](defaultValue)?defaultValue:JSON[xT(0x254)](defaultValue):_['isBoolean'](defaultValue)?defaultValue:'don\x27t\x20change';if(choices)N=N[xT(0x25a)]();_[xT(0x228)](this[xT(0x24c)],x['join']('.'))&&(N=this[xT(0x24c)][x[xT(0x27f)]('.')]);const C=choices&&R===![]?[xT(0x248),...choices]:choices,q=(n===null||n===void 0x0?void 0x0:n['type'])==='integer',f=Object[xT(0x21d)]({'type':Y,'name':'id','message':this[xT(0x1f0)](x,n),'choices':C,'default':N,'filter':this[xT(0x1e1)](Y,R),'validate':this[xT(0x1b4)](n,R,q)},w),M=(yield inquirer[xT(0x1b7)]([f]))['id'];if(M===xT(0x248)||M==='')return undefined;if(q)return parseInt(M,0xa);return M;});}[a8i(0x1f0)](x,n){const xH=a8i,R=(n===null||n===void 0x0?void 0x0:n[xH(0x1be)])!==xH(0x20c)?xH(0x1ad):xH(0x204);return this[xH(0x279)](x,R,n===null||n===void 0x0?void 0x0:n['description']);}[a8i(0x1ac)](){return __awaiter(this,void 0x0,void 0x0,function*(){const xe=a8n,x=n=>__awaiter(this,void 0x0,void 0x0,function*(){const xF=a8n;var R;const u=yield this[xF(0x210)][xF(0x1cb)][xF(0x1c2)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':n}}),V=u['data'][xF(0x1c2)]['map'](P=>P['id']);return{'elements':V,'nextCursor':(R=u[xF(0x1bb)])===null||R===void 0x0?void 0x0:R[xF(0x1c7)]};});return yield this[xe(0x1a4)](xe(0x1f7),x);});}[a8i(0x227)](x,n,R,u){return __awaiter(this,void 0x0,void 0x0,function*(){const xQ=a8n,V=R||this['apiClient']['contextProvider'][xQ(0x241)]();if(_[xQ(0x232)](V))throw new Error(xQ(0x256));const P=yield n(V);return yield this[xQ(0x21f)](x,P,(u?u+'\x20in\x20':'')+xQ(0x1db)+V+'\x27');});}[a8i(0x280)](x,n,R,u){return __awaiter(this,void 0x0,void 0x0,function*(){const xL=a8n,V=R||this[xL(0x210)][xL(0x1f6)][xL(0x241)]();if(_[xL(0x232)](V))throw new Error(xL(0x256));const P=yield n(V);return yield this[xL(0x1a4)](x,P,(u?u+xL(0x223):'')+xL(0x1db)+V+'\x27');});}[a8i(0x1c1)](){return __awaiter(this,void 0x0,void 0x0,function*(){const xG=a8n,x=n=>__awaiter(this,void 0x0,void 0x0,function*(){const xD=a8n;var R;const u=yield this[xD(0x210)]['list'][xD(0x1a8)]({'options':{'per_page':this[xD(0x21e)],'cursor':n}});return{'elements':u[xD(0x1e8)]['domains'][xD(0x1ee)](V=>V['name']),'nextCursor':(R=u[xD(0x1bb)])===null||R===void 0x0?void 0x0:R[xD(0x1c7)]};});return this['askForResourcePaginated'](xG(0x1c5),x);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const xo=a8n,x=n=>__awaiter(this,void 0x0,void 0x0,function*(){const xh=a8n;var R;const u=yield this[xh(0x210)][xh(0x1cb)][xh(0x216)]({'options':{'per_page':this[xh(0x21e)],'cursor':n}});return{'elements':u[xh(0x1e8)]['credentials'][xh(0x1ee)](V=>V['id']),'nextCursor':(R=u[xh(0x1bb)])===null||R===void 0x0?void 0x0:R['cursor']};});return this[xo(0x1a4)](xo(0x1ba),x);});}['setPathVars'](x){this['pathVars']=x;}}function a8n(x,n){const R=a8x();return a8n=function(u,V){u=u-0x1a2;let P=R[u];return P;},a8n(x,n);}exports['InquirerHelper']=InquirerHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a9a=a9n;(function(x,n){const Z=a9n,R=x();while(!![]){try{const u=parseInt(Z(0xd5))/0x1*(-parseInt(Z(0xe5))/0x2)+parseInt(Z(0xf2))/0x3+parseInt(Z(0x106))/0x4+-parseInt(Z(0x111))/0x5*(parseInt(Z(0xfe))/0x6)+-parseInt(Z(0xe3))/0x7+parseInt(Z(0xe0))/0x8+parseInt(Z(0x10d))/0x9*(parseInt(Z(0xe4))/0xa);if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a9x,0xea142));function a9x(){const l=['initPackage','exit','__esModule','6715XNVBAN','unable\x20to\x20parse\x20message:\x20','Unexpected\x20response,\x20api\x20token\x20missing','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','browser-opened','done','write','create','1366213MuRVav','end','toString','idle','prototype','error','writable','call','value','http:','replace','102304QBgzkK','defineProperty','login-failure','9625266EFSFuh','13350430rnnXvP','2CTQLfp','status','handleError','aborted','Login\x20process\x20stopped\x20before\x20completed','startLogin','stringify','next','get','then','SIGINT','Unexpected\x20response','duplex','5227902WNGGJe','message','apply','default','getOwnPropertyDescriptor','ws:','hasOwnProperty','type','login-success','open','configurable','finally','4326GlVqTX','success','__importStar','https:','error\x20happened\x20during\x20browser\x20login:\x20','parse','openBrowser','__importDefault','6311500EHhVJU','NorthflankApiBrowserLogin','__awaiter','__createBinding','init','/v1/cli-login','__setModuleDefault','9EyDmCm'];a9x=function(){return l;};return a9x();}var __createBinding=this&&this[a9a(0x109)]||(Object['create']?function(x,n,R,u){const E=a9a;if(u===undefined)u=R;var V=Object[E(0xf6)](n,R);(!V||(E(0xed)in V?!n[E(0x110)]:V[E(0xdb)]||V[E(0xfc)]))&&(V={'enumerable':!![],'get':function(){return n[R];}}),Object[E(0xe1)](x,u,V);}:function(x,n,R,u){if(u===undefined)u=R;x[u]=n[R];}),__setModuleDefault=this&&this[a9a(0x10c)]||(Object[a9a(0xd4)]?function(x,n){const z=a9a;Object[z(0xe1)](x,z(0xf5),{'enumerable':!![],'value':n});}:function(x,n){const T=a9a;x[T(0xf5)]=n;}),__importStar=this&&this[a9a(0x100)]||function(x){const H=a9a;if(x&&x[H(0x110)])return x;var n={};if(x!=null){for(var R in x)if(R!=='default'&&Object[H(0xd9)][H(0xf8)][H(0xdc)](x,R))__createBinding(n,x,R);}return __setModuleDefault(n,x),n;},__awaiter=this&&this[a9a(0x108)]||function(x,n,R,u){function V(w){return w instanceof R?w:new R(function(Y){Y(w);});}return new(R||(R=Promise))(function(w,Y){const Q=a9n;function N(f){const F=a9n;try{q(u[F(0xec)](f));}catch(M){Y(M);}}function C(f){try{q(u['throw'](f));}catch(M){Y(M);}}function q(f){const e=a9n;f[e(0xd2)]?w(f[e(0xdd)]):V(f[e(0xdd)])[e(0xee)](N,C);}q((u=u[Q(0xf4)](x,n||[]))[Q(0xec)]());});},__importDefault=this&&this[a9a(0x105)]||function(x){const L=a9a;return x&&x[L(0x110)]?x:{'default':x};};Object['defineProperty'](exports,a9a(0x110),{'value':!![]}),exports['NorthflankApiBrowserLogin']=void 0x0;const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a9a(0xfb))),events_1=require('events');function a9n(x,n){const R=a9x();return a9n=function(u,V){u=u-0xce;let P=R[u];return P;},a9n(x,n);}class NorthflankApiBrowserLogin extends events_1['EventEmitter']{constructor(x,n=!![]){const D=a9a;super(),this['baseUrl']=x,this['openBrowser']=n,this[D(0xe6)]=D(0xd8),this[D(0x10e)]=()=>JSON['stringify']({'type':D(0x10a)});}[a9a(0xea)](){const G=a9a;var x;const n=this['baseUrl'][G(0xdf)](G(0x101),'wss:')[G(0xdf)](G(0xde),G(0xf7)),R=n+G(0x10b),u=new ws_1[(G(0xf5))](R),V=()=>__awaiter(this,void 0x0,void 0x0,function*(){const o=G;yield new Promise(w=>{const h=a9n;var Y;(Y=this['duplex'])===null||Y===void 0x0?void 0x0:Y[h(0xd6)](JSON[h(0xeb)]({'type':h(0xe8)}),()=>w());}),process[o(0x10f)]();}),P=new Promise((w,Y)=>{const d=G;var N,C,q;try{this[d(0xf1)]=(0x0,ws_1['createWebSocketStream'])(u),process['on'](d(0xef),V);}catch(f){Y(new Error(d(0xd0)+f[d(0xf3)]));}(N=this[d(0xf1)])===null||N===void 0x0?void 0x0:N['on']('data',M=>{const c=d;var X;const S=JSON[c(0x103)](M[c(0xd7)]());switch(S===null||S===void 0x0?void 0x0:S[c(0xf9)]){case'init-ack':{const {loginPage:W}=S;if(W===undefined){this[c(0xe7)](c(0xf0),Y);return;}this[c(0x104)]&&(0x0,open_1[c(0xf5)])(W)['catch'](t=>{const v=c,i='Unable\x20to\x20open\x20browser:\x20'+t['message'];this[v(0xe7)](i,Y);});this['emit'](c(0xd1),{'url':W});break;}case c(0xfa):{const {apiToken:t,contextName:i}=S;if(t===undefined){this[c(0xe7)](c(0xcf),Y);return;}(X=this[c(0xf1)])===null||X===void 0x0?void 0x0:X[c(0xd6)](),w({'token':t,'contextName':i}),this['status']='success';break;}case c(0xe2):{const p='Failure\x20during\x20login:\x20'+(S===null||S===void 0x0?void 0x0:S['message']);this[c(0xe7)](p,Y);break;}default:{const O=c(0xce)+JSON[c(0xeb)](S);this['handleError'](O,Y);}}}),(C=this['duplex'])===null||C===void 0x0?void 0x0:C['on']('error',M=>{const s=d;this[s(0xe7)](s(0x102)+M['message'],Y);}),(q=this[d(0xf1)])===null||q===void 0x0?void 0x0:q['on']('end',()=>{const g=d;if(this[g(0xe6)]===g(0xff)){}else this[g(0xe7)](g(0xe9),Y);});});return(x=this[G(0xf1)])===null||x===void 0x0?void 0x0:x[G(0xd3)](this['initPackage']()),this['status']=G(0x10a),P[G(0xfd)](()=>{const A=G;process['removeListener'](A(0xef),V);});}[a9a(0xe7)](x,n){const J=a9a;var R,u;n?(R=this[J(0xf1)])===null||R===void 0x0?void 0x0:R[J(0xd6)](()=>n(new Error(x))):(u=this[J(0xf1)])===null||u===void 0x0?void 0x0:u[J(0xd6)](),this[J(0xe6)]=J(0xda);}}exports[a9a(0x107)]=NorthflankApiBrowserLogin;
|
package/dist/logs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a10j=a10I;(function(A,I){const G=a10I,a=A();while(!![]){try{const d=-parseInt(G(0x122))/0x1+-parseInt(G(0xfa))/0x2+parseInt(G(0x179))/0x3+parseInt(G(0x100))/0x4*(-parseInt(G(0x124))/0x5)+-parseInt(G(0x108))/0x6+-parseInt(G(0xfb))/0x7+parseInt(G(0x12a))/0x8;if(d===I)break;else a['push'](a['shift']());}catch(s){a['push'](a['shift']());}}}(a10A,0xe89e1));var __awaiter=this&&this[a10j(0x109)]||function(A,I,a,d){function s(T){return T instanceof a?T:new a(function(V){V(T);});}return new(a||(a=Promise))(function(T,V){const w=a10I;function g(f){const z=a10I;try{L(d[z(0x151)](f));}catch(t){V(t);}}function u(f){try{L(d['throw'](f));}catch(t){V(t);}}function L(f){const h=a10I;f['done']?T(f[h(0x102)]):s(f[h(0x102)])[h(0xf7)](g,u);}L((d=d[w(0x155)](A,I||[]))[w(0x151)]());});},__importDefault=this&&this[a10j(0x117)]||function(A){return A&&A['__esModule']?A:{'default':A};};function a10I(A,I){const a=a10A();return a10I=function(d,s){d=d-0xf2;let T=a[d];return T;},a10I(A,I);}Object[a10j(0x13d)](exports,'__esModule',{'value':!![]}),exports['CliLogs']=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a10j(0xfd))),utils_1=require(a10j(0x126)),inquirer_helper_1=require(a10j(0x16f)),commander_1=require(a10j(0x105)),console_format_helpers_1=require('../formatting/console-format-helpers'),log_formatter_1=require(a10j(0x14c));function a10A(){const AI=['\x20with\x20live-tailing',',\x20from:\x20','./log-formatter','textNotIncludes','runId','LogType','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','next','\x20--','InquirerHelper','Backup\x20to\x20get\x20logs\x20from','apply','askForProject','askForJob','Get\x20log\x20for\x20the\x20specified\x20','\x20seconds','alias','\x20for\x20all\x20containers','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','getCommand','pagination','formatLogLine','getCurrentProjectName','values','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','parseDateInput','getStandardLogCommand','serviceId','--noDefaults','argParser','action','format','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','addonRestore','defaultDurationSeconds','getFormatter',',\x20restore\x20id\x20','../inquirer-helper','--textNotIncludes\x20<text>','length','getLogsCommand','noDefaults','--backup\x20--backupId\x20[backupId]','CliLogs','Build\x20to\x20get\x20logs\x20from','description','--restore\x20--restoreId\x20[restoreId]','5015037WKLNYp','Error\x20while\x20fetching\x20log\x20lines:\x20','toUpperCase','stringify','data','customUserAgent','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','logTail','-d,\x20--direction\x20<order>','slice','--duration\x20[duration]','getCurrentServiceName','option','warning','then','yml','getCurrentJobName','2923374fspQwk','8532706RVsuuU','log','chalk','-t,\x20--types\x20<types...>','job','163288XgKmOl','tsHint','value','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','\x20of\x20','commander','askForAddon','printInitInfo','10981050PoVJUG','__awaiter','yaml','inquirerHelper','--regexIncludes\x20<regex>','error','printResponse','askForBuild','containerId','assign','apiContext','Project\x20for\x20logs','askForAddonRestore','--endTime\x20<timestamp>','message','__importDefault','getSeconds','\x20to\x20get\x20logs\x20from','apiClient','--textIncludes\x20<text>','assertContextExisting','service',',\x20to:\x20','addon','charAt','close','1641285SDZVLV','Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression','185OeOTHQ','regexNotIncludes','../utils','choices','conflicts','addonId','55549128AidLoI','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','name','Option','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','tail','setSeconds','Number\x20of\x20lines\x20to\x20return.','Error\x20while\x20tailing\x20log\x20lines:\x20','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','json','build-','regexIncludes',',\x20duration:\x20','--build\x20--buildId\x20[buildId]','hasNextPage','Id]','forEach','logRange','defineProperty','default','bold','textIncludes','\x20(exit\x20with\x20','logs','addOption','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','askForContainer','valueOf','>\x20Container\x20logs','-o,\x20--output\x20[output]','--run\x20--runId\x20[runId]'];a10A=function(){return AI;};return a10A();}class CliLogs{constructor(A){const i=a10j;this[i(0x112)]=A,this['defaultDurationSeconds']=0x708,this[i(0x164)]=(I,a,d,s)=>{const A0=i,T=(0x0,utils_1[A0(0x15d)])(!![])[A0(0x12c)]((a?A0(0x135):'')+A0(0x142))[A0(0x15a)]((a?A0(0x135):'')+A0(0xfc))[A0(0x177)](A0(0x158)+I)[A0(0xf5)]('--project\x20--projectId\x20[projectId]',A0(0x113))['option']('--'+I+A0(0x152)+I+'Id\x20['+I+A0(0x13a),I[A0(0x120)](0x0)[A0(0x17b)]()+I[A0(0xf2)](0x1)+A0(0x119))[A0(0xf5)]('--container\x20--containerId\x20[containerId]',A0(0x12b));if(a)T[A0(0xf5)](A0(0x138),A0(0x176));if(I===A0(0xff))T[A0(0xf5)](A0(0x149),'Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0');if(d)T[A0(0xf5)](A0(0x174),A0(0x154));if(s)T[A0(0xf5)](A0(0x178),'Restore\x20to\x20get\x20logs\x20from');return!a&&!d&&!s&&T[A0(0x143)](new commander_1[(A0(0x12d))](A0(0xfe),'Which\x20log\x20types\x20to\x20fetch')[A0(0x127)](Object[A0(0x161)](js_client_1[A0(0x14f)]))),T[A0(0xf5)]('-f,\x20--tail','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.')[A0(0xf5)]('-l,\x20--lineLimit\x20[limit]',A0(0x131))['option']('--startTime\x20<timestamp>','Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1[A0(0x101)],utils_1[A0(0x163)])[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x115),'Get\x20logs\x20generated\x20before\x20this\x20time,\x20'+utils_1[A0(0x101)])[A0(0x167)](utils_1[A0(0x163)])[A0(0x128)]([A0(0x12f)]))['option'](A0(0xf3),A0(0x17f))[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x181),A0(0x133))[A0(0x127)](['backward','forward'])[A0(0x128)]([A0(0x12f)]))[A0(0x143)](new commander_1['Option'](A0(0x11b),A0(0x16a))[A0(0x128)]([A0(0x14d),'regexIncludes','regexNotIncludes']))[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x170),'Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text')[A0(0x128)]([A0(0x140),A0(0x136),A0(0x125)]))[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x10c),A0(0x123))[A0(0x128)]([A0(0x14d),'textIncludes',A0(0x125)]))[A0(0x143)](new commander_1[(A0(0x12d))]('--regexNotIncludes\x20<regex>',A0(0x162))[A0(0x128)](['textNotIncludes',A0(0x136),A0(0x140)]))[A0(0xf5)](A0(0x166),A0(0x144),![])[A0(0x143)](new commander_1[(A0(0x12d))](A0(0x148),A0(0x12e))[A0(0x127)](Object['values']([A0(0x169),A0(0x134),A0(0x10a)]))),T;},this[i(0x107)]=(I,a,d,s)=>{const A1=i,{containerName:T,restoreId:V,backupId:g,quiet:u,tail:L,startTime:f,endTime:t,duration:m}=s;if(u===!![])return;const U=L?A1(0x141)+chalk_1[A1(0x13e)][A1(0x13f)]('\x27Ctrl+C\x27')+')':'',S=L?A1(0x14a):'',k=new Date(),e=f!==null&&f!==void 0x0?f:new Date(new Date((t!==null&&t!==void 0x0?t:k)[A1(0x146)]())[A1(0x130)]((t!==null&&t!==void 0x0?t:k)[A1(0x118)]()-(m!==null&&m!==void 0x0?m:this['defaultDurationSeconds']))),x=(t!==null&&t!==void 0x0?t:f!==undefined)?new Date(new Date(f[A1(0x146)]())[A1(0x130)](f['getSeconds']()+(m!==null&&m!==void 0x0?m:this[A1(0x16c)]))):k,o=g!==undefined,M=e&&!o?A1(0x14b)+chalk_1[A1(0x13e)]['bold'](e['toISOString']()):'',N=x&&!o?A1(0x11e)+chalk_1[A1(0x13e)][A1(0x13f)](x['toISOString']()):'',q=m?A1(0x137)+m+A1(0x159):'',K=T?'\x20for\x20container\x20'+chalk_1[A1(0x13e)][A1(0x13f)](T):o?'':A1(0x15b),y=g?',\x20backup\x20id\x20'+g:'',D=V?A1(0x16e)+V:'',l=I+'\x20'+chalk_1[A1(0x13e)][A1(0x13f)](a)+y+D+'\x20in\x20project\x20'+chalk_1[A1(0x13e)]['bold'](d),n=''+M+N+q;console['log'](A1(0x147)+S+K+A1(0x104)+l+n+U+':');},this[i(0x16d)]=(I,a)=>(d,s)=>{const A2=i;if(!I){if(d[A2(0x171)]===0x0)console[A2(0xfc)](A2(0x15c));d[A2(0x13b)](T=>(0x0,log_formatter_1[A2(0x15f)])(T,a));}else(0x0,console_format_helpers_1[A2(0x10e)])(I,d);(s===null||s===void 0x0?void 0x0:s[A2(0x139)])&&(0x0,utils_1[A2(0xf6)])(A2(0x103)+s['cursor']);},this[i(0x11a)]=new js_client_1['ApiClient'](A,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[i(0x17e)]}),this['logsApiClient']=this[i(0x11a)],this[i(0x10b)]=new inquirer_helper_1[(i(0x153))](this[i(0x11a)]);}[a10j(0x172)](A,I=![],a=![],d=![]){const A9=a10j,s=(f,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const A3=a10I,m=t[A3(0x173)],{apiContext:U,inquirerHelper:S}=this;switch(A){case A3(0x11d):{const k=m?undefined:U[A3(0xf4)]();return t[A3(0x165)]||k||(yield S['askForService'](f)());}case A3(0xff):{const e=m?undefined:U[A3(0xf9)]();return t['jobId']||e||(yield S[A3(0x157)](f)());}case A3(0x11f):{return t[A3(0x129)]||(yield S[A3(0x106)](f)());}}}),T=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A4=a10I;if(I)return m['buildId']||(yield this['inquirerHelper'][A4(0x10f)](f,A===A4(0x11d)?t:undefined,A===A4(0xff)?t:undefined,!![])());return undefined;}),V=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A5=a10I;if(a||d)return m['backupId']||(yield this[A5(0x10b)]['askForAddonBackup'](f,t)());return undefined;}),g=(f,t,m,U)=>__awaiter(this,void 0x0,void 0x0,function*(){const A6=a10I;if(d)return U['restoreId']||(yield this[A6(0x10b)][A6(0x114)](f,t,m)());return undefined;}),u=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A7=a10I;if(!I&&m[A7(0x110)]!==undefined){if(m[A7(0x110)]!==!![])return m[A7(0x110)];return yield this[A7(0x10b)][A7(0x145)](f,A==='service'?t:undefined,A==='job'?t:undefined,!![])();}return undefined;}),L=(f,t,m)=>__awaiter(this,void 0x0,void 0x0,function*(){const A8=a10I;if(A===A8(0xff))return m[A8(0x14e)]||(yield this[A8(0x10b)]['askForJobRun'](t,f,!![])());return undefined;});return this[A9(0x164)](A,I,a,d)[A9(0x168)](f=>__awaiter(this,void 0x0,void 0x0,function*(){const AA=A9,{noDefaults:t,projectId:m,quiet:U,tail:S,types:k,textIncludes:e,textNotIncludes:x,regexIncludes:o,regexNotIncludes:M,direction:N,lineLimit:q,startTime:K,endTime:y,duration:D,output:l}=f;(0x0,utils_1[AA(0x11c)])(this[AA(0x11a)]);const {apiContext:n,inquirerHelper:v,logsApiClient:X}=this,Q=t?undefined:n[AA(0x160)](),O=m||Q||(yield v[AA(0x156)]()),p=yield s(O,f),r=yield T(O,p,f),H=yield V(O,p,f),P=yield g(O,p,H,f),R=yield L(O,p,f),Z=yield u(O,p,f);if(K&&y&&D)throw new Error(AA(0x150));const B={'projectId':O,'entityId':p},E={'containerName':Z,'types':k,'textIncludes':e,'textNotIncludes':x,'regexIncludes':o,'regexNotIncludes':M,'lineLimit':q,'startTime':K,'duration':D,'runId':R,'buildId':r,'backupId':H,'restoreId':P,'isBuild':I!==null&&I!==void 0x0?I:![]},J=d?AA(0x16b):a?'addonBackup':A,b=Object['assign'](Object[AA(0x111)]({},E),{'endTime':y,'direction':N});if(!U&&l!==AA(0x10a)&&l!==AA(0xf8)&&l!==AA(0x134))this['printInitInfo'](A,p,O,Object[AA(0x111)](Object['assign']({},b),f));const Y=this['getFormatter'](l,e!==null&&e!==void 0x0?e:o);if(S){const F=yield X[AA(0x142)][AA(0x180)](B,E,J);F['on']('logs-received',Y),F['on'](AA(0x10d),c=>(0x0,utils_1[AA(0x10d)])(AA(0x132)+c[AA(0x116)])),F['on'](AA(0x121),()=>console[AA(0xfc)]('Log\x20session\x20ended')),yield F['start']();}else{const c=yield X['logs'][AA(0x13c)](B,b,J);if(c[AA(0x10d)]){const W=c[AA(0x10d)]['details'],C=W?'\x0aDetails:\x20'+JSON[AA(0x17c)](W,null,'\x20'):'';(0x0,utils_1[AA(0x10d)])(AA(0x17a)+c[AA(0x10d)][AA(0x116)]+C);}else Y(c[AA(0x17d)],c[AA(0x15e)]);}}));}}exports[a10j(0x175)]=CliLogs;
|
|
1
|
+
'use strict';const a10B=a10n;(function(x,n){const k=a10n,R=x();while(!![]){try{const u=parseInt(k(0x10c))/0x1*(parseInt(k(0x176))/0x2)+parseInt(k(0xf8))/0x3+parseInt(k(0x161))/0x4+parseInt(k(0x177))/0x5+parseInt(k(0xee))/0x6*(parseInt(k(0x107))/0x7)+parseInt(k(0x16a))/0x8+parseInt(k(0x132))/0x9*(-parseInt(k(0x155))/0xa);if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a10x,0xd4783));var __awaiter=this&&this[a10B(0x11c)]||function(x,n,R,u){function V(w){return w instanceof R?w:new R(function(Y){Y(w);});}return new(R||(R=Promise))(function(w,Y){const j=a10n;function N(f){const U=a10n;try{q(u[U(0x102)](f));}catch(M){Y(M);}}function C(f){const b=a10n;try{q(u[b(0x115)](f));}catch(M){Y(M);}}function q(f){const K=a10n;f[K(0x101)]?w(f[K(0x147)]):V(f[K(0x147)])[K(0x144)](N,C);}q((u=u[j(0x10f)](x,n||[]))[j(0x102)]());});},__importDefault=this&&this[a10B(0x16b)]||function(x){const x0=a10B;return x&&x[x0(0xea)]?x:{'default':x};};Object[a10B(0xf2)](exports,a10B(0xea),{'value':!![]}),exports[a10B(0x105)]=void 0x0;const js_client_1=require(a10B(0x136)),chalk_1=__importDefault(require(a10B(0xf9))),utils_1=require('../utils'),inquirer_helper_1=require('../inquirer-helper'),commander_1=require(a10B(0xff)),console_format_helpers_1=require(a10B(0x125)),log_formatter_1=require(a10B(0xf3));function a10x(){const xu=['Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','740056MSVXIC','6216530anRLAu','charAt','start','--restore\x20--restoreId\x20[restoreId]','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','length','formatLogLine','getLogsCommand','hasNextPage','askForProject','valueOf','warning','-t,\x20--types\x20<types...>',',\x20backup\x20id\x20','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','\x0aDetails:\x20','toUpperCase','__esModule','\x20for\x20all\x20containers','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.','--regexIncludes\x20<regex>','1433826VPvWeG','assign','Error\x20while\x20fetching\x20log\x20lines:\x20','data','defineProperty','./log-formatter','--run\x20--runId\x20[runId]','--backup\x20--backupId\x20[backupId]','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','backward','3338898JcPXsp','chalk','Which\x20log\x20types\x20to\x20fetch','textIncludes','askForAddonBackup','addonId','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','commander','--noDefaults','done','next','getCurrentServiceName','getFormatter','CliLogs','Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression','7CEmWNl','setSeconds','Backup\x20to\x20get\x20logs\x20from','Id]','-o,\x20--output\x20[output]','3byhVNo','askForContainer',',\x20duration:\x20','apply','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','apiClient','action','service','getSeconds','throw','containerId','askForBuild','logRange','\x20seconds','slice','printResponse','__awaiter','--textIncludes\x20<text>','getCommand','option','\x20--','forEach','addonRestore','Number\x20of\x20lines\x20to\x20return.','askForJobRun','../formatting/console-format-helpers','noDefaults','Error\x20while\x20tailing\x20log\x20lines:\x20','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','apiContext','--build\x20--buildId\x20[buildId]','conflicts','buildId','stringify','Build\x20to\x20get\x20logs\x20from','--container\x20--containerId\x20[containerId]','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','parseDateInput','16641XbTXkw','message','log','backupId','@northflank/js-client','pagination','InquirerHelper','tail','defaultDurationSeconds','\x20for\x20container\x20','customUserAgent',',\x20to:\x20','addOption','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','logTail','\x20with\x20live-tailing','logs-received','logs','then','serviceId','addon','value','Option','inquirerHelper','choices','>\x20Container\x20logs','askForAddonRestore','format','bold',',\x20from:\x20',',\x20restore\x20id\x20','Restore\x20to\x20get\x20logs\x20from','alias','--project\x20--projectId\x20[projectId]','-f,\x20--tail','27740fPnzkD','askForAddon','toISOString','\x27Ctrl+C\x27','forward','\x20of\x20','job','regexNotIncludes','runId','--duration\x20[duration]','default','Id\x20[','2952972TTVFsw','restoreId','regexIncludes','\x20(exit\x20with\x20','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','yaml','--startTime\x20<timestamp>','--endTime\x20<timestamp>','values','12446648DFkHyQ','__importDefault','addonBackup','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','build-','error','textNotIncludes','json','details','name','jobId'];a10x=function(){return xu;};return a10x();}class CliLogs{constructor(x){const x1=a10B;this[x1(0x129)]=x,this[x1(0x13a)]=0x708,this['getStandardLogCommand']=(n,R,u,V)=>{const x2=x1,P=(0x0,utils_1[x2(0x11e)])(!![])[x2(0x173)]((R?x2(0x16e):'')+x2(0x143))[x2(0x152)]((R?'build-':'')+x2(0x134))['description']('Get\x20log\x20for\x20the\x20specified\x20'+n)[x2(0x11f)](x2(0x153),'Project\x20for\x20logs')[x2(0x11f)]('--'+n+x2(0x120)+n+x2(0x160)+n+x2(0x10a),n[x2(0x178)](0x0)[x2(0xe9)]()+n[x2(0x11a)](0x1)+'\x20to\x20get\x20logs\x20from')[x2(0x11f)](x2(0x12f),'Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)');if(R)P[x2(0x11f)](x2(0x12a),x2(0x12e));if(n===x2(0x15b))P[x2(0x11f)](x2(0xf4),x2(0x165));if(u)P[x2(0x11f)](x2(0xf5),x2(0x109));if(V)P['option'](x2(0x17a),x2(0x151));return!R&&!u&&!V&&P[x2(0x13e)](new commander_1[(x2(0x148))](x2(0xe5),x2(0xfa))['choices'](Object[x2(0x169)](js_client_1['LogType']))),P[x2(0x11f)](x2(0x154),x2(0xec))[x2(0x11f)]('-l,\x20--lineLimit\x20[limit]',x2(0x123))[x2(0x11f)](x2(0x167),'Get\x20logs\x20generated\x20after\x20this\x20time,\x20'+utils_1['tsHint'],utils_1[x2(0x131)])[x2(0x13e)](new commander_1[(x2(0x148))](x2(0x168),x2(0xe7)+utils_1['tsHint'])['argParser'](utils_1[x2(0x131)])[x2(0x12b)]([x2(0x139)]))[x2(0x11f)](x2(0x15e),x2(0x110))[x2(0x13e)](new commander_1[(x2(0x148))]('-d,\x20--direction\x20<order>',x2(0xfe))['choices']([x2(0xf7),x2(0x159)])[x2(0x12b)]([x2(0x139)]))[x2(0x13e)](new commander_1[(x2(0x148))](x2(0x11d),x2(0x13f))[x2(0x12b)]([x2(0x170),x2(0x163),x2(0x15c)]))[x2(0x13e)](new commander_1[(x2(0x148))]('--textNotIncludes\x20<text>',x2(0x16d))[x2(0x12b)]([x2(0xfb),x2(0x163),x2(0x15c)]))['addOption'](new commander_1[(x2(0x148))](x2(0xed),'Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression')[x2(0x12b)]([x2(0x170),x2(0xfb),'regexNotIncludes']))[x2(0x13e)](new commander_1['Option']('--regexNotIncludes\x20<regex>',x2(0x106))['conflicts']([x2(0x170),x2(0x163),'textIncludes']))[x2(0x11f)](x2(0x100),x2(0xf6),![])['addOption'](new commander_1['Option'](x2(0x10b),x2(0x17b))[x2(0x14a)](Object[x2(0x169)]([x2(0x14d),x2(0x171),'yaml']))),P;},this['printInitInfo']=(n,R,u,V)=>{const x3=x1,{containerName:P,restoreId:w,backupId:Y,quiet:N,tail:C,startTime:q,endTime:f,duration:M}=V;if(N===!![])return;const X=C?x3(0x164)+chalk_1[x3(0x15f)]['bold'](x3(0x158))+')':'',S=C?x3(0x141):'',W=new Date(),t=q!==null&&q!==void 0x0?q:new Date(new Date((f!==null&&f!==void 0x0?f:W)[x3(0xe3)]())[x3(0x108)]((f!==null&&f!==void 0x0?f:W)[x3(0x114)]()-(M!==null&&M!==void 0x0?M:this[x3(0x13a)]))),i=(f!==null&&f!==void 0x0?f:q!==undefined)?new Date(new Date(q[x3(0xe3)]())['setSeconds'](q['getSeconds']()+(M!==null&&M!==void 0x0?M:this[x3(0x13a)]))):W,p=Y!==undefined,O=t&&!p?x3(0x14f)+chalk_1[x3(0x15f)]['bold'](t[x3(0x157)]()):'',Z=i&&!p?x3(0x13d)+chalk_1[x3(0x15f)][x3(0x14e)](i[x3(0x157)]()):'',a=M?x3(0x10e)+M+x3(0x119):'',E=P?x3(0x13b)+chalk_1[x3(0x15f)][x3(0x14e)](P):p?'':x3(0xeb),z=Y?x3(0xe6)+Y:'',T=w?x3(0x150)+w:'',H=n+'\x20'+chalk_1[x3(0x15f)][x3(0x14e)](R)+z+T+'\x20in\x20project\x20'+chalk_1[x3(0x15f)]['bold'](u),F=''+O+Z+a;console['log'](x3(0x14b)+S+E+x3(0x15a)+H+F+X+':');},this['getFormatter']=(n,R)=>(u,V)=>{const x4=x1;if(!n){if(u[x4(0x17c)]===0x0)console[x4(0x134)](x4(0x128));u[x4(0x121)](P=>(0x0,log_formatter_1[x4(0x17d)])(P,R));}else(0x0,console_format_helpers_1[x4(0x11b)])(n,u);(V===null||V===void 0x0?void 0x0:V[x4(0x17f)])&&(0x0,utils_1[x4(0xe4)])(x4(0x130)+V['cursor']);},this[x1(0x111)]=new js_client_1['ApiClient'](x,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[x1(0x13c)]}),this['logsApiClient']=this[x1(0x111)],this[x1(0x149)]=new inquirer_helper_1[(x1(0x138))](this[x1(0x111)]);}[a10B(0x17e)](x,n=![],R=![],u=![]){const xn=a10B,V=(q,f)=>__awaiter(this,void 0x0,void 0x0,function*(){const x5=a10n,M=f[x5(0x126)],{apiContext:X,inquirerHelper:S}=this;switch(x){case x5(0x113):{const W=M?undefined:X[x5(0x103)]();return f[x5(0x145)]||W||(yield S['askForService'](q)());}case x5(0x15b):{const t=M?undefined:X['getCurrentJobName']();return f[x5(0x174)]||t||(yield S['askForJob'](q)());}case x5(0x146):{return f[x5(0xfd)]||(yield S[x5(0x156)](q)());}}}),P=(q,f,M)=>__awaiter(this,void 0x0,void 0x0,function*(){const x6=a10n;if(n)return M[x6(0x12c)]||(yield this[x6(0x149)][x6(0x117)](q,x===x6(0x113)?f:undefined,x===x6(0x15b)?f:undefined,!![])());return undefined;}),w=(q,f,M)=>__awaiter(this,void 0x0,void 0x0,function*(){const x7=a10n;if(R||u)return M[x7(0x135)]||(yield this[x7(0x149)][x7(0xfc)](q,f)());return undefined;}),Y=(q,f,M,X)=>__awaiter(this,void 0x0,void 0x0,function*(){const x8=a10n;if(u)return X[x8(0x162)]||(yield this[x8(0x149)][x8(0x14c)](q,f,M)());return undefined;}),N=(q,f,M)=>__awaiter(this,void 0x0,void 0x0,function*(){const x9=a10n;if(!n&&M[x9(0x116)]!==undefined){if(M['containerId']!==!![])return M[x9(0x116)];return yield this[x9(0x149)][x9(0x10d)](q,x===x9(0x113)?f:undefined,x==='job'?f:undefined,!![])();}return undefined;}),C=(q,f,M)=>__awaiter(this,void 0x0,void 0x0,function*(){const xx=a10n;if(x===xx(0x15b))return M[xx(0x15d)]||(yield this[xx(0x149)][xx(0x124)](f,q,!![])());return undefined;});return this['getStandardLogCommand'](x,n,R,u)[xn(0x112)](q=>__awaiter(this,void 0x0,void 0x0,function*(){const xR=xn,{noDefaults:f,projectId:M,quiet:X,tail:S,types:W,textIncludes:t,textNotIncludes:i,regexIncludes:p,regexNotIncludes:O,direction:Z,lineLimit:a,startTime:E,endTime:z,duration:T,output:H}=q;(0x0,utils_1['assertContextExisting'])(this[xR(0x111)]);const {apiContext:F,inquirerHelper:e,logsApiClient:Q}=this,L=f?undefined:F['getCurrentProjectName'](),D=M||L||(yield e[xR(0xe2)]()),G=yield V(D,q),h=yield P(D,G,q),o=yield w(D,G,q),d=yield Y(D,G,o,q),c=yield C(D,G,q),v=yield N(D,G,q);if(E&&z&&T)throw new Error(xR(0x175));const s={'projectId':D,'entityId':G},g={'containerName':v,'types':W,'textIncludes':t,'textNotIncludes':i,'regexIncludes':p,'regexNotIncludes':O,'lineLimit':a,'startTime':E,'duration':T,'runId':c,'buildId':h,'backupId':o,'restoreId':d,'isBuild':n!==null&&n!==void 0x0?n:![]},A=u?xR(0x122):R?xR(0x16c):x,J=Object[xR(0xef)](Object[xR(0xef)]({},g),{'endTime':z,'direction':Z});if(!X&&H!==xR(0x166)&&H!=='yml'&&H!==xR(0x171))this['printInitInfo'](x,G,D,Object[xR(0xef)](Object[xR(0xef)]({},J),q));const l=this[xR(0x104)](H,t!==null&&t!==void 0x0?t:p);if(S){const y=yield Q[xR(0x143)][xR(0x140)](s,g,A);y['on'](xR(0x142),l),y['on']('error',I=>(0x0,utils_1[xR(0x16f)])(xR(0x127)+I[xR(0x133)])),y['on']('close',()=>console['log']('Log\x20session\x20ended')),yield y[xR(0x179)]();}else{const I=yield Q[xR(0x143)][xR(0x118)](s,J,A);if(I[xR(0x16f)]){const r=I[xR(0x16f)][xR(0x172)],m=r?xR(0xe8)+JSON[xR(0x12d)](r,null,'\x20'):'';(0x0,utils_1['error'])(xR(0xf0)+I[xR(0x16f)][xR(0x133)]+m);}else l(I[xR(0xf1)],I[xR(0x137)]);}}));}}function a10n(x,n){const R=a10x();return a10n=function(u,V){u=u-0xe2;let P=R[u];return P;},a10n(x,n);}exports['CliLogs']=CliLogs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a11n(x,n){const R=a11x();return a11n=function(u,V){u=u-0xd5;let P=R[u];return P;},a11n(x,n);}const a11q=a11n;(function(x,n){const C=a11n,R=x();while(!![]){try{const u=-parseInt(C(0xe5))/0x1*(parseInt(C(0xef))/0x2)+-parseInt(C(0xea))/0x3+-parseInt(C(0xe4))/0x4+parseInt(C(0xe7))/0x5+-parseInt(C(0xd6))/0x6+parseInt(C(0xf0))/0x7+parseInt(C(0xec))/0x8;if(u===n)break;else R['push'](R['shift']());}catch(V){R['push'](R['shift']());}}}(a11x,0x1a574));var __importDefault=this&&this[a11q(0xdc)]||function(x){const f=a11q;return x&&x[f(0xd8)]?x:{'default':x};};Object['defineProperty'](exports,a11q(0xd8),{'value':!![]}),exports[a11q(0xed)]=exports['defaultLogSyntax']=void 0x0;function a11x(){const S=['red','defaultLogSyntax','cyan','yellow','832632LkOEFd','854nToKLw','reduce','875290ATLnLz','dim','grey','345153COpivv','pattern','1298816aNBTvV','formatLogLine','chalk','72FTNJks','1264375BBHFwo','green','337140OgDqut','color','__esModule','replace','log','blue','__importDefault','gray','default','s\x08(?!mailto:)(?:(?:http|https|ftp)://)(?:\x5cS+(?::\x5cS*)?@)?(?:(?:(?:[1-9]\x5cd?|1\x5cd\x5cd|2[01]\x5cd|22[0-3])(?:\x5c.(?:1?\x5cd{1,2}|2[0-4]\x5cd|25[0-5])){2}(?:\x5c.(?:[0-9]\x5cd?|1\x5cd\x5cd|2[0-4]\x5cd|25[0-4]))|(?:(?:[a-z\x5cu00a1-\x5cuffff0-9]+-?)*[a-z\x5cu00a1-\x5cuffff0-9]+)(?:\x5c.(?:[a-z\x5cu00a1-\x5cuffff0-9]+-?)*[a-z\x5cu00a1-\x5cuffff0-9]+)*(?:\x5c.(?:[a-z\x5cu00a1-\x5cuffff]{2,})))|localhost)(?::\x5cd{2,5})?(?:(/|\x5c?|#)[^\x5cs]*)?\x08s'];a11x=function(){return S;};return a11x();}const chalk_1=__importDefault(require(a11q(0xee)));exports[a11q(0xe1)]=[{'color':a11q(0xe9),'pattern':/\[[0-9]{1,2}\/[a-z]{3}\/[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{2} \+[0-9]{4}\]/i},{'color':a11q(0xe9),'pattern':/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]+)?Z/i},{'color':a11q(0xe9),'pattern':/[0-9]{4}\/[0-9]{2}\/[0-9]{2}/i},{'color':a11q(0xe9),'pattern':/\s\b([0-9]{2}:){1,2}[0-9]{2}\b\s/i},{'color':'bold','pattern':new RegExp(a11q(0xdf),'i')},{'color':a11q(0xd5),'pattern':/(?:\d{1,3}\.){3}\d{1,3}/i},{'color':a11q(0xd5),'pattern':/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/},{'color':'blue','pattern':/\b(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH)\b/},{'color':'greenBright','pattern':/\b(successful|success|completed|complete|done)\b/i},{'color':a11q(0xe0),'pattern':/\b(failed|fail|stderr|error|err)\b/i},{'color':a11q(0xdd),'pattern':/\b(information|info|debug)\b/i},{'color':a11q(0xe3),'pattern':/\b(warning|warn)\b/i},{'color':a11q(0xdb),'pattern':/[0-9a-f]{64}/i},{'color':'blue','pattern':/[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}/i}];const formatLogLine=(x,n)=>{const M=a11q,R=chalk_1[M(0xde)][M(0xe8)](x['ts']['toISOString']()),u=chalk_1[M(0xde)][M(0xe2)](x['containerId']),V=exports[M(0xe1)][M(0xe6)]((w,Y)=>{const X=M;return w[X(0xd9)](Y[X(0xeb)],N=>Y[X(0xd7)]?chalk_1['default'][Y['color']](N):chalk_1[X(0xde)][X(0xe9)](N));},x[M(0xda)]),P=n?V[M(0xd9)](new RegExp(n,'g'),w=>chalk_1[M(0xde)]['bold'](w)):V;console[M(0xda)](R+'\x20'+u+'\x20--\x20'+P);};exports[a11q(0xed)]=formatLogLine;
|