@northflank/cli 0.9.4 → 0.9.5
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/command-overview.js +1 -1
- package/dist/console-format-helpers.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/inquirer-helper.js +1 -1
- package/dist/login/browser-login.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 +2 -2
package/dist/exec/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a6k=a6f;(function(H,f){const e=a6f,l=H();while(!![]){try{const t=-parseInt(e(0xb4))/0x1+parseInt(e(0x94))/0x2+parseInt(e(0xcc))/0x3*(parseInt(e(0xa5))/0x4)+-parseInt(e(0x93))/0x5+-parseInt(e(0xa7))/0x6*(-parseInt(e(0x9b))/0x7)+-parseInt(e(0xa3))/0x8*(-parseInt(e(0x8a))/0x9)+parseInt(e(0xa1))/0xa*(-parseInt(e(0x9f))/0xb);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a6H,0xa83fe));var __awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const A=a6f;function r(Y){const O=a6f;try{w(t[O(0xb8)](Y));}catch(x){n(x);}}function q(Y){const E=a6f;try{w(t[E(0xd6)](Y));}catch(x){n(x);}}function w(Y){const S=a6f;Y[S(0xbd)]?i(Y[S(0xb6)]):b(Y[S(0xb6)])[S(0xb2)](r,q);}w((t=t['apply'](H,f||[]))[A(0xb8)]());});},__importDefault=this&&this[a6k(0xb7)]||function(H){const h=a6k;return H&&H[h(0xab)]?H:{'default':H};};Object[a6k(0xe7)](exports,a6k(0xab),{'value':!![]}),exports['CliExec']=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require(a6k(0xdf))),utils_1=require('../utils'),inquirer_helper_1=require(a6k(0xd1));class CliExec{constructor(H){const K=a6k;this[K(0xae)]=b=>(0x0,utils_1['getCommand'])(!![])['name'](b)[K(0xaf)]('Command\x20exec\x20for\x20the\x20specified\x20'+b)[K(0xe3)](K(0xdd),'Project\x20for\x20exec')[K(0xe3)]('--'+b+K(0xa0)+b+K(0xca),b[K(0x9c)](0x0)[K(0xc8)]()+b[K(0x98)](0x1)+K(0xd4))['option'](K(0xb1),K(0x9a))[K(0xe3)](K(0xbe),'Run\x20command\x20with\x20shell\x20(e.g.\x20bash,sh).\x20If\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')['option'](K(0x97),'Run\x20command\x20with\x20this\x20user')[K(0xe3)](K(0xe5),'Run\x20command\x20with\x20this\x20group')[K(0xe3)]('--noDefaults','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.',![])[K(0xe3)]('--cmd\x20--command\x20[COMMAND]',K(0xd5)),this['getTerminalSize']=()=>({'columns':process['stdout'][K(0xcb)],'rows':process[K(0xb3)][K(0xa4)]}),this[K(0xb9)]=(b,i,n,r,q,w,Y,x)=>{const I=K;if(x===!![])return;const U=r==='none',m=U?'without\x20shell':r===undefined?'with\x20shell\x20session':I(0xdc)+chalk_1[I(0xe2)][I(0xda)](r),Q=q!==undefined?'with\x20user:'+q:'',L=w!==undefined?I(0xba)+w:'',B=Y!==undefined?I(0x9e)+chalk_1[I(0xe2)][I(0xda)](Y)+'\x27':'',T=[B,m,Q,L][I(0xc1)](C=>C!=='')[I(0x96)]('\x20'),X='(exit\x20with\x20two\x20quick\x20'+chalk_1['default']['bold'](I(0xa9))+')';console[I(0xe6)](I(0xac)+b+'\x20'+chalk_1[I(0xe2)][I(0xbf)](i)+I(0x8c)+chalk_1[I(0xe2)]['bold'](n)+'\x20'+T+'\x20'+X);},this[K(0xb0)]=(b,i,n=![])=>__awaiter(this,void 0x0,void 0x0,function*(){const P=K;var r,q;let w=![];try{if(process[P(0xde)][P(0xe0)]){const x=require(P(0xcd));x[P(0xd9)](process['stdin']),process['stdin'][P(0xea)](!![]),process[P(0xb3)]['on'](P(0xc2),()=>{const Z=P;b[Z(0xe8)](this[Z(0xce)]());}),process[P(0xde)]['on'](P(0x8f),(U,m)=>{const W=P;m['sequence']==='\x04'&&(w?(process[W(0xde)]['setRawMode'](![]),(0x0,utils_1[W(0xd2)])('Received\x20Ctrl+D\x20twice,\x20exiting\x20shell\x20forcefully.'),process[W(0x91)]()):(w=!![],setTimeout(()=>w=![],0x190)));});}process[P(0xde)][P(0xcf)](b[P(0x99)]),b['stdErr'][P(0xcf)](process[P(0xbc)]),b[P(0xe9)][P(0xcf)](process[P(0xb3)]),b['on'](P(0x95),U=>{const u=P;var m;(0x0,utils_1['error'])(u(0xc4)+i+u(0xb5)+((m=U[u(0x89)])!==null&&m!==void 0x0?m:U)),process[u(0xde)][u(0xe0)]&&process[u(0xde)][u(0xea)](![]),process[u(0x91)](-0x1);});const Y=yield b['waitForCommandResult']();if(n!==!![]){const U=(r=Y===null||Y===void 0x0?void 0x0:Y['status'])!==null&&r!==void 0x0?r:P(0xa6),m=(q=Y===null||Y===void 0x0?void 0x0:Y[P(0xc7)])!==null&&q!==void 0x0?q:-0x1,Q=(Y===null||Y===void 0x0?void 0x0:Y[P(0x89)])?P(0xc3)+Y[P(0x89)]:'';U===P(0xd7)?(0x0,utils_1[P(0xdb)])(P(0x90)+m):(0x0,utils_1[P(0xd2)])(P(0x8e)+U+',\x20exit\x20code:\x20'+m+Q);}return Y;}finally{process[P(0xde)][P(0xe0)]&&process[P(0xde)][P(0xea)](![]);}}),this['apiClient']=new js_client_1[(K(0xa2))](H,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[K(0xc0)]});const f=new inquirer_helper_1['InquirerHelper'](this[K(0xd8)]);this[K(0xa8)]=(0x0,utils_1[K(0xc6)])()[K(0xad)](K(0x9d))['alias'](K(0xc5))[K(0xaf)]('Command\x20execution\x20(exec)\x20for\x20Northflank\x20services\x20and\x20jobs.');const l=this[K(0xae)](K(0xbb))['action'](b=>__awaiter(this,void 0x0,void 0x0,function*(){const g=K,{noDefaults:i,projectId:n,serviceId:r,containerId:q,shellCmd:w,user:Y,group:x,command:U,quiet:m}=b;(0x0,utils_1[g(0x8d)])(this[g(0xd8)]);try{const Q=i?undefined:H[g(0x92)](),L=n||Q||(yield f[g(0xd0)]()),B=i?undefined:H[g(0xc9)](),T=r||B||(yield f[g(0xe4)](L)()),X=w!==null&&w!==void 0x0?w:U!==undefined?'none':undefined;this[g(0xb9)](g(0xbb),T,L,X,Y,x,U,m);const C=process[g(0xb3)][g(0xcb)],j=process[g(0xb3)][g(0xa4)],c={'projectId':L,'serviceId':T},D=yield this[g(0xd8)][g(0xc5)][g(0xe1)](c,{'containerName':q,'command':U,'shell':X,'user':Y,'group':x,'ttyColumns':C,'ttyRows':j});yield this[g(0xb0)](D,g(0xbb),m);}catch(V){(0x0,utils_1[g(0x95)])(''+V[g(0x89)]);}finally{process[g(0x91)]();}})),t=this[K(0xae)](K(0xd3))[K(0xaa)](b=>__awaiter(this,void 0x0,void 0x0,function*(){const d=K,{projectId:i,jobId:n,containerId:r,noDefaults:q,shellCmd:w,user:Y,group:x,command:U,quiet:m}=b;(0x0,utils_1[d(0x8d)])(this[d(0xd8)]);try{const Q=q?undefined:H[d(0x92)](),L=i||Q||(yield f[d(0xd0)]()),B=n||(yield f['askForJob'](L)());this['execStartLog'](d(0xd3),B,L,w,m);const {rows:T,columns:X}=this['getTerminalSize'](),C={'projectId':L,'jobId':B},j=yield this[d(0xd8)][d(0xc5)][d(0x8b)](C,{'containerName':r,'command':U,'shell':w,'user':Y,'group':x,'ttyColumns':X,'ttyRows':T});yield this[d(0xb0)](j,d(0xd3),m);}catch(c){(0x0,utils_1[d(0x95)])(''+c[d(0x89)]);}finally{process[d(0x91)]();}}));this[K(0xa8)]['addCommand'](l),this[K(0xa8)]['addCommand'](t);}}exports[a6k(0xeb)]=CliExec;function a6f(H,f){const l=a6H();return a6f=function(t,b){t=t-0x89;let i=l[t];return i;},a6f(H,f);}function a6H(){const F=['chalk','isTTY','execServiceSession','default','option','askForService','--group\x20[GROUP]','log','defineProperty','resizeTerminal','stdOut','setRawMode','CliExec','message','7263QuqMKI','execJobSession','\x20in\x20project\x20','assertContextExisting','Command\x20didn\x27t\x20complete\x20successfully,\x20status:\x20','keypress','Command\x20completed\x20successfully,\x20exit\x20code:\x20','exit','getCurrentProjectName','5398935fdltYg','1496902IGVfFr','error','join','--user\x20[USER]','slice','stdIn','Container\x20to\x20exec\x20into\x20(random\x20container\x20will\x20be\x20chosen\x20if\x20not\x20specified)','81977hddDgp','charAt','command-exec','with\x20command\x20\x27','335786qPDveP','\x20--','20tXTiph','ApiClient','13336lCImfN','rows','2124628xUwcMW','Unknown','210KkrTlg','execCmd','\x27Ctrl+D\x27','action','__esModule','Exec\x20','name','getStandardExecCommand','description','handleShellSession','--container\x20--containerId\x20[NAME]','then','stdout','1204773eHzYVY','\x20command\x20exec:\x20','value','__importDefault','next','execStartLog','with\x20group:','service','stderr','done','--shell-cmd\x20[SHELL-CMD]','bold','customUserAgent','filter','resize',',\x20details:\x20','Error\x20occured\x20during\x20','exec','getCommand','exitCode','toUpperCase','getCurrentServiceName','Id\x20[NAME]','columns','3TAPGEb','readline','getTerminalSize','pipe','askForProject','../inquirer-helper','warning','job','\x20to\x20exec\x20into','Command\x20to\x20execute,\x20if\x20--shell\x20option\x20is\x20present,\x20it\x20will\x20run\x20in\x20the\x20specified\x20shell,\x20otherwise','throw','Success','apiClient','emitKeypressEvents','greenBright','success','shell\x20command\x20','--project\x20--projectId\x20[NAME]','stdin'];a6H=function(){return F;};return a6H();}
|
package/dist/inquirer-helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a7T=a7G;(function(l,G){const o=a7G,s=l();while(!![]){try{const I=parseInt(o(0x1df))/0x1+parseInt(o(0x1c8))/0x2+-parseInt(o(0x247))/0x3*(-parseInt(o(0x1f9))/0x4)+-parseInt(o(0x26e))/0x5+-parseInt(o(0x1d7))/0x6+-parseInt(o(0x258))/0x7*(-parseInt(o(0x1b6))/0x8)+-parseInt(o(0x1c5))/0x9*(parseInt(o(0x1a3))/0xa);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a7l,0xb51c4));var __createBinding=this&&this[a7T(0x238)]||(Object['create']?function(l,G,s,I){const d=a7T;if(I===undefined)I=s;var z=Object[d(0x1b4)](G,s);(!z||('get'in z?!G['__esModule']:z['writable']||z[d(0x216)]))&&(z={'enumerable':!![],'get':function(){return G[s];}}),Object[d(0x215)](l,I,z);}:function(l,G,s,I){if(I===undefined)I=s;l[I]=G[s];}),__setModuleDefault=this&&this[a7T(0x20e)]||(Object[a7T(0x19e)]?function(l,G){const W=a7T;Object[W(0x215)](l,W(0x212),{'enumerable':!![],'value':G});}:function(l,G){const B=a7T;l[B(0x212)]=G;}),__importStar=this&&this[a7T(0x219)]||function(l){const R=a7T;if(l&&l[R(0x1b3)])return l;var G={};if(l!=null){for(var s in l)if(s!==R(0x212)&&Object[R(0x26d)][R(0x277)][R(0x285)](l,s))__createBinding(G,l,s);}return __setModuleDefault(G,l),G;},__awaiter=this&&this[a7T(0x1d1)]||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const J=a7G;function A(p){const y=a7G;try{n(I[y(0x250)](p));}catch(m){N(m);}}function a(p){const K=a7G;try{n(I[K(0x23e)](p));}catch(m){N(m);}}function n(p){const i=a7G;p[i(0x18d)]?X(p[i(0x1d6)]):z(p[i(0x1d6)])['then'](A,a);}n((I=I[J(0x1d8)](l,G||[]))[J(0x250)]());});},__importDefault=this&&this[a7T(0x23f)]||function(l){const Q=a7T;return l&&l[Q(0x1b3)]?l:{'default':l};};Object[a7T(0x215)](exports,a7T(0x1b3),{'value':!![]}),exports['InquirerHelper']=void 0x0;const _=__importStar(require(a7T(0x1f3))),chalk_1=__importDefault(require(a7T(0x23b))),fs=__importStar(require('fs')),utils_1=require(a7T(0x1f4)),api_helpers_1=require(a7T(0x209)),inquirer_pagination_prompt_1=require(a7T(0x1ce)),inquirer=require(a7T(0x24f)),inquirerSearchList=require('inquirer-search-list'),yaml=require('js-yaml');function a7l(){const lR=['default','askForResource','ask','defineProperty','configurable','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','No\x20builds\x20found','__importStar','Unexpected\x20file\x20type:\x20','whiteBright','type','toUpperCase','saveFile','No,\x20but\x20save\x20as\x20file','Writing\x20configuration\x20failed:\x20','Something\x20unexpected\x20happened.','nextPageCursor','bgGrey','secret','domains','volume','backups','message','job\x20runs','What\x27s\x20the\x20','askForProjectScopedResource','addon:\x20\x27','Please\x20confirm\x20following\x20configuration:\x0a','must\x20be\x20a\x20number,\x20is\x20','split','\x20and\x20it\x20','builds','max','service','has','required','job','logSinks','__createBinding','project','askForJobRun','chalk','askArrayEntry','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','throw','__importDefault','.*\x5c.(json|yaml|yml)$','concat','\x20characters,\x20is\x20','Go\x20to\x20editor','array','confirmation','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','3309087bQMXxr','askForProjectScopedResourcePaginated','Aborted.','writeFileSync','charAt','No,\x20repeat','then','json','inquirer','next','\x20characters','warning','credentials','Choose\x20the\x20login\x20token:','to\x20use:','EDIT','isObject','3045875GrvlqU','get','DynamicReloadPaginationPrompt','domain\x20(','loginPrompt','success','length','addons','jobs','\x20type?','SAVE','pagination','What\x20do\x20you\x20want\x20to\x20use\x20as','project:\x20\x27','askForSubdomain','isEmpty','don\x27t\x20change','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','description','boolean','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','prototype','2344130JglYXz','askForDomain','askForBuild','Configuration\x20file\x20written\x20to\x20','retry','object','bold',',\x20supported\x20types:\x20[json|yaml|yml]','blue','hasOwnProperty','createdAt','unset','resultCache','items','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','greenBright','getPathString','cmdPath','filter','editPayload','editedResult','reset','yellowBright','call','for\x20this\x20','data','this\x20option\x20is\x20required,\x20please\x20answer','done','assign','template\x20run','pop','values','isValidJSON','yaml','toString','body','No\x20','nextCursor','subdomains','projects','\x20to\x20use:','askForLogSink','pathVars','\x20(startedAt:\x20','create','\x20in\x20','No,\x20edit','rawObject','askForJob','70PpgnLc','cursor','list','slice','getInnerType','addEntry','askForResourcePaginated','minimum','Choose\x20the\x20','find','askGeneric','templates','isBoolean','fetchResourceList','templateRuns','red','__esModule','getOwnPropertyDescriptor','YES','16CmZJrw','Yes,\x20send','maxLength','repeat','defaultPaginationPageSize','domain','tmpCmdPath','safeLoad','getCurrentProjectName','runs','confirmationPrompt','askForProject','tokenPrompt','job\x20builds','\x20(completedAt:\x20','2272383QgocMs','doesn\x27t\x20match\x20pattern\x20\x27','getType','1085966HOmlLD','isUndefined','main-context','string','Context\x20name\x20already\x20exists.','name','./pagination/inquirer-pagination-prompt','setPathVars','isNaN','__awaiter','example','password','askConfirm','addon','value','1529046KDPmhW','apply','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','pattern','trim','propToType','getQuestionString','integer','716642iRqHRS','test','deleteWarningPrompt','set','keys','join','job:\x20\x27','\x20(full\x20domain:\x20','minLength','askForVolume','token','search-list','override','grey','services','askForAddon','completedAt','isArray','prompt','askForTemplateRun','lodash','./utils','REPEAT','ABORT','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','4AsbfRj','No,\x20abort','green','Template\x20id\x20not\x20provided.','opt','Context\x20with\x20name\x20\x27','push','\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','volumes','retrievePayloadViaInteractiveCli','validate','pagination-prompt','map','askForTemplate','editor','askForAddonBackup','./api-helpers','apiClient','properties','confirm','input','__setModuleDefault','oneOf','maximum','\x20Example:\x20'];a7l=function(){return lR;};return a7l();}var ConfirmChoices;(function(l){const r=a7T;l[r(0x1b5)]=r(0x1b7),l[r(0x1f5)]=r(0x24c),l[r(0x256)]=r(0x1a0),l[r(0x262)]=r(0x21f),l[r(0x1f6)]=r(0x1fa);}(ConfirmChoices||(ConfirmChoices={})));function a7G(l,G){const s=a7l();return a7G=function(I,z){I=I-0x18d;let X=s[I];return X;},a7G(l,G);}class InquirerHelper{constructor(l){const E=a7T;this['apiClient']=l,this[E(0x1ba)]=0x32,this['editPayload']=G=>__awaiter(this,void 0x0,void 0x0,function*(){const V=E,{editedResult:s}=yield inquirer[V(0x1f1)]([{'type':V(0x207),'name':V(0x282),'message':V(0x243),'default':yaml['safeDump'](G)}]);return yaml[V(0x1bd)](s);}),this[E(0x21e)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const M=E,s=N=>M(0x21a)+N+M(0x275);function I(){return __awaiter(this,void 0x0,void 0x0,function*(){const e=a7G;return inquirer['prompt']([{'type':e(0x20d),'name':'fileName','message':e(0x1f8),'validate':N=>new RegExp(e(0x240))[e(0x1e0)](N)?!![]:s(N)}]);});}const {fileName:z}=yield I(),X=z[M(0x194)]()[M(0x22f)]('.')[M(0x190)]();try{switch(X){case M(0x24e):(0x0,utils_1['success'])(M(0x271)+z);return fs[M(0x24a)](z,JSON['stringify'](G,null,'\x20\x20'));case M(0x193):case'yml':(0x0,utils_1[M(0x25d)])(M(0x271)+z);return fs[M(0x24a)](z,yaml['safeDump'](G));default:(0x0,utils_1['warning'])(s(X));}}catch(N){(0x0,utils_1[M(0x252)])(M(0x220)+N[M(0x228)]);}return undefined;}),this[E(0x280)]=(G,s)=>I=>{const w=E,z=typeof I==='string'?I[w(0x1db)]():I;return s===![]&&z===w(0x268)?'':z;},this['validate']=(G,s,I)=>z=>{const q=E,X=[];if(z===''||z===q(0x268)){if(s!==![])X[q(0x1ff)](q(0x288));else return!![];}G[q(0x21c)]===q(0x1cb)&&!_[q(0x1c9)](G[q(0x1da)])&&X[q(0x1ff)](new RegExp(G[q(0x1da)])['test'](z)?!![]:q(0x1c6)+G[q(0x1da)]+'\x27');G[q(0x21c)]===q(0x1cb)&&!_[q(0x1c9)](G[q(0x1e7)])&&X[q(0x1ff)](z[q(0x25e)]>=G[q(0x1e7)]?!![]:'must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20'+G['minLength']+q(0x242)+z['length']+q(0x251));G[q(0x21c)]==='string'&&!_[q(0x1c9)](G[q(0x1b8)])&&X[q(0x1ff)](z[q(0x25e)]<=G['maxLength']?!![]:q(0x269)+G['maxLength']+q(0x242)+z[q(0x25e)]+'\x20characters');I&&Number[q(0x1d0)](parseInt(z,0xa))&&X[q(0x1ff)](q(0x22e)+z);G[q(0x21c)]===q(0x1de)&&!_[q(0x1c9)](G[q(0x1aa)])&&X[q(0x1ff)](z>=G['minimum']?!![]:q(0x217)+G[q(0x1aa)]);G[q(0x21c)]===q(0x1de)&&!_[q(0x1c9)](G[q(0x210)])&&X['push'](z<=G[q(0x210)]?!![]:q(0x23d)+G['maximum']);if(G[q(0x21c)]===q(0x1a1)){const a=(0x0,utils_1[q(0x192)])(z);X[q(0x1ff)](a===![]||_[q(0x267)](a)?q(0x26c):!![]);}const N=X['filter'](n=>n!==!![]),A=(G===null||G===void 0x0?void 0x0:G[q(0x1d2)])?'\x0a'+chalk_1[q(0x212)][q(0x1b2)]('>>')+q(0x211)+chalk_1['default'][q(0x21b)](JSON['stringify'](G['example'])):'';return N['length']>0x0?N['join'](chalk_1[q(0x212)]['underline'](q(0x230)))+A:!![];},this[E(0x27e)]=(G,s,I)=>{const O=E,z=G[G[O(0x25e)]-0x1];function X(){const U=O;return G['slice'](0x0,-0x1)[U(0x205)](a=>a[U(0x24b)](0x0)[U(0x21d)]()+a[U(0x1a6)](0x1))[U(0x1e4)]('>');}const N=G['length']>0x1?chalk_1[O(0x212)][O(0x223)][O(0x21b)](X())+':\x20':'',A=I?'\x20('+chalk_1[O(0x212)][O(0x276)](I)+')':'';return chalk_1[O(0x212)][O(0x283)](''+N+s+'\x20'+chalk_1[O(0x212)][O(0x274)][O(0x27d)](z)+A+'?');},this[E(0x213)]=(G,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=E;if(s['length']<0x1){const N=I?Z(0x286)+I:'found';throw new Error('No\x20'+G+'\x20'+N+'.');}const z=Z(0x1ab)+G+Z(0x19a),X=s[Z(0x25e)]>0x4?Z(0x1ea):Z(0x1a5);return(yield inquirer['prompt']([{'type':X,'name':Z(0x1cd),'message':z,'choices':s}]))['name'];}),this[E(0x1a9)]=(G,s,I)=>__awaiter(this,void 0x0,void 0x0,function*(){const v=E,{elements:z,nextCursor:X}=yield s();if(z[v(0x25e)]<0x1){const a=I?v(0x286)+I:'found';throw new Error(v(0x196)+G+'\x20'+a+'.');}const N=v(0x1ab)+G+v(0x19a);if(X!==undefined){const n=({nextPageCursor:p})=>__awaiter(this,void 0x0,void 0x0,function*(){const S=v,m=yield s(p);return{'elements':m['elements'],'nextPageCursor':m[S(0x197)]};});return(yield inquirer[v(0x1f1)]([{'type':v(0x204),'name':v(0x1cd),'message':N,'choices':z,'nextPageCursor':X,'loadMore':n}]))['name'];}const A=z['length']>0x4?v(0x1ea):v(0x1a5);return(yield inquirer[v(0x1f1)]([{'type':A,'name':v(0x1cd),'message':N,'choices':z}]))[v(0x1cd)];}),this[E(0x1ad)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const g=E,I=''+(s?'('+chalk_1[g(0x212)]['blue'](s)+')\x20':''),z='Enter\x20the\x20'+chalk_1['default'][g(0x1fb)](G)+'\x20'+I+g(0x255),X=this[g(0x203)]({'type':'string','required':!![]});return(yield inquirer[g(0x1f1)]([{'type':g(0x20d),'name':g(0x1cd),'message':z,'validate':X}]))['name'];}),this[E(0x1d4)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const j=E;return(yield inquirer['prompt']([{'type':j(0x20c),'name':j(0x1cd),'message':G,'default':!![]}]))[j(0x1cd)];}),this['askForService']=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const f=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const C=a7G;var X;const N=yield this['apiClient'][C(0x1a5)][C(0x1ed)]({'parameters':{'projectId':I},'options':{'per_page':this[C(0x1ba)],'cursor':z}}),A=N[C(0x287)]['services'][C(0x205)](a=>a['id']);return{'elements':A,'nextCursor':(X=N[C(0x263)])===null||X===void 0x0?void 0x0:X[C(0x1a4)]};});return this[f(0x248)](f(0x233),s,G);}),this[E(0x206)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=s=>__awaiter(this,void 0x0,void 0x0,function*(){const h=a7G;var I;const z=yield this[h(0x20a)][h(0x1a5)][h(0x1ae)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':s}}),X=z[h(0x287)]['templates'][h(0x205)](N=>N['id']);return{'elements':X,'nextCursor':(I=z[h(0x263)])===null||I===void 0x0?void 0x0:I[h(0x1a4)]};});return this['askForResourcePaginated']('template',G);}),this[E(0x1f2)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=E;if(_[F(0x1c9)](G))throw new Error(F(0x1fc));const s=I=>__awaiter(this,void 0x0,void 0x0,function*(){const P=F;var z;let X=this[P(0x1ba)];const N=yield this['apiClient'][P(0x1a5)][P(0x1b1)]({'parameters':{'templateId':G},'options':{'per_page':X,'cursor':I}}),A=N[P(0x287)][P(0x1b1)]['map'](a=>a['id']+'\x20(startedAt:\x20'+a['createdAt']+')');return{'elements':A,'nextCursor':(z=N['pagination'])===null||z===void 0x0?void 0x0:z[P(0x1a4)]};});return this[F(0x1a9)](F(0x18f),s)[F(0x24d)](I=>I[F(0x22f)]('\x20')[0x0]);}),this[E(0x19b)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=s=>__awaiter(this,void 0x0,void 0x0,function*(){const L=a7G;var I;let z=this['defaultPaginationPageSize'];const X=yield this['apiClient']['list'][L(0x237)]({'options':{'per_page':z,'cursor':s}}),N=X[L(0x287)]['logSinks'][L(0x205)](A=>A['id']);return{'elements':N,'nextCursor':(I=X[L(0x263)])===null||I===void 0x0?void 0x0:I[L(0x1a4)]};});return this['askForResourcePaginated']('log\x20sink',G);}),this[E(0x1a2)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Y=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const k=a7G;var X;const N=yield this['apiClient'][k(0x1a5)][k(0x260)]({'parameters':{'projectId':I},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':z}}),A=N[k(0x287)][k(0x260)][k(0x205)](a=>a['id']);return{'elements':A,'nextCursor':(X=N[k(0x263)])===null||X===void 0x0?void 0x0:X[k(0x1a4)]};});return this['askForProjectScopedResourcePaginated'](Y(0x236),s,G);}),this[E(0x23a)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=E,I=z=>X=>__awaiter(this,void 0x0,void 0x0,function*(){const x=a7G;var N;const A=yield this['apiClient'][x(0x259)][x(0x236)][x(0x1bf)]({'parameters':{'projectId':z,'jobId':G},'options':{'per_page':this[x(0x1ba)],'cursor':X}}),a=A[x(0x287)][x(0x1bf)][x(0x205)](n=>n['id']+x(0x19d)+n['startedAt']+')');return{'elements':a,'nextCursor':(N=A[x(0x263)])===null||N===void 0x0?void 0x0:N[x(0x1a4)]};});return this[u(0x248)](u(0x229),I,s,u(0x1e5)+G+'\x27')['then'](z=>z[u(0x22f)]('\x20')[0x0]);}),this[E(0x270)]=(G,s,I)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const t=E;if(I!==undefined){const z=X=>N=>__awaiter(this,void 0x0,void 0x0,function*(){const b=a7G;var A;const a=yield this[b(0x20a)]['get'][b(0x236)][b(0x231)]({'parameters':{'projectId':X,'jobId':I},'options':{'per_page':this[b(0x1ba)],'cursor':N}});return{'elements':a[b(0x287)][b(0x231)][b(0x205)](n=>n['id']+b(0x19d)+n[b(0x278)]+')'),'nextCursor':(A=a[b(0x263)])===null||A===void 0x0?void 0x0:A['cursor']};});return this[t(0x248)](t(0x1c3),z,G,t(0x1e5)+I+'\x27')['then'](X=>X['split']('\x20')[0x0]);}if(s!==undefined){const X=N=>A=>__awaiter(this,void 0x0,void 0x0,function*(){const H=t;var a;const n=yield this['apiClient'][H(0x259)]['service']['builds']({'parameters':{'projectId':N,'serviceId':s},'options':{'per_page':this[H(0x1ba)],'cursor':A}});return{'elements':n[H(0x287)][H(0x231)][H(0x205)](p=>p['id']+H(0x19d)+p[H(0x278)]+')'),'nextCursor':(a=n[H(0x263)])===null||a===void 0x0?void 0x0:a[H(0x1a4)]};});return this[t(0x248)]('job\x20build',X,G,'service:\x20\x27'+I+'\x27')[t(0x24d)](N=>N['split']('\x20')[0x0]);}throw new Error(t(0x218));}),this[E(0x1ee)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l1=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const l0=a7G;var X;const N=yield this['apiClient'][l0(0x1a5)][l0(0x25f)]({'parameters':{'projectId':I},'options':{'per_page':this[l0(0x1ba)],'cursor':z}});return{'elements':N[l0(0x287)][l0(0x25f)]['map'](A=>A['id']),'nextCursor':(X=N[l0(0x263)])===null||X===void 0x0?void 0x0:X['cursor']};});return this[l1(0x248)](l1(0x1d5),s,G);}),this[E(0x208)]=(G,s)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l3=E,I=z=>X=>__awaiter(this,void 0x0,void 0x0,function*(){const l2=a7G;var N;const A=yield this[l2(0x20a)][l2(0x259)][l2(0x1d5)]['backups']({'parameters':{'projectId':z,'addonId':s},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':X}});return{'elements':A['data'][l2(0x227)][l2(0x205)](a=>a['id']+l2(0x1c4)+(a[l2(0x1ef)]||'not\x20completed')+')'),'nextCursor':(N=A[l2(0x263)])===null||N===void 0x0?void 0x0:N['cursor']};});return this[l3(0x248)]('backups',I,G,l3(0x22c)+s+'\x27')['then'](z=>z['split']('\x20')[0x0]);}),this[E(0x1e8)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l5=E,s=I=>__awaiter(this,void 0x0,void 0x0,function*(){const l4=a7G;return(yield this['apiClient'][l4(0x1a5)][l4(0x201)]({'parameters':{'projectId':I}}))[l4(0x287)][l4(0x205)](z=>z['id']);});return this[l5(0x22b)](l5(0x226),s,G);}),this['askForSecret']=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l7=E,s=I=>z=>__awaiter(this,void 0x0,void 0x0,function*(){const l6=a7G;var X;const N=yield this[l6(0x20a)][l6(0x1a5)]['secrets']({'parameters':{'projectId':I},'options':{'per_page':this[l6(0x1ba)],'cursor':z}});return{'elements':N[l6(0x287)]['secrets'][l6(0x205)](A=>A['id']),'nextCursor':(X=N[l6(0x263)])===null||X===void 0x0?void 0x0:X[l6(0x1a4)]};});return this[l7(0x248)](l7(0x224),s,G);}),this[E(0x266)]=G=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const l8=E,s=yield this[l8(0x20a)][l8(0x259)][l8(0x1bb)]({'parameters':{'domain':G}}),I=s[l8(0x287)][l8(0x198)][l8(0x205)](X=>X['name']+l8(0x1e6)+X['fullName']+')'),z=l8(0x25b)+G+')';return this['askForResource']('subdomain',I,z)['then'](X=>X[l8(0x22f)]('\x20')[0x0]);}),this[E(0x1e1)]=G=>__awaiter(this,void 0x0,void 0x0,function*(){const l9=E;return(yield inquirer['prompt']([{'type':'confirm','name':l9(0x245),'message':chalk_1[l9(0x212)][l9(0x284)](l9(0x27c)+(G||'a\x20Northflank\x20resource')+l9(0x1d9)),'default':![]}]))[l9(0x245)];}),this[E(0x25c)]=(G,s)=>__awaiter(this,void 0x0,void 0x0,function*(){const ll=E;_[ll(0x1c9)](G[ll(0x1cd)])&&(s[ll(0x25e)]<=0x0?_[ll(0x1e2)](G,ll(0x1cd),ll(0x212)):yield(0x0,utils_1[ll(0x272)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const lG=ll,{name:I}=yield inquirer[lG(0x1f1)]([{'type':lG(0x20d),'name':lG(0x1cd),'message':lG(0x246),'default':lG(0x1ca)}]);if(!G[lG(0x1eb)]&&s[lG(0x1ac)](z=>z[lG(0x1cd)]===I)){const {c:z}=yield inquirer[lG(0x1f1)]([{'type':lG(0x20c),'name':'c','message':lG(0x1fe)+I+lG(0x200),'default':![]}]);if(z===![])throw new Error(lG(0x1cc));_[lG(0x1e2)](G,lG(0x1eb),!![]);}_['set'](G,lG(0x1cd),I);})));if(_[ll(0x1c9)](G[ll(0x1e9)])){const I=yield this[ll(0x1c2)]();_['set'](G,'token',I);}return G;}),this[E(0x1c2)]=()=>__awaiter(this,void 0x0,void 0x0,function*(){const ls=E,{token:G}=yield inquirer[ls(0x1f1)]([{'type':ls(0x1d3),'name':ls(0x1e9),'mask':'*','message':ls(0x254)}]);return G;}),inquirer['registerPrompt'](E(0x1ea),inquirerSearchList),inquirer['registerPrompt'](E(0x204),inquirer_pagination_prompt_1[E(0x25a)]);}[a7T(0x1c0)](l,G){return __awaiter(this,void 0x0,void 0x0,function*(){const lI=a7G,s=yaml['safeDump'](l),I=_[lI(0x232)](s[lI(0x22f)]('\x0a')['map'](N=>N[lI(0x25e)])),z=chalk_1['default'][lI(0x1ec)]('-'[lI(0x1b9)](I)+'\x0a'),{confirm:X}=yield inquirer[lI(0x1f1)]([{'type':lI(0x1a5),'name':'confirm','message':''+chalk_1['default'][lI(0x274)][lI(0x1fb)](lI(0x22d))+z+chalk_1[lI(0x212)]['blueBright'](s)+z,'choices':Object[lI(0x191)](ConfirmChoices)}]);switch(X){case ConfirmChoices['YES']:return l;case ConfirmChoices['ABORT']:throw new Error(lI(0x249));case ConfirmChoices[lI(0x1f5)]:return this['retrievePayloadViaInteractiveCli'](G);case ConfirmChoices[lI(0x256)]:return this[lI(0x1c0)](yield this[lI(0x281)](l),G);case ConfirmChoices[lI(0x262)]:yield this['saveFile'](l);return this[lI(0x1c0)](l,G);default:throw new Error(lI(0x221));}});}[a7T(0x202)](l,G){return __awaiter(this,void 0x0,void 0x0,function*(){const lz=a7G;if((G===null||G===void 0x0?void 0x0:G[lz(0x27a)])!==undefined)this[lz(0x27a)]=G===null||G===void 0x0?void 0x0:G[lz(0x27a)];this['tmpCmdPath']=G===null||G===void 0x0?void 0x0:G[lz(0x27f)];const s={};return yield this['propToType']([],l[lz(0x1fd)][lz(0x195)],s),this[lz(0x27a)]=s,yield this['confirmationPrompt'](s,l);});}[a7T(0x1dc)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lX=a7G;let z;if(G[lX(0x20f)]&&!_[lX(0x234)](G,'properties')){if(G[lX(0x20f)][lX(0x25e)]>0x1){const {choice:X}=yield inquirer[lX(0x1f1)]([{'type':lX(0x1a5),'name':'choice','message':lX(0x22a)+(l[l[lX(0x25e)]-0x1]||'')+lX(0x261),'choices':G[lX(0x20f)][lX(0x205)](N=>{var A;return(A=N['description'])!==null&&A!==void 0x0?A:'??';})}]);z=yield this[lX(0x1c7)](l,G['oneOf'][lX(0x1ac)](N=>N[lX(0x26a)]===X),s,I);}else{const N=G['oneOf'][0x0];_[lX(0x1e2)](N,'description',G[lX(0x26a)]),z=yield this[lX(0x1c7)](l,N,s,I);}z={};}else z=yield this[lX(0x1c7)](l,G,s,I);return z;});}[a7T(0x1a7)](l,G,s,I){var z;return __awaiter(this,void 0x0,void 0x0,function*(){const lN=a7G;if(I===![]){const {addEntry:A}=yield inquirer['prompt']([{'type':lN(0x20c),'name':lN(0x1a8),'message':this[lN(0x27e)](G,'Do\x20you\x20want\x20to\x20add',l===null||l===void 0x0?void 0x0:l[lN(0x26a)]),'default':![]}]);if(!A)return s;}const X=Object[lN(0x1e3)]((z=l===null||l===void 0x0?void 0x0:l[lN(0x20b)])!==null&&z!==void 0x0?z:[]),N=l[lN(0x235)]||[];if(X[lN(0x25e)]>0x0)for(const a of X){const n=G[lN(0x241)](a);if(G[lN(0x25e)]>0x0&&!_['has'](s,G['join']('.')))_[lN(0x1e2)](s,G[lN(0x1e4)]('.'),{});yield this['propToType'](n,l[lN(0x20b)][a],s,N['includes'](a));}else yield this['getType'](G,Object['assign'](Object[lN(0x18e)]({},l),{'type':lN(0x1a1)}),s,I);return s;});}[a7T(0x23c)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lA=a7G;if(G&&s)return!![];const z=G?'Do\x20you\x20want\x20to\x20add':'Do\x20you\x20want\x20to\x20add\x20more',{addEntry:X}=yield inquirer[lA(0x1f1)]([{'type':'confirm','name':lA(0x1a8),'message':this['getPathString'](l,z,G?I:undefined),'default':![]}]);return X;});}['getType'](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const la=a7G;let z;const X=l['join']('.');switch(G===null||G===void 0x0?void 0x0:G['type']){case la(0x244):{let N=!![];while(yield this[la(0x23c)](l,N,I,G===null||G===void 0x0?void 0x0:G['description'])){const A=_[la(0x259)](s,X);_[la(0x279)](s,X),yield this['getType'](l,G[la(0x27b)],s);const a=_[la(0x259)](s,X);!_[la(0x1f0)](A)?_[la(0x1e2)](s,X,[a]):(A[la(0x1ff)](a),_['set'](s,X,A)),N=![];}return z||[];}case la(0x273):{return z=yield this['getInnerType'](G,l,s,I),z;}case'rawObject':z=(0x0,utils_1[la(0x192)])(yield this[la(0x214)](l,G,I))||undefined;break;case la(0x1cb):case'boolean':case la(0x1de):default:z=yield this[la(0x214)](l,G,I,s);break;}return!_[la(0x1c9)](z)&&_['set'](s,X,z),z;});}['ask'](l,G,s,I){var z;return __awaiter(this,void 0x0,void 0x0,function*(){const ln=a7G,X=l[l[ln(0x25e)]-0x1],{defaultValue:defaultValue=(z=G===null||G===void 0x0?void 0x0:G[ln(0x1d2)])!==null&&z!==void 0x0?z:G===null||G===void 0x0?void 0x0:G['default'],choices:choices=G===null||G===void 0x0?void 0x0:G['enum'],pagination:N}=yield(0x0,api_helpers_1[ln(0x1b0)])(X,this[ln(0x20a)],this[ln(0x1bc)],I,this[ln(0x19c)],l);let A=ln(0x20d);if(!_[ln(0x1c9)](choices)&&choices['length']>0x0){if(N!==undefined&&N[ln(0x222)]!==undefined)A=ln(0x204);else choices['length']>0x4&&typeof choices[0x0]===ln(0x1cb)?A=ln(0x1ea):A=ln(0x1a5);}else{if((G===null||G===void 0x0?void 0x0:G[ln(0x21c)])===ln(0x26b))A=ln(0x20c);else{if((G===null||G===void 0x0?void 0x0:G[ln(0x21c)])===ln(0x1de))A=ln(0x20d);else(G===null||G===void 0x0?void 0x0:G['type'])==='rawObject'&&(A=ln(0x207));}}let a=s!==![]?!_[ln(0x257)](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[ln(0x1af)](defaultValue)?defaultValue:ln(0x268);if(choices)a=a['toString']();_[ln(0x234)](this[ln(0x27a)],l[ln(0x1e4)]('.'))&&(a=this[ln(0x27a)][l[ln(0x1e4)]('.')]);const n=choices&&s===![]?['don\x27t\x20change',...choices]:choices,p=(G===null||G===void 0x0?void 0x0:G[ln(0x21c)])==='integer',m=Object[ln(0x18e)]({'type':A,'name':'id','message':this[ln(0x1dd)](l,G),'choices':n,'default':a,'filter':this[ln(0x280)](A,s),'validate':this[ln(0x203)](G,s,p)},N),D=(yield inquirer[ln(0x1f1)]([m]))['id'];if(D===ln(0x268)||D==='')return undefined;if(p)return parseInt(D,0xa);return D;});}[a7T(0x1dd)](l,G){const lp=a7T,s=(G===null||G===void 0x0?void 0x0:G[lp(0x21c)])!=='boolean'?lp(0x264):'Should\x20it\x20be';return this[lp(0x27e)](l,s,G===null||G===void 0x0?void 0x0:G[lp(0x26a)]);}[a7T(0x1c1)](){return __awaiter(this,void 0x0,void 0x0,function*(){const lD=a7G,l=G=>__awaiter(this,void 0x0,void 0x0,function*(){const lm=a7G;var s;const I=yield this['apiClient'][lm(0x1a5)][lm(0x199)]({'options':{'per_page':this[lm(0x1ba)],'cursor':G}}),z=I[lm(0x287)][lm(0x199)]['map'](X=>X['id']);return{'elements':z,'nextCursor':(s=I[lm(0x263)])===null||s===void 0x0?void 0x0:s[lm(0x1a4)]};});return yield this[lD(0x1a9)](lD(0x239),l);});}[a7T(0x22b)](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lo=a7G,z=s||this[lo(0x20a)]['contextProvider'][lo(0x1be)]();if(_['isUndefined'](z))throw new Error('Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.');const X=yield G(z);return yield this[lo(0x213)](l,X,(I?I+lo(0x19f):'')+lo(0x265)+z+'\x27');});}['askForProjectScopedResourcePaginated'](l,G,s,I){return __awaiter(this,void 0x0,void 0x0,function*(){const lT=a7G,z=s||this['apiClient']['contextProvider']['getCurrentProjectName']();if(_[lT(0x1c9)](z))throw new Error(lT(0x1f7));const X=yield G(z);return yield this['askForResourcePaginated'](l,X,(I?I+lT(0x19f):'')+lT(0x265)+z+'\x27');});}[a7T(0x26f)](){return __awaiter(this,void 0x0,void 0x0,function*(){const ld=a7G,l=yield this[ld(0x20a)]['list'][ld(0x225)]({}),G=l['data']['domains'][ld(0x205)](s=>s[ld(0x1cd)]);return this['askForResource'](ld(0x1bb),G);});}['askForCredentials'](){return __awaiter(this,void 0x0,void 0x0,function*(){const lW=a7G,l=yield this[lW(0x20a)][lW(0x1a5)]['registries']({}),G=l[lW(0x287)][lW(0x253)][lW(0x205)](s=>s['id']);return this[lW(0x213)](lW(0x253),G);});}[a7T(0x1cf)](l){const lB=a7T;this[lB(0x19c)]=l;}}exports['InquirerHelper']=InquirerHelper;
|
|
1
|
+
'use strict';const a7Q=a7f;function a7f(H,f){const l=a7H();return a7f=function(t,b){t=t-0xed;let i=l[t];return i;},a7f(H,f);}(function(H,f){const m=a7f,l=H();while(!![]){try{const t=-parseInt(m(0x150))/0x1+parseInt(m(0x132))/0x2*(-parseInt(m(0x12e))/0x3)+parseInt(m(0x12a))/0x4+-parseInt(m(0x192))/0x5*(-parseInt(m(0x112))/0x6)+parseInt(m(0x194))/0x7+-parseInt(m(0x1b9))/0x8*(-parseInt(m(0xed))/0x9)+-parseInt(m(0x16e))/0xa;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a7H,0xaf586));var __createBinding=this&&this[a7Q(0x16c)]||(Object[a7Q(0x1d7)]?function(H,f,l,t){const L=a7Q;if(t===undefined)t=l;var b=Object[L(0x19d)](f,l);(!b||('get'in b?!f['__esModule']:b[L(0x127)]||b[L(0x12b)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[L(0x189)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a7Q(0x140)]||(Object['create']?function(H,f){const B=a7Q;Object[B(0x189)](H,B(0x182),{'enumerable':!![],'value':f});}:function(H,f){const T=a7Q;H[T(0x182)]=f;}),__importStar=this&&this[a7Q(0x1eb)]||function(H){const X=a7Q;if(H&&H[X(0x1ae)])return H;var f={};if(H!=null){for(var l in H)if(l!==X(0x182)&&Object['prototype']['hasOwnProperty'][X(0x181)](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this[a7Q(0x168)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const V=a7f;function r(Y){const C=a7f;try{w(t[C(0x146)](Y));}catch(x){n(x);}}function q(Y){const j=a7f;try{w(t[j(0x1da)](Y));}catch(x){n(x);}}function w(Y){const D=a7f;Y[D(0x179)]?i(Y[D(0x176)]):b(Y[D(0x176)])[D(0x169)](r,q);}w((t=t['apply'](H,f||[]))[V(0x146)]());});},__importDefault=this&&this[a7Q(0x1e3)]||function(H){return H&&H['__esModule']?H:{'default':H};};Object[a7Q(0x189)](exports,a7Q(0x1ae),{'value':!![]}),exports[a7Q(0x15a)]=void 0x0;const _=__importStar(require(a7Q(0x102))),chalk_1=__importDefault(require(a7Q(0x10e))),fs=__importStar(require('fs')),utils_1=require(a7Q(0x1d8)),api_helpers_1=require(a7Q(0x1d9)),inquirer_pagination_prompt_1=require(a7Q(0x162)),inquirer=require(a7Q(0xf0)),inquirerSearchList=require(a7Q(0x1cb)),yaml=require(a7Q(0x193));var ConfirmChoices;function a7H(){const HD=['askForBuild','max','addon:\x20\x27','bgGrey','lodash','askForAddonBackup','safeLoad','completedAt','unset','toString','Do\x20you\x20want\x20to\x20add','charAt','pattern','\x20type?','isEmpty','Do\x20you\x20want\x20to\x20add\x20more','chalk','askForTemplate','project','resultCache','6283206HzuhdW','body','blueBright','startedAt','secrets','domain','split','\x20to\x20use:','registerPrompt','No\x20builds\x20found','volume','properties','service:\x20\x27','nextCursor','DynamicReloadPaginationPrompt','addon','must\x20be\x20a\x20number,\x20is\x20','get','askConfirm','Something\x20unexpected\x20happened.','askForJob','writable','must\x20be\x20shorter\x20than\x20or\x20equal\x20to\x20','project:\x20\x27','5302104PKKmcF','configurable','getQuestionString','don\x27t\x20change','1053OOLhIg','yellowBright','EDIT','Configuration\x20file\x20written\x20to\x20','2246aKIhZS','boolean','main-context','list','name','pagination','stringify','maximum','join','override','Provide\x20a\x20file\x20path\x20to\x20write\x20the\x20configuration\x20to\x20(<name>.[json|yaml|yml])','askForLogSink','Writing\x20configuration\x20failed:\x20','green','__setModuleDefault','Context\x20with\x20name\x20\x27','Please\x20confirm\x20following\x20configuration:\x0a','example','push','What\x27s\x20the\x20','next','\x20in\x20','pathVars','must\x20be\x20bigger\x20than\x20or\x20equal\x20to\x20','backups','REPEAT','apiClient','doesn\x27t\x20match\x20pattern\x20\x27','askArrayEntry','log\x20sink','409813RiqdHW','blue','editedResult','input','json','confirm','pop','isNaN','job:\x20\x27','\x20Example:\x20','InquirerHelper','length','grey','isUndefined','must\x20be\x20smaller\x20than\x20or\x20equal\x20to\x20','password','token','No\x20','./pagination/inquirer-pagination-prompt','found','trim','required','has','reset','__awaiter','then','YES','isObject','__createBinding','pipelines','33917590IUYoXv','defaultPaginationPageSize','fullName','loginPrompt','pipeline','builds','tokenPrompt','integer','value','bold','What\x20do\x20you\x20want\x20to\x20use\x20as','done','ask','No,\x20but\x20save\x20as\x20file','setPathVars','cmdPath','deleteWarningPrompt','template\x20run','nextPageCursor','call','default','\x20and\x20it\x20',',\x20supported\x20types:\x20[json|yaml|yml]','askForProjectScopedResource','Aborted.','retrievePayloadViaInteractiveCli','search-list','defineProperty','must\x20be\x20longer\x20than\x20or\x20equal\x20to\x20','getType','services','Default\x20project\x20in\x20context\x20not\x20set\x20and\x20no\x20argument\x20provided.','subdomains','job\x20build','fileName','WARNING:\x20You\x20are\x20about\x20to\x20delete\x20','5JdrcCX','js-yaml','8236102dAJKFu','askForProjectScopedResourcePaginated','this\x20option\x20is\x20required,\x20please\x20answer','\x20(startedAt:\x20','askForAddon','yaml','.*\x5c.(json|yaml|yml)$','validate','jobs','getOwnPropertyDescriptor','No,\x20edit','set','Enter\x20the\x20','whiteBright','askForSecret','data','domains','No,\x20abort','createdAt','writeFileSync','opt','fetchResourceList','find','type','values','enum','__esModule','Go\x20to\x20editor','ABORT','repeat','Context\x20name\x20already\x20exists.','askForPipeline','confirmationPrompt','askForSubdomain','propToType','.\x20This\x20is\x20irreversible.\x20Please\x20confirm!','success','138192FrmChP','slice','getInnerType','keys','must\x20be\x20a\x20valid\x20non-empty\x20json\x20string','items','oneOf','logSinks','addons','secret','rawObject','red','template','service','Choose\x20the\x20name\x20of\x20the\x20new\x20local\x20context:','prompt','askForResourcePaginated','string','inquirer-search-list','array','askForResource','map','greenBright','credentials','runs','confirmation','retry','cursor','askForDomain','\x20characters,\x20is\x20','create','./utils','./api-helpers','throw','test','description','askGeneric','pagination-prompt','includes','\x20(completedAt:\x20','templateRuns','Unexpected\x20file\x20type:\x20','__importDefault','job','assign','templates','saveFile','safeDump','addEntry','askForService','__importStar','maxLength','filter','domain\x20(','711AEixPh','warning','contextProvider','inquirer','isBoolean','choice','isValidJSON','\x20characters','SAVE','Choose\x20the\x20','minimum','minLength','editor','askForCredentials','getCurrentProjectName','underline','volumes'];a7H=function(){return HD;};return a7H();}(function(H){const e=a7Q;H[e(0x16a)]='Yes,\x20send',H[e(0x14b)]='No,\x20repeat',H[e(0x130)]=e(0x19e),H['SAVE']=e(0x17b),H['ABORT']=e(0x1a5);}(ConfirmChoices||(ConfirmChoices={})));class InquirerHelper{constructor(H){const O=a7Q;this[O(0x14c)]=H,this[O(0x16f)]=0x32,this['editPayload']=f=>__awaiter(this,void 0x0,void 0x0,function*(){const E=O,{editedResult:l}=yield inquirer[E(0x1c8)]([{'type':E(0xf9),'name':E(0x152),'message':E(0x1af),'default':yaml[E(0x1e8)](f)}]);return yaml[E(0x104)](l);}),this[O(0x1e7)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const S=O,l=n=>S(0x1e2)+n+S(0x184);function t(){return __awaiter(this,void 0x0,void 0x0,function*(){const A=a7f;return inquirer[A(0x1c8)]([{'type':'input','name':A(0x190),'message':A(0x13c),'validate':n=>new RegExp(A(0x19a))[A(0x1db)](n)?!![]:l(n)}]);});}const {fileName:b}=yield t(),i=b[S(0x107)]()[S(0x118)]('.')[S(0x156)]();try{switch(i){case S(0x154):(0x0,utils_1[S(0x1b8)])(S(0x131)+b);return fs[S(0x1a7)](b,JSON[S(0x138)](f,null,'\x20\x20'));case S(0x199):case'yml':(0x0,utils_1['success'])(S(0x131)+b);return fs[S(0x1a7)](b,yaml[S(0x1e8)](f));default:(0x0,utils_1[S(0xee)])(l(i));}}catch(n){(0x0,utils_1[S(0xee)])(S(0x13e)+n['message']);}return undefined;}),this[O(0x1ed)]=(f,l)=>t=>{const k=O,b=typeof t===k(0x1ca)?t[k(0x164)]():t;return l===![]&&b==='don\x27t\x20change'?'':b;},this[O(0x19b)]=(f,l,t)=>b=>{const h=O,i=[];if(b===''||b===h(0x12d)){if(l!==![])i[h(0x144)](h(0x196));else return!![];}f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0x10a)])&&i[h(0x144)](new RegExp(f['pattern'])[h(0x1db)](b)?!![]:h(0x14d)+f[h(0x10a)]+'\x27');f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0xf8)])&&i['push'](b['length']>=f['minLength']?!![]:h(0x18a)+f['minLength']+'\x20characters,\x20is\x20'+b[h(0x15b)]+h(0xf4));f[h(0x1ab)]===h(0x1ca)&&!_[h(0x15d)](f[h(0x1ec)])&&i['push'](b[h(0x15b)]<=f[h(0x1ec)]?!![]:h(0x128)+f[h(0x1ec)]+h(0x1d6)+b[h(0x15b)]+h(0xf4));t&&Number[h(0x157)](parseInt(b,0xa))&&i[h(0x144)](h(0x122)+b);f[h(0x1ab)]===h(0x175)&&!_[h(0x15d)](f[h(0xf7)])&&i[h(0x144)](b>=f['minimum']?!![]:h(0x149)+f[h(0xf7)]);f[h(0x1ab)]==='integer'&&!_[h(0x15d)](f[h(0x139)])&&i['push'](b<=f[h(0x139)]?!![]:h(0x15e)+f[h(0x139)]);if(f['type']==='rawObject'){const q=(0x0,utils_1[h(0xf3)])(b);i[h(0x144)](q===![]||_[h(0x10c)](q)?h(0x1bd):!![]);}const n=i[h(0x1ed)](w=>w!==!![]),r=(f===null||f===void 0x0?void 0x0:f[h(0x143)])?'\x0a'+chalk_1[h(0x182)][h(0x1c4)]('>>')+h(0x159)+chalk_1['default'][h(0x1a1)](JSON[h(0x138)](f['example'])):'';return n[h(0x15b)]>0x0?n[h(0x13a)](chalk_1['default'][h(0xfc)](h(0x183)))+r:!![];},this['getPathString']=(f,l,t)=>{const K=O,b=f[f[K(0x15b)]-0x1];function i(){const I=K;return f[I(0x1ba)](0x0,-0x1)[I(0x1ce)](q=>q[I(0x109)](0x0)['toUpperCase']()+q['slice'](0x1))[I(0x13a)]('>');}const n=f[K(0x15b)]>0x1?chalk_1['default'][K(0x101)][K(0x1a1)](i())+':\x20':'',r=t?'\x20('+chalk_1[K(0x182)][K(0x151)](t)+')':'';return chalk_1[K(0x182)][K(0x167)](''+n+l+'\x20'+chalk_1[K(0x182)][K(0x177)][K(0x1cf)](b)+r+'?');},this['askForResource']=(f,l,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const P=O;if(l[P(0x15b)]<0x1){const n=t?'for\x20this\x20'+t:P(0x163);throw new Error(P(0x161)+f+'\x20'+n+'.');}const b=P(0xf6)+f+P(0x119),i=l[P(0x15b)]>0x4?P(0x188):P(0x135);return(yield inquirer[P(0x1c8)]([{'type':i,'name':P(0x136),'message':b,'choices':l}]))[P(0x136)];}),this[O(0x1c9)]=(f,l,t)=>__awaiter(this,void 0x0,void 0x0,function*(){const Z=O,{elements:b,nextCursor:i}=yield l();if(b[Z(0x15b)]<0x1){const q=t?'for\x20this\x20'+t:Z(0x163);throw new Error(Z(0x161)+f+'\x20'+q+'.');}const n='Choose\x20the\x20'+f+Z(0x119);if(i!==undefined){const w=({nextPageCursor:Y})=>__awaiter(this,void 0x0,void 0x0,function*(){const W=Z,x=yield l(Y);return{'elements':x['elements'],'nextPageCursor':x[W(0x11f)]};});return(yield inquirer[Z(0x1c8)]([{'type':Z(0x1de),'name':Z(0x136),'message':n,'choices':b,'nextPageCursor':i,'loadMore':w}]))[Z(0x136)];}const r=b[Z(0x15b)]>0x4?Z(0x188):Z(0x135);return(yield inquirer['prompt']([{'type':r,'name':Z(0x136),'message':n,'choices':b}]))['name'];}),this[O(0x1dd)]=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const u=O,t=''+(l?'('+chalk_1[u(0x182)]['blue'](l)+')\x20':''),b=u(0x1a0)+chalk_1['default'][u(0x13f)](f)+'\x20'+t+'to\x20use:',i=this[u(0x19b)]({'type':u(0x1ca),'required':!![]});return(yield inquirer['prompt']([{'type':u(0x153),'name':u(0x136),'message':b,'validate':i}]))[u(0x136)];}),this[O(0x124)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const g=O;return(yield inquirer[g(0x1c8)]([{'type':g(0x155),'name':'name','message':f,'default':!![]}]))['name'];}),this[O(0x1ea)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const F=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const d=a7f;var i;const n=yield this[d(0x14c)]['list'][d(0x18c)]({'parameters':{'projectId':t},'options':{'per_page':this[d(0x16f)],'cursor':b}}),r=n[d(0x1a3)]['services'][d(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[d(0x137)])===null||i===void 0x0?void 0x0:i[d(0x1d4)]};});return this[F(0x195)](F(0x1c6),l,f);}),this[O(0x10f)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const a=O,f=l=>__awaiter(this,void 0x0,void 0x0,function*(){const p=a7f;var t;const b=yield this[p(0x14c)][p(0x135)][p(0x1e6)]({'options':{'per_page':this['defaultPaginationPageSize'],'cursor':l}}),i=b['data']['templates'][p(0x1ce)](n=>n['id']);return{'elements':i,'nextCursor':(t=b[p(0x137)])===null||t===void 0x0?void 0x0:t['cursor']};});return this[a(0x1c9)](a(0x1c5),f);}),this['askForTemplateRun']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const J=O;if(_[J(0x15d)](f))throw new Error('Template\x20id\x20not\x20provided.');const l=t=>__awaiter(this,void 0x0,void 0x0,function*(){const o=J;var b;let i=this[o(0x16f)];const n=yield this[o(0x14c)][o(0x135)]['templateRuns']({'parameters':{'templateId':f},'options':{'per_page':i,'cursor':t}}),r=n[o(0x1a3)][o(0x1e1)][o(0x1ce)](q=>q['id']+o(0x197)+q[o(0x1a6)]+')');return{'elements':r,'nextCursor':(b=n[o(0x137)])===null||b===void 0x0?void 0x0:b[o(0x1d4)]};});return this[J(0x1c9)](J(0x17f),l)[J(0x169)](t=>t['split']('\x20')[0x0]);}),this[O(0x13d)]=()=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const G=O,f=l=>__awaiter(this,void 0x0,void 0x0,function*(){const M=a7f;var t;let b=this['defaultPaginationPageSize'];const i=yield this[M(0x14c)][M(0x135)][M(0x1c0)]({'options':{'per_page':b,'cursor':l}}),n=i[M(0x1a3)][M(0x1c0)][M(0x1ce)](r=>r['id']);return{'elements':n,'nextCursor':(t=i[M(0x137)])===null||t===void 0x0?void 0x0:t['cursor']};});return this[G(0x1c9)](G(0x14f),f);}),this[O(0x1b3)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const z=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const N=a7f;var i;const n=yield this[N(0x14c)][N(0x135)]['pipelines']({'parameters':{'projectId':t},'options':{'per_page':this[N(0x16f)],'cursor':b}}),r=n[N(0x1a3)][N(0x16d)][N(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[N(0x137)])===null||i===void 0x0?void 0x0:i['cursor']};});return this[z(0x195)](z(0x172),l,f);}),this[O(0x126)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const R=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const v=a7f;var i;const n=yield this['apiClient']['list']['jobs']({'parameters':{'projectId':t},'options':{'per_page':this[v(0x16f)],'cursor':b}}),r=n['data'][v(0x19c)][v(0x1ce)](q=>q['id']);return{'elements':r,'nextCursor':(i=n[v(0x137)])===null||i===void 0x0?void 0x0:i['cursor']};});return this[R(0x195)]('job',l,f);}),this['askForJobRun']=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const y=O,t=b=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const s=a7f;var n;const r=yield this[s(0x14c)][s(0x123)][s(0x1e4)][s(0x1d1)]({'parameters':{'projectId':b,'jobId':f},'options':{'per_page':this[s(0x16f)],'cursor':i}}),q=r[s(0x1a3)][s(0x1d1)]['map'](w=>w['id']+s(0x197)+w[s(0x115)]+')');return{'elements':q,'nextCursor':(n=r[s(0x137)])===null||n===void 0x0?void 0x0:n[s(0x1d4)]};});return this[y(0x195)]('job\x20runs',t,l,y(0x158)+f+'\x27')['then'](b=>b[y(0x118)]('\x20')[0x0]);}),this[O(0xfe)]=(f,l,t)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H1=O;if(t!==undefined){const b=i=>n=>__awaiter(this,void 0x0,void 0x0,function*(){const H0=a7f;var r;const q=yield this[H0(0x14c)]['get'][H0(0x1e4)][H0(0x173)]({'parameters':{'projectId':i,'jobId':t},'options':{'per_page':this[H0(0x16f)],'cursor':n}});return{'elements':q[H0(0x1a3)][H0(0x173)][H0(0x1ce)](w=>w['id']+H0(0x197)+w[H0(0x1a6)]+')'),'nextCursor':(r=q[H0(0x137)])===null||r===void 0x0?void 0x0:r[H0(0x1d4)]};});return this['askForProjectScopedResourcePaginated']('job\x20builds',b,f,H1(0x158)+t+'\x27')[H1(0x169)](i=>i[H1(0x118)]('\x20')[0x0]);}if(l!==undefined){const i=n=>r=>__awaiter(this,void 0x0,void 0x0,function*(){const H2=H1;var q;const w=yield this[H2(0x14c)][H2(0x123)][H2(0x1c6)]['builds']({'parameters':{'projectId':n,'serviceId':l},'options':{'per_page':this[H2(0x16f)],'cursor':r}});return{'elements':w[H2(0x1a3)][H2(0x173)]['map'](Y=>Y['id']+H2(0x197)+Y[H2(0x1a6)]+')'),'nextCursor':(q=w['pagination'])===null||q===void 0x0?void 0x0:q[H2(0x1d4)]};});return this['askForProjectScopedResourcePaginated'](H1(0x18f),i,f,H1(0x11e)+t+'\x27')[H1(0x169)](n=>n['split']('\x20')[0x0]);}throw new Error(H1(0x11b));}),this[O(0x198)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H4=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const H3=a7f;var i;const n=yield this[H3(0x14c)][H3(0x135)][H3(0x1c1)]({'parameters':{'projectId':t},'options':{'per_page':this[H3(0x16f)],'cursor':b}});return{'elements':n['data'][H3(0x1c1)][H3(0x1ce)](r=>r['id']),'nextCursor':(i=n[H3(0x137)])===null||i===void 0x0?void 0x0:i[H3(0x1d4)]};});return this[H4(0x195)](H4(0x121),l,f);}),this[O(0x103)]=(f,l)=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H6=O,t=b=>i=>__awaiter(this,void 0x0,void 0x0,function*(){const H5=a7f;var n;const r=yield this[H5(0x14c)]['get'][H5(0x121)][H5(0x14a)]({'parameters':{'projectId':b,'addonId':l},'options':{'per_page':this['defaultPaginationPageSize'],'cursor':i}});return{'elements':r['data'][H5(0x14a)]['map'](q=>q['id']+H5(0x1e0)+(q[H5(0x105)]||'not\x20completed')+')'),'nextCursor':(n=r[H5(0x137)])===null||n===void 0x0?void 0x0:n[H5(0x1d4)]};});return this[H6(0x195)](H6(0x14a),t,f,H6(0x100)+l+'\x27')[H6(0x169)](b=>b[H6(0x118)]('\x20')[0x0]);}),this['askForVolume']=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const H8=O,l=t=>__awaiter(this,void 0x0,void 0x0,function*(){const H7=a7f;return(yield this[H7(0x14c)][H7(0x135)][H7(0xfd)]({'parameters':{'projectId':t}}))[H7(0x1a3)]['map'](b=>b['id']);});return this[H8(0x185)](H8(0x11c),l,f);}),this[O(0x1a2)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const HH=O,l=t=>b=>__awaiter(this,void 0x0,void 0x0,function*(){const H9=a7f;var i;const n=yield this[H9(0x14c)]['list'][H9(0x116)]({'parameters':{'projectId':t},'options':{'per_page':this[H9(0x16f)],'cursor':b}});return{'elements':n['data'][H9(0x116)][H9(0x1ce)](r=>r['id']),'nextCursor':(i=n['pagination'])===null||i===void 0x0?void 0x0:i[H9(0x1d4)]};});return this[HH(0x195)](HH(0x1c2),l,f);}),this[O(0x1b5)]=f=>()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hf=O,l=yield this[Hf(0x14c)]['get']['domain']({'parameters':{'domain':f}}),t=l[Hf(0x1a3)][Hf(0x18e)][Hf(0x1ce)](i=>i[Hf(0x136)]+'\x20(full\x20domain:\x20'+i[Hf(0x170)]+')'),b=Hf(0x1ee)+f+')';return this[Hf(0x1cd)]('subdomain',t,b)[Hf(0x169)](i=>i[Hf(0x118)]('\x20')[0x0]);}),this[O(0x17e)]=f=>__awaiter(this,void 0x0,void 0x0,function*(){const Hl=O;return(yield inquirer['prompt']([{'type':Hl(0x155),'name':Hl(0x1d2),'message':chalk_1['default'][Hl(0x12f)](Hl(0x191)+(f||'a\x20Northflank\x20resource')+Hl(0x1b7)),'default':![]}]))[Hl(0x1d2)];}),this[O(0x171)]=(f,l)=>__awaiter(this,void 0x0,void 0x0,function*(){const Ht=O;_[Ht(0x15d)](f[Ht(0x136)])&&(l['length']<=0x0?_[Ht(0x19f)](f,'name',Ht(0x182)):yield(0x0,utils_1[Ht(0x1d3)])(0xa)(()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hb=Ht,{name:t}=yield inquirer[Hb(0x1c8)]([{'type':Hb(0x153),'name':Hb(0x136),'message':Hb(0x1c7),'default':Hb(0x134)}]);if(!f[Hb(0x13b)]&&l['find'](b=>b[Hb(0x136)]===t)){const {c:b}=yield inquirer[Hb(0x1c8)]([{'type':Hb(0x155),'name':'c','message':Hb(0x141)+t+'\x27\x20already\x20exists.\x20Do\x20you\x20want\x20to\x20override\x20this\x20context\x20(y)\x20or\x20enter\x20a\x20new\x20name\x20(N)?','default':![]}]);if(b===![])throw new Error(Hb(0x1b2));_['set'](f,'override',!![]);}_[Hb(0x19f)](f,Hb(0x136),t);})));if(_['isUndefined'](f['token'])){const t=yield this[Ht(0x174)]();_[Ht(0x19f)](f,Ht(0x160),t);}return f;}),this['tokenPrompt']=()=>__awaiter(this,void 0x0,void 0x0,function*(){const Hi=O,{token:f}=yield inquirer['prompt']([{'type':Hi(0x15f),'name':Hi(0x160),'mask':'*','message':'Choose\x20the\x20login\x20token:'}]);return f;}),inquirer[O(0x11a)](O(0x188),inquirerSearchList),inquirer[O(0x11a)](O(0x1de),inquirer_pagination_prompt_1[O(0x120)]);}[a7Q(0x1b4)](H,f){return __awaiter(this,void 0x0,void 0x0,function*(){const Hn=a7f,l=yaml[Hn(0x1e8)](H),t=_[Hn(0xff)](l[Hn(0x118)]('\x0a')['map'](n=>n[Hn(0x15b)])),b=chalk_1[Hn(0x182)][Hn(0x15c)]('-'[Hn(0x1b1)](t)+'\x0a'),{confirm:i}=yield inquirer[Hn(0x1c8)]([{'type':Hn(0x135),'name':Hn(0x155),'message':''+chalk_1['default'][Hn(0x177)]['green'](Hn(0x142))+b+chalk_1[Hn(0x182)][Hn(0x114)](l)+b,'choices':Object[Hn(0x1ac)](ConfirmChoices)}]);switch(i){case ConfirmChoices[Hn(0x16a)]:return H;case ConfirmChoices[Hn(0x1b0)]:throw new Error(Hn(0x186));case ConfirmChoices[Hn(0x14b)]:return this[Hn(0x187)](f);case ConfirmChoices['EDIT']:return this['confirmationPrompt'](yield this['editPayload'](H),f);case ConfirmChoices[Hn(0xf5)]:yield this['saveFile'](H);return this['confirmationPrompt'](H,f);default:throw new Error(Hn(0x125));}});}[a7Q(0x187)](H,f){return __awaiter(this,void 0x0,void 0x0,function*(){const Hr=a7f;if((f===null||f===void 0x0?void 0x0:f[Hr(0x111)])!==undefined)this[Hr(0x111)]=f===null||f===void 0x0?void 0x0:f[Hr(0x111)];this['tmpCmdPath']=f===null||f===void 0x0?void 0x0:f[Hr(0x17d)];const l={};return yield this[Hr(0x1b6)]([],H[Hr(0x1a8)][Hr(0x113)],l),this[Hr(0x111)]=l,yield this['confirmationPrompt'](l,H);});}['propToType'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const Hq=a7f;let b;if(f[Hq(0x1bf)]&&!_[Hq(0x166)](f,'properties')){if(f['oneOf'][Hq(0x15b)]>0x1){const {choice:i}=yield inquirer[Hq(0x1c8)]([{'type':Hq(0x135),'name':Hq(0xf2),'message':Hq(0x145)+(H[H[Hq(0x15b)]-0x1]||'')+Hq(0x10b),'choices':f[Hq(0x1bf)][Hq(0x1ce)](n=>{const Hw=Hq;var r;return(r=n[Hw(0x1dc)])!==null&&r!==void 0x0?r:'??';})}]);b=yield this[Hq(0x18b)](H,f[Hq(0x1bf)][Hq(0x1aa)](n=>n[Hq(0x1dc)]===i),l,t);}else{const n=f[Hq(0x1bf)][0x0];_['set'](n,'description',f[Hq(0x1dc)]),b=yield this[Hq(0x18b)](H,n,l,t);}b={};}else b=yield this[Hq(0x18b)](H,f,l,t);return b;});}[a7Q(0x1bb)](H,f,l,t){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const HY=a7f;if(t===![]){const {addEntry:r}=yield inquirer[HY(0x1c8)]([{'type':HY(0x155),'name':HY(0x1e9),'message':this['getPathString'](f,HY(0x108),H===null||H===void 0x0?void 0x0:H[HY(0x1dc)]),'default':![]}]);if(!r)return l;}const i=Object[HY(0x1bc)]((b=H===null||H===void 0x0?void 0x0:H[HY(0x11d)])!==null&&b!==void 0x0?b:[]),n=H[HY(0x165)]||[];if(i['length']>0x0)for(const q of i){const w=f['concat'](q);if(f['length']>0x0&&!_['has'](l,f[HY(0x13a)]('.')))_[HY(0x19f)](l,f[HY(0x13a)]('.'),{});yield this[HY(0x1b6)](w,H[HY(0x11d)][q],l,n[HY(0x1df)](q));}else yield this['getType'](f,Object[HY(0x1e5)](Object[HY(0x1e5)]({},H),{'type':'rawObject'}),l,t);return l;});}[a7Q(0x14e)](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const Hx=a7f;if(f&&l)return!![];const b=f?'Do\x20you\x20want\x20to\x20add':Hx(0x10d),{addEntry:i}=yield inquirer['prompt']([{'type':'confirm','name':'addEntry','message':this['getPathString'](H,b,f?t:undefined),'default':![]}]);return i;});}[a7Q(0x18b)](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HU=a7f;let b;const i=H[HU(0x13a)]('.');switch(f===null||f===void 0x0?void 0x0:f['type']){case HU(0x1cc):{let n=!![];while(yield this[HU(0x14e)](H,n,t,f===null||f===void 0x0?void 0x0:f[HU(0x1dc)])){const r=_[HU(0x123)](l,i);_[HU(0x106)](l,i),yield this[HU(0x18b)](H,f[HU(0x1be)],l);const q=_[HU(0x123)](l,i);!_['isArray'](r)?_[HU(0x19f)](l,i,[q]):(r[HU(0x144)](q),_[HU(0x19f)](l,i,r)),n=![];}return b||[];}case'object':{return b=yield this[HU(0x1bb)](f,H,l,t),b;}case'rawObject':b=(0x0,utils_1[HU(0xf3)])(yield this[HU(0x17a)](H,f,t))||undefined;break;case HU(0x1ca):case HU(0x133):case HU(0x175):default:b=yield this[HU(0x17a)](H,f,t,l);break;}return!_[HU(0x15d)](b)&&_['set'](l,i,b),b;});}['ask'](H,f,l,t){var b;return __awaiter(this,void 0x0,void 0x0,function*(){const Hm=a7f,i=H[H[Hm(0x15b)]-0x1],{defaultValue:defaultValue=(b=f===null||f===void 0x0?void 0x0:f['example'])!==null&&b!==void 0x0?b:f===null||f===void 0x0?void 0x0:f[Hm(0x182)],choices:choices=f===null||f===void 0x0?void 0x0:f[Hm(0x1ad)],pagination:n}=yield(0x0,api_helpers_1[Hm(0x1a9)])(i,this[Hm(0x14c)],this['tmpCmdPath'],t,this[Hm(0x148)],H);let r='input';if(!_[Hm(0x15d)](choices)&&choices[Hm(0x15b)]>0x0){if(n!==undefined&&n[Hm(0x180)]!==undefined)r='pagination-prompt';else choices[Hm(0x15b)]>0x4&&typeof choices[0x0]==='string'?r=Hm(0x188):r=Hm(0x135);}else{if((f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])===Hm(0x133))r=Hm(0x155);else{if((f===null||f===void 0x0?void 0x0:f['type'])===Hm(0x175))r=Hm(0x153);else(f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])===Hm(0x1c3)&&(r=Hm(0xf9));}}let q=l!==![]?!_[Hm(0x16b)](defaultValue)?defaultValue:JSON['stringify'](defaultValue):_[Hm(0xf1)](defaultValue)?defaultValue:Hm(0x12d);if(choices)q=q[Hm(0x107)]();_['has'](this[Hm(0x111)],H[Hm(0x13a)]('.'))&&(q=this[Hm(0x111)][H['join']('.')]);const w=choices&&l===![]?[Hm(0x12d),...choices]:choices,Y=(f===null||f===void 0x0?void 0x0:f[Hm(0x1ab)])==='integer',x=Object[Hm(0x1e5)]({'type':r,'name':'id','message':this['getQuestionString'](H,f),'choices':w,'default':q,'filter':this[Hm(0x1ed)](r,l),'validate':this[Hm(0x19b)](f,l,Y)},n),U=(yield inquirer['prompt']([x]))['id'];if(U==='don\x27t\x20change'||U==='')return undefined;if(Y)return parseInt(U,0xa);return U;});}[a7Q(0x12c)](H,f){const HQ=a7Q,l=(f===null||f===void 0x0?void 0x0:f[HQ(0x1ab)])!==HQ(0x133)?HQ(0x178):'Should\x20it\x20be';return this['getPathString'](H,l,f===null||f===void 0x0?void 0x0:f[HQ(0x1dc)]);}['askForProject'](){return __awaiter(this,void 0x0,void 0x0,function*(){const HB=a7f,H=f=>__awaiter(this,void 0x0,void 0x0,function*(){const HL=a7f;var l;const t=yield this[HL(0x14c)]['list']['projects']({'options':{'per_page':this[HL(0x16f)],'cursor':f}}),b=t[HL(0x1a3)]['projects'][HL(0x1ce)](i=>i['id']);return{'elements':b,'nextCursor':(l=t[HL(0x137)])===null||l===void 0x0?void 0x0:l[HL(0x1d4)]};});return yield this[HB(0x1c9)](HB(0x110),H);});}['askForProjectScopedResource'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HT=a7f,b=l||this['apiClient']['contextProvider'][HT(0xfb)]();if(_['isUndefined'](b))throw new Error(HT(0x18d));const i=yield f(b);return yield this[HT(0x1cd)](H,i,(t?t+HT(0x147):'')+'project:\x20\x27'+b+'\x27');});}['askForProjectScopedResourcePaginated'](H,f,l,t){return __awaiter(this,void 0x0,void 0x0,function*(){const HX=a7f,b=l||this[HX(0x14c)][HX(0xef)][HX(0xfb)]();if(_[HX(0x15d)](b))throw new Error(HX(0x18d));const i=yield f(b);return yield this[HX(0x1c9)](H,i,(t?t+'\x20in\x20':'')+HX(0x129)+b+'\x27');});}[a7Q(0x1d5)](){return __awaiter(this,void 0x0,void 0x0,function*(){const HC=a7f,H=yield this[HC(0x14c)]['list'][HC(0x1a4)]({}),f=H['data']['domains']['map'](l=>l[HC(0x136)]);return this['askForResource'](HC(0x117),f);});}[a7Q(0xfa)](){return __awaiter(this,void 0x0,void 0x0,function*(){const Hj=a7f,H=yield this[Hj(0x14c)]['list']['registries']({}),f=H[Hj(0x1a3)][Hj(0x1d0)][Hj(0x1ce)](l=>l['id']);return this['askForResource'](Hj(0x1d0),f);});}[a7Q(0x17c)](H){const Hc=a7Q;this[Hc(0x148)]=H;}}exports['InquirerHelper']=InquirerHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a8c=a8f;(function(H,f){const j=a8f,l=H();while(!![]){try{const t=parseInt(j(0x210))/0x1*(-parseInt(j(0x1e1))/0x2)+-parseInt(j(0x1e5))/0x3*(-parseInt(j(0x1fb))/0x4)+parseInt(j(0x1e2))/0x5+-parseInt(j(0x20b))/0x6+-parseInt(j(0x214))/0x7+parseInt(j(0x1df))/0x8+parseInt(j(0x1dc))/0x9;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a8H,0xe9cf9));function a8H(){const a=['login-success','http:','/v1/cli-login','SIGINT','__importDefault','emit','duplex','parse','1476200mwyKud','init-ack','message','__esModule','end','value','then','https:','login-failure','init','Unable\x20to\x20open\x20browser:\x20','Login\x20process\x20stopped\x20before\x20completed','openBrowser','configurable','catch','__importStar','4595784OzWXIW','idle','defineProperty','toString','EventEmitter','55126wQpLrR','unable\x20to\x20parse\x20message:\x20','create','write','12107487cnpDRB','Failed\x20to\x20establish\x20connection\x20to\x20command\x20execution\x20proxy:\x20','open','getOwnPropertyDescriptor','wss:','Unexpected\x20response','exit','10797912qtxDkH','default','finally','5649288umpJrL','NorthflankApiBrowserLogin','16ekEHvA','8096615CTfXHw','startLogin','stringify','3MhYkPo','writable','baseUrl','status','__createBinding','browser-opened','initPackage','replace','events','handleError','apply','data','next','error'];a8H=function(){return a;};return a8H();}var __createBinding=this&&this[a8c(0x1e9)]||(Object[a8c(0x212)]?function(H,f,l,t){const D=a8c;if(t===undefined)t=l;var b=Object[D(0x217)](f,l);(!b||('get'in b?!f[D(0x1fe)]:b[D(0x1e6)]||b[D(0x208)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[D(0x20d)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a8c(0x212)]?function(H,f){const V=a8c;Object[V(0x20d)](H,V(0x1dd),{'enumerable':!![],'value':f});}:function(H,f){const e=a8c;H[e(0x1dd)]=f;}),__importStar=this&&this[a8c(0x20a)]||function(H){const O=a8c;if(H&&H[O(0x1fe)])return H;var f={};if(H!=null){for(var l in H)if(l!==O(0x1dd)&&Object['prototype']['hasOwnProperty']['call'](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const A=a8f;function r(Y){const E=a8f;try{w(t[E(0x1f1)](Y));}catch(x){n(x);}}function q(Y){try{w(t['throw'](Y));}catch(x){n(x);}}function w(Y){const S=a8f;Y['done']?i(Y[S(0x200)]):b(Y['value'])[S(0x201)](r,q);}w((t=t[A(0x1ef)](H,f||[]))['next']());});},__importDefault=this&&this[a8c(0x1f7)]||function(H){const k=a8c;return H&&H[k(0x1fe)]?H:{'default':H};};Object[a8c(0x20d)](exports,a8c(0x1fe),{'value':!![]}),exports[a8c(0x1e0)]=void 0x0;function a8f(H,f){const l=a8H();return a8f=function(t,b){t=t-0x1db;let i=l[t];return i;},a8f(H,f);}const ws_1=__importStar(require('ws')),open_1=__importDefault(require(a8c(0x216))),events_1=require(a8c(0x1ed));class NorthflankApiBrowserLogin extends events_1[a8c(0x20f)]{constructor(H,f=!![]){const h=a8c;super(),this['baseUrl']=H,this[h(0x207)]=f,this[h(0x1e8)]=h(0x20c),this[h(0x1eb)]=()=>JSON['stringify']({'type':h(0x204)});}[a8c(0x1e3)](){const K=a8c;var H;const f=this[K(0x1e7)][K(0x1ec)](K(0x202),K(0x218))['replace'](K(0x1f4),'ws:'),l=f+K(0x1f5),t=new ws_1['default'](l),b=()=>__awaiter(this,void 0x0,void 0x0,function*(){const P=K;yield new Promise(n=>{const I=a8f;var r;(r=this['duplex'])===null||r===void 0x0?void 0x0:r[I(0x1ff)](JSON['stringify']({'type':'aborted'}),()=>n());}),process[P(0x1db)]();}),i=new Promise((n,r)=>{const Z=K;var q,w,Y;try{this[Z(0x1f9)]=(0x0,ws_1['createWebSocketStream'])(t),process['on'](Z(0x1f6),b);}catch(x){r(new Error(Z(0x215)+x[Z(0x1fd)]));}(q=this['duplex'])===null||q===void 0x0?void 0x0:q['on'](Z(0x1f0),U=>{const W=Z;var m;const Q=JSON[W(0x1fa)](U[W(0x20e)]());switch(Q===null||Q===void 0x0?void 0x0:Q['type']){case W(0x1fc):{const {loginPage:L}=Q;if(L===undefined){this[W(0x1ee)](W(0x219),r);return;}this[W(0x207)]&&(0x0,open_1[W(0x1dd)])(L)[W(0x209)](B=>{const u=W,T=u(0x205)+B[u(0x1fd)];this[u(0x1ee)](T,r);});this[W(0x1f8)](W(0x1ea),{'url':L});break;}case W(0x1f3):{const {apiToken:B,contextName:T}=Q;if(B===undefined){this[W(0x1ee)]('Unexpected\x20response,\x20api\x20token\x20missing',r);return;}(m=this[W(0x1f9)])===null||m===void 0x0?void 0x0:m[W(0x1ff)](),n({'token':B,'contextName':T}),this[W(0x1e8)]='success';break;}case W(0x203):{const X='Failure\x20during\x20login:\x20'+(Q===null||Q===void 0x0?void 0x0:Q['message']);this[W(0x1ee)](X,r);break;}default:{const C=W(0x211)+JSON[W(0x1e4)](Q);this[W(0x1ee)](C,r);}}}),(w=this[Z(0x1f9)])===null||w===void 0x0?void 0x0:w['on'](Z(0x1f2),U=>{const g=Z;this['handleError']('error\x20happened\x20during\x20browser\x20login:\x20'+U[g(0x1fd)],r);}),(Y=this[Z(0x1f9)])===null||Y===void 0x0?void 0x0:Y['on'](Z(0x1ff),()=>{const d=Z;if(this[d(0x1e8)]==='success'){}else this[d(0x1ee)](d(0x206),r);});});return(H=this[K(0x1f9)])===null||H===void 0x0?void 0x0:H[K(0x213)](this[K(0x1eb)]()),this[K(0x1e8)]='init',i[K(0x1de)](()=>{const F=K;process['removeListener'](F(0x1f6),b);});}[a8c(0x1ee)](H,f){const p=a8c;var l,t;f?(l=this[p(0x1f9)])===null||l===void 0x0?void 0x0:l[p(0x1ff)](()=>f(new Error(H))):(t=this[p(0x1f9)])===null||t===void 0x0?void 0x0:t[p(0x1ff)](),this[p(0x1e8)]=p(0x1f2);}}exports[a8c(0x1e0)]=NorthflankApiBrowserLogin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a9B=a9f;(function(H,f){const U=a9f,l=H();while(!![]){try{const t=-parseInt(U(0x95))/0x1+parseInt(U(0x8c))/0x2*(-parseInt(U(0x96))/0x3)+parseInt(U(0x79))/0x4*(parseInt(U(0x88))/0x5)+parseInt(U(0x8b))/0x6+-parseInt(U(0x99))/0x7+parseInt(U(0x9c))/0x8+parseInt(U(0x84))/0x9*(parseInt(U(0x9e))/0xa);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a9H,0xc414f));function a9f(H,f){const l=a9H();return a9f=function(t,b){t=t-0x75;let i=l[t];return i;},a9f(H,f);}var __awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const L=a9f;function r(Y){const m=a9f;try{w(t[m(0x90)](Y));}catch(x){n(x);}}function q(Y){try{w(t['throw'](Y));}catch(x){n(x);}}function w(Y){const Q=a9f;Y[Q(0x93)]?i(Y['value']):b(Y[Q(0x9f)])[Q(0x9d)](r,q);}w((t=t[L(0x75)](H,f||[]))['next']());});},__importDefault=this&&this[a9B(0x7f)]||function(H){const T=a9B;return H&&H[T(0x7a)]?H:{'default':H};};Object[a9B(0x91)](exports,'__esModule',{'value':!![]}),exports[a9B(0x77)]=void 0x0;function a9H(){const e=['opt','map','next','defineProperty','realLength','done','choices','1096487OzzSol','54DYaTxk','selected','default','5665758OysARd','inquirer/lib/objects/choice','loadMore','1082848XYWoDp','then','28538590LdwZxU','value','apply','onUpKey','DynamicReloadPaginationPrompt','handleDynamicPageLoad','28828pDMWSX','__esModule','dir\x20must\x20be\x20up\x20or\x20down','loop','pagOpt','reloadText','__importDefault','down','..\x20Load\x20more\x20options\x20..','push','splice','9BDSxsY','render','onDownKey','length','415tMqieJ','loading','nextPageCursor','2026188BSwBUv','135118eaSGif','\x20Loading\x20more\x20options'];a9H=function(){return e;};return a9H();}const list_1=__importDefault(require('inquirer/lib/prompts/list')),choice_1=__importDefault(require(a9B(0x9a))),chalk_1=__importDefault(require('chalk'));function incrementListIndex(H,f,l){const X=a9B,t=l[X(0x94)][X(0x92)],b=X(0x7c)in l?Boolean(l[X(0x7c)]):!![];if(f==='up'){if(H>0x0)return H-0x1;return b?t-0x1:H;}if(f===X(0x80)){if(H<t-0x1)return H+0x1;return b?0x0:H;}throw new Error(X(0x7b));}class DynamicReloadPaginationPrompt extends list_1[a9B(0x98)]{constructor(H,f,l){const C=a9B;super(H,f,l),this[C(0x7e)]=chalk_1['default']['italic'](C(0x81)),this[C(0x89)]=![],this[C(0x7d)]=this[C(0x8e)],this['nextPageCursor']=this[C(0x7d)]['nextPageCursor'],this[C(0x8a)]!==undefined&&this[C(0x8e)][C(0x94)][C(0x82)](new choice_1[(C(0x98))](this[C(0x7e)],this[C(0x7e)]));}[a9B(0x76)](){const j=a9B;if(this[j(0x89)])return;this[j(0x97)]=incrementListIndex(this[j(0x97)],'up',this[j(0x8e)]),this[j(0x85)]();}[a9B(0x86)](){return __awaiter(this,void 0x0,void 0x0,function*(){const c=a9f;if(this[c(0x89)])return;this[c(0x97)]=incrementListIndex(this['selected'],c(0x80),this['opt']),yield this[c(0x78)](),this[c(0x85)]();});}['handleDynamicPageLoad'](){return __awaiter(this,void 0x0,void 0x0,function*(){const D=a9f;if(this[D(0x97)]>=this['opt'][D(0x94)]['length']-0x1){if(this['nextPageCursor']===undefined)return;this['loading']=!![];let H=0x0;const f=setInterval(()=>{const V=D,n=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'],r=chalk_1[V(0x98)]['italic'](n[H%n[V(0x87)]]+V(0x8d));this[V(0x8e)]['choices'][V(0x94)][this[V(0x97)]]['name']=''+r,H+=0x1,this[V(0x85)]();},0x50),{elements:l,nextPageCursor:t}=yield this[D(0x7d)][D(0x9b)]({'nextPageCursor':this[D(0x8a)]})['catch'](()=>({'elements':[],'nextPageCursor':undefined}));this['nextPageCursor']=t;const b=l[D(0x8f)](n=>new choice_1[(D(0x98))](n,n));this[D(0x8e)][D(0x94)][D(0x94)][D(0x83)](this['selected'],0x1),this[D(0x8e)][D(0x94)][D(0x82)](...b),t!==undefined&&this[D(0x8e)][D(0x94)][D(0x82)](new choice_1[(D(0x98))](this[D(0x7e)],this[D(0x7e)])),clearInterval(f),this[D(0x89)]=![];}});}}exports['DynamicReloadPaginationPrompt']=DynamicReloadPaginationPrompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a10W=a10G;(function(l,G){const d=a10G,s=l();while(!![]){try{const I=parseInt(d(0xe2))/0x1+parseInt(d(0x10f))/0x2+parseInt(d(0x119))/0x3*(parseInt(d(0xf6))/0x4)+-parseInt(d(0xcf))/0x5*(parseInt(d(0xbb))/0x6)+parseInt(d(0x11f))/0x7*(parseInt(d(0xdb))/0x8)+parseInt(d(0xd3))/0x9*(parseInt(d(0x108))/0xa)+parseInt(d(0x122))/0xb*(-parseInt(d(0x111))/0xc);if(I===G)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(a10l,0xaa0ab));var __createBinding=this&&this[a10W(0xd2)]||(Object[a10W(0x11c)]?function(l,G,s,I){const B=a10W;if(I===undefined)I=s;var z=Object[B(0xb8)](G,s);(!z||('get'in z?!G[B(0xf4)]:z[B(0xd4)]||z[B(0xc9)]))&&(z={'enumerable':!![],'get':function(){return G[s];}}),Object[B(0xc5)](l,I,z);}:function(l,G,s,I){if(I===undefined)I=s;l[I]=G[s];}),__setModuleDefault=this&&this[a10W(0xf7)]||(Object[a10W(0x11c)]?function(l,G){Object['defineProperty'](l,'default',{'enumerable':!![],'value':G});}:function(l,G){const R=a10W;l[R(0xfb)]=G;}),__importStar=this&&this[a10W(0x113)]||function(l){const y=a10W;if(l&&l[y(0xf4)])return l;var G={};if(l!=null){for(var s in l)if(s!==y(0xfb)&&Object[y(0xfd)][y(0x12b)][y(0xc2)](l,s))__createBinding(G,l,s);}return __setModuleDefault(G,l),G;},__awaiter=this&&this['__awaiter']||function(l,G,s,I){function z(X){return X instanceof s?X:new s(function(N){N(X);});}return new(s||(s=Promise))(function(X,N){const Q=a10G;function A(p){const K=a10G;try{n(I[K(0xec)](p));}catch(m){N(m);}}function a(p){const i=a10G;try{n(I[i(0x128)](p));}catch(m){N(m);}}function n(p){const J=a10G;p['done']?X(p[J(0x10a)]):z(p['value'])[J(0x12d)](A,a);}n((I=I[Q(0x109)](l,G||[]))[Q(0xec)]());});},__importDefault=this&&this['__importDefault']||function(l){const r=a10W;return l&&l[r(0xf4)]?l:{'default':l};};function a10G(l,G){const s=a10l();return a10G=function(I,z){I=I-0xb5;let X=s[I];return X;},a10G(l,G);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a10W(0xcd)]=void 0x0;function a10l(){const g=['Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','__importStar','description','forwardAddon','message','project\x20for\x20forwarding','\x20with\x20these\x20hostnames:','6471ecPxOg','protocol','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','create','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','port','8713873fqyvlB','http://','all','286gAnffs','assertContextExisting','hostnames','addCommand','fwd','Port-forwarding\x20for\x20the\x20specified\x20addon','throw','getCurrentServiceName','canExecuteWithHostnames','hasOwnProperty','--skipHostnames','then','\x20\x20Running\x20on\x20macOS\x20in\x20','green','chalk','../inquirer-helper','getOwnPropertyDescriptor','forwardProject','noDefaultsText','5882454gWzVNf','Service\x20to\x20forward','platform','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20your\x20','getCommand','warning','apiClient','call','customUserAgent','@northflank/js-client','defineProperty','getCurrentProjectName','stop','name','configurable','\x20for\x20these\x20hostnames:','ApiClient','Forwarding\x20service\x20','CliPortForward','type','5PrcNTV','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','Port-forwarding\x20for\x20the\x20specified\x20service','__createBinding','414qLICoK','writable','forward','bold','Project\x20for\x20forwarding','win32','--noDefaults','\x20in\x20project\x20','8YjpsYY','askForProject','alias','darwin','addon','askForAddon','address','1293721lTgveT','--service\x20--serviceId\x20[NAME]','tunnel-close','\x20to\x20','\x20on\x20','getProxyForwarder','SIGINT','option','C:/Windows/System32/drivers/etc/hosts','--project\x20--projectId\x20[NAME]','next','length','join','\x20addon\x20ports','skipHostnamesText','Failed:\x20','log','InquirerHelper','__esModule','action','1700EdCftq','__setModuleDefault','Stop\x20forwarding\x20traffic\x20from\x20','error','\x20and\x20','default','tunnel-open','prototype','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','service','Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27','\x20service\x20ports','Forwarding\x20','forEach','HTTP','--addon\x20--addonId\x20[NAME]','Forwarding\x20addon\x20','251450yQkUac','apply','value','success','askForService','portFwdCmd','/etc/hosts','1679926PNgmWu','\x20\x20\x20\x20\x20\x20\x20\x20\x20','1742316BpyMQP'];a10l=function(){return g;};return a10l();}const js_client_1=require(a10W(0xc4)),chalk_1=__importDefault(require(a10W(0xb6))),utils_1=require('../utils'),inquirer_helper_1=require(a10W(0xb7)),os=__importStar(require('os'));class CliPortForward{constructor(l){const E=a10W;this['noDefaultsText']=E(0x11d),this[E(0xf0)]=E(0xd0),this[E(0xc1)]=new js_client_1[(E(0xcb))](l,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[E(0xc3)]});const G=new inquirer_helper_1[(E(0xf3))](this[E(0xc1)]);this[E(0x10d)]=(0x0,utils_1[E(0xbf)])()[E(0xc8)](E(0xd5))[E(0xdd)](E(0x126))[E(0x114)](E(0x112));const s=(0x0,utils_1[E(0xbf)])(!![])['name']('all')[E(0x114)]('Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project')[E(0xe9)](E(0xeb),E(0x117))[E(0xe9)](E(0xd9),this[E(0xba)],![])[E(0xe9)](E(0x12c),this[E(0xf0)],![])['action'](({noDefaults:X,projectId:N,skipHostnames:A})=>__awaiter(this,void 0x0,void 0x0,function*(){const V=E;(0x0,utils_1[V(0x123)])(this[V(0xc1)]);const a=this[V(0xe7)](A),n=X?undefined:l[V(0xc6)](),p=N||n||(yield G[V(0xdc)]());try{const {services:m,addons:D}=yield a[V(0xb9)]({'projectId':p},A);m['length']+D[V(0xed)]<=0x0?(0x0,utils_1[V(0xc0)])(V(0x11b)+chalk_1['default'][V(0xd6)](p)):(console[V(0xf2)](V(0x103)+chalk_1[V(0xfb)]['green'][V(0xd6)](m['length']+V(0x102))+V(0xfa)+chalk_1['default'][V(0xb5)][V(0xd6)](D[V(0xed)]+V(0xef))+'\x20in\x20project\x20'+chalk_1[V(0xfb)][V(0xd6)](p)),yield Promise[V(0x121)]([...m,...D]));}catch(o){(0x0,utils_1[V(0xf9)])(V(0xf1)+o[V(0x116)]);}})),I=(0x0,utils_1[E(0xbf)])(!![])[E(0xc8)](E(0x100))[E(0x114)](E(0xd1))[E(0xe9)](E(0xeb),E(0xd7))[E(0xe9)](E(0xe3),E(0xbc))[E(0xe9)]('--noDefaults',this[E(0xba)],![])['option'](E(0x12c),this[E(0xf0)],![])[E(0xf5)](({noDefaults:X,projectId:N,serviceId:A,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const M=E;(0x0,utils_1[M(0x123)])(this['apiClient']);const n=this[M(0xe7)](a),p=X?undefined:l[M(0xc6)](),m=N||p||(yield G[M(0xdc)]()),D=X?undefined:l[M(0x129)](),o=A||D||(yield G[M(0x10c)](m)());console[M(0xf2)](M(0xcc)+chalk_1['default'][M(0xd6)](o)+M(0xda)+chalk_1['default'][M(0xd6)](m));try{yield n['forwardService']({'projectId':m,'serviceId':o},a);}catch(T){(0x0,utils_1[M(0xf9)])('Failed:\x20'+T[M(0x116)]);}})),z=(0x0,utils_1['getCommand'])(!![])['name'](E(0xdf))['description'](E(0x127))[E(0xe9)](E(0xeb),E(0xd7))['option'](E(0x106),'Addon\x20to\x20forward')[E(0xe9)]('--skipHostnames',this[E(0xf0)],![])[E(0xf5)](({noDefaults:X,projectId:N,addonId:A,skipHostnames:a})=>__awaiter(this,void 0x0,void 0x0,function*(){const e=E;(0x0,utils_1[e(0x123)])(this[e(0xc1)]);const n=this[e(0xe7)](a),p=X?undefined:l[e(0xc6)](),m=N||p||(yield G[e(0xdc)]()),D=A||(yield G[e(0xe0)](m)());console[e(0xf2)](e(0x107)+chalk_1['default'][e(0xd6)](D)+e(0xda)+chalk_1[e(0xfb)][e(0xd6)](m));try{yield n[e(0x115)]({'projectId':m,'addonId':D},a);}catch(o){(0x0,utils_1[e(0xf9)])(e(0xf1)+o[e(0x116)]);}}));this['portFwdCmd'][E(0x125)](s),this[E(0x10d)][E(0x125)](I),this[E(0x10d)]['addCommand'](z);}['getProxyForwarder'](l=![]){const w=a10W,G=this['apiClient']['forwarding'];if(!l){const s=G[w(0x12a)]();if(s[w(0xf9)])throw new Error(s[w(0x116)]);}return G['on'](w(0xfc),(I,z)=>{const q=w,X=chalk_1[q(0xfb)]['greenBright'][q(0xd6)](z[q(0xce)]+'\x20\x27'+z['id']+'\x27'),N=z[q(0x124)]['length']>0x0,A=''+(!l?q(0x118):'.'),a=z['protocol']===q(0x105)?q(0x120):'';(0x0,utils_1['success'])('Exposing\x20'+X+q(0xe6)+z[q(0xe1)]+':'+z[q(0x11e)]+'\x20('+z[q(0x11a)]+')'+A);if(!l)z[q(0x124)][q(0x104)](n=>{const O=q;(0x0,utils_1[O(0x10b)])('\x20\x20'+a+n+':'+z[O(0x11e)]);});else{if(N){const n=process[q(0xbd)]===q(0xd8),p=os[q(0xbd)]()===q(0xde),m=n?q(0xea):q(0x10e),D=chalk_1[q(0xfb)]['bold']('skipHostnames'),o=p?q(0x12e)+D+q(0xbe)+z['type']+'.':undefined;let T='\x20\x20Running\x20in\x20'+D+q(0xff)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+m+'):';if(o!==undefined)(0x0,utils_1[q(0xc0)])(o);(0x0,utils_1['warning'])(T),console[q(0xf2)](z['address']+q(0x110)+z[q(0x124)][q(0xee)]('\x20'));}}(0x0,utils_1[q(0x10b)])('');}),G['on'](w(0xe4),(I,z)=>{const U=w,X=chalk_1['default']['greenBright'][U(0xd6)](z[U(0xce)]+'\x20\x27'+z['id']+'\x27'),N=z[U(0x124)][U(0xed)]>0x0,A=''+(!l?U(0xca):'.');(0x0,utils_1[U(0xc0)])(U(0xf8)+z['address']+':'+z[U(0x11e)]+U(0xe5)+X+A);if(!l)z['hostnames'][U(0x104)](a=>{const Z=U;(0x0,utils_1[Z(0xc0)])('\x20\x20'+a+':'+z['port']);});else N&&(0x0,utils_1['warning'])(U(0xfe));(0x0,utils_1['warning'])('');}),G['on']('connection-error',(I,z,X)=>{const v=w;(0x0,utils_1[v(0xc0)])(v(0x101)+z[v(0xe1)]+':'+z['port']+'\x27:\x20\x22'+(X===null||X===void 0x0?void 0x0:X[v(0x116)])+'\x22');}),process['on'](w(0xe8),()=>__awaiter(this,void 0x0,void 0x0,function*(){const S=w;try{yield G[S(0xc7)]();}catch(I){(0x0,utils_1[S(0xf9)])('Cleaning\x20up\x20open\x20connections\x20failed:\x20'+I['message']);}finally{process['exit']();}})),G;}}exports['CliPortForward']=CliPortForward;
|
|
1
|
+
'use strict';function a10f(H,f){const l=a10H();return a10f=function(t,b){t=t-0x6b;let i=l[t];return i;},a10f(H,f);}const a10O=a10f;(function(H,f){const e=a10f,l=H();while(!![]){try{const t=-parseInt(e(0xcb))/0x1+parseInt(e(0xa5))/0x2*(-parseInt(e(0xa6))/0x3)+-parseInt(e(0xed))/0x4+-parseInt(e(0x83))/0x5*(-parseInt(e(0x6f))/0x6)+parseInt(e(0x7f))/0x7+parseInt(e(0xdd))/0x8+parseInt(e(0x98))/0x9;if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a10H,0x326f9));var __createBinding=this&&this['__createBinding']||(Object[a10O(0x7e)]?function(H,f,l,t){const E=a10O;if(t===undefined)t=l;var b=Object[E(0xb9)](f,l);(!b||(E(0x87)in b?!f[E(0x84)]:b['writable']||b[E(0xaf)]))&&(b={'enumerable':!![],'get':function(){return f[l];}}),Object[E(0x6c)](H,t,b);}:function(H,f,l,t){if(t===undefined)t=l;H[t]=f[l];}),__setModuleDefault=this&&this[a10O(0xa9)]||(Object[a10O(0x7e)]?function(H,f){const S=a10O;Object['defineProperty'](H,S(0x78),{'enumerable':!![],'value':f});}:function(H,f){H['default']=f;}),__importStar=this&&this[a10O(0xb2)]||function(H){const A=a10O;if(H&&H[A(0x84)])return H;var f={};if(H!=null){for(var l in H)if(l!==A(0x78)&&Object[A(0xcd)][A(0xdc)][A(0xc9)](H,l))__createBinding(f,H,l);}return __setModuleDefault(f,H),f;},__awaiter=this&&this['__awaiter']||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const I=a10f;function r(Y){const k=a10f;try{w(t[k(0xd6)](Y));}catch(x){n(x);}}function q(Y){const h=a10f;try{w(t[h(0x70)](Y));}catch(x){n(x);}}function w(Y){const K=a10f;Y[K(0x91)]?i(Y[K(0xe8)]):b(Y[K(0xe8)])['then'](r,q);}w((t=t[I(0xc4)](H,f||[]))[I(0xd6)]());});},__importDefault=this&&this['__importDefault']||function(H){const P=a10O;return H&&H[P(0x84)]?H:{'default':H};};function a10H(){const H0=['entries','port','portName','data.id','\x27:\x20\x22','6244704WZHHEs','option','message','forwardProject','noDefaultsText','Forwarding\x20','Port-forwarding\x20for\x20the\x20specified\x20service','Only\x20expose\x20on\x20IP\x20address,\x20not\x20on\x20hostnames.\x20With\x20this\x20option,\x20no\x20root\x20permissions\x20are\x20required.','CliPortForward','Cleaning\x20up\x20open\x20connections\x20failed:\x20','join','printHostsFileHint','connection-error','2UNQqnu','938325fWDcSD','SIGINT','printForwardingInfo','__setModuleDefault','Forwarding\x20addon\x20','win32','\x20with\x20multiple\x20ports:','No\x20services\x20and\x20addons\x20to\x20forward\x20found\x20in\x20project\x20','Forwarding\x20service\x20','configurable','\x20is\x20running\x20and\x20reachable.','--noDefaults','__importStar','flatMap','customUserAgent','repeat','service','\x20-\x20','--skipHostnames','getOwnPropertyDescriptor','\x20in\x20project\x20','Addon\x20to\x20forward','Failed:\x20','error','flat','\x20is\x20exposed\x20with\x20multiple\x20','capitalize','protocol','apiClient','/etc/hosts','apply','uniqBy','greenBright','stop','forwardAddon','call','assertContextExisting','396061PPFuXP','Error\x20occured\x20while\x20trying\x20to\x20forward\x20','prototype','name','portFwdCmd','lodash','Port-forwarding\x20for\x20all\x20services\x20and\x20addons\x20in\x20the\x20given\x20project','uniq','green','log','skipHostnamesText','next','type','hostnames','addon','\x20mode.\x20If\x20hostname\x20forwarding\x20is\x20required,\x20remove\x20','success','hasOwnProperty','2840xMtwFG','\x20mode:\x20the\x20locally\x20forwarded\x20port\x20differs\x20from\x20the\x20actual\x20port\x20on\x20the\x20forwarded\x20service/addon.','Don\x27t\x20use\x20context\x20default\x20values,\x20explicitly\x20use\x20options\x20or\x20ask.','C:/Windows/System32/drivers/etc/hosts','getCurrentProjectName','\x20addon\x20ports','askForProject','../utils','description','\x20is\x20exposed\x20on\x20','fwd','value','\x20\x20-\x20Address:\x20','warning','askForAddon','Running\x20in\x20','1097248UIOWTx','Services:','\x20\x20\x20No\x20running\x20container\x20found\x20for\x20','black','defineProperty','alias','\x20\x20-\x20port\x20','1458usPtFh','throw','action','askForService','addCommand','getProxyForwarder','http://','--project\x20--projectId\x20[NAME]','getCommand','default','\x20\x20If\x20you\x20have\x20added\x20entries\x20to\x20your\x20hosts\x20file,\x20it\x20is\x20recommended\x20to\x20remove\x20them\x20again\x20now.','Running\x20on\x20macOS\x20in\x20','data','Project\x20for\x20forwarding','Port-forwarding\x20for\x20Northflank\x20services\x20and\x20addons.','create','2825676XIjyEt','forEach','../inquirer-helper','\x20to\x20','1890USsFJL','__esModule','\x20and\x20','filter','get','--service\x20--serviceId\x20[NAME]','bold','--addon\x20--addonId\x20[NAME]','map','\x20with\x20these\x20hostnames:','Stop\x20forwarding\x20traffic\x20from\x20','forwardService','length','platform','done','address'];a10H=function(){return H0;};return a10H();}Object[a10O(0x6c)](exports,a10O(0x84),{'value':!![]}),exports[a10O(0xa0)]=void 0x0;const js_client_1=require('@northflank/js-client'),chalk_1=__importDefault(require('chalk')),utils_1=require(a10O(0xe4)),inquirer_helper_1=require(a10O(0x81)),os=__importStar(require('os')),lodash_1=require(a10O(0xd0)),{EOL}=require('os');class CliPortForward{constructor(H){const Z=a10O;this['noDefaultsText']=Z(0xdf),this['skipHostnamesText']=Z(0x9f),this[Z(0xc2)]=new js_client_1['ApiClient'](H,{'throwErrorOnHttpErrorCode':!![],'customUserAgent':utils_1[Z(0xb4)]});const f=new inquirer_helper_1['InquirerHelper'](this[Z(0xc2)]);this[Z(0xcf)]=(0x0,utils_1[Z(0x77)])()[Z(0xce)]('forward')[Z(0x6d)](Z(0xe7))[Z(0xe5)](Z(0x7d));const l=(0x0,utils_1['getCommand'])(!![])[Z(0xce)]('all')[Z(0xe5)](Z(0xd1))['option'](Z(0x76),'project\x20for\x20forwarding')[Z(0x99)](Z(0xb1),this[Z(0x9c)],![])[Z(0x99)]('--skipHostnames',this[Z(0xd5)],![])[Z(0x71)](({noDefaults:i,projectId:n,skipHostnames:r})=>__awaiter(this,void 0x0,void 0x0,function*(){const W=Z;(0x0,utils_1[W(0xca)])(this[W(0xc2)]);const q=this[W(0x74)](r),w=i?undefined:H[W(0xe1)](),Y=n||w||(yield f['askForProject']());try{const {services:x,addons:U}=yield q[W(0x9b)]({'projectId':Y},r);if(x[W(0x8f)]+U[W(0x8f)]<=0x0)(0x0,utils_1[W(0xea)])(W(0xad)+chalk_1['default']['bold'](Y));else{const m=x[W(0x86)](B=>B[W(0x8f)]>0x0)[W(0x8f)],Q=U['filter'](B=>B[W(0x8f)]>0x0)[W(0x8f)],L=W(0xba)+chalk_1[W(0x78)][W(0x89)](Y);console['log'](W(0x9d)+chalk_1[W(0x78)][W(0xd3)][W(0x89)](m+'\x20service\x20ports')+W(0x85)+chalk_1[W(0x78)][W(0xd3)][W(0x89)](Q+W(0xe2))+L),console[W(0xd4)](),console[W(0xd4)](chalk_1[W(0x78)]['bold'](W(0xee))),x[W(0x80)](B=>{const u=W;if(B[u(0x8f)]>=0x1&&!B[0x0][u(0xbd)])this[u(0xa8)](B,{'type':u(0xb6),'name':B[0x0]['data']['id']},r);}),console[W(0xd4)](chalk_1[W(0x78)][W(0x89)]('Addons:')),U[W(0x80)](B=>{const g=W;if(B['length']>=0x1&&!B[0x0][g(0xbd)])this[g(0xa8)](B,{'type':g(0xd9),'name':B[0x0][g(0x7b)]['id']},r);}),this['printHostsFileHint']([...x[W(0xbe)](),...U[W(0xbe)]()],r);}}catch(B){(0x0,utils_1[W(0xbd)])(W(0xbc)+B[W(0x9a)]);}})),t=(0x0,utils_1[Z(0x77)])(!![])['name'](Z(0xb6))['description'](Z(0x9e))[Z(0x99)](Z(0x76),Z(0x7c))['option'](Z(0x88),'Service\x20to\x20forward')[Z(0x99)]('--noDefaults',this[Z(0x9c)],![])[Z(0x99)](Z(0xb8),this['skipHostnamesText'],![])[Z(0x71)](({noDefaults:i,projectId:n,serviceId:r,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const d=Z;(0x0,utils_1[d(0xca)])(this[d(0xc2)]);const w=this[d(0x74)](q),Y=i?undefined:H['getCurrentProjectName'](),x=n||Y||(yield f[d(0xe3)]()),U=i?undefined:H['getCurrentServiceName'](),m=r||U||(yield f[d(0x72)](x)());console['log'](d(0xae)+chalk_1[d(0x78)][d(0x89)](m)+d(0xba)+chalk_1[d(0x78)][d(0x89)](x));try{const Q=yield w[d(0x8e)]({'projectId':x,'serviceId':m},q);this['printForwardingInfo'](Q,{'name':m,'type':d(0xb6)},q),this[d(0xa3)](Q,q);}catch(L){(0x0,utils_1[d(0xbd)])(d(0xbc)+L[d(0x9a)]);}})),b=(0x0,utils_1[Z(0x77)])(!![])['name'](Z(0xd9))[Z(0xe5)]('Port-forwarding\x20for\x20the\x20specified\x20addon')[Z(0x99)](Z(0x76),Z(0x7c))[Z(0x99)](Z(0x8a),Z(0xbb))['option'](Z(0xb8),this[Z(0xd5)],![])[Z(0x71)](({noDefaults:i,projectId:n,addonId:r,skipHostnames:q})=>__awaiter(this,void 0x0,void 0x0,function*(){const F=Z;(0x0,utils_1[F(0xca)])(this[F(0xc2)]);const w=this[F(0x74)](q),Y=i?undefined:H[F(0xe1)](),x=n||Y||(yield f['askForProject']()),U=r||(yield f[F(0xeb)](x)());console[F(0xd4)](F(0xaa)+chalk_1[F(0x78)][F(0x89)](U)+F(0xba)+chalk_1[F(0x78)]['bold'](x));try{const m={'projectId':x,'addonId':U},Q=yield w[F(0xc8)](m,q);this[F(0xa8)](Q,{'name':U,'type':F(0xd9)},q),this['printHostsFileHint'](Q,q);}catch(L){(0x0,utils_1[F(0xbd)])(F(0xbc)+L[F(0x9a)]);}}));this[Z(0xcf)][Z(0x73)](l),this['portFwdCmd']['addCommand'](t),this[Z(0xcf)][Z(0x73)](b);}['getProxyForwarder'](H=![]){const p=a10O,f=this[p(0xc2)]['forwarding'];if(!H){const l=f['canExecuteWithHostnames']();if(l[p(0xbd)])throw new Error(l[p(0x9a)]);}return f['on']('tunnel-close',(t,b)=>{const a=p,i=chalk_1[a(0x78)]['bold'](b['type']+'\x20\x27'+b['id']+'\x27'),n=b[a(0xd8)]['length']>0x0;(0x0,utils_1[a(0xea)])(a(0x8d)+b[a(0x92)]+':'+b[a(0x94)]+a(0x82)+i),H&&n&&(0x0,utils_1[a(0xea)])(a(0x79));}),f['on'](p(0xa4),(t,b,i)=>{const J=p;(0x0,utils_1[J(0xea)])('Connection\x20error\x20occurred\x20when\x20forwarding\x20\x27'+b[J(0x92)]+':'+b['port']+J(0x97)+(i===null||i===void 0x0?void 0x0:i[J(0x9a)])+'\x22');}),process['on'](p(0xa7),()=>__awaiter(this,void 0x0,void 0x0,function*(){const o=p;try{yield f[o(0xc7)]();}catch(t){(0x0,utils_1[o(0xbd)])(o(0xa1)+t[o(0x9a)]);}finally{process['exit']();}})),f;}[a10O(0xa8)](H,f,l=![]){const M=a10O,{type:t,name:b}=f;if(H[M(0x8f)]<=0x0){const q='Please\x20ensure\x20the\x20'+f[M(0xd7)]+M(0xb0);(0x0,utils_1['warning'])(M(0xef)+t+'\x20'+chalk_1[M(0x78)][M(0x89)](b)+'.\x20'+q);return;}const i=(0x0,lodash_1['groupBy'])(H,M(0x96)),n=w=>'\x20('+(w[M(0x95)]?w[M(0x95)]+M(0xb7):'')+w[M(0xc1)]+')';function r(w,Y=0x2){const G=M;if(!l){const x=w[G(0xc1)]==='HTTP'?G(0x75):'';w[G(0xd8)]['forEach'](U=>{const N=G;console['log']((0x0,lodash_1[N(0xb5)])('\x20',Y)+'-\x20'+x+U+':'+w[N(0x94)]);});}}Object[M(0x93)](i)[M(0x80)](([w,Y])=>{const z=M;var x,U;const m='>\x20'+(0x0,lodash_1[z(0xc0)])(t)+'\x20\x27'+chalk_1[z(0x78)][z(0xc6)][z(0x89)](w)+'\x27';if(t===z(0xd9)){if(Y[z(0x8f)]===0x1){const Q=Y[0x0];if(Q[z(0xbd)]){(0x0,utils_1[z(0xbd)])(z(0xcc)+w+':\x20'+Q[z(0xbd)][z(0x9a)]);return;}const L=Q['data'],B=!l?chalk_1['default'][z(0x6b)]('\x20with\x20hostname:\x20'+L[z(0xd8)][z(0xa2)](',')):'';(0x0,utils_1[z(0xdb)])(m+'\x20is\x20exposed\x20on\x20'+L['address']+':'+L[z(0x94)]+n(L)+B);}else{const T=(0x0,lodash_1[z(0xc5)])(Y,X=>{const v=z;var C,j;return(j=(C=X===null||X===void 0x0?void 0x0:X['data'])===null||C===void 0x0?void 0x0:C[v(0xd8)])===null||j===void 0x0?void 0x0:j[v(0xa2)](',');})[z(0x8f)]>0x1;(0x0,utils_1[z(0xdb)])(m+z(0xbf)+(T?'hosts':'ports')+':'),Y['forEach'](X=>{const R=z;if(X[R(0xbd)]){(0x0,utils_1[R(0xbd)])(R(0xcc)+w+':\x20'+X[R(0xbd)][R(0x9a)]);return;}const C=X[R(0x7b)],j=!l?',\x20hostname:\x20'+C[R(0xd8)][R(0xa2)](','):'';console[R(0xd4)](R(0xe9)+C[R(0x92)]+':'+C['port']+n(C)+j);});}}if(t===z(0xb6)){if(Y[z(0x8f)]===0x1){const X=Y[0x0];if(X['error']){(0x0,utils_1['error'])(z(0xcc)+w+':\x20'+X[z(0xbd)][z(0x9a)]);return;}const C=X[z(0x7b)],j=!l?z(0x8c):':',c=C[z(0x92)]+':'+C[z(0x94)]+n(C);(0x0,utils_1[z(0xdb)])(m+z(0xe6)+c+j),r(C);}else(0x0,utils_1['success'])(m+z(0xe6)+((U=(x=Y[0x0])===null||x===void 0x0?void 0x0:x['data'])===null||U===void 0x0?void 0x0:U[z(0x92)])+z(0xac)),Y[z(0x80)](D=>{const s=z;if(D[s(0xbd)]){(0x0,utils_1[s(0xbd)])(s(0xcc)+w+':\x20'+D[s(0xbd)][s(0x9a)]);return;}const V=D[s(0x7b)];(0x0,utils_1['success'])(s(0x6e)+V[s(0x94)]+n(V)),r(V,0x4);});}});}[a10O(0xa3)](H,f=![]){const y=a10O;if(f){const l=H[y(0xb3)](Y=>Y[y(0x7b)])[y(0x86)](Y=>Y!==undefined),t=(process===null||process===void 0x0?void 0x0:process[y(0x90)])===y(0xab),b=os[y(0x90)]()==='darwin',i=t?y(0xe0):y(0xc3),n=chalk_1[y(0x78)][y(0x89)]('skipHostnames'),r=b?EOL+y(0x7a)+n+y(0xde):undefined;let q=y(0xec)+n+y(0xda)+'--skipHostnames'+'\x20flag\x20or\x20manually\x20append\x20following\x20entry\x20to\x20your\x20hosts\x20file\x20('+i+'):';r!==undefined&&(0x0,utils_1[y(0xea)])(r!==null&&r!==void 0x0?r:'');(0x0,utils_1[y(0xea)])(q);const w=l[y(0x8b)](Y=>Y['address']+'\x20\x20\x20\x20\x20\x20\x20\x20\x20'+Y['hostnames'][y(0xa2)]('\x20'));console['log']((0x0,lodash_1[y(0xd2)])(w)[y(0xa2)](EOL)),console[y(0xd4)]();}}}exports[a10O(0xa0)]=CliPortForward;
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function a11H(){const E=['2983578gqSntJ','next','**\x20You\x27re\x20running\x20on\x20version\x20','option','900520xuSiTP','528XHHfpp','retry','error','No\x20token\x20in\x20CLI\x20context.\x20Add\x20token\x20with\x20\x27northflank\x20set-token\x27','version','getCurrentToken','72852BVFFBg','assertContextExisting','\x20Consider\x20updating\x20using\x20\x27npm\x20i\x20','--quiet','getCurrentContext','then','done','__esModule','__awaiter','defineProperty','186XqvJXX','12392FMlveO','712GrLOjF','customUserAgent','allowUnknownOption','checkUpdate','Command','Verbose\x20output','redBright','success','split','--verbose','Failed:\x20','json','5733zVJOOQ','contextProvider','min',',\x20the\x20latest\x20version\x20of\x20the\x20cli\x20is\x20','resolve','6DqTEAY','5enJufx','default','log','warning','push','storeOptionsAsProperties','chalk','isValidJSON','No\x20CLI\x20context\x20present.\x20Create\x20context\x20with\x20\x27northflank\x20login\x27','2552157eYrKqN','value','63607UTjzte','apply','No\x20API\x20URL\x20present\x20in\x20context.\x20Create\x20new\x20context\x20with\x20\x27northflank\x20login\x27','length','/latest','node-fetch','getLastUpdateCheck','getCommand','__importDefault','replace','asyncSequential'];a11H=function(){return E;};return a11H();}const a11m=a11f;(function(H,f){const U=a11f,l=H();while(!![]){try{const t=-parseInt(U(0x1f5))/0x1*(parseInt(U(0x1e9))/0x2)+parseInt(U(0x1d6))/0x3*(parseInt(U(0x1d7))/0x4)+-parseInt(U(0x1ea))/0x5*(-parseInt(U(0x200))/0x6)+parseInt(U(0x1e4))/0x7*(parseInt(U(0x1d8))/0x8)+parseInt(U(0x1f3))/0x9+-parseInt(U(0x204))/0xa+-parseInt(U(0x205))/0xb*(parseInt(U(0x1cc))/0xc);if(t===f)break;else l['push'](l['shift']());}catch(b){l['push'](l['shift']());}}}(a11H,0x739b2));var __awaiter=this&&this[a11m(0x1d4)]||function(H,f,l,t){function b(i){return i instanceof l?i:new l(function(n){n(i);});}return new(l||(l=Promise))(function(i,n){const B=a11f;function r(Y){const Q=a11f;try{w(t[Q(0x201)](Y));}catch(x){n(x);}}function q(Y){try{w(t['throw'](Y));}catch(x){n(x);}}function w(Y){const L=a11f;Y[L(0x1d2)]?i(Y['value']):b(Y[L(0x1f4)])[L(0x1d1)](r,q);}w((t=t[B(0x1f6)](H,f||[]))['next']());});},__importDefault=this&&this[a11m(0x1fd)]||function(H){const T=a11m;return H&&H[T(0x1d3)]?H:{'default':H};};Object[a11m(0x1d5)](exports,a11m(0x1d3),{'value':!![]}),exports[a11m(0x1cd)]=exports[a11m(0x1f1)]=exports['asyncSequential']=exports[a11m(0x206)]=exports[a11m(0x1fc)]=exports[a11m(0x1df)]=exports[a11m(0x1ed)]=exports[a11m(0x207)]=exports[a11m(0x1db)]=exports[a11m(0x1d9)]=void 0x0;const node_fetch_1=__importDefault(require(a11m(0x1fa))),chalk_1=__importDefault(require(a11m(0x1f0))),commander_1=require('commander'),pgk=require('../package.json');exports['customUserAgent']='northflank-cli/'+(pgk===null||pgk===void 0x0?void 0x0:pgk[a11m(0x209)]);function checkUpdate(H){return __awaiter(this,void 0x0,void 0x0,function*(){const X=a11f;function f(l,t){const b=new Date(Number(l));return b['setDate'](b['getDate']()+t),b;}try{if(f(H[X(0x1fb)](),0x1)>new Date())return;const l=pgk['version'],{name:t}=pgk;if(!l)return;const b='https://registry.npmjs.org/'+t+X(0x1f9),i=yield(0x0,node_fetch_1[X(0x1eb)])(b,{'method':'GET','timeout':0x1388}),n=(yield i[X(0x1e3)]())[X(0x209)];needsUpdate(l,n)&&warning(X(0x202)+l+X(0x1e7)+n+'.'+(X(0x1ce)+t+'\x20-g\x27\x20or\x20\x27yarn\x20global\x20add\x20'+t+'\x27\x20**')),yield H['setLastUpdateCheck'](new Date());}catch(r){}});}function a11f(H,f){const l=a11H();return a11f=function(t,b){t=t-0x1cc;let i=l[t];return i;},a11f(H,f);}exports[a11m(0x1db)]=checkUpdate;function needsUpdate(H,f){const C=a11m,l=/(\.0+)+$/,t=H[C(0x1fe)](l,'')[C(0x1e0)]('.'),b=f['replace'](l,'')[C(0x1e0)]('.');for(let n=0x0;n<Math[C(0x1e6)](t[C(0x1f8)],b['length']);n+=0x1){const r=parseInt(b[n],0xa)-parseInt(t[n],0xa);if(r>0x0)return!![];if(r<0x0)return![];}return b['length']>t[C(0x1f8)];}function error(H){const j=a11m;console['error'](chalk_1[j(0x1eb)][j(0x1de)](j(0x1e2)+H));}exports[a11m(0x207)]=error;function warning(H){console['error'](chalk_1['default']['yellow'](''+H));}exports[a11m(0x1ed)]=warning;function success(H){const c=a11m;console[c(0x1ec)](chalk_1[c(0x1eb)]['green'](''+H));}exports[a11m(0x1df)]=success;function getCommand(H=![]){const D=a11m,f=new commander_1[(D(0x1dc))]();return f[D(0x1ef)](![]),f[D(0x1da)](![]),f['allowExcessArguments'](![]),f['enablePositionalOptions'](!![]),H&&(f[D(0x203)](D(0x1e1),D(0x1dd),![]),f['option'](D(0x1cf),'No\x20console\x20output',![])),f;}exports[a11m(0x1fc)]=getCommand;const retry=(H,f=0x32)=>l=>{let t=H;const b=()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){try{return yield l();}catch(i){if(t<=0x0)throw i;return t-=0x1,yield new Promise(n=>setTimeout(()=>n(),f)),b();}});return b();};exports['retry']=retry;const asyncSequential=(H,f)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const V=a11m,l=Promise[V(0x1e8)]([]);return H['reduce']((t,b)=>t['then'](i=>f(b)['then'](n=>{const e=V;return i[e(0x1ee)](n),i;})),l);});exports[a11m(0x1ff)]=asyncSequential;function isValidJSON(H){try{return JSON['parse'](H);}catch(f){return![];}}exports['isValidJSON']=isValidJSON;function assertContextExisting(H){const O=a11m;if(H['contextProvider'][O(0x1d0)]()===undefined)throw new Error(O(0x1f2));if(H[O(0x1e5)]['getCurrentBaseUrl']()===undefined)throw new Error(O(0x1f7));if(H[O(0x1e5)][O(0x20a)]()===undefined)throw new Error(O(0x208));}exports[a11m(0x1cd)]=assertContextExisting;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@northflank/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"author": "Marco Suter",
|
|
5
5
|
"description": "Provides a command-line interface to the Northflank platform.",
|
|
6
6
|
"homepage": "https://www.northflank.com",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"LICENSE"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@northflank/js-client": "0.7.
|
|
29
|
+
"@northflank/js-client": "0.7.3",
|
|
30
30
|
"ajv": "8.6.3",
|
|
31
31
|
"bufferutil": "^4.0.7",
|
|
32
32
|
"chalk": "~4.1.0",
|