@northflank/cli 0.9.12 → 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';const
|
|
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 a8d=a8k;(function(H,k){const G=a8k,S=H();while(!![]){try{const W=-parseInt(G(0x224))/0x1+-parseInt(G(0x247))/0x2*(-parseInt(G(0x1e0))/0x3)+parseInt(G(0x240))/0x4*(parseInt(G(0x190))/0x5)+parseInt(G(0x1b4))/0x6*(parseInt(G(0x216))/0x7)+parseInt(G(0x1a1))/0x8+parseInt(G(0x20e))/0x9+-parseInt(G(0x1ed))/0xa;if(W===k)break;else S['push'](S['shift']());}catch(Z){S['push'](S['shift']());}}}(a8H,0xda7cd));function a8H(){const Hg=['credentials','SAVE','askForService','opt','name','success','pathVars','__createBinding','choice','isEmpty','includes','ask','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','underline','minLength','12vKFjVe','jobs','completedAt','value','getType','retrievePayloadViaInteractiveCli','Something\x20unexpected\x20happened.','body','askGeneric','isUndefined','DynamicReloadPaginationPrompt','What\x27s\x20the\x20','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','bold','throw','stringify','string','askForJobRun','example','services','\x20to\x20use:','service\x20containers','No,\x20edit','editedResult','containers','./pagination/inquirer-pagination-prompt','__importStar','askArrayEntry','projects','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','nextPageCursor','password','yellowBright','Unexpected\x20file\x20type:\x20','this\x20option\x20is\x20required,\x20please\x20answer','toUpperCase','runs','main-context','propToType','REPEAT','No\x20','properties','askForSecret','askForAddonRestore','3128028lFsodn','askForLogSink','to\x20use:','Aborted.','addons','templates','subdomain','./api-helpers',',\x20supported\x20types:\x20[json|yaml|yml]','Do\x20you\x20want\x20to\x20add\x20more','deleteWarningPrompt','max','backups','24817140EaNseQ','don\x27t\x20change','grey','registerPrompt','call','red','type','isArray','Please\x20confirm\x20following\x20configuration:\x0a','data','\x20(full\x20domain:\x20','then','isNaN','__setModuleDefault','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','defineProperty','a\x20Northflank\x20resource','enum','\x20characters,\x20is\x20','editor','retry','tmpCmdPath','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','secret','token','getInnerType','askForResourcePaginated','No\x20containers\x20found','minimum','InquirerHelper','join','all-builds','addEntry','1296882SOVdsI','__awaiter','askForContainer','integer','writable','\x20type?','object','editPayload','2288552osNFEC','Go\x20to\x20editor','domain\x20(','unshift','registryCredentials','askForResource','array','saveFile','cursor','YES','job:\x20\x27','getCurrentProjectName','maximum','createdAt','1003622lZsOCE','confirm','pagination-prompt','doesn\x27t\x20match\x20pattern\x20\x27','assign','input','oneOf','domains','reset','askForAddon','contextProvider','keys','found','safeDump','restores','map','getQuestionString','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','set','js-yaml','fetchResourceList','default','writeFileSync','concat','\x20in\x20','Should\x20it\x20be','secrets','pipeline','1548028Acpzku','items','prototype','askForBuild','search-list','safeLoad','tokenPrompt','2NfywOc','What\x20do\x20you\x20want\x20to\x20use\x20as','loginPrompt','pipelines','job\x20containers','description','askForJob','isObject','service:\x20\x27','No\x20builds\x20found','restore','confirmation','trim','Do\x20you\x20want\x20to\x20add','filter','blue','volume','pagination','templateRuns','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','for\x20this\x20','get','repeat','EDIT','job\x20builds','apiClient','find','No,\x20but\x20save\x20as\x20file','Configuration\x20file\x20written\x20to\x20','pattern','values','subdomains','isValidJSON','green','template\x20run','\x20(completedAt:\x20','confirmationPrompt','askForTemplateRun','has','fullName','No,\x20repeat','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','all-job-runs','builds','\x20characters','blueBright','required','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','getPathString','ABORT','Choose\x20the\x20login\x20token:','askForAddonBackup','must\x20be\x20a\x20number,\x20is\x20','maxLength','project','resultCache','__esModule','askForTemplate','Choose\x20the\x20','Enter\x20the\x20','test','addon','\x20(startedAt:\x20','greenBright','domain','volumes','length','lodash','list','Writing\x20configuration\x20failed:\x20','log\x20sink','service\x20build','askForProject','project:\x20\x27','job','not\x20completed','elements','fileName','job\x20runs','slice','rawObject','unset','askForVolume','isBoolean','configurable','toString','10maiTId','next','inquirer-search-list','boolean','askForProjectScopedResourcePaginated','push','prompt','whiteBright','create','addon:\x20\x27','logSinks','inquirer','validate','all-containers','pop','override','defaultPaginationPageSize','14124808XHlRnu','split','done','warning'];a8H=function(){return Hg;};return a8H();}var __createBinding=this&&this[a8d(0x1ac)]||(Object[a8d(0x198)]?function(H,S,W,Z){const e=a8d;if(Z===undefined)Z=W;var y=Object['getOwnPropertyDescriptor'](S,W);(!y||(e(0x25c)in y?!S[e(0x172)]:y[e(0x212)]||y[e(0x18e)]))&&(y={'enumerable':!![],'get':function(){return S[W];}}),Object[e(0x1fc)](H,Z,y);}:function(H,S,W,Z){if(Z===undefined)Z=W;H[Z]=S[W];}),__setModuleDefault=this&&this[a8d(0x1fa)]||(Object[a8d(0x198)]?function(H,k){const m=a8d;Object['defineProperty'](H,m(0x239),{'enumerable':!![],'value':k});}:function(H,k){const U=a8d;H[U(0x239)]=k;}),__importStar=this&&this[a8d(0x1ce)]||function(H){const K=a8d;if(H&&H[K(0x172)])return H;var S={};if(H!=null){for(var W in H)if(W!==K(0x239)&&Object[K(0x242)]['hasOwnProperty'][K(0x1f1)](H,W))__createBinding(S,H,W);}return __setModuleDefault(S,H),S;},__awaiter=this&&this[a8d(0x20f)]||function(H,k,S,W){function Z(y){return y instanceof S?y:new S(function(O){O(y);});}return new(S||(S=Promise))(function(y,O){const q=a8k;function b(r){try{j(W['next'](r));}catch(V){O(V);}}function h(r){const l=a8k;try{j(W[l(0x1c2)](r));}catch(V){O(V);}}function j(r){const J=a8k;r[J(0x1a3)]?y(r[J(0x1b7)]):Z(r[J(0x1b7)])[J(0x1f8)](b,h);}j((W=W['apply'](H,k||[]))[q(0x191)]());});},__importDefault=this&&this['__importDefault']||function(H){const n=a8d;return H&&H[n(0x172)]?H:{'default':H};};function a8k(H,k){const S=a8H();return a8k=function(W,Z){W=W-0x170;let y=S[W];return y;},a8k(H,k);}Object[a8d(0x1fc)](exports,a8d(0x172),{'value':!![]}),exports[a8d(0x20a)]=void 0x0;const _=__importStar(require(a8d(0x17d))),chalk_1=__importDefault(require('chalk')),fs=__importStar(require('fs')),utils_1=require('./utils'),api_helpers_1=require(a8d(0x1e7)),inquirer_pagination_prompt_1=require(a8d(0x1cd)),inquirer=require(a8d(0x19b)),inquirerSearchList=require(a8d(0x192)),yaml=require(a8d(0x237));var ConfirmChoices;(function(H){const v=a8d;H['YES']='Yes,\x20send',H[v(0x1db)]=v(0x26f),H[v(0x25e)]=v(0x1ca),H[v(0x1a6)]=v(0x262),H['ABORT']='No,\x20abort';}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(H){const N=a8d;this['apiClient']=H,this[N(0x1a0)]=0x32,this[N(0x215)]=k=>__awaiter(this,void 0x0,void 0x0,function*(){const i=N,{editedResult:S}=yield inquirer[i(0x196)]([{'type':i(0x200),'name':i(0x1cb),'message':i(0x217),'default':yaml[i(0x231)](k)}]);return yaml[i(0x245)](S);}),this[N(0x21d)]=k=>__awaiter(this,void 0x0,void 0x0,function*(){const o=N,S=O=>o(0x1d5)+O+o(0x1e8);function W(){return __awaiter(this,void 0x0,void 0x0,function*(){const x=a8k;return inquirer['prompt']([{'type':x(0x229),'name':x(0x187),'message':x(0x203),'validate':O=>new RegExp('.*\x5c.(json|yaml|yml)$')[x(0x176)](O)?!![]:S(O)}]);});}const {fileName:Z}=yield W(),y=Z[o(0x18f)]()[o(0x1a2)]('.')[o(0x19e)]();try{switch(y){case'json':(0x0,utils_1['success'])(o(0x263)+Z);return fs[o(0x23a)](Z,JSON[o(0x1c3)](k,null,'\x20\x20'));case'yaml':case'yml':(0x0,utils_1[o(0x1aa)])(o(0x263)+Z);return fs[o(0x23a)](Z,yaml[o(0x231)](k));default:(0x0,utils_1[o(0x1a4)])(S(y));}}catch(O){(0x0,utils_1[o(0x1a4)])(o(0x17f)+O['message']);}return undefined;}),this[N(0x255)]=(k,S)=>W=>{const Y=N,Z=typeof W===Y(0x1c4)?W[Y(0x253)]():W;return S===![]&&Z==='don\x27t\x20change'?'':Z;},this['validate']=(k,S,W)=>Z=>{const R=N,y=[];if(Z===''||Z===R(0x1ee)){if(S!==![])y['push'](R(0x1d6));else return!![];}k[R(0x1f3)]===R(0x1c4)&&!_['isUndefined'](k[R(0x264)])&&y[R(0x195)](new RegExp(k[R(0x264)])[R(0x176)](Z)?!![]:R(0x227)+k[R(0x264)]+'\x27');k[R(0x1f3)]==='string'&&!_[R(0x1bd)](k[R(0x1b3)])&&y[R(0x195)](Z[R(0x17c)]>=k['minLength']?!![]:R(0x1fb)+k[R(0x1b3)]+R(0x1ff)+Z[R(0x17c)]+R(0x273));k[R(0x1f3)]===R(0x1c4)&&!_[R(0x1bd)](k[R(0x27c)])&&y[R(0x195)](Z[R(0x17c)]<=k[R(0x27c)]?!![]:R(0x276)+k['maxLength']+R(0x1ff)+Z[R(0x17c)]+R(0x273));W&&Number[R(0x1f9)](parseInt(Z,0xa))&&y['push'](R(0x27b)+Z);k[R(0x1f3)]==='integer'&&!_[R(0x1bd)](k[R(0x209)])&&y[R(0x195)](Z>=k[R(0x209)]?!![]:R(0x25a)+k[R(0x209)]);k['type']===R(0x211)&&!_['isUndefined'](k['maximum'])&&y[R(0x195)](Z<=k[R(0x222)]?!![]:R(0x235)+k['maximum']);if(k[R(0x1f3)]==='rawObject'){const h=(0x0,utils_1[R(0x267)])(Z);y[R(0x195)](h===![]||_[R(0x1ae)](h)?R(0x1c0):!![]);}const O=y['filter'](j=>j!==!![]),b=(k===null||k===void 0x0?void 0x0:k['example'])?'\x0a'+chalk_1['default'][R(0x1f2)]('>>')+'\x20Example:\x20'+chalk_1[R(0x239)][R(0x197)](JSON[R(0x1c3)](k[R(0x1c6)])):'';return O['length']>0x0?O[R(0x20b)](chalk_1[R(0x239)][R(0x1b2)]('\x20and\x20it\x20'))+b:!![];},this[N(0x277)]=(k,S,W)=>{const F=N,Z=k[k['length']-0x1];function y(){const g=a8k;return k[g(0x189)](0x0,-0x1)[g(0x233)](h=>h['charAt'](0x0)[g(0x1d7)]()+h[g(0x189)](0x1))[g(0x20b)]('>');}const O=k['length']>0x1?chalk_1[F(0x239)]['bgGrey']['whiteBright'](y())+':\x20':'',b=W?'\x20('+chalk_1[F(0x239)][F(0x256)](W)+')':'';return chalk_1['default'][F(0x22c)](''+O+S+'\x20'+chalk_1[F(0x239)][F(0x1c1)][F(0x179)](Z)+b+'?');},this[N(0x21b)]=(k,S,W)=>__awaiter(this,void 0x0,void 0x0,function*(){const A=N;if(S['length']<0x1){const O=W?A(0x25b)+W:A(0x230);throw new Error(A(0x1dc)+k+'\x20'+O+'.');}const Z=A(0x174)+k+A(0x1c8),y=S[A(0x17c)]>0x4?A(0x244):A(0x17e);return(yield inquirer[A(0x196)]([{'type':y,'name':'name','message':Z,'choices':S}]))['name'];}),this['askForResourcePaginated']=(k,S,W)=>__awaiter(this,void 0x0,void 0x0,function*(){const L=N,{elements:Z,nextCursor:y}=yield S();if(Z[L(0x17c)]<0x1){const h=W?L(0x25b)+W:L(0x230);throw new Error(L(0x1dc)+k+'\x20'+h+'.');}const O='Choose\x20the\x20'+k+L(0x1c8);if(y!==undefined){const j=({nextPageCursor:r})=>__awaiter(this,void 0x0,void 0x0,function*(){const s=L,V=yield S(r);return{'elements':V[s(0x186)],'nextPageCursor':V['nextCursor']};});return(yield inquirer[L(0x196)]([{'type':L(0x226),'name':L(0x1a9),'message':O,'choices':Z,'nextPageCursor':y,'loadMore':j}]))[L(0x1a9)];}const b=Z['length']>0x4?L(0x244):L(0x17e);return(yield inquirer[L(0x196)]([{'type':b,'name':L(0x1a9),'message':O,'choices':Z}]))[L(0x1a9)];}),this[N(0x1bc)]=(k,S)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const a=N,W=''+(S?'('+chalk_1['default'][a(0x256)](S)+')\x20':''),Z=a(0x175)+chalk_1[a(0x239)][a(0x268)](k)+'\x20'+W+a(0x1e2),y=this['validate']({'type':a(0x1c4),'required':!![]});return(yield inquirer[a(0x196)]([{'type':'input','name':'name','message':Z,'validate':y}]))[a(0x1a9)];}),this['askConfirm']=k=>__awaiter(this,void 0x0,void 0x0,function*(){const T=N;return(yield inquirer[T(0x196)]([{'type':T(0x225),'name':'name','message':k,'default':!![]}]))[T(0x1a9)];}),this[N(0x1a7)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const S=W=>Z=>__awaiter(this,void 0x0,void 0x0,function*(){const Q=a8k;var y;const O=yield this['apiClient'][Q(0x17e)][Q(0x1c7)]({'parameters':{'projectId':W},'options':{'per_page':this[Q(0x1a0)],'cursor':Z}}),b=O[Q(0x1f6)]['services'][Q(0x233)](h=>h['id']);return{'elements':b,'nextCursor':(y=O[Q(0x258)])===null||y===void 0x0?void 0x0:y[Q(0x21e)]};});return this['askForProjectScopedResourcePaginated']('service',S,k);}),this[N(0x173)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const B=N,k=S=>__awaiter(this,void 0x0,void 0x0,function*(){const u=a8k;var W;const Z=yield this[u(0x260)][u(0x17e)][u(0x1e5)]({'options':{'per_page':this[u(0x1a0)],'cursor':S}}),y=Z[u(0x1f6)][u(0x1e5)]['map'](O=>O['id']);return{'elements':y,'nextCursor':(W=Z[u(0x258)])===null||W===void 0x0?void 0x0:W[u(0x21e)]};});return this[B(0x207)]('template',k);}),this[N(0x26c)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const p=N;if(_[p(0x1bd)](k))throw new Error('Template\x20id\x20not\x20provided.');const S=W=>__awaiter(this,void 0x0,void 0x0,function*(){const P=p;var Z;let y=this[P(0x1a0)];const O=yield this[P(0x260)][P(0x17e)][P(0x259)]({'parameters':{'templateId':k},'options':{'per_page':y,'cursor':W}}),b=O[P(0x1f6)][P(0x259)][P(0x233)](h=>h['id']+'\x20(startedAt:\x20'+h[P(0x223)]+')');return{'elements':b,'nextCursor':(Z=O[P(0x258)])===null||Z===void 0x0?void 0x0:Z[P(0x21e)]};});return this[p(0x207)](p(0x269),S)[p(0x1f8)](W=>W['split']('\x20')[0x0]);}),this[N(0x1e1)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const D=N,k=S=>__awaiter(this,void 0x0,void 0x0,function*(){const E=a8k;var W;let Z=this['defaultPaginationPageSize'];const y=yield this['apiClient'][E(0x17e)][E(0x19a)]({'options':{'per_page':Z,'cursor':S}}),O=y[E(0x1f6)]['logSinks'][E(0x233)](b=>b['id']);return{'elements':O,'nextCursor':(W=y[E(0x258)])===null||W===void 0x0?void 0x0:W['cursor']};});return this['askForResourcePaginated'](D(0x180),k);}),this['askForPipeline']=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const t=N,S=W=>Z=>__awaiter(this,void 0x0,void 0x0,function*(){const w=a8k;var y;const O=yield this['apiClient'][w(0x17e)][w(0x24a)]({'parameters':{'projectId':W},'options':{'per_page':this[w(0x1a0)],'cursor':Z}}),b=O[w(0x1f6)][w(0x24a)][w(0x233)](h=>h['id']);return{'elements':b,'nextCursor':(y=O[w(0x258)])===null||y===void 0x0?void 0x0:y['cursor']};});return this[t(0x194)](t(0x23f),S,k);}),this[N(0x24d)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const X=N,S=W=>Z=>__awaiter(this,void 0x0,void 0x0,function*(){const I=a8k;var y;const O=yield this['apiClient'][I(0x17e)]['jobs']({'parameters':{'projectId':W},'options':{'per_page':this[I(0x1a0)],'cursor':Z}}),b=O[I(0x1f6)][I(0x1b5)][I(0x233)](h=>h['id']);return{'elements':b,'nextCursor':(y=O['pagination'])===null||y===void 0x0?void 0x0:y['cursor']};});return this[X(0x194)]('job',S,k);}),this[N(0x1c5)]=(k,S,W=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H0=N,Z=H0(0x271),y=O=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const H1=H0;var h;const j=yield this[H1(0x260)]['get'][H1(0x184)][H1(0x1d8)]({'parameters':{'projectId':O,'jobId':k},'options':{'per_page':this[H1(0x1a0)],'cursor':b}}),r=j[H1(0x1f6)][H1(0x1d8)][H1(0x233)](V=>V['id']+H1(0x178)+V['startedAt']+')');return W&&r['unshift'](Z),{'elements':r,'nextCursor':(h=j[H1(0x258)])===null||h===void 0x0?void 0x0:h['cursor']};});return this[H0(0x194)](H0(0x188),y,S,H0(0x220)+k+'\x27')['then'](O=>{const H2=H0,b=O[H2(0x1a2)]('\x20')[0x0];if(b===Z)return undefined;return b;});}),this[N(0x243)]=(k,S,W,Z=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H3=N,y=H3(0x20c);if(W!==undefined){const O=b=>h=>__awaiter(this,void 0x0,void 0x0,function*(){const H4=H3;var j;const r=yield this[H4(0x260)][H4(0x25c)][H4(0x184)]['builds']({'parameters':{'projectId':b,'jobId':W},'options':{'per_page':this[H4(0x1a0)],'cursor':h}}),V=r[H4(0x1f6)]['builds'][H4(0x233)](f=>f['id']+H4(0x178)+f[H4(0x223)]+')');return Z&&V[H4(0x219)](y),{'elements':V,'nextCursor':(j=r['pagination'])===null||j===void 0x0?void 0x0:j[H4(0x21e)]};});return this[H3(0x194)](H3(0x25f),O,k,H3(0x220)+W+'\x27')[H3(0x1f8)](b=>{const h=b['split']('\x20')[0x0];if(h===y)return undefined;return h;});}if(S!==undefined){const b=h=>j=>__awaiter(this,void 0x0,void 0x0,function*(){const H5=H3;var r;const V=yield this[H5(0x260)]['get']['service'][H5(0x272)]({'parameters':{'projectId':h,'serviceId':S},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':j}}),f=V['data'][H5(0x272)][H5(0x233)](M=>M['id']+H5(0x178)+M[H5(0x223)]+')');if(Z)f['unshift'](y);return{'elements':f,'nextCursor':(r=V[H5(0x258)])===null||r===void 0x0?void 0x0:r['cursor']};});return this[H3(0x194)](H3(0x181),b,k,H3(0x24f)+W+'\x27')['then'](h=>{const H6=H3,r=h[H6(0x1a2)]('\x20')[0x0];if(r===y)return undefined;return r;});}throw new Error(H3(0x250));}),this[N(0x210)]=(k,S,W,Z=![])=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H7=N,y=H7(0x19d);if(W!==undefined){const O=b=>h=>__awaiter(this,void 0x0,void 0x0,function*(){const H8=H7;var j,r;const V=yield this[H8(0x260)][H8(0x25c)][H8(0x184)]['containers']({'parameters':{'projectId':b,'jobId':W},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':h}}),f=(j=V['data'][H8(0x1cc)])!==null&&j!==void 0x0?j:[],M=f===null||f===void 0x0?void 0x0:f['map'](C=>C['name']+'\x20(startedAt:\x20'+C[H8(0x223)]+')');return Z&&M[H8(0x219)](y),{'elements':M,'nextCursor':(r=V[H8(0x258)])===null||r===void 0x0?void 0x0:r[H8(0x21e)]};});return this['askForProjectScopedResourcePaginated'](H7(0x24b),O,k,'job:\x20\x27'+W+'\x27')['then'](b=>{const H9=H7,h=b[H9(0x1a2)]('\x20')[0x0];if(h===y)return undefined;return h;});}if(S!==undefined){const b=h=>j=>__awaiter(this,void 0x0,void 0x0,function*(){const HH=H7;var r,V;const f=yield this['apiClient'][HH(0x25c)]['service'][HH(0x1cc)]({'parameters':{'projectId':h,'serviceId':S},'options':{'per_page':this[HH(0x1a0)],'cursor':j}}),M=(r=f[HH(0x1f6)][HH(0x1cc)])!==null&&r!==void 0x0?r:[],C=M['map'](z=>z['name']+'\x20(startedAt:\x20'+z[HH(0x223)]+')');if(Z)C===null||C===void 0x0?void 0x0:C['unshift'](y);return{'elements':C,'nextCursor':(V=f['pagination'])===null||V===void 0x0?void 0x0:V['cursor']};});return this[H7(0x194)](H7(0x1c9),b,k,'service:\x20\x27'+W+'\x27')[H7(0x1f8)](h=>{const Hk=H7,r=h[Hk(0x1a2)]('\x20')[0x0];if(r===y)return undefined;return r;});}throw new Error(H7(0x208));}),this[N(0x22d)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const HW=N,S=W=>Z=>__awaiter(this,void 0x0,void 0x0,function*(){const HS=a8k;var y;const O=yield this[HS(0x260)][HS(0x17e)][HS(0x1e4)]({'parameters':{'projectId':W},'options':{'per_page':this[HS(0x1a0)],'cursor':Z}});return{'elements':O[HS(0x1f6)][HS(0x1e4)]['map'](b=>b['id']),'nextCursor':(y=O[HS(0x258)])===null||y===void 0x0?void 0x0:y[HS(0x21e)]};});return this['askForProjectScopedResourcePaginated'](HW(0x177),S,k);}),this[N(0x27a)]=(k,S)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hy=N,W=Z=>y=>__awaiter(this,void 0x0,void 0x0,function*(){const HZ=a8k;var O;const b=yield this['apiClient']['get']['addon']['backups']({'parameters':{'projectId':Z,'addonId':S},'options':{'per_page':this[HZ(0x1a0)],'cursor':y}});return{'elements':b[HZ(0x1f6)][HZ(0x1ec)][HZ(0x233)](h=>h['id']+HZ(0x26a)+(h[HZ(0x1b6)]||'not\x20completed')+')'),'nextCursor':(O=b[HZ(0x258)])===null||O===void 0x0?void 0x0:O[HZ(0x21e)]};});return this[Hy(0x194)](Hy(0x1ec),W,k,Hy(0x199)+S+'\x27')[Hy(0x1f8)](Z=>Z[Hy(0x1a2)]('\x20')[0x0]);}),this[N(0x1df)]=(k,S,W)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hb=N,Z=y=>O=>__awaiter(this,void 0x0,void 0x0,function*(){const HO=a8k;var b;const h=yield this[HO(0x260)][HO(0x25c)][HO(0x177)][HO(0x232)]({'parameters':{'projectId':y,'addonId':S,'backupId':W},'options':{'per_page':this[HO(0x1a0)],'cursor':O}});return{'elements':h[HO(0x1f6)][HO(0x232)]['map'](j=>j['id']+HO(0x26a)+(j[HO(0x1b6)]||HO(0x185))+')'),'nextCursor':(b=h[HO(0x258)])===null||b===void 0x0?void 0x0:b[HO(0x21e)]};});return this['askForProjectScopedResourcePaginated'](Hb(0x251),Z,k,Hb(0x199)+S+'\x27')[Hb(0x1f8)](y=>y[Hb(0x1a2)]('\x20')[0x0]);}),this[N(0x18c)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hj=N,S=W=>__awaiter(this,void 0x0,void 0x0,function*(){const Hh=a8k;return(yield this[Hh(0x260)]['list'][Hh(0x17b)]({'parameters':{'projectId':W}}))[Hh(0x1f6)]['map'](Z=>Z['id']);});return this['askForProjectScopedResource'](Hj(0x257),S,k);}),this[N(0x1de)]=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const HV=N,S=W=>Z=>__awaiter(this,void 0x0,void 0x0,function*(){const Hr=a8k;var y;const O=yield this['apiClient'][Hr(0x17e)][Hr(0x23e)]({'parameters':{'projectId':W},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':Z}});return{'elements':O[Hr(0x1f6)]['secrets'][Hr(0x233)](b=>b['id']),'nextCursor':(y=O['pagination'])===null||y===void 0x0?void 0x0:y[Hr(0x21e)]};});return this[HV(0x194)](HV(0x204),S,k);}),this['askForSubdomain']=k=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hf=N,S=yield this[Hf(0x260)]['get'][Hf(0x17a)]({'parameters':{'domain':k}}),W=S[Hf(0x1f6)][Hf(0x266)][Hf(0x233)](y=>y['name']+Hf(0x1f7)+y[Hf(0x26e)]+')'),Z=Hf(0x218)+k+')';return this['askForResource'](Hf(0x1e6),W,Z)[Hf(0x1f8)](y=>y[Hf(0x1a2)]('\x20')[0x0]);}),this[N(0x1ea)]=k=>__awaiter(this,void 0x0,void 0x0,function*(){const HM=N;return(yield inquirer[HM(0x196)]([{'type':'confirm','name':HM(0x252),'message':chalk_1[HM(0x239)][HM(0x1d4)]('WARNING:\x20You\x20are\x20about\x20to\x20delete\x20'+(k||HM(0x1fd))+HM(0x1b1)),'default':![]}]))['confirmation'];}),this[N(0x249)]=(k,S)=>__awaiter(this,void 0x0,void 0x0,function*(){const HC=N;_[HC(0x1bd)](k[HC(0x1a9)])&&(S[HC(0x17c)]<=0x0?_[HC(0x236)](k,HC(0x1a9),HC(0x239)):yield(0x0,utils_1[HC(0x201)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const HG=HC,{name:W}=yield inquirer['prompt']([{'type':'input','name':HG(0x1a9),'message':HG(0x1d1),'default':HG(0x1d9)}]);if(!k[HG(0x19f)]&&S[HG(0x261)](Z=>Z[HG(0x1a9)]===W)){const {c:Z}=yield inquirer[HG(0x196)]([{'type':HG(0x225),'name':'c','message':'Context\x20with\x20name\x20\x27'+W+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(Z===![])throw new Error('Context\x20name\x20already\x20exists.');_['set'](k,HG(0x19f),!![]);}_[HG(0x236)](k,HG(0x1a9),W);})));if(_['isUndefined'](k[HC(0x205)])){const W=yield this[HC(0x246)]();_[HC(0x236)](k,HC(0x205),W);}return k;}),this[N(0x246)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hd=N,{token:k}=yield inquirer[Hd(0x196)]([{'type':Hd(0x1d3),'name':Hd(0x205),'mask':'*','message':Hd(0x279)}]);return k;}),inquirer[N(0x1f0)]('search-list',inquirerSearchList),inquirer[N(0x1f0)](N(0x226),inquirer_pagination_prompt_1[N(0x1be)]);}['confirmationPrompt'](H,k){return __awaiter(this,void 0x0,void 0x0,function*(){const He=a8k,S=yaml[He(0x231)](H),W=_[He(0x1eb)](S[He(0x1a2)]('\x0a')[He(0x233)](O=>O[He(0x17c)])),Z=chalk_1[He(0x239)][He(0x1ef)]('-'[He(0x25d)](W)+'\x0a'),{confirm:y}=yield inquirer[He(0x196)]([{'type':He(0x17e),'name':'confirm','message':''+chalk_1[He(0x239)]['bold'][He(0x268)](He(0x1f5))+Z+chalk_1[He(0x239)][He(0x274)](S)+Z,'choices':Object[He(0x265)](ConfirmChoices)}]);switch(y){case ConfirmChoices[He(0x21f)]:return H;case ConfirmChoices[He(0x278)]:throw new Error(He(0x1e3));case ConfirmChoices[He(0x1db)]:return this[He(0x1b9)](k);case ConfirmChoices['EDIT']:return this[He(0x26b)](yield this[He(0x215)](H),k);case ConfirmChoices[He(0x1a6)]:yield this[He(0x21d)](H);return this[He(0x26b)](H,k);default:throw new Error(He(0x1ba));}});}[a8d(0x1b9)](H,k){return __awaiter(this,void 0x0,void 0x0,function*(){const Hm=a8k;if((k===null||k===void 0x0?void 0x0:k[Hm(0x171)])!==undefined)this['resultCache']=k===null||k===void 0x0?void 0x0:k[Hm(0x171)];this[Hm(0x202)]=k===null||k===void 0x0?void 0x0:k['cmdPath'];const S={};return yield this[Hm(0x1da)]([],H[Hm(0x1a8)][Hm(0x1bb)],S),this[Hm(0x171)]=S,yield this[Hm(0x26b)](S,H);});}[a8d(0x1da)](H,k,S,W){return __awaiter(this,void 0x0,void 0x0,function*(){const HU=a8k;let Z;if(k[HU(0x22a)]&&!_['has'](k,HU(0x1dd))){if(k[HU(0x22a)][HU(0x17c)]>0x1){const {choice:y}=yield inquirer[HU(0x196)]([{'type':HU(0x17e),'name':HU(0x1ad),'message':HU(0x1bf)+(H[H[HU(0x17c)]-0x1]||'')+HU(0x213),'choices':k[HU(0x22a)][HU(0x233)](O=>{const HK=HU;var b;return(b=O[HK(0x24c)])!==null&&b!==void 0x0?b:'??';})}]);Z=yield this[HU(0x1b8)](H,k[HU(0x22a)][HU(0x261)](O=>O[HU(0x24c)]===y),S,W);}else{const O=k['oneOf'][0x0];_[HU(0x236)](O,HU(0x24c),k[HU(0x24c)]),Z=yield this[HU(0x1b8)](H,O,S,W);}Z={};}else Z=yield this[HU(0x1b8)](H,k,S,W);return Z;});}[a8d(0x206)](H,k,S,W){var Z;return __awaiter(this,void 0x0,void 0x0,function*(){const Hl=a8k;if(W===![]){const {addEntry:b}=yield inquirer['prompt']([{'type':Hl(0x225),'name':Hl(0x20d),'message':this[Hl(0x277)](k,'Do\x20you\x20want\x20to\x20add',H===null||H===void 0x0?void 0x0:H[Hl(0x24c)]),'default':![]}]);if(!b)return S;}const y=Object[Hl(0x22f)]((Z=H===null||H===void 0x0?void 0x0:H[Hl(0x1dd)])!==null&&Z!==void 0x0?Z:[]),O=H[Hl(0x275)]||[];if(y[Hl(0x17c)]>0x0)for(const h of y){const j=k[Hl(0x23b)](h);if(k[Hl(0x17c)]>0x0&&!_[Hl(0x26d)](S,k[Hl(0x20b)]('.')))_[Hl(0x236)](S,k[Hl(0x20b)]('.'),{});yield this[Hl(0x1da)](j,H['properties'][h],S,O[Hl(0x1af)](h));}else yield this['getType'](k,Object[Hl(0x228)](Object['assign']({},H),{'type':Hl(0x18a)}),S,W);return S;});}[a8d(0x1cf)](H,k,S,W){return __awaiter(this,void 0x0,void 0x0,function*(){const HJ=a8k;if(k&&S)return!![];const Z=k?HJ(0x254):HJ(0x1e9),{addEntry:y}=yield inquirer[HJ(0x196)]([{'type':'confirm','name':HJ(0x20d),'message':this['getPathString'](H,Z,k?W:undefined),'default':![]}]);return y;});}[a8d(0x1b8)](H,k,S,W){return __awaiter(this,void 0x0,void 0x0,function*(){const Hq=a8k;let Z;const y=H[Hq(0x20b)]('.');switch(k===null||k===void 0x0?void 0x0:k['type']){case Hq(0x21c):{let O=!![];while(yield this[Hq(0x1cf)](H,O,W,k===null||k===void 0x0?void 0x0:k[Hq(0x24c)])){const b=_[Hq(0x25c)](S,y);_[Hq(0x18b)](S,y),yield this[Hq(0x1b8)](H,k[Hq(0x241)],S);const h=_[Hq(0x25c)](S,y);!_[Hq(0x1f4)](b)?_[Hq(0x236)](S,y,[h]):(b[Hq(0x195)](h),_[Hq(0x236)](S,y,b)),O=![];}return Z||[];}case Hq(0x214):{return Z=yield this[Hq(0x206)](k,H,S,W),Z;}case'rawObject':Z=(0x0,utils_1[Hq(0x267)])(yield this['ask'](H,k,W))||undefined;break;case Hq(0x1c4):case Hq(0x193):case Hq(0x211):default:Z=yield this['ask'](H,k,W,S);break;}return!_[Hq(0x1bd)](Z)&&_[Hq(0x236)](S,y,Z),Z;});}[a8d(0x1b0)](H,k,S,W){var Z;return __awaiter(this,void 0x0,void 0x0,function*(){const Hn=a8k,y=H[H[Hn(0x17c)]-0x1],{defaultValue:defaultValue=(Z=k===null||k===void 0x0?void 0x0:k[Hn(0x1c6)])!==null&&Z!==void 0x0?Z:k===null||k===void 0x0?void 0x0:k['default'],choices:choices=k===null||k===void 0x0?void 0x0:k[Hn(0x1fe)],pagination:O}=yield(0x0,api_helpers_1[Hn(0x238)])(y,this[Hn(0x260)],this[Hn(0x202)],W,this[Hn(0x1ab)],H);let b='input';if(!_[Hn(0x1bd)](choices)&&choices[Hn(0x17c)]>0x0){if(O!==undefined&&O[Hn(0x1d2)]!==undefined)b=Hn(0x226);else choices[Hn(0x17c)]>0x4&&typeof choices[0x0]==='string'?b=Hn(0x244):b='list';}else{if((k===null||k===void 0x0?void 0x0:k[Hn(0x1f3)])==='boolean')b=Hn(0x225);else{if((k===null||k===void 0x0?void 0x0:k[Hn(0x1f3)])===Hn(0x211))b='input';else(k===null||k===void 0x0?void 0x0:k['type'])===Hn(0x18a)&&(b=Hn(0x200));}}let h=S!==![]?!_[Hn(0x24e)](defaultValue)?defaultValue:JSON[Hn(0x1c3)](defaultValue):_[Hn(0x18d)](defaultValue)?defaultValue:'don\x27t\x20change';if(choices)h=h[Hn(0x18f)]();_[Hn(0x26d)](this[Hn(0x171)],H[Hn(0x20b)]('.'))&&(h=this['resultCache'][H[Hn(0x20b)]('.')]);const j=choices&&S===![]?[Hn(0x1ee),...choices]:choices,r=(k===null||k===void 0x0?void 0x0:k['type'])===Hn(0x211),V=Object[Hn(0x228)]({'type':b,'name':'id','message':this[Hn(0x234)](H,k),'choices':j,'default':h,'filter':this[Hn(0x255)](b,S),'validate':this[Hn(0x19c)](k,S,r)},O),f=(yield inquirer[Hn(0x196)]([V]))['id'];if(f===Hn(0x1ee)||f==='')return undefined;if(r)return parseInt(f,0xa);return f;});}[a8d(0x234)](H,k){const Hv=a8d,S=(k===null||k===void 0x0?void 0x0:k['type'])!==Hv(0x193)?Hv(0x248):Hv(0x23d);return this[Hv(0x277)](H,S,k===null||k===void 0x0?void 0x0:k[Hv(0x24c)]);}[a8d(0x182)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Hi=a8k,H=k=>__awaiter(this,void 0x0,void 0x0,function*(){const HN=a8k;var S;const W=yield this[HN(0x260)][HN(0x17e)][HN(0x1d0)]({'options':{'per_page':this[HN(0x1a0)],'cursor':k}}),Z=W['data'][HN(0x1d0)][HN(0x233)](y=>y['id']);return{'elements':Z,'nextCursor':(S=W[HN(0x258)])===null||S===void 0x0?void 0x0:S[HN(0x21e)]};});return yield this[Hi(0x207)](Hi(0x170),H);});}['askForProjectScopedResource'](H,k,S,W){return __awaiter(this,void 0x0,void 0x0,function*(){const Ho=a8k,Z=S||this['apiClient'][Ho(0x22e)][Ho(0x221)]();if(_[Ho(0x1bd)](Z))throw new Error(Ho(0x270));const y=yield k(Z);return yield this[Ho(0x21b)](H,y,(W?W+Ho(0x23c):'')+Ho(0x183)+Z+'\x27');});}[a8d(0x194)](H,k,S,W){return __awaiter(this,void 0x0,void 0x0,function*(){const Hc=a8k,Z=S||this[Hc(0x260)][Hc(0x22e)][Hc(0x221)]();if(_[Hc(0x1bd)](Z))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const y=yield k(Z);return yield this[Hc(0x207)](H,y,(W?W+Hc(0x23c):'')+Hc(0x183)+Z+'\x27');});}['askForDomain'](){return __awaiter(this,void 0x0,void 0x0,function*(){const H=k=>__awaiter(this,void 0x0,void 0x0,function*(){const Hx=a8k;var S;const W=yield this[Hx(0x260)][Hx(0x17e)][Hx(0x22b)]({'options':{'per_page':this[Hx(0x1a0)],'cursor':k}});return{'elements':W['data']['domains'][Hx(0x233)](Z=>Z[Hx(0x1a9)]),'nextCursor':(S=W[Hx(0x258)])===null||S===void 0x0?void 0x0:S['cursor']};});return this['askForResourcePaginated']('domain',H);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const HR=a8k,H=k=>__awaiter(this,void 0x0,void 0x0,function*(){const HY=a8k;var S;const W=yield this[HY(0x260)][HY(0x17e)][HY(0x21a)]({'options':{'per_page':this[HY(0x1a0)],'cursor':k}});return{'elements':W[HY(0x1f6)][HY(0x1a5)][HY(0x233)](Z=>Z['id']),'nextCursor':(S=W['pagination'])===null||S===void 0x0?void 0x0:S[HY(0x21e)]};});return this[HR(0x207)]('credentials',H);});}['setPathVars'](H){this['pathVars']=H;}}exports[a8d(0x20a)]=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 a10X=a10k;(function(H,k){const P=a10k,S=H();while(!![]){try{const W=parseInt(P(0x101))/0x1+-parseInt(P(0x110))/0x2+-parseInt(P(0xf4))/0x3*(-parseInt(P(0x127))/0x4)+-parseInt(P(0xe8))/0x5+parseInt(P(0x12a))/0x6+parseInt(P(0x104))/0x7+-parseInt(P(0xf2))/0x8;if(W===k)break;else S['push'](S['shift']());}catch(Z){S['push'](S['shift']());}}}(a10H,0x81ac5));function a10k(H,k){const S=a10H();return a10k=function(W,Z){W=W-0xba;let y=S[W];return y;},a10k(H,k);}var __awaiter=this&&this['__awaiter']||function(H,k,S,W){function Z(y){return y instanceof S?y:new S(function(O){O(y);});}return new(S||(S=Promise))(function(y,O){const t=a10k;function b(r){const E=a10k;try{j(W[E(0xed)](r));}catch(V){O(V);}}function h(r){const D=a10k;try{j(W[D(0x14a)](r));}catch(V){O(V);}}function j(r){const w=a10k;r[w(0xfa)]?y(r[w(0x143)]):Z(r[w(0x143)])[w(0xd3)](b,h);}j((W=W[t(0x128)](H,k||[]))[t(0xed)]());});},__importDefault=this&&this['__importDefault']||function(H){const I=a10k;return H&&H[I(0xdf)]?H:{'default':H};};Object[a10X(0xc4)](exports,a10X(0xdf),{'value':!![]}),exports[a10X(0xd7)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a10X(0x14d))),utils_1=require(a10X(0x11d)),inquirer_helper_1=require('../inquirer-helper'),commander_1=require(a10X(0xbc)),console_format_helpers_1=require('../formatting/console-format-helpers'),log_formatter_1=require(a10X(0x10c));function a10H(){const HS=['tsHint','backupId','textNotIncludes','start','askForAddonRestore','inquirerHelper','Id]','4672235lIPeie','default','--textIncludes\x20<text>','build-','Get\x20log\x20for\x20the\x20specified\x20','next','>\x20Container\x20logs','-o,\x20--output\x20[output]','Get\x20logs\x20generated\x20after\x20this\x20time,\x20','close','3304752eFgsIL','message','772791rKOPqv','InquirerHelper','regexNotIncludes','option','Element\x20count\x20for\x20this\x20request\x20exceeds\x20the\x20line\x20limit,\x20output\x20was\x20truncated.\x20Cut\x20off\x20at\x20timestamp\x20','\x20(exit\x20with\x20','done','charAt','-d,\x20--direction\x20<order>','regexIncludes','length','--backup\x20--backupId\x20[backupId]','\x20to\x20get\x20logs\x20from','548720QeulzL','textIncludes','--textNotIncludes\x20<text>','7366485EZlRXD','--regexNotIncludes\x20<regex>','ApiClient','service','data','yml','parseDateInput','buildId','./log-formatter','Log\x20session\x20ended','Filter\x20log\x20lines\x20to\x20not\x20include\x20this\x20text','Only\x20two\x20of\x20\x27startTime\x27,\x20\x27endTime\x27\x20and\x20\x27duration\x27\x20can\x20be\x20set.','1435176cxaKIW','Get\x20logs\x20generated\x20before\x20this\x20time,\x20','Backup\x20to\x20get\x20logs\x20from','--project\x20--projectId\x20[projectId]','Error\x20while\x20tailing\x20log\x20lines:\x20','getSeconds','Job\x20run\x20id,\x20example:\x20162b1977-6636-4000-929b-cc265b862ff0','stringify',',\x20backup\x20id\x20','askForBuild','customUserAgent','error','forEach','../utils','logsApiClient','addonId','description','--regexIncludes\x20<regex>','Container\x20to\x20exec\x20into\x20(logs\x20from\x20all\x20containers\x20will\x20be\x20shown\x20if\x20not\x20specified)','name','forward','json','askForJobRun','8fhRFaO','apply','tail','2880006fAYpFW','runId','No\x20logs\x20found\x20for\x20this\x20query.\x20Make\x20sure\x20to\x20select\x20an\x20appropriate\x20time\x20window.','\x20with\x20live-tailing','Filter\x20log\x20lines\x20to\x20include\x20this\x20text','containerId','conflicts','--duration\x20[duration]','getStandardLogCommand','\x20for\x20all\x20containers','formatLogLine','askForProject','format','--restore\x20--restoreId\x20[restoreId]','addOption','toUpperCase','log','defaultDurationSeconds','\x0aDetails:\x20','Length\x20of\x20timespan\x20in\x20seconds.\x20Only\x20valid\x20if\x20not\x20both,\x20startTime\x20and\x20endTime\x20are\x20set','askForService','bold','Output\x20formatting.\x20Will\x20use\x20advanced\x20formatting\x20by\x20default.','job','addonBackup','value','cursor','slice','pagination','warning','Project\x20for\x20logs','getCommand','throw','getCurrentJobName','\x27Ctrl+C\x27','chalk','apiClient','logs','Option','askForContainer','commander','\x20seconds','action','Error\x20while\x20fetching\x20log\x20lines:\x20','toISOString','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','askForJob','--run\x20--runId\x20[runId]','defineProperty','\x20in\x20project\x20','argParser','printInitInfo','Tail\x20will\x20stream\x20logs\x20in\x20real-time.\x20Session\x20will\x20be\x20kept\x20open.',',\x20duration:\x20','details','addon','apiContext','assertContextExisting','jobId',',\x20restore\x20id\x20','logTail','valueOf','getFormatter','then','\x20of\x20','\x20--','alias','CliLogs','printResponse','Build\x20to\x20get\x20logs\x20from','choices','\x20for\x20container\x20','askForAddonBackup',',\x20from:\x20','Direction\x20of\x20logs.\x20Ignored\x20when\x20tailing.','__esModule','assign'];a10H=function(){return HS;};return a10H();}class CliLogs{constructor(H){const H0=a10X;this[H0(0xcc)]=H,this[H0(0x13b)]=0x708,this[H0(0x132)]=(k,S,W,Z)=>{const H1=H0,y=(0x0,utils_1[H1(0x149)])(!![])[H1(0x123)]((S?H1(0xeb):'')+'logs')[H1(0xd6)]((S?H1(0xeb):'')+H1(0x13a))[H1(0x120)](H1(0xec)+k)[H1(0xf7)](H1(0x113),H1(0x148))[H1(0xf7)]('--'+k+H1(0xd5)+k+'Id\x20['+k+H1(0xe7),k[H1(0xfb)](0x0)[H1(0x139)]()+k[H1(0x145)](0x1)+H1(0x100))[H1(0xf7)]('--container\x20--containerId\x20[containerId]',H1(0x122));if(S)y[H1(0xf7)]('--build\x20--buildId\x20[buildId]',H1(0xd9));if(k==='job')y['option'](H1(0xc3),H1(0x116));if(W)y[H1(0xf7)](H1(0xff),H1(0x112));if(Z)y[H1(0xf7)](H1(0x137),'Restore\x20to\x20get\x20logs\x20from');return y[H1(0xf7)]('-f,\x20--tail',H1(0xc8))[H1(0xf7)]('-l,\x20--lineLimit\x20[limit]','Number\x20of\x20lines\x20to\x20return.')[H1(0xf7)]('--startTime\x20<timestamp>',H1(0xf0)+utils_1[H1(0xe1)],utils_1[H1(0x10a)])[H1(0x138)](new commander_1[(H1(0xba))]('--endTime\x20<timestamp>',H1(0x111)+utils_1[H1(0xe1)])[H1(0xc6)](utils_1[H1(0x10a)])[H1(0x130)]([H1(0x129)]))[H1(0xf7)](H1(0x131),H1(0x13d))[H1(0x138)](new commander_1[(H1(0xba))](H1(0xfc),H1(0xde))[H1(0xda)](['backward',H1(0x124)])[H1(0x130)]([H1(0x129)]))[H1(0x138)](new commander_1['Option'](H1(0xea),H1(0x12e))['conflicts']([H1(0xe3),H1(0xfd),'regexNotIncludes']))[H1(0x138)](new commander_1[(H1(0xba))](H1(0x103),H1(0x10e))[H1(0x130)](['textIncludes','regexIncludes','regexNotIncludes']))[H1(0x138)](new commander_1[(H1(0xba))](H1(0x121),'Filter\x20log\x20lines\x20to\x20match\x20this\x20regular\x20expression')[H1(0x130)]([H1(0xe3),H1(0x102),H1(0xf6)]))[H1(0x138)](new commander_1[(H1(0xba))](H1(0x105),'Filter\x20log\x20lines\x20to\x20not\x20match\x20this\x20regular\x20expression')[H1(0x130)]([H1(0xe3),H1(0xfd),H1(0x102)]))[H1(0xf7)]('--noDefaults',H1(0xc1),![])[H1(0x138)](new commander_1[(H1(0xba))](H1(0xef),H1(0x140))[H1(0xda)](Object['values']([H1(0x136),H1(0x125),'yaml']))),y;},this[H0(0xc7)]=(k,S,W,Z)=>{const H2=H0,{containerName:y,restoreId:O,backupId:b,quiet:h,tail:j,startTime:r,endTime:V,duration:f}=Z;if(h===!![])return;const M=j?H2(0xf9)+chalk_1[H2(0xe9)]['bold'](H2(0x14c))+')':'',C=j?H2(0x12d):'',z=new Date(),G=r!==null&&r!==void 0x0?r:new Date(new Date((V!==null&&V!==void 0x0?V:z)[H2(0xd1)]())['setSeconds']((V!==null&&V!==void 0x0?V:z)[H2(0x115)]()-(f!==null&&f!==void 0x0?f:this[H2(0x13b)]))),d=(V!==null&&V!==void 0x0?V:r!==undefined)?new Date(new Date(r[H2(0xd1)]())['setSeconds'](r['getSeconds']()+(f!==null&&f!==void 0x0?f:this[H2(0x13b)]))):z,e=b!==undefined,m=G&&!e?H2(0xdd)+chalk_1[H2(0xe9)][H2(0x13f)](G['toISOString']()):'',U=d&&!e?',\x20to:\x20'+chalk_1[H2(0xe9)]['bold'](d[H2(0xc0)]()):'',K=f?H2(0xc9)+f+H2(0xbd):'',l=y?H2(0xdb)+chalk_1[H2(0xe9)]['bold'](y):e?'':H2(0x133),J=b?H2(0x118)+b:'',q=O?H2(0xcf)+O:'',n=k+'\x20'+chalk_1[H2(0xe9)][H2(0x13f)](S)+J+q+H2(0xc5)+chalk_1[H2(0xe9)][H2(0x13f)](W),v=''+m+U+K;console['log'](H2(0xee)+C+l+H2(0xd4)+n+v+M+':');},this[H0(0xd2)]=(k,S)=>(W,Z)=>{const H3=H0;if(!k){if(W[H3(0xfe)]===0x0)console['log'](H3(0x12c));W[H3(0x11c)](y=>(0x0,log_formatter_1[H3(0x134)])(y,S));}else(0x0,console_format_helpers_1[H3(0xd8)])(k,W);(Z===null||Z===void 0x0?void 0x0:Z['hasNextPage'])&&(0x0,utils_1[H3(0x147)])(H3(0xf8)+Z[H3(0x144)]);},this[H0(0x14e)]=new js_client_1[(H0(0x106))](H,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[H0(0x11a)]}),this[H0(0x11e)]=this[H0(0x14e)],this[H0(0xe6)]=new inquirer_helper_1[(H0(0xf5))](this['apiClient']);}['getLogsCommand'](H,k=![],S=![],W=![]){const HH=a10X,Z=(r,V)=>__awaiter(this,void 0x0,void 0x0,function*(){const H4=a10k,f=V['noDefaults'],{apiContext:M,inquirerHelper:C}=this;switch(H){case'service':{const z=f?undefined:M['getCurrentServiceName']();return V['serviceId']||z||(yield C[H4(0x13e)](r)());}case H4(0x141):{const G=f?undefined:M[H4(0x14b)]();return V[H4(0xce)]||G||(yield C[H4(0xc2)](r)());}case H4(0xcb):{return V[H4(0x11f)]||(yield C['askForAddon'](r)());}}}),y=(r,V,f)=>__awaiter(this,void 0x0,void 0x0,function*(){const H5=a10k;if(k)return f[H5(0x10b)]||(yield this['inquirerHelper'][H5(0x119)](r,H===H5(0x107)?V:undefined,H===H5(0x141)?V:undefined,!![])());return undefined;}),O=(r,V,f)=>__awaiter(this,void 0x0,void 0x0,function*(){const H6=a10k;if(S||W)return f[H6(0xe2)]||(yield this['inquirerHelper'][H6(0xdc)](r,V)());return undefined;}),b=(r,V,f,M)=>__awaiter(this,void 0x0,void 0x0,function*(){const H7=a10k;if(W)return M['restoreId']||(yield this[H7(0xe6)][H7(0xe5)](r,V,f)());return undefined;}),h=(r,V,f)=>__awaiter(this,void 0x0,void 0x0,function*(){const H8=a10k;if(!k&&f[H8(0x12f)]!==undefined){if(f[H8(0x12f)]!==!![])return f['containerId'];return yield this[H8(0xe6)][H8(0xbb)](r,H===H8(0x107)?V:undefined,H===H8(0x141)?V:undefined,!![])();}return undefined;}),j=(r,V,f)=>__awaiter(this,void 0x0,void 0x0,function*(){const H9=a10k;if(H===H9(0x141))return f[H9(0x12b)]||(yield this[H9(0xe6)][H9(0x126)](V,r,!![])());return undefined;});return this[HH(0x132)](H,k,S,W)[HH(0xbe)](r=>__awaiter(this,void 0x0,void 0x0,function*(){const Hk=HH,{noDefaults:V,projectId:f,quiet:M,tail:C,textIncludes:z,textNotIncludes:G,regexIncludes:d,regexNotIncludes:e,direction:m,lineLimit:U,startTime:K,endTime:l,duration:J,output:q}=r;(0x0,utils_1[Hk(0xcd)])(this[Hk(0x14e)]);const {apiContext:n,inquirerHelper:v,logsApiClient:N}=this,i=V?undefined:n['getCurrentProjectName'](),o=f||i||(yield v[Hk(0x135)]()),c=yield Z(o,r),x=yield y(o,c,r),Y=yield O(o,c,r),R=yield b(o,c,Y,r),g=yield j(o,c,r),F=yield h(o,c,r);if(K&&l&&J)throw new Error(Hk(0x10f));const A={'projectId':o,'entityId':c},L={'containerName':F,'textIncludes':z,'textNotIncludes':G,'regexIncludes':d,'regexNotIncludes':e,'lineLimit':U,'startTime':K,'duration':J,'runId':g,'buildId':x,'backupId':Y,'restoreId':R,'isBuild':k!==null&&k!==void 0x0?k:![]},s=W?'addonRestore':S?Hk(0x142):H,a=Object[Hk(0xe0)](Object[Hk(0xe0)]({},L),{'endTime':l,'direction':m});if(!M&&q!=='yaml'&&q!==Hk(0x109)&&q!==Hk(0x125))this[Hk(0xc7)](H,c,o,Object[Hk(0xe0)](Object[Hk(0xe0)]({},a),r));const T=this[Hk(0xd2)](q,z!==null&&z!==void 0x0?z:d);if(C){const Q=yield N[Hk(0x14f)][Hk(0xd0)](A,L,s);Q['on']('logs-received',T),Q['on'](Hk(0x11b),u=>(0x0,utils_1['error'])(Hk(0x114)+u[Hk(0xf3)])),Q['on'](Hk(0xf1),()=>console[Hk(0x13a)](Hk(0x10d))),yield Q[Hk(0xe4)]();}else{const u=yield N[Hk(0x14f)]['logRange'](A,a,s);if(u[Hk(0x11b)]){const B=u[Hk(0x11b)][Hk(0xca)],p=B?Hk(0x13c)+JSON[Hk(0x117)](B,null,'\x20'):'';(0x0,utils_1['error'])(Hk(0xbf)+u[Hk(0x11b)][Hk(0xf3)]+p);}else T(u[Hk(0x108)],u[Hk(0x146)]);}}));}}exports[a10X(0xd7)]=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';function
|
|
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;
|